diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..b295d9f --- /dev/null +++ b/.babelrc @@ -0,0 +1,6 @@ +{ + "presets": ["es2015"], + "plugins": [ + "transform-object-rest-spread" + ] +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..cfbfd19 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,5948 @@ +(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i= 0 && n[max].type !== 'total'); + var destination = __assign({}, options, { scopeChecker: scopeChecker, + subject: subject, bubbles: !!options.bubbles, useCapture: !!options.useCapture, passive: !!options.passive }); + for (var i = 0; i < relevantSets.length; i++) { + relevantSets[i].add(destination, n.length); + } + return destination; + }; + /** + * Returns a set of all virtual listeners in the scope of the namespace + * Set `exact` to true to treat sibiling isolated scopes as total scopes + */ + EventDelegator.prototype.getVirtualListeners = function (eventType, namespace, exact, max) { + if (exact === void 0) { exact = false; } + var _max = max !== undefined ? max : namespace.length; + if (!exact) { + for (var i = _max - 1; i >= 0; i--) { + if (namespace[i].type === 'total') { + _max = i + 1; + break; + } + _max = i; + } + } + var map = this.virtualListeners.getDefault(namespace, function () { return new Map(); }, _max); + if (!map.has(eventType)) { + map.set(eventType, new PriorityQueue_1.default()); + } + return map.get(eventType); + }; + EventDelegator.prototype.setupDOMListener = function (eventType, passive) { + var _this = this; + if (this.origin) { + var sub = fromEvent_1.fromEvent(this.origin, eventType, false, false, passive).subscribe({ + next: function (event) { return _this.onEvent(eventType, event, passive); }, + error: function () { }, + complete: function () { }, + }); + this.domListeners.set(eventType, { sub: sub, passive: passive }); + } + else { + this.domListenersToAdd.set(eventType, passive); + } + }; + EventDelegator.prototype.setupNonBubblingListener = function (input) { + var _this = this; + var eventType = input[0], elementFinder = input[1], destination = input[2]; + if (!this.origin) { + this.nonBubblingListenersToAdd.add(input); + return; + } + var element = elementFinder.call()[0]; + if (element) { + this.nonBubblingListenersToAdd.delete(input); + var sub = fromEvent_1.fromEvent(element, eventType, false, false, destination.passive).subscribe({ + next: function (ev) { return _this.onEvent(eventType, ev, !!destination.passive, false); }, + error: function () { }, + complete: function () { }, + }); + if (!this.nonBubblingListeners.has(eventType)) { + this.nonBubblingListeners.set(eventType, new Map()); + } + var map = this.nonBubblingListeners.get(eventType); + if (!map) { + return; + } + map.set(element, { sub: sub, destination: destination }); + } + else { + this.nonBubblingListenersToAdd.add(input); + } + }; + EventDelegator.prototype.resetEventListeners = function () { + var iter = this.domListeners.entries(); + var curr = iter.next(); + while (!curr.done) { + var _a = curr.value, type = _a[0], _b = _a[1], sub = _b.sub, passive = _b.passive; + sub.unsubscribe(); + this.setupDOMListener(type, passive); + curr = iter.next(); + } + }; + EventDelegator.prototype.resetNonBubblingListeners = function () { + var _this = this; + var newMap = new Map(); + var insert = utils_1.makeInsert(newMap); + this.nonBubblingListeners.forEach(function (map, type) { + map.forEach(function (value, elm) { + if (!document.body.contains(elm)) { + var sub = value.sub, destination_1 = value.destination; + if (sub) { + sub.unsubscribe(); + } + var elementFinder = new ElementFinder_1.ElementFinder(destination_1.scopeChecker.namespace, _this.isolateModule); + var newElm = elementFinder.call()[0]; + var newSub = fromEvent_1.fromEvent(newElm, type, false, false, destination_1.passive).subscribe({ + next: function (event) { + return _this.onEvent(type, event, !!destination_1.passive, false); + }, + error: function () { }, + complete: function () { }, + }); + insert(type, newElm, { sub: newSub, destination: destination_1 }); + } + else { + insert(type, elm, value); + } + }); + _this.nonBubblingListeners = newMap; + }); + }; + EventDelegator.prototype.putNonBubblingListener = function (eventType, elm, useCapture, passive) { + var map = this.nonBubblingListeners.get(eventType); + if (!map) { + return; + } + var listener = map.get(elm); + if (listener && + listener.destination.passive === passive && + listener.destination.useCapture === useCapture) { + this.virtualNonBubblingListener[0] = listener.destination; + } + }; + EventDelegator.prototype.onEvent = function (eventType, event, passive, bubbles) { + if (bubbles === void 0) { bubbles = true; } + var cycleEvent = this.patchEvent(event); + var rootElement = this.isolateModule.getRootElement(event.target); + if (bubbles) { + var namespace = this.isolateModule.getNamespace(event.target); + if (!namespace) { + return; + } + var listeners = this.getVirtualListeners(eventType, namespace); + this.bubble(eventType, event.target, rootElement, cycleEvent, listeners, namespace, namespace.length - 1, true, passive); + this.bubble(eventType, event.target, rootElement, cycleEvent, listeners, namespace, namespace.length - 1, false, passive); + } + else { + this.putNonBubblingListener(eventType, event.target, true, passive); + this.doBubbleStep(eventType, event.target, rootElement, cycleEvent, this.virtualNonBubblingListener, true, passive); + this.putNonBubblingListener(eventType, event.target, false, passive); + this.doBubbleStep(eventType, event.target, rootElement, cycleEvent, this.virtualNonBubblingListener, false, passive); + event.stopPropagation(); //fix reset event (spec'ed as non-bubbling, but bubbles in reality + } + }; + EventDelegator.prototype.bubble = function (eventType, elm, rootElement, event, listeners, namespace, index, useCapture, passive) { + if (!useCapture && !event.propagationHasBeenStopped) { + this.doBubbleStep(eventType, elm, rootElement, event, listeners, useCapture, passive); + } + var newRoot = rootElement; + var newIndex = index; + if (elm === rootElement) { + if (index >= 0 && namespace[index].type === 'sibling') { + newRoot = this.isolateModule.getElement(namespace, index); + newIndex--; + } + else { + return; + } + } + if (elm.parentNode && newRoot) { + this.bubble(eventType, elm.parentNode, newRoot, event, listeners, namespace, newIndex, useCapture, passive); + } + if (useCapture && !event.propagationHasBeenStopped) { + this.doBubbleStep(eventType, elm, rootElement, event, listeners, useCapture, passive); + } + }; + EventDelegator.prototype.doBubbleStep = function (eventType, elm, rootElement, event, listeners, useCapture, passive) { + if (!rootElement) { + return; + } + this.mutateEventCurrentTarget(event, elm); + listeners.forEach(function (dest) { + if (dest.passive === passive && dest.useCapture === useCapture) { + var sel = utils_1.getSelectors(dest.scopeChecker.namespace); + if (!event.propagationHasBeenStopped && + dest.scopeChecker.isDirectlyInScope(elm) && + ((sel !== '' && elm.matches(sel)) || + (sel === '' && elm === rootElement))) { + fromEvent_1.preventDefaultConditional(event, dest.preventDefault); + dest.subject.shamefullySendNext(event); + } + } + }); + }; + EventDelegator.prototype.patchEvent = function (event) { + var pEvent = event; + pEvent.propagationHasBeenStopped = false; + var oldStopPropagation = pEvent.stopPropagation; + pEvent.stopPropagation = function stopPropagation() { + oldStopPropagation.call(this); + this.propagationHasBeenStopped = true; + }; + return pEvent; + }; + EventDelegator.prototype.mutateEventCurrentTarget = function (event, currentTargetElement) { + try { + Object.defineProperty(event, "currentTarget", { + value: currentTargetElement, + configurable: true, + }); + } + catch (err) { + console.log("please use event.ownerTarget"); + } + event.ownerTarget = currentTargetElement; + }; + return EventDelegator; +}()); +exports.EventDelegator = EventDelegator; + +},{"./ElementFinder":3,"./PriorityQueue":7,"./RemovalSet":8,"./ScopeChecker":9,"./SymbolTree":10,"./fromEvent":12,"./utils":20,"xstream":55}],5:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var utils_1 = require("./utils"); +var SymbolTree_1 = require("./SymbolTree"); +var IsolateModule = /** @class */ (function () { + function IsolateModule() { + this.namespaceTree = new SymbolTree_1.default(function (x) { return x.scope; }); + this.namespaceByElement = new Map(); + this.vnodesBeingRemoved = []; + } + IsolateModule.prototype.setEventDelegator = function (del) { + this.eventDelegator = del; + }; + IsolateModule.prototype.insertElement = function (namespace, el) { + this.namespaceByElement.set(el, namespace); + this.namespaceTree.set(namespace, el); + }; + IsolateModule.prototype.removeElement = function (elm) { + this.namespaceByElement.delete(elm); + var namespace = this.getNamespace(elm); + if (namespace) { + this.namespaceTree.delete(namespace); + } + }; + IsolateModule.prototype.getElement = function (namespace, max) { + return this.namespaceTree.get(namespace, undefined, max); + }; + IsolateModule.prototype.getRootElement = function (elm) { + if (this.namespaceByElement.has(elm)) { + return elm; + } + //TODO: Add quick-lru or similar as additional O(1) cache + var curr = elm; + while (!this.namespaceByElement.has(curr)) { + curr = curr.parentNode; + if (!curr) { + return undefined; + } + else if (curr.tagName === 'HTML') { + throw new Error('No root element found, this should not happen at all'); + } + } + return curr; + }; + IsolateModule.prototype.getNamespace = function (elm) { + var rootElement = this.getRootElement(elm); + if (!rootElement) { + return undefined; + } + return this.namespaceByElement.get(rootElement); + }; + IsolateModule.prototype.createModule = function () { + var self = this; + return { + create: function (emptyVNode, vNode) { + var elm = vNode.elm, _a = vNode.data, data = _a === void 0 ? {} : _a; + var namespace = data.isolate; + if (Array.isArray(namespace)) { + self.insertElement(namespace, elm); + } + }, + update: function (oldVNode, vNode) { + var oldElm = oldVNode.elm, _a = oldVNode.data, oldData = _a === void 0 ? {} : _a; + var elm = vNode.elm, _b = vNode.data, data = _b === void 0 ? {} : _b; + var oldNamespace = oldData.isolate; + var namespace = data.isolate; + if (!utils_1.isEqualNamespace(oldNamespace, namespace)) { + if (Array.isArray(oldNamespace)) { + self.removeElement(oldElm); + } + } + if (Array.isArray(namespace)) { + self.insertElement(namespace, elm); + } + }, + destroy: function (vNode) { + self.vnodesBeingRemoved.push(vNode); + }, + remove: function (vNode, cb) { + self.vnodesBeingRemoved.push(vNode); + cb(); + }, + post: function () { + var vnodesBeingRemoved = self.vnodesBeingRemoved; + for (var i = vnodesBeingRemoved.length - 1; i >= 0; i--) { + var vnode = vnodesBeingRemoved[i]; + var namespace = vnode.data !== undefined + ? vnode.data.isolation + : undefined; + if (namespace !== undefined) { + self.removeElement(namespace); + } + self.eventDelegator.removeElement(vnode.elm, namespace); + } + self.vnodesBeingRemoved = []; + }, + }; + }; + return IsolateModule; +}()); +exports.IsolateModule = IsolateModule; + +},{"./SymbolTree":10,"./utils":20}],6:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var adapt_1 = require("@cycle/run/lib/adapt"); +var DocumentDOMSource_1 = require("./DocumentDOMSource"); +var BodyDOMSource_1 = require("./BodyDOMSource"); +var ElementFinder_1 = require("./ElementFinder"); +var isolate_1 = require("./isolate"); +var MainDOMSource = /** @class */ (function () { + function MainDOMSource(_rootElement$, _sanitation$, _namespace, _isolateModule, _eventDelegator, _name) { + if (_namespace === void 0) { _namespace = []; } + this._rootElement$ = _rootElement$; + this._sanitation$ = _sanitation$; + this._namespace = _namespace; + this._isolateModule = _isolateModule; + this._eventDelegator = _eventDelegator; + this._name = _name; + this.isolateSource = function (source, scope) { + return new MainDOMSource(source._rootElement$, source._sanitation$, source._namespace.concat(isolate_1.getScopeObj(scope)), source._isolateModule, source._eventDelegator, source._name); + }; + this.isolateSink = isolate_1.makeIsolateSink(this._namespace); + } + MainDOMSource.prototype._elements = function () { + if (this._namespace.length === 0) { + return this._rootElement$.map(function (x) { return [x]; }); + } + else { + var elementFinder_1 = new ElementFinder_1.ElementFinder(this._namespace, this._isolateModule); + return this._rootElement$.map(function () { return elementFinder_1.call(); }); + } + }; + MainDOMSource.prototype.elements = function () { + var out = adapt_1.adapt(this._elements().remember()); + out._isCycleSource = this._name; + return out; + }; + MainDOMSource.prototype.element = function () { + var out = adapt_1.adapt(this._elements() + .filter(function (arr) { return arr.length > 0; }) + .map(function (arr) { return arr[0]; }) + .remember()); + out._isCycleSource = this._name; + return out; + }; + Object.defineProperty(MainDOMSource.prototype, "namespace", { + get: function () { + return this._namespace; + }, + enumerable: true, + configurable: true + }); + MainDOMSource.prototype.select = function (selector) { + if (typeof selector !== 'string') { + throw new Error("DOM driver's select() expects the argument to be a " + + "string as a CSS selector"); + } + if (selector === 'document') { + return new DocumentDOMSource_1.DocumentDOMSource(this._name); + } + if (selector === 'body') { + return new BodyDOMSource_1.BodyDOMSource(this._name); + } + var namespace = selector === ':root' + ? [] + : this._namespace.concat({ type: 'selector', scope: selector.trim() }); + return new MainDOMSource(this._rootElement$, this._sanitation$, namespace, this._isolateModule, this._eventDelegator, this._name); + }; + MainDOMSource.prototype.events = function (eventType, options, bubbles) { + if (options === void 0) { options = {}; } + if (typeof eventType !== "string") { + throw new Error("DOM driver's events() expects argument to be a " + + "string representing the event type to listen for."); + } + var event$ = this._eventDelegator.addEventListener(eventType, this._namespace, options, bubbles); + var out = adapt_1.adapt(event$); + out._isCycleSource = this._name; + return out; + }; + MainDOMSource.prototype.dispose = function () { + this._sanitation$.shamefullySendNext(null); + //this._isolateModule.reset(); + }; + return MainDOMSource; +}()); +exports.MainDOMSource = MainDOMSource; + +},{"./BodyDOMSource":1,"./DocumentDOMSource":2,"./ElementFinder":3,"./isolate":15,"@cycle/run/lib/adapt":21}],7:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var PriorityQueue = /** @class */ (function () { + function PriorityQueue() { + this.arr = []; + this.prios = []; + } + PriorityQueue.prototype.add = function (t, prio) { + for (var i = 0; i < this.arr.length; i++) { + if (this.prios[i] < prio) { + this.arr.splice(i, 0, t); + this.prios.splice(i, 0, prio); + return; + } + } + this.arr.push(t); + this.prios.push(prio); + }; + PriorityQueue.prototype.forEach = function (f) { + for (var i = 0; i < this.arr.length; i++) { + f(this.arr[i], i, this.arr); + } + }; + PriorityQueue.prototype.delete = function (t) { + for (var i = 0; i < this.arr.length; i++) { + if (this.arr[i] === t) { + this.arr.splice(i, 1); + this.prios.splice(i, 1); + return; + } + } + }; + return PriorityQueue; +}()); +exports.default = PriorityQueue; + +},{}],8:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var RemovalSet = /** @class */ (function () { + function RemovalSet() { + this.toDelete = []; + this.toDeleteSize = 0; + this._set = new Set(); + } + RemovalSet.prototype.add = function (t) { + this._set.add(t); + }; + RemovalSet.prototype.forEach = function (f) { + this._set.forEach(f); + this.flush(); + }; + RemovalSet.prototype.delete = function (t) { + if (this.toDelete.length === this.toDeleteSize) { + this.toDelete.push(t); + } + else { + this.toDelete[this.toDeleteSize] = t; + } + this.toDeleteSize++; + }; + RemovalSet.prototype.flush = function () { + for (var i = 0; i < this.toDelete.length; i++) { + if (i < this.toDeleteSize) { + this._set.delete(this.toDelete[i]); + } + this.toDelete[i] = undefined; + } + this.toDeleteSize = 0; + }; + return RemovalSet; +}()); +exports.default = RemovalSet; + +},{}],9:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var utils_1 = require("./utils"); +var ScopeChecker = /** @class */ (function () { + function ScopeChecker(namespace, isolateModule) { + this.namespace = namespace; + this.isolateModule = isolateModule; + this._namespace = namespace.filter(function (n) { return n.type !== 'selector'; }); + } + /** + * Checks whether the given element is *directly* in the scope of this + * scope checker. Being contained *indirectly* through other scopes + * is not valid. This is crucial for implementing parent-child isolation, + * so that the parent selectors don't search inside a child scope. + */ + ScopeChecker.prototype.isDirectlyInScope = function (leaf) { + var namespace = this.isolateModule.getNamespace(leaf); + if (!namespace) { + return false; + } + if (this._namespace.length > namespace.length || + !utils_1.isEqualNamespace(this._namespace, namespace.slice(0, this._namespace.length))) { + return false; + } + for (var i = this._namespace.length; i < namespace.length; i++) { + if (namespace[i].type === 'total') { + return false; + } + } + return true; + }; + return ScopeChecker; +}()); +exports.ScopeChecker = ScopeChecker; + +},{"./utils":20}],10:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var SymbolTree = /** @class */ (function () { + function SymbolTree(mapper) { + this.mapper = mapper; + this.tree = [undefined, {}]; + } + SymbolTree.prototype.set = function (path, element, max) { + var curr = this.tree; + var _max = max !== undefined ? max : path.length; + for (var i = 0; i < _max; i++) { + var n = this.mapper(path[i]); + var child = curr[1][n]; + if (!child) { + child = [undefined, {}]; + curr[1][n] = child; + } + curr = child; + } + curr[0] = element; + }; + SymbolTree.prototype.getDefault = function (path, mkDefaultElement, max) { + return this.get(path, mkDefaultElement, max); + }; + /** + * Returns the payload of the path + * If a default element creator is given, it will insert it at the path + */ + SymbolTree.prototype.get = function (path, mkDefaultElement, max) { + var curr = this.tree; + var _max = max !== undefined ? max : path.length; + for (var i = 0; i < _max; i++) { + var n = this.mapper(path[i]); + var child = curr[1][n]; + if (!child) { + if (mkDefaultElement) { + child = [undefined, {}]; + curr[1][n] = child; + } + else { + return undefined; + } + } + curr = child; + } + if (mkDefaultElement && !curr[0]) { + curr[0] = mkDefaultElement(); + } + return curr[0]; + }; + SymbolTree.prototype.delete = function (path) { + var curr = this.tree; + for (var i = 0; i < path.length - 1; i++) { + var child = curr[1][this.mapper(path[i])]; + if (!child) { + return; + } + curr = child; + } + delete curr[1][this.mapper(path[path.length - 1])]; + }; + return SymbolTree; +}()); +exports.default = SymbolTree; + +},{}],11:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var vnode_1 = require("snabbdom/vnode"); +var h_1 = require("snabbdom/h"); +var snabbdom_selector_1 = require("snabbdom-selector"); +var utils_1 = require("./utils"); +var VNodeWrapper = /** @class */ (function () { + function VNodeWrapper(rootElement) { + this.rootElement = rootElement; + } + VNodeWrapper.prototype.call = function (vnode) { + if (utils_1.isDocFrag(this.rootElement)) { + return this.wrapDocFrag(vnode === null ? [] : [vnode]); + } + if (vnode === null) { + return this.wrap([]); + } + var _a = snabbdom_selector_1.selectorParser(vnode), selTagName = _a.tagName, selId = _a.id; + var vNodeClassName = snabbdom_selector_1.classNameFromVNode(vnode); + var vNodeData = vnode.data || {}; + var vNodeDataProps = vNodeData.props || {}; + var _b = vNodeDataProps.id, vNodeId = _b === void 0 ? selId : _b; + var isVNodeAndRootElementIdentical = typeof vNodeId === 'string' && + vNodeId.toUpperCase() === this.rootElement.id.toUpperCase() && + selTagName.toUpperCase() === this.rootElement.tagName.toUpperCase() && + vNodeClassName.toUpperCase() === this.rootElement.className.toUpperCase(); + if (isVNodeAndRootElementIdentical) { + return vnode; + } + return this.wrap([vnode]); + }; + VNodeWrapper.prototype.wrapDocFrag = function (children) { + return vnode_1.vnode('', { isolate: [] }, children, undefined, this + .rootElement); + }; + VNodeWrapper.prototype.wrap = function (children) { + var _a = this.rootElement, tagName = _a.tagName, id = _a.id, className = _a.className; + var selId = id ? "#" + id : ''; + var selClass = className ? "." + className.split(" ").join(".") : ''; + var vnode = h_1.h("" + tagName.toLowerCase() + selId + selClass, {}, children); + vnode.data = vnode.data || {}; + vnode.data.isolate = vnode.data.isolate || []; + return vnode; + }; + return VNodeWrapper; +}()); +exports.VNodeWrapper = VNodeWrapper; + +},{"./utils":20,"snabbdom-selector":30,"snabbdom/h":34,"snabbdom/vnode":45}],12:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var xstream_1 = require("xstream"); +function fromEvent(element, eventName, useCapture, preventDefault, passive) { + if (useCapture === void 0) { useCapture = false; } + if (preventDefault === void 0) { preventDefault = false; } + if (passive === void 0) { passive = false; } + var next = null; + return xstream_1.Stream.create({ + start: function start(listener) { + if (preventDefault) { + next = function _next(event) { + preventDefaultConditional(event, preventDefault); + listener.next(event); + }; + } + else { + next = function _next(event) { + listener.next(event); + }; + } + element.addEventListener(eventName, next, { + capture: useCapture, + passive: passive, + }); + }, + stop: function stop() { + element.removeEventListener(eventName, next, useCapture); + next = null; + }, + }); +} +exports.fromEvent = fromEvent; +function matchObject(matcher, obj) { + var keys = Object.keys(matcher); + var n = keys.length; + for (var i = 0; i < n; i++) { + var k = keys[i]; + if (typeof matcher[k] === 'object' && typeof obj[k] === 'object') { + if (!matchObject(matcher[k], obj[k])) { + return false; + } + } + else if (matcher[k] !== obj[k]) { + return false; + } + } + return true; +} +function preventDefaultConditional(event, preventDefault) { + if (preventDefault) { + if (typeof preventDefault === 'boolean') { + event.preventDefault(); + } + else if (isPredicate(preventDefault)) { + if (preventDefault(event)) { + event.preventDefault(); + } + } + else if (typeof preventDefault === 'object') { + if (matchObject(preventDefault, event)) { + event.preventDefault(); + } + } + else { + throw new Error('preventDefault has to be either a boolean, predicate function or object'); + } + } +} +exports.preventDefaultConditional = preventDefaultConditional; +function isPredicate(fn) { + return typeof fn === 'function'; +} + +},{"xstream":55}],13:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// tslint:disable:max-file-line-count +var h_1 = require("snabbdom/h"); +function isValidString(param) { + return typeof param === 'string' && param.length > 0; +} +function isSelector(param) { + return isValidString(param) && (param[0] === '.' || param[0] === '#'); +} +function createTagFunction(tagName) { + return function hyperscript(a, b, c) { + var hasA = typeof a !== 'undefined'; + var hasB = typeof b !== 'undefined'; + var hasC = typeof c !== 'undefined'; + if (isSelector(a)) { + if (hasB && hasC) { + return h_1.h(tagName + a, b, c); + } + else if (hasB) { + return h_1.h(tagName + a, b); + } + else { + return h_1.h(tagName + a, {}); + } + } + else if (hasC) { + return h_1.h(tagName + a, b, c); + } + else if (hasB) { + return h_1.h(tagName, a, b); + } + else if (hasA) { + return h_1.h(tagName, a); + } + else { + return h_1.h(tagName, {}); + } + }; +} +var SVG_TAG_NAMES = [ + 'a', + 'altGlyph', + 'altGlyphDef', + 'altGlyphItem', + 'animate', + 'animateColor', + 'animateMotion', + 'animateTransform', + 'circle', + 'clipPath', + 'colorProfile', + 'cursor', + 'defs', + 'desc', + 'ellipse', + 'feBlend', + 'feColorMatrix', + 'feComponentTransfer', + 'feComposite', + 'feConvolveMatrix', + 'feDiffuseLighting', + 'feDisplacementMap', + 'feDistantLight', + 'feFlood', + 'feFuncA', + 'feFuncB', + 'feFuncG', + 'feFuncR', + 'feGaussianBlur', + 'feImage', + 'feMerge', + 'feMergeNode', + 'feMorphology', + 'feOffset', + 'fePointLight', + 'feSpecularLighting', + 'feSpotlight', + 'feTile', + 'feTurbulence', + 'filter', + 'font', + 'fontFace', + 'fontFaceFormat', + 'fontFaceName', + 'fontFaceSrc', + 'fontFaceUri', + 'foreignObject', + 'g', + 'glyph', + 'glyphRef', + 'hkern', + 'image', + 'line', + 'linearGradient', + 'marker', + 'mask', + 'metadata', + 'missingGlyph', + 'mpath', + 'path', + 'pattern', + 'polygon', + 'polyline', + 'radialGradient', + 'rect', + 'script', + 'set', + 'stop', + 'style', + 'switch', + 'symbol', + 'text', + 'textPath', + 'title', + 'tref', + 'tspan', + 'use', + 'view', + 'vkern', +]; +var svg = createTagFunction('svg'); +SVG_TAG_NAMES.forEach(function (tag) { + svg[tag] = createTagFunction(tag); +}); +var TAG_NAMES = [ + 'a', + 'abbr', + 'address', + 'area', + 'article', + 'aside', + 'audio', + 'b', + 'base', + 'bdi', + 'bdo', + 'blockquote', + 'body', + 'br', + 'button', + 'canvas', + 'caption', + 'cite', + 'code', + 'col', + 'colgroup', + 'dd', + 'del', + 'details', + 'dfn', + 'dir', + 'div', + 'dl', + 'dt', + 'em', + 'embed', + 'fieldset', + 'figcaption', + 'figure', + 'footer', + 'form', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'head', + 'header', + 'hgroup', + 'hr', + 'html', + 'i', + 'iframe', + 'img', + 'input', + 'ins', + 'kbd', + 'keygen', + 'label', + 'legend', + 'li', + 'link', + 'main', + 'map', + 'mark', + 'menu', + 'meta', + 'nav', + 'noscript', + 'object', + 'ol', + 'optgroup', + 'option', + 'p', + 'param', + 'pre', + 'progress', + 'q', + 'rp', + 'rt', + 'ruby', + 's', + 'samp', + 'script', + 'section', + 'select', + 'small', + 'source', + 'span', + 'strong', + 'style', + 'sub', + 'summary', + 'sup', + 'table', + 'tbody', + 'td', + 'textarea', + 'tfoot', + 'th', + 'thead', + 'time', + 'title', + 'tr', + 'u', + 'ul', + 'video', +]; +var exported = { + SVG_TAG_NAMES: SVG_TAG_NAMES, + TAG_NAMES: TAG_NAMES, + svg: svg, + isSelector: isSelector, + createTagFunction: createTagFunction, +}; +TAG_NAMES.forEach(function (n) { + exported[n] = createTagFunction(n); +}); +exports.default = exported; + +},{"snabbdom/h":34}],14:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var thunk_1 = require("./thunk"); +exports.thunk = thunk_1.thunk; +var MainDOMSource_1 = require("./MainDOMSource"); +exports.MainDOMSource = MainDOMSource_1.MainDOMSource; +/** + * A factory for the DOM driver function. + * + * Takes a `container` to define the target on the existing DOM which this + * driver will operate on, and an `options` object as the second argument. The + * input to this driver is a stream of virtual DOM objects, or in other words, + * Snabbdom "VNode" objects. The output of this driver is a "DOMSource": a + * collection of Observables queried with the methods `select()` and `events()`. + * + * **`DOMSource.select(selector)`** returns a new DOMSource with scope + * restricted to the element(s) that matches the CSS `selector` given. To select + * the page's `document`, use `.select('document')`. To select the container + * element for this app, use `.select(':root')`. + * + * **`DOMSource.events(eventType, options)`** returns a stream of events of + * `eventType` happening on the elements that match the current DOMSource. The + * event object contains the `ownerTarget` property that behaves exactly like + * `currentTarget`. The reason for this is that some browsers doesn't allow + * `currentTarget` property to be mutated, hence a new property is created. The + * returned stream is an *xstream* Stream if you use `@cycle/xstream-run` to run + * your app with this driver, or it is an RxJS Observable if you use + * `@cycle/rxjs-run`, and so forth. + * + * **options for DOMSource.events** + * + * The `options` parameter on `DOMSource.events(eventType, options)` is an + * (optional) object with two optional fields: `useCapture` and + * `preventDefault`. + * + * `useCapture` is by default `false`, except it is `true` for event types that + * do not bubble. Read more here + * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener + * about the `useCapture` and its purpose. + * + * `preventDefault` is by default `false`, and indicates to the driver whether + * `event.preventDefault()` should be invoked. This option can be configured in + * three ways: + * + * - `{preventDefault: boolean}` to invoke preventDefault if `true`, and not + * invoke otherwise. + * - `{preventDefault: (ev: Event) => boolean}` for conditional invocation. + * - `{preventDefault: NestedObject}` uses an object to be recursively compared + * to the `Event` object. `preventDefault` is invoked when all properties on the + * nested object match with the properties on the event object. + * + * Here are some examples: + * ```typescript + * // always prevent default + * DOMSource.select('input').events('keydown', { + * preventDefault: true + * }) + * + * // prevent default only when `ENTER` is pressed + * DOMSource.select('input').events('keydown', { + * preventDefault: e => e.keyCode === 13 + * }) + * + * // prevent defualt when `ENTER` is pressed AND target.value is 'HELLO' + * DOMSource.select('input').events('keydown', { + * preventDefault: { keyCode: 13, ownerTarget: { value: 'HELLO' } } + * }); + * ``` + * + * **`DOMSource.elements()`** returns a stream of arrays containing the DOM + * elements that match the selectors in the DOMSource (e.g. from previous + * `select(x)` calls). + * + * **`DOMSource.element()`** returns a stream of DOM elements. Notice that this + * is the singular version of `.elements()`, so the stream will emit an element, + * not an array. If there is no element that matches the selected DOMSource, + * then the returned stream will not emit anything. + * + * @param {(String|HTMLElement)} container the DOM selector for the element + * (or the element itself) to contain the rendering of the VTrees. + * @param {DOMDriverOptions} options an object with two optional properties: + * + * - `modules: array` overrides `@cycle/dom`'s default Snabbdom modules as + * as defined in [`src/modules.ts`](./src/modules.ts). + * @return {Function} the DOM driver function. The function expects a stream of + * VNode as input, and outputs the DOMSource object. + * @function makeDOMDriver + */ +var makeDOMDriver_1 = require("./makeDOMDriver"); +exports.makeDOMDriver = makeDOMDriver_1.makeDOMDriver; +/** + * A factory function to create mocked DOMSource objects, for testing purposes. + * + * Takes a `mockConfig` object as argument, and returns + * a DOMSource that can be given to any Cycle.js app that expects a DOMSource in + * the sources, for testing. + * + * The `mockConfig` parameter is an object specifying selectors, eventTypes and + * their streams. Example: + * + * ```js + * const domSource = mockDOMSource({ + * '.foo': { + * 'click': xs.of({target: {}}), + * 'mouseover': xs.of({target: {}}), + * }, + * '.bar': { + * 'scroll': xs.of({target: {}}), + * elements: xs.of({tagName: 'div'}), + * } + * }); + * + * // Usage + * const click$ = domSource.select('.foo').events('click'); + * const element$ = domSource.select('.bar').elements(); + * ``` + * + * The mocked DOM Source supports isolation. It has the functions `isolateSink` + * and `isolateSource` attached to it, and performs simple isolation using + * classNames. *isolateSink* with scope `foo` will append the class `___foo` to + * the stream of virtual DOM nodes, and *isolateSource* with scope `foo` will + * perform a conventional `mockedDOMSource.select('.__foo')` call. + * + * @param {Object} mockConfig an object where keys are selector strings + * and values are objects. Those nested objects have `eventType` strings as keys + * and values are streams you created. + * @return {Object} fake DOM source object, with an API containing `select()` + * and `events()` and `elements()` which can be used just like the DOM Driver's + * DOMSource. + * + * @function mockDOMSource + */ +var mockDOMSource_1 = require("./mockDOMSource"); +exports.mockDOMSource = mockDOMSource_1.mockDOMSource; +exports.MockedDOMSource = mockDOMSource_1.MockedDOMSource; +/** + * The hyperscript function `h()` is a function to create virtual DOM objects, + * also known as VNodes. Call + * + * ```js + * h('div.myClass', {style: {color: 'red'}}, []) + * ``` + * + * to create a VNode that represents a `DIV` element with className `myClass`, + * styled with red color, and no children because the `[]` array was passed. The + * API is `h(tagOrSelector, optionalData, optionalChildrenOrText)`. + * + * However, usually you should use "hyperscript helpers", which are shortcut + * functions based on hyperscript. There is one hyperscript helper function for + * each DOM tagName, such as `h1()`, `h2()`, `div()`, `span()`, `label()`, + * `input()`. For instance, the previous example could have been written + * as: + * + * ```js + * div('.myClass', {style: {color: 'red'}}, []) + * ``` + * + * There are also SVG helper functions, which apply the appropriate SVG + * namespace to the resulting elements. `svg()` function creates the top-most + * SVG element, and `svg.g`, `svg.polygon`, `svg.circle`, `svg.path` are for + * SVG-specific child elements. Example: + * + * ```js + * svg({attrs: {width: 150, height: 150}}, [ + * svg.polygon({ + * attrs: { + * class: 'triangle', + * points: '20 0 20 150 150 20' + * } + * }) + * ]) + * ``` + * + * @function h + */ +var h_1 = require("snabbdom/h"); +exports.h = h_1.h; +var hyperscript_helpers_1 = require("./hyperscript-helpers"); +exports.svg = hyperscript_helpers_1.default.svg; +exports.a = hyperscript_helpers_1.default.a; +exports.abbr = hyperscript_helpers_1.default.abbr; +exports.address = hyperscript_helpers_1.default.address; +exports.area = hyperscript_helpers_1.default.area; +exports.article = hyperscript_helpers_1.default.article; +exports.aside = hyperscript_helpers_1.default.aside; +exports.audio = hyperscript_helpers_1.default.audio; +exports.b = hyperscript_helpers_1.default.b; +exports.base = hyperscript_helpers_1.default.base; +exports.bdi = hyperscript_helpers_1.default.bdi; +exports.bdo = hyperscript_helpers_1.default.bdo; +exports.blockquote = hyperscript_helpers_1.default.blockquote; +exports.body = hyperscript_helpers_1.default.body; +exports.br = hyperscript_helpers_1.default.br; +exports.button = hyperscript_helpers_1.default.button; +exports.canvas = hyperscript_helpers_1.default.canvas; +exports.caption = hyperscript_helpers_1.default.caption; +exports.cite = hyperscript_helpers_1.default.cite; +exports.code = hyperscript_helpers_1.default.code; +exports.col = hyperscript_helpers_1.default.col; +exports.colgroup = hyperscript_helpers_1.default.colgroup; +exports.dd = hyperscript_helpers_1.default.dd; +exports.del = hyperscript_helpers_1.default.del; +exports.dfn = hyperscript_helpers_1.default.dfn; +exports.dir = hyperscript_helpers_1.default.dir; +exports.div = hyperscript_helpers_1.default.div; +exports.dl = hyperscript_helpers_1.default.dl; +exports.dt = hyperscript_helpers_1.default.dt; +exports.em = hyperscript_helpers_1.default.em; +exports.embed = hyperscript_helpers_1.default.embed; +exports.fieldset = hyperscript_helpers_1.default.fieldset; +exports.figcaption = hyperscript_helpers_1.default.figcaption; +exports.figure = hyperscript_helpers_1.default.figure; +exports.footer = hyperscript_helpers_1.default.footer; +exports.form = hyperscript_helpers_1.default.form; +exports.h1 = hyperscript_helpers_1.default.h1; +exports.h2 = hyperscript_helpers_1.default.h2; +exports.h3 = hyperscript_helpers_1.default.h3; +exports.h4 = hyperscript_helpers_1.default.h4; +exports.h5 = hyperscript_helpers_1.default.h5; +exports.h6 = hyperscript_helpers_1.default.h6; +exports.head = hyperscript_helpers_1.default.head; +exports.header = hyperscript_helpers_1.default.header; +exports.hgroup = hyperscript_helpers_1.default.hgroup; +exports.hr = hyperscript_helpers_1.default.hr; +exports.html = hyperscript_helpers_1.default.html; +exports.i = hyperscript_helpers_1.default.i; +exports.iframe = hyperscript_helpers_1.default.iframe; +exports.img = hyperscript_helpers_1.default.img; +exports.input = hyperscript_helpers_1.default.input; +exports.ins = hyperscript_helpers_1.default.ins; +exports.kbd = hyperscript_helpers_1.default.kbd; +exports.keygen = hyperscript_helpers_1.default.keygen; +exports.label = hyperscript_helpers_1.default.label; +exports.legend = hyperscript_helpers_1.default.legend; +exports.li = hyperscript_helpers_1.default.li; +exports.link = hyperscript_helpers_1.default.link; +exports.main = hyperscript_helpers_1.default.main; +exports.map = hyperscript_helpers_1.default.map; +exports.mark = hyperscript_helpers_1.default.mark; +exports.menu = hyperscript_helpers_1.default.menu; +exports.meta = hyperscript_helpers_1.default.meta; +exports.nav = hyperscript_helpers_1.default.nav; +exports.noscript = hyperscript_helpers_1.default.noscript; +exports.object = hyperscript_helpers_1.default.object; +exports.ol = hyperscript_helpers_1.default.ol; +exports.optgroup = hyperscript_helpers_1.default.optgroup; +exports.option = hyperscript_helpers_1.default.option; +exports.p = hyperscript_helpers_1.default.p; +exports.param = hyperscript_helpers_1.default.param; +exports.pre = hyperscript_helpers_1.default.pre; +exports.progress = hyperscript_helpers_1.default.progress; +exports.q = hyperscript_helpers_1.default.q; +exports.rp = hyperscript_helpers_1.default.rp; +exports.rt = hyperscript_helpers_1.default.rt; +exports.ruby = hyperscript_helpers_1.default.ruby; +exports.s = hyperscript_helpers_1.default.s; +exports.samp = hyperscript_helpers_1.default.samp; +exports.script = hyperscript_helpers_1.default.script; +exports.section = hyperscript_helpers_1.default.section; +exports.select = hyperscript_helpers_1.default.select; +exports.small = hyperscript_helpers_1.default.small; +exports.source = hyperscript_helpers_1.default.source; +exports.span = hyperscript_helpers_1.default.span; +exports.strong = hyperscript_helpers_1.default.strong; +exports.style = hyperscript_helpers_1.default.style; +exports.sub = hyperscript_helpers_1.default.sub; +exports.sup = hyperscript_helpers_1.default.sup; +exports.table = hyperscript_helpers_1.default.table; +exports.tbody = hyperscript_helpers_1.default.tbody; +exports.td = hyperscript_helpers_1.default.td; +exports.textarea = hyperscript_helpers_1.default.textarea; +exports.tfoot = hyperscript_helpers_1.default.tfoot; +exports.th = hyperscript_helpers_1.default.th; +exports.thead = hyperscript_helpers_1.default.thead; +exports.title = hyperscript_helpers_1.default.title; +exports.tr = hyperscript_helpers_1.default.tr; +exports.u = hyperscript_helpers_1.default.u; +exports.ul = hyperscript_helpers_1.default.ul; +exports.video = hyperscript_helpers_1.default.video; + +},{"./MainDOMSource":6,"./hyperscript-helpers":13,"./makeDOMDriver":16,"./mockDOMSource":17,"./thunk":19,"snabbdom/h":34}],15:[function(require,module,exports){ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var utils_1 = require("./utils"); +function makeIsolateSink(namespace) { + return function (sink, scope) { + if (scope === ':root') { + return sink; + } + return sink.map(function (node) { + if (!node) { + return node; + } + var scopeObj = getScopeObj(scope); + var newNode = __assign({}, node, { data: __assign({}, node.data, { isolate: !node.data || !Array.isArray(node.data.isolate) + ? namespace.concat([scopeObj]) + : node.data.isolate }) }); + return __assign({}, newNode, { key: newNode.key !== undefined + ? newNode.key + : JSON.stringify(newNode.data.isolate) }); + }); + }; +} +exports.makeIsolateSink = makeIsolateSink; +function getScopeObj(scope) { + return { + type: utils_1.isClassOrId(scope) ? 'sibling' : 'total', + scope: scope, + }; +} +exports.getScopeObj = getScopeObj; + +},{"./utils":20}],16:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var snabbdom_1 = require("snabbdom"); +var xstream_1 = require("xstream"); +var concat_1 = require("xstream/extra/concat"); +var sampleCombine_1 = require("xstream/extra/sampleCombine"); +var MainDOMSource_1 = require("./MainDOMSource"); +var tovnode_1 = require("snabbdom/tovnode"); +var VNodeWrapper_1 = require("./VNodeWrapper"); +var utils_1 = require("./utils"); +var modules_1 = require("./modules"); +var IsolateModule_1 = require("./IsolateModule"); +var EventDelegator_1 = require("./EventDelegator"); +function makeDOMDriverInputGuard(modules) { + if (!Array.isArray(modules)) { + throw new Error("Optional modules option must be an array for snabbdom modules"); + } +} +function domDriverInputGuard(view$) { + if (!view$ || + typeof view$.addListener !== "function" || + typeof view$.fold !== "function") { + throw new Error("The DOM driver function expects as input a Stream of " + + "virtual DOM elements"); + } +} +function dropCompletion(input) { + return xstream_1.default.merge(input, xstream_1.default.never()); +} +function unwrapElementFromVNode(vnode) { + return vnode.elm; +} +function reportSnabbdomError(err) { + (console.error || console.log)(err); +} +function makeDOMReady$() { + return xstream_1.default.create({ + start: function (lis) { + if (document.readyState === 'loading') { + document.addEventListener('readystatechange', function () { + var state = document.readyState; + if (state === 'interactive' || state === 'complete') { + lis.next(null); + lis.complete(); + } + }); + } + else { + lis.next(null); + lis.complete(); + } + }, + stop: function () { }, + }); +} +function addRootScope(vnode) { + vnode.data = vnode.data || {}; + vnode.data.isolate = []; + return vnode; +} +function makeDOMDriver(container, options) { + if (!options) { + options = {}; + } + utils_1.checkValidContainer(container); + var modules = options.modules || modules_1.default; + makeDOMDriverInputGuard(modules); + var isolateModule = new IsolateModule_1.IsolateModule(); + var patch = snabbdom_1.init([isolateModule.createModule()].concat(modules)); + var domReady$ = makeDOMReady$(); + var vnodeWrapper; + var mutationObserver; + var mutationConfirmed$ = xstream_1.default.create({ + start: function (listener) { + mutationObserver = new MutationObserver(function () { return listener.next(null); }); + }, + stop: function () { + mutationObserver.disconnect(); + }, + }); + function DOMDriver(vnode$, name) { + if (name === void 0) { name = 'DOM'; } + domDriverInputGuard(vnode$); + var sanitation$ = xstream_1.default.create(); + var firstRoot$ = domReady$.map(function () { + var firstRoot = utils_1.getValidNode(container) || document.body; + vnodeWrapper = new VNodeWrapper_1.VNodeWrapper(firstRoot); + return firstRoot; + }); + // We need to subscribe to the sink (i.e. vnode$) synchronously inside this + // driver, and not later in the map().flatten() because this sink is in + // reality a SinkProxy from @cycle/run, and we don't want to miss the first + // emission when the main() is connected to the drivers. + // Read more in issue #739. + var rememberedVNode$ = vnode$.remember(); + rememberedVNode$.addListener({}); + // The mutation observer internal to mutationConfirmed$ should + // exist before elementAfterPatch$ calls mutationObserver.observe() + mutationConfirmed$.addListener({}); + var elementAfterPatch$ = firstRoot$ + .map(function (firstRoot) { + return xstream_1.default + .merge(rememberedVNode$.endWhen(sanitation$), sanitation$) + .map(function (vnode) { return vnodeWrapper.call(vnode); }) + .startWith(addRootScope(tovnode_1.toVNode(firstRoot))) + .fold(patch, tovnode_1.toVNode(firstRoot)) + .drop(1) + .map(unwrapElementFromVNode) + .startWith(firstRoot) + .map(function (el) { + mutationObserver.observe(el, { + childList: true, + attributes: true, + characterData: true, + subtree: true, + attributeOldValue: true, + characterDataOldValue: true, + }); + return el; + }) + .compose(dropCompletion); + } // don't complete this stream + ) + .flatten(); + var rootElement$ = concat_1.default(domReady$, mutationConfirmed$) + .endWhen(sanitation$) + .compose(sampleCombine_1.default(elementAfterPatch$)) + .map(function (arr) { return arr[1]; }) + .remember(); + // Start the snabbdom patching, over time + rootElement$.addListener({ error: reportSnabbdomError }); + var delegator = new EventDelegator_1.EventDelegator(rootElement$, isolateModule); + return new MainDOMSource_1.MainDOMSource(rootElement$, sanitation$, [], isolateModule, delegator, name); + } + return DOMDriver; +} +exports.makeDOMDriver = makeDOMDriver; + +},{"./EventDelegator":4,"./IsolateModule":5,"./MainDOMSource":6,"./VNodeWrapper":11,"./modules":18,"./utils":20,"snabbdom":42,"snabbdom/tovnode":44,"xstream":55,"xstream/extra/concat":53,"xstream/extra/sampleCombine":54}],17:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var xstream_1 = require("xstream"); +var adapt_1 = require("@cycle/run/lib/adapt"); +var SCOPE_PREFIX = '___'; +var MockedDOMSource = /** @class */ (function () { + function MockedDOMSource(_mockConfig) { + this._mockConfig = _mockConfig; + if (_mockConfig.elements) { + this._elements = _mockConfig.elements; + } + else { + this._elements = adapt_1.adapt(xstream_1.default.empty()); + } + } + MockedDOMSource.prototype.elements = function () { + var out = this + ._elements; + out._isCycleSource = 'MockedDOM'; + return out; + }; + MockedDOMSource.prototype.element = function () { + var output$ = this.elements() + .filter(function (arr) { return arr.length > 0; }) + .map(function (arr) { return arr[0]; }) + .remember(); + var out = adapt_1.adapt(output$); + out._isCycleSource = 'MockedDOM'; + return out; + }; + MockedDOMSource.prototype.events = function (eventType, options, bubbles) { + var streamForEventType = this._mockConfig[eventType]; + var out = adapt_1.adapt(streamForEventType || xstream_1.default.empty()); + out._isCycleSource = 'MockedDOM'; + return out; + }; + MockedDOMSource.prototype.select = function (selector) { + var mockConfigForSelector = this._mockConfig[selector] || {}; + return new MockedDOMSource(mockConfigForSelector); + }; + MockedDOMSource.prototype.isolateSource = function (source, scope) { + return source.select('.' + SCOPE_PREFIX + scope); + }; + MockedDOMSource.prototype.isolateSink = function (sink, scope) { + return adapt_1.adapt(xstream_1.default.fromObservable(sink).map(function (vnode) { + if (vnode.sel && vnode.sel.indexOf(SCOPE_PREFIX + scope) !== -1) { + return vnode; + } + else { + vnode.sel += "." + SCOPE_PREFIX + scope; + return vnode; + } + })); + }; + return MockedDOMSource; +}()); +exports.MockedDOMSource = MockedDOMSource; +function mockDOMSource(mockConfig) { + return new MockedDOMSource(mockConfig); +} +exports.mockDOMSource = mockDOMSource; + +},{"@cycle/run/lib/adapt":21,"xstream":55}],18:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var class_1 = require("snabbdom/modules/class"); +exports.ClassModule = class_1.default; +var props_1 = require("snabbdom/modules/props"); +exports.PropsModule = props_1.default; +var attributes_1 = require("snabbdom/modules/attributes"); +exports.AttrsModule = attributes_1.default; +var style_1 = require("snabbdom/modules/style"); +exports.StyleModule = style_1.default; +var dataset_1 = require("snabbdom/modules/dataset"); +exports.DatasetModule = dataset_1.default; +var modules = [ + style_1.default, + class_1.default, + props_1.default, + attributes_1.default, + dataset_1.default, +]; +exports.default = modules; + +},{"snabbdom/modules/attributes":37,"snabbdom/modules/class":38,"snabbdom/modules/dataset":39,"snabbdom/modules/props":40,"snabbdom/modules/style":41}],19:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var h_1 = require("snabbdom/h"); +function copyToThunk(vnode, thunkVNode) { + thunkVNode.elm = vnode.elm; + vnode.data.fn = thunkVNode.data.fn; + vnode.data.args = thunkVNode.data.args; + vnode.data.isolate = thunkVNode.data.isolate; + thunkVNode.data = vnode.data; + thunkVNode.children = vnode.children; + thunkVNode.text = vnode.text; + thunkVNode.elm = vnode.elm; +} +function init(thunkVNode) { + var cur = thunkVNode.data; + var vnode = cur.fn.apply(undefined, cur.args); + copyToThunk(vnode, thunkVNode); +} +function prepatch(oldVnode, thunkVNode) { + var old = oldVnode.data, cur = thunkVNode.data; + var i; + var oldArgs = old.args, args = cur.args; + if (old.fn !== cur.fn || oldArgs.length !== args.length) { + copyToThunk(cur.fn.apply(undefined, args), thunkVNode); + } + for (i = 0; i < args.length; ++i) { + if (oldArgs[i] !== args[i]) { + copyToThunk(cur.fn.apply(undefined, args), thunkVNode); + return; + } + } + copyToThunk(oldVnode, thunkVNode); +} +function thunk(sel, key, fn, args) { + if (args === undefined) { + args = fn; + fn = key; + key = undefined; + } + return h_1.h(sel, { + key: key, + hook: { init: init, prepatch: prepatch }, + fn: fn, + args: args, + }); +} +exports.thunk = thunk; +exports.default = thunk; + +},{"snabbdom/h":34}],20:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function isValidNode(obj) { + var ELEM_TYPE = 1; + var FRAG_TYPE = 11; + return typeof HTMLElement === 'object' + ? obj instanceof HTMLElement || obj instanceof DocumentFragment + : obj && + typeof obj === 'object' && + obj !== null && + (obj.nodeType === ELEM_TYPE || obj.nodeType === FRAG_TYPE) && + typeof obj.nodeName === 'string'; +} +function isClassOrId(str) { + return str.length > 1 && (str[0] === '.' || str[0] === '#'); +} +exports.isClassOrId = isClassOrId; +function isDocFrag(el) { + return el.nodeType === 11; +} +exports.isDocFrag = isDocFrag; +function checkValidContainer(container) { + if (typeof container !== 'string' && !isValidNode(container)) { + throw new Error('Given container is not a DOM element neither a selector string.'); + } +} +exports.checkValidContainer = checkValidContainer; +function getValidNode(selectors) { + var domElement = typeof selectors === 'string' + ? document.querySelector(selectors) + : selectors; + if (typeof selectors === 'string' && domElement === null) { + throw new Error("Cannot render into unknown element `" + selectors + "`"); + } + return domElement; +} +exports.getValidNode = getValidNode; +function getSelectors(namespace) { + var res = ''; + for (var i = namespace.length - 1; i >= 0; i--) { + if (namespace[i].type !== 'selector') { + break; + } + res = namespace[i].scope + ' ' + res; + } + return res.trim(); +} +exports.getSelectors = getSelectors; +function isEqualNamespace(a, b) { + if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) { + return false; + } + for (var i = 0; i < a.length; i++) { + if (a[i].type !== b[i].type || a[i].scope !== b[i].scope) { + return false; + } + } + return true; +} +exports.isEqualNamespace = isEqualNamespace; +function makeInsert(map) { + return function (type, elm, value) { + if (map.has(type)) { + var innerMap = map.get(type); + innerMap.set(elm, value); + } + else { + var innerMap = new Map(); + innerMap.set(elm, value); + map.set(type, innerMap); + } + }; +} +exports.makeInsert = makeInsert; + +},{}],21:[function(require,module,exports){ +(function (global){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function getGlobal() { + var globalObj; + if (typeof window !== 'undefined') { + globalObj = window; + } + else if (typeof global !== 'undefined') { + globalObj = global; + } + else { + globalObj = this; + } + globalObj.Cyclejs = globalObj.Cyclejs || {}; + globalObj = globalObj.Cyclejs; + globalObj.adaptStream = globalObj.adaptStream || (function (x) { return x; }); + return globalObj; +} +function setAdapt(f) { + getGlobal().adaptStream = f; +} +exports.setAdapt = setAdapt; +function adapt(stream) { + return getGlobal().adaptStream(stream); +} +exports.adapt = adapt; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) + +},{}],22:[function(require,module,exports){ +(function (global){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function getGlobal() { + var globalObj; + if (typeof window !== 'undefined') { + globalObj = window; + } + else if (typeof global !== 'undefined') { + globalObj = global; + } + else { + globalObj = this; + } + globalObj.Cyclejs = globalObj.Cyclejs || {}; + globalObj = globalObj.Cyclejs; + globalObj.adaptStream = globalObj.adaptStream || (function (x) { return x; }); + return globalObj; +} +function setAdapt(f) { + getGlobal().adaptStream = f; +} +exports.setAdapt = setAdapt; +function adapt(stream) { + return getGlobal().adaptStream(stream); +} +exports.adapt = adapt; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) + +},{}],23:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var internals_1 = require("./internals"); +/** + * A function that prepares the Cycle application to be executed. Takes a `main` + * function and prepares to circularly connects it to the given collection of + * driver functions. As an output, `setup()` returns an object with three + * properties: `sources`, `sinks` and `run`. Only when `run()` is called will + * the application actually execute. Refer to the documentation of `run()` for + * more details. + * + * **Example:** + * ```js + * import {setup} from '@cycle/run'; + * const {sources, sinks, run} = setup(main, drivers); + * // ... + * const dispose = run(); // Executes the application + * // ... + * dispose(); + * ``` + * + * @param {Function} main a function that takes `sources` as input and outputs + * `sinks`. + * @param {Object} drivers an object where keys are driver names and values + * are driver functions. + * @return {Object} an object with three properties: `sources`, `sinks` and + * `run`. `sources` is the collection of driver sources, `sinks` is the + * collection of driver sinks, these can be used for debugging or testing. `run` + * is the function that once called will execute the application. + * @function setup + */ +function setup(main, drivers) { + if (typeof main !== "function") { + throw new Error("First argument given to Cycle must be the 'main' " + "function."); + } + if (typeof drivers !== "object" || drivers === null) { + throw new Error("Second argument given to Cycle must be an object " + + "with driver functions as properties."); + } + if (internals_1.isObjectEmpty(drivers)) { + throw new Error("Second argument given to Cycle must be an object " + + "with at least one driver function declared as a property."); + } + var engine = setupReusable(drivers); + var sinks = main(engine.sources); + if (typeof window !== 'undefined') { + window.Cyclejs = window.Cyclejs || {}; + window.Cyclejs.sinks = sinks; + } + function _run() { + var disposeRun = engine.run(sinks); + return function dispose() { + disposeRun(); + engine.dispose(); + }; + } + return { sinks: sinks, sources: engine.sources, run: _run }; +} +exports.setup = setup; +/** + * A partially-applied variant of setup() which accepts only the drivers, and + * allows many `main` functions to execute and reuse this same set of drivers. + * + * Takes an object with driver functions as input, and outputs an object which + * contains the generated sources (from those drivers) and a `run` function + * (which in turn expects sinks as argument). This `run` function can be called + * multiple times with different arguments, and it will reuse the drivers that + * were passed to `setupReusable`. + * + * **Example:** + * ```js + * import {setupReusable} from '@cycle/run'; + * const {sources, run, dispose} = setupReusable(drivers); + * // ... + * const sinks = main(sources); + * const disposeRun = run(sinks); + * // ... + * disposeRun(); + * // ... + * dispose(); // ends the reusability of drivers + * ``` + * + * @param {Object} drivers an object where keys are driver names and values + * are driver functions. + * @return {Object} an object with three properties: `sources`, `run` and + * `dispose`. `sources` is the collection of driver sources, `run` is the + * function that once called with 'sinks' as argument, will execute the + * application, tying together sources with sinks. `dispose` terminates the + * reusable resources used by the drivers. Note also that `run` returns a + * dispose function which terminates resources that are specific (not reusable) + * to that run. + * @function setupReusable + */ +function setupReusable(drivers) { + if (typeof drivers !== "object" || drivers === null) { + throw new Error("Argument given to setupReusable must be an object " + + "with driver functions as properties."); + } + if (internals_1.isObjectEmpty(drivers)) { + throw new Error("Argument given to setupReusable must be an object " + + "with at least one driver function declared as a property."); + } + var sinkProxies = internals_1.makeSinkProxies(drivers); + var rawSources = internals_1.callDrivers(drivers, sinkProxies); + var sources = internals_1.adaptSources(rawSources); + function _run(sinks) { + return internals_1.replicateMany(sinks, sinkProxies); + } + function disposeEngine() { + internals_1.disposeSources(sources); + internals_1.disposeSinkProxies(sinkProxies); + } + return { sources: sources, run: _run, dispose: disposeEngine }; +} +exports.setupReusable = setupReusable; +/** + * Takes a `main` function and circularly connects it to the given collection + * of driver functions. + * + * **Example:** + * ```js + * import run from '@cycle/run'; + * const dispose = run(main, drivers); + * // ... + * dispose(); + * ``` + * + * The `main` function expects a collection of "source" streams (returned from + * drivers) as input, and should return a collection of "sink" streams (to be + * given to drivers). A "collection of streams" is a JavaScript object where + * keys match the driver names registered by the `drivers` object, and values + * are the streams. Refer to the documentation of each driver to see more + * details on what types of sources it outputs and sinks it receives. + * + * @param {Function} main a function that takes `sources` as input and outputs + * `sinks`. + * @param {Object} drivers an object where keys are driver names and values + * are driver functions. + * @return {Function} a dispose function, used to terminate the execution of the + * Cycle.js program, cleaning up resources used. + * @function run + */ +function run(main, drivers) { + var program = setup(main, drivers); + if (typeof window !== 'undefined' && + window.CyclejsDevTool_startGraphSerializer) { + window.CyclejsDevTool_startGraphSerializer(program.sinks); + } + return program.run(); +} +exports.run = run; +exports.default = run; + +},{"./internals":24}],24:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var xstream_1 = require("xstream"); +var quicktask_1 = require("quicktask"); +var adapt_1 = require("./adapt"); +var scheduleMicrotask = quicktask_1.default(); +function makeSinkProxies(drivers) { + var sinkProxies = {}; + for (var name_1 in drivers) { + if (drivers.hasOwnProperty(name_1)) { + sinkProxies[name_1] = xstream_1.default.create(); + } + } + return sinkProxies; +} +exports.makeSinkProxies = makeSinkProxies; +function callDrivers(drivers, sinkProxies) { + var sources = {}; + for (var name_2 in drivers) { + if (drivers.hasOwnProperty(name_2)) { + sources[name_2] = drivers[name_2](sinkProxies[name_2], name_2); + if (sources[name_2] && typeof sources[name_2] === 'object') { + sources[name_2]._isCycleSource = name_2; + } + } + } + return sources; +} +exports.callDrivers = callDrivers; +// NOTE: this will mutate `sources`. +function adaptSources(sources) { + for (var name_3 in sources) { + if (sources.hasOwnProperty(name_3) && + sources[name_3] && + typeof sources[name_3].shamefullySendNext === + 'function') { + sources[name_3] = adapt_1.adapt(sources[name_3]); + } + } + return sources; +} +exports.adaptSources = adaptSources; +function replicateMany(sinks, sinkProxies) { + var sinkNames = Object.keys(sinks).filter(function (name) { return !!sinkProxies[name]; }); + var buffers = {}; + var replicators = {}; + sinkNames.forEach(function (name) { + buffers[name] = { _n: [], _e: [] }; + replicators[name] = { + next: function (x) { return buffers[name]._n.push(x); }, + error: function (err) { return buffers[name]._e.push(err); }, + complete: function () { }, + }; + }); + var subscriptions = sinkNames.map(function (name) { + return xstream_1.default.fromObservable(sinks[name]).subscribe(replicators[name]); + }); + sinkNames.forEach(function (name) { + var listener = sinkProxies[name]; + var next = function (x) { + scheduleMicrotask(function () { return listener._n(x); }); + }; + var error = function (err) { + scheduleMicrotask(function () { + (console.error || console.log)(err); + listener._e(err); + }); + }; + buffers[name]._n.forEach(next); + buffers[name]._e.forEach(error); + replicators[name].next = next; + replicators[name].error = error; + // because sink.subscribe(replicator) had mutated replicator to add + // _n, _e, _c, we must also update these: + replicators[name]._n = next; + replicators[name]._e = error; + }); + buffers = null; // free up for GC + return function disposeReplication() { + subscriptions.forEach(function (s) { return s.unsubscribe(); }); + }; +} +exports.replicateMany = replicateMany; +function disposeSinkProxies(sinkProxies) { + Object.keys(sinkProxies).forEach(function (name) { return sinkProxies[name]._c(); }); +} +exports.disposeSinkProxies = disposeSinkProxies; +function disposeSources(sources) { + for (var k in sources) { + if (sources.hasOwnProperty(k) && + sources[k] && + sources[k].dispose) { + sources[k].dispose(); + } + } +} +exports.disposeSources = disposeSources; +function isObjectEmpty(obj) { + return Object.keys(obj).length === 0; +} +exports.isObjectEmpty = isObjectEmpty; + +},{"./adapt":22,"quicktask":26,"xstream":55}],25:[function(require,module,exports){ +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + +},{}],26:[function(require,module,exports){ +(function (process,setImmediate){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function microtask() { + if (typeof MutationObserver !== 'undefined') { + var node_1 = document.createTextNode(''); + var queue_1 = []; + var i_1 = 0; + new MutationObserver(function () { + while (queue_1.length) { + queue_1.shift()(); + } + }).observe(node_1, { characterData: true }); + return function (fn) { + queue_1.push(fn); + node_1.data = i_1 = 1 - i_1; + }; + } + else if (typeof setImmediate !== 'undefined') { + return setImmediate; + } + else if (typeof process !== 'undefined') { + return process.nextTick; + } + else { + return setTimeout; + } +} +exports.default = microtask; + +}).call(this,require('_process'),require("timers").setImmediate) + +},{"_process":25,"timers":48}],27:[function(require,module,exports){ +"use strict"; +var selectorParser_1 = require('./selectorParser'); +function classNameFromVNode(vNode) { + var _a = selectorParser_1.selectorParser(vNode).className, cn = _a === void 0 ? '' : _a; + if (!vNode.data) { + return cn; + } + var _b = vNode.data, dataClass = _b.class, props = _b.props; + if (dataClass) { + var c = Object.keys(dataClass) + .filter(function (cl) { return dataClass[cl]; }); + cn += " " + c.join(" "); + } + if (props && props.className) { + cn += " " + props.className; + } + return cn && cn.trim(); +} +exports.classNameFromVNode = classNameFromVNode; + +},{"./selectorParser":33}],28:[function(require,module,exports){ +"use strict"; +function curry2(select) { + return function selector(sel, vNode) { + switch (arguments.length) { + case 0: return select; + case 1: return function (_vNode) { return select(sel, _vNode); }; + default: return select(sel, vNode); + } + }; +} +exports.curry2 = curry2; +; + +},{}],29:[function(require,module,exports){ +"use strict"; +var query_1 = require('./query'); +var parent_symbol_1 = require('./parent-symbol'); +function findMatches(cssSelector, vNode) { + if (!vNode) { + return []; + } + traverseVNode(vNode, addParent); // add mapping to the parent selectorParser + return query_1.querySelector(cssSelector, vNode); +} +exports.findMatches = findMatches; +function traverseVNode(vNode, f) { + function recurse(currentNode, isParent, parentVNode) { + var length = currentNode.children && currentNode.children.length || 0; + for (var i = 0; i < length; ++i) { + var children = currentNode.children; + if (children && children[i] && typeof children[i] !== 'string') { + var child = children[i]; + recurse(child, false, currentNode); + } + } + f(currentNode, isParent, isParent ? void 0 : parentVNode); + } + recurse(vNode, true); +} +function addParent(vNode, isParent, parent) { + if (isParent) { + return void 0; + } + if (!vNode.data) { + vNode.data = {}; + } + if (!vNode.data[parent_symbol_1.default]) { + Object.defineProperty(vNode.data, parent_symbol_1.default, { + value: parent, + }); + } +} + +},{"./parent-symbol":31,"./query":32}],30:[function(require,module,exports){ +"use strict"; +var curry2_1 = require('./curry2'); +var findMatches_1 = require('./findMatches'); +exports.select = curry2_1.curry2(findMatches_1.findMatches); +var selectorParser_1 = require('./selectorParser'); +exports.selectorParser = selectorParser_1.selectorParser; +var classNameFromVNode_1 = require('./classNameFromVNode'); +exports.classNameFromVNode = classNameFromVNode_1.classNameFromVNode; + +},{"./classNameFromVNode":27,"./curry2":28,"./findMatches":29,"./selectorParser":33}],31:[function(require,module,exports){ +(function (global){ +"use strict"; +var root; +if (typeof self !== 'undefined') { + root = self; +} +else if (typeof window !== 'undefined') { + root = window; +} +else if (typeof global !== 'undefined') { + root = global; +} +else { + root = Function('return this')(); +} +var Symbol = root.Symbol; +var parentSymbol; +if (typeof Symbol === 'function') { + parentSymbol = Symbol('parent'); +} +else { + parentSymbol = '@@snabbdom-selector-parent'; +} +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = parentSymbol; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) + +},{}],32:[function(require,module,exports){ +"use strict"; +var tree_selector_1 = require('tree-selector'); +var selectorParser_1 = require('./selectorParser'); +var classNameFromVNode_1 = require('./classNameFromVNode'); +var parent_symbol_1 = require('./parent-symbol'); +var options = { + tag: function (vNode) { return selectorParser_1.selectorParser(vNode).tagName; }, + className: function (vNode) { return classNameFromVNode_1.classNameFromVNode(vNode); }, + id: function (vNode) { return selectorParser_1.selectorParser(vNode).id || ''; }, + children: function (vNode) { return vNode.children || []; }, + parent: function (vNode) { return vNode.data[parent_symbol_1.default] || vNode; }, + contents: function (vNode) { return vNode.text || ''; }, + attr: function (vNode, attr) { + if (vNode.data) { + var _a = vNode.data, _b = _a.attrs, attrs = _b === void 0 ? {} : _b, _c = _a.props, props = _c === void 0 ? {} : _c, _d = _a.dataset, dataset = _d === void 0 ? {} : _d; + if (attrs[attr]) { + return attrs[attr]; + } + if (props[attr]) { + return props[attr]; + } + if (attr.indexOf('data-') === 0 && dataset[attr.slice(5)]) { + return dataset[attr.slice(5)]; + } + } + }, +}; +var matches = tree_selector_1.createMatches(options); +function customMatches(sel, vnode) { + var data = vnode.data; + var selector = matches.bind(null, sel); + if (data && data.fn) { + var n = void 0; + if (Array.isArray(data.args)) { + n = data.fn.apply(null, data.args); + } + else if (data.args) { + n = data.fn.call(null, data.args); + } + else { + n = data.fn(); + } + return selector(n) ? n : false; + } + return selector(vnode); +} +exports.querySelector = tree_selector_1.createQuerySelector(options, customMatches); + +},{"./classNameFromVNode":27,"./parent-symbol":31,"./selectorParser":33,"tree-selector":49}],33:[function(require,module,exports){ +"use strict"; +function selectorParser(node) { + if (!node.sel) { + return { + tagName: '', + id: '', + className: '', + }; + } + var sel = node.sel; + var hashIdx = sel.indexOf('#'); + var dotIdx = sel.indexOf('.', hashIdx); + var hash = hashIdx > 0 ? hashIdx : sel.length; + var dot = dotIdx > 0 ? dotIdx : sel.length; + var tagName = hashIdx !== -1 || dotIdx !== -1 ? + sel.slice(0, Math.min(hash, dot)) : + sel; + var id = hash < dot ? sel.slice(hash + 1, dot) : void 0; + var className = dotIdx > 0 ? sel.slice(dot + 1).replace(/\./g, ' ') : void 0; + return { + tagName: tagName, + id: id, + className: className, + }; +} +exports.selectorParser = selectorParser; + +},{}],34:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var vnode_1 = require("./vnode"); +var is = require("./is"); +function addNS(data, children, sel) { + data.ns = 'http://www.w3.org/2000/svg'; + if (sel !== 'foreignObject' && children !== undefined) { + for (var i = 0; i < children.length; ++i) { + var childData = children[i].data; + if (childData !== undefined) { + addNS(childData, children[i].children, children[i].sel); + } + } + } +} +function h(sel, b, c) { + var data = {}, children, text, i; + if (c !== undefined) { + data = b; + if (is.array(c)) { + children = c; + } + else if (is.primitive(c)) { + text = c; + } + else if (c && c.sel) { + children = [c]; + } + } + else if (b !== undefined) { + if (is.array(b)) { + children = b; + } + else if (is.primitive(b)) { + text = b; + } + else if (b && b.sel) { + children = [b]; + } + else { + data = b; + } + } + if (children !== undefined) { + for (i = 0; i < children.length; ++i) { + if (is.primitive(children[i])) + children[i] = vnode_1.vnode(undefined, undefined, undefined, children[i], undefined); + } + } + if (sel[0] === 's' && sel[1] === 'v' && sel[2] === 'g' && + (sel.length === 3 || sel[3] === '.' || sel[3] === '#')) { + addNS(data, children, sel); + } + return vnode_1.vnode(sel, data, children, text, undefined); +} +exports.h = h; +; +exports.default = h; + +},{"./is":36,"./vnode":45}],35:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function createElement(tagName) { + return document.createElement(tagName); +} +function createElementNS(namespaceURI, qualifiedName) { + return document.createElementNS(namespaceURI, qualifiedName); +} +function createTextNode(text) { + return document.createTextNode(text); +} +function createComment(text) { + return document.createComment(text); +} +function insertBefore(parentNode, newNode, referenceNode) { + parentNode.insertBefore(newNode, referenceNode); +} +function removeChild(node, child) { + node.removeChild(child); +} +function appendChild(node, child) { + node.appendChild(child); +} +function parentNode(node) { + return node.parentNode; +} +function nextSibling(node) { + return node.nextSibling; +} +function tagName(elm) { + return elm.tagName; +} +function setTextContent(node, text) { + node.textContent = text; +} +function getTextContent(node) { + return node.textContent; +} +function isElement(node) { + return node.nodeType === 1; +} +function isText(node) { + return node.nodeType === 3; +} +function isComment(node) { + return node.nodeType === 8; +} +exports.htmlDomApi = { + createElement: createElement, + createElementNS: createElementNS, + createTextNode: createTextNode, + createComment: createComment, + insertBefore: insertBefore, + removeChild: removeChild, + appendChild: appendChild, + parentNode: parentNode, + nextSibling: nextSibling, + tagName: tagName, + setTextContent: setTextContent, + getTextContent: getTextContent, + isElement: isElement, + isText: isText, + isComment: isComment, +}; +exports.default = exports.htmlDomApi; + +},{}],36:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.array = Array.isArray; +function primitive(s) { + return typeof s === 'string' || typeof s === 'number'; +} +exports.primitive = primitive; + +},{}],37:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var xlinkNS = 'http://www.w3.org/1999/xlink'; +var xmlNS = 'http://www.w3.org/XML/1998/namespace'; +var colonChar = 58; +var xChar = 120; +function updateAttrs(oldVnode, vnode) { + var key, elm = vnode.elm, oldAttrs = oldVnode.data.attrs, attrs = vnode.data.attrs; + if (!oldAttrs && !attrs) + return; + if (oldAttrs === attrs) + return; + oldAttrs = oldAttrs || {}; + attrs = attrs || {}; + // update modified attributes, add new attributes + for (key in attrs) { + var cur = attrs[key]; + var old = oldAttrs[key]; + if (old !== cur) { + if (cur === true) { + elm.setAttribute(key, ""); + } + else if (cur === false) { + elm.removeAttribute(key); + } + else { + if (key.charCodeAt(0) !== xChar) { + elm.setAttribute(key, cur); + } + else if (key.charCodeAt(3) === colonChar) { + // Assume xml namespace + elm.setAttributeNS(xmlNS, key, cur); + } + else if (key.charCodeAt(5) === colonChar) { + // Assume xlink namespace + elm.setAttributeNS(xlinkNS, key, cur); + } + else { + elm.setAttribute(key, cur); + } + } + } + } + // remove removed attributes + // use `in` operator since the previous `for` iteration uses it (.i.e. add even attributes with undefined value) + // the other option is to remove all attributes with value == undefined + for (key in oldAttrs) { + if (!(key in attrs)) { + elm.removeAttribute(key); + } + } +} +exports.attributesModule = { create: updateAttrs, update: updateAttrs }; +exports.default = exports.attributesModule; + +},{}],38:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function updateClass(oldVnode, vnode) { + var cur, name, elm = vnode.elm, oldClass = oldVnode.data.class, klass = vnode.data.class; + if (!oldClass && !klass) + return; + if (oldClass === klass) + return; + oldClass = oldClass || {}; + klass = klass || {}; + for (name in oldClass) { + if (!klass[name]) { + elm.classList.remove(name); + } + } + for (name in klass) { + cur = klass[name]; + if (cur !== oldClass[name]) { + elm.classList[cur ? 'add' : 'remove'](name); + } + } +} +exports.classModule = { create: updateClass, update: updateClass }; +exports.default = exports.classModule; + +},{}],39:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var CAPS_REGEX = /[A-Z]/g; +function updateDataset(oldVnode, vnode) { + var elm = vnode.elm, oldDataset = oldVnode.data.dataset, dataset = vnode.data.dataset, key; + if (!oldDataset && !dataset) + return; + if (oldDataset === dataset) + return; + oldDataset = oldDataset || {}; + dataset = dataset || {}; + var d = elm.dataset; + for (key in oldDataset) { + if (!dataset[key]) { + if (d) { + if (key in d) { + delete d[key]; + } + } + else { + elm.removeAttribute('data-' + key.replace(CAPS_REGEX, '-$&').toLowerCase()); + } + } + } + for (key in dataset) { + if (oldDataset[key] !== dataset[key]) { + if (d) { + d[key] = dataset[key]; + } + else { + elm.setAttribute('data-' + key.replace(CAPS_REGEX, '-$&').toLowerCase(), dataset[key]); + } + } + } +} +exports.datasetModule = { create: updateDataset, update: updateDataset }; +exports.default = exports.datasetModule; + +},{}],40:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function updateProps(oldVnode, vnode) { + var key, cur, old, elm = vnode.elm, oldProps = oldVnode.data.props, props = vnode.data.props; + if (!oldProps && !props) + return; + if (oldProps === props) + return; + oldProps = oldProps || {}; + props = props || {}; + for (key in oldProps) { + if (!props[key]) { + delete elm[key]; + } + } + for (key in props) { + cur = props[key]; + old = oldProps[key]; + if (old !== cur && (key !== 'value' || elm[key] !== cur)) { + elm[key] = cur; + } + } +} +exports.propsModule = { create: updateProps, update: updateProps }; +exports.default = exports.propsModule; + +},{}],41:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// Bindig `requestAnimationFrame` like this fixes a bug in IE/Edge. See #360 and #409. +var raf = (typeof window !== 'undefined' && (window.requestAnimationFrame).bind(window)) || setTimeout; +var nextFrame = function (fn) { raf(function () { raf(fn); }); }; +var reflowForced = false; +function setNextFrame(obj, prop, val) { + nextFrame(function () { obj[prop] = val; }); +} +function updateStyle(oldVnode, vnode) { + var cur, name, elm = vnode.elm, oldStyle = oldVnode.data.style, style = vnode.data.style; + if (!oldStyle && !style) + return; + if (oldStyle === style) + return; + oldStyle = oldStyle || {}; + style = style || {}; + var oldHasDel = 'delayed' in oldStyle; + for (name in oldStyle) { + if (!style[name]) { + if (name[0] === '-' && name[1] === '-') { + elm.style.removeProperty(name); + } + else { + elm.style[name] = ''; + } + } + } + for (name in style) { + cur = style[name]; + if (name === 'delayed' && style.delayed) { + for (var name2 in style.delayed) { + cur = style.delayed[name2]; + if (!oldHasDel || cur !== oldStyle.delayed[name2]) { + setNextFrame(elm.style, name2, cur); + } + } + } + else if (name !== 'remove' && cur !== oldStyle[name]) { + if (name[0] === '-' && name[1] === '-') { + elm.style.setProperty(name, cur); + } + else { + elm.style[name] = cur; + } + } + } +} +function applyDestroyStyle(vnode) { + var style, name, elm = vnode.elm, s = vnode.data.style; + if (!s || !(style = s.destroy)) + return; + for (name in style) { + elm.style[name] = style[name]; + } +} +function applyRemoveStyle(vnode, rm) { + var s = vnode.data.style; + if (!s || !s.remove) { + rm(); + return; + } + if (!reflowForced) { + getComputedStyle(document.body).transform; + reflowForced = true; + } + var name, elm = vnode.elm, i = 0, compStyle, style = s.remove, amount = 0, applied = []; + for (name in style) { + applied.push(name); + elm.style[name] = style[name]; + } + compStyle = getComputedStyle(elm); + var props = compStyle['transition-property'].split(', '); + for (; i < props.length; ++i) { + if (applied.indexOf(props[i]) !== -1) + amount++; + } + elm.addEventListener('transitionend', function (ev) { + if (ev.target === elm) + --amount; + if (amount === 0) + rm(); + }); +} +function forceReflow() { + reflowForced = false; +} +exports.styleModule = { + pre: forceReflow, + create: updateStyle, + update: updateStyle, + destroy: applyDestroyStyle, + remove: applyRemoveStyle +}; +exports.default = exports.styleModule; + +},{}],42:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var vnode_1 = require("./vnode"); +var is = require("./is"); +var htmldomapi_1 = require("./htmldomapi"); +function isUndef(s) { return s === undefined; } +function isDef(s) { return s !== undefined; } +var emptyNode = vnode_1.default('', {}, [], undefined, undefined); +function sameVnode(vnode1, vnode2) { + return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel; +} +function isVnode(vnode) { + return vnode.sel !== undefined; +} +function createKeyToOldIdx(children, beginIdx, endIdx) { + var i, map = {}, key, ch; + for (i = beginIdx; i <= endIdx; ++i) { + ch = children[i]; + if (ch != null) { + key = ch.key; + if (key !== undefined) + map[key] = i; + } + } + return map; +} +var hooks = ['create', 'update', 'remove', 'destroy', 'pre', 'post']; +var h_1 = require("./h"); +exports.h = h_1.h; +var thunk_1 = require("./thunk"); +exports.thunk = thunk_1.thunk; +function init(modules, domApi) { + var i, j, cbs = {}; + var api = domApi !== undefined ? domApi : htmldomapi_1.default; + for (i = 0; i < hooks.length; ++i) { + cbs[hooks[i]] = []; + for (j = 0; j < modules.length; ++j) { + var hook = modules[j][hooks[i]]; + if (hook !== undefined) { + cbs[hooks[i]].push(hook); + } + } + } + function emptyNodeAt(elm) { + var id = elm.id ? '#' + elm.id : ''; + var c = elm.className ? '.' + elm.className.split(' ').join('.') : ''; + return vnode_1.default(api.tagName(elm).toLowerCase() + id + c, {}, [], undefined, elm); + } + function createRmCb(childElm, listeners) { + return function rmCb() { + if (--listeners === 0) { + var parent_1 = api.parentNode(childElm); + api.removeChild(parent_1, childElm); + } + }; + } + function createElm(vnode, insertedVnodeQueue) { + var i, data = vnode.data; + if (data !== undefined) { + if (isDef(i = data.hook) && isDef(i = i.init)) { + i(vnode); + data = vnode.data; + } + } + var children = vnode.children, sel = vnode.sel; + if (sel === '!') { + if (isUndef(vnode.text)) { + vnode.text = ''; + } + vnode.elm = api.createComment(vnode.text); + } + else if (sel !== undefined) { + // Parse selector + var hashIdx = sel.indexOf('#'); + var dotIdx = sel.indexOf('.', hashIdx); + var hash = hashIdx > 0 ? hashIdx : sel.length; + var dot = dotIdx > 0 ? dotIdx : sel.length; + var tag = hashIdx !== -1 || dotIdx !== -1 ? sel.slice(0, Math.min(hash, dot)) : sel; + var elm = vnode.elm = isDef(data) && isDef(i = data.ns) ? api.createElementNS(i, tag) + : api.createElement(tag); + if (hash < dot) + elm.setAttribute('id', sel.slice(hash + 1, dot)); + if (dotIdx > 0) + elm.setAttribute('class', sel.slice(dot + 1).replace(/\./g, ' ')); + for (i = 0; i < cbs.create.length; ++i) + cbs.create[i](emptyNode, vnode); + if (is.array(children)) { + for (i = 0; i < children.length; ++i) { + var ch = children[i]; + if (ch != null) { + api.appendChild(elm, createElm(ch, insertedVnodeQueue)); + } + } + } + else if (is.primitive(vnode.text)) { + api.appendChild(elm, api.createTextNode(vnode.text)); + } + i = vnode.data.hook; // Reuse variable + if (isDef(i)) { + if (i.create) + i.create(emptyNode, vnode); + if (i.insert) + insertedVnodeQueue.push(vnode); + } + } + else { + vnode.elm = api.createTextNode(vnode.text); + } + return vnode.elm; + } + function addVnodes(parentElm, before, vnodes, startIdx, endIdx, insertedVnodeQueue) { + for (; startIdx <= endIdx; ++startIdx) { + var ch = vnodes[startIdx]; + if (ch != null) { + api.insertBefore(parentElm, createElm(ch, insertedVnodeQueue), before); + } + } + } + function invokeDestroyHook(vnode) { + var i, j, data = vnode.data; + if (data !== undefined) { + if (isDef(i = data.hook) && isDef(i = i.destroy)) + i(vnode); + for (i = 0; i < cbs.destroy.length; ++i) + cbs.destroy[i](vnode); + if (vnode.children !== undefined) { + for (j = 0; j < vnode.children.length; ++j) { + i = vnode.children[j]; + if (i != null && typeof i !== "string") { + invokeDestroyHook(i); + } + } + } + } + } + function removeVnodes(parentElm, vnodes, startIdx, endIdx) { + for (; startIdx <= endIdx; ++startIdx) { + var i_1 = void 0, listeners = void 0, rm = void 0, ch = vnodes[startIdx]; + if (ch != null) { + if (isDef(ch.sel)) { + invokeDestroyHook(ch); + listeners = cbs.remove.length + 1; + rm = createRmCb(ch.elm, listeners); + for (i_1 = 0; i_1 < cbs.remove.length; ++i_1) + cbs.remove[i_1](ch, rm); + if (isDef(i_1 = ch.data) && isDef(i_1 = i_1.hook) && isDef(i_1 = i_1.remove)) { + i_1(ch, rm); + } + else { + rm(); + } + } + else { + api.removeChild(parentElm, ch.elm); + } + } + } + } + function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue) { + var oldStartIdx = 0, newStartIdx = 0; + var oldEndIdx = oldCh.length - 1; + var oldStartVnode = oldCh[0]; + var oldEndVnode = oldCh[oldEndIdx]; + var newEndIdx = newCh.length - 1; + var newStartVnode = newCh[0]; + var newEndVnode = newCh[newEndIdx]; + var oldKeyToIdx; + var idxInOld; + var elmToMove; + var before; + while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { + if (oldStartVnode == null) { + oldStartVnode = oldCh[++oldStartIdx]; // Vnode might have been moved left + } + else if (oldEndVnode == null) { + oldEndVnode = oldCh[--oldEndIdx]; + } + else if (newStartVnode == null) { + newStartVnode = newCh[++newStartIdx]; + } + else if (newEndVnode == null) { + newEndVnode = newCh[--newEndIdx]; + } + else if (sameVnode(oldStartVnode, newStartVnode)) { + patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue); + oldStartVnode = oldCh[++oldStartIdx]; + newStartVnode = newCh[++newStartIdx]; + } + else if (sameVnode(oldEndVnode, newEndVnode)) { + patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue); + oldEndVnode = oldCh[--oldEndIdx]; + newEndVnode = newCh[--newEndIdx]; + } + else if (sameVnode(oldStartVnode, newEndVnode)) { + patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue); + api.insertBefore(parentElm, oldStartVnode.elm, api.nextSibling(oldEndVnode.elm)); + oldStartVnode = oldCh[++oldStartIdx]; + newEndVnode = newCh[--newEndIdx]; + } + else if (sameVnode(oldEndVnode, newStartVnode)) { + patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue); + api.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm); + oldEndVnode = oldCh[--oldEndIdx]; + newStartVnode = newCh[++newStartIdx]; + } + else { + if (oldKeyToIdx === undefined) { + oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); + } + idxInOld = oldKeyToIdx[newStartVnode.key]; + if (isUndef(idxInOld)) { + api.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm); + newStartVnode = newCh[++newStartIdx]; + } + else { + elmToMove = oldCh[idxInOld]; + if (elmToMove.sel !== newStartVnode.sel) { + api.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm); + } + else { + patchVnode(elmToMove, newStartVnode, insertedVnodeQueue); + oldCh[idxInOld] = undefined; + api.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm); + } + newStartVnode = newCh[++newStartIdx]; + } + } + } + if (oldStartIdx <= oldEndIdx || newStartIdx <= newEndIdx) { + if (oldStartIdx > oldEndIdx) { + before = newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].elm; + addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); + } + else { + removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); + } + } + } + function patchVnode(oldVnode, vnode, insertedVnodeQueue) { + var i, hook; + if (isDef(i = vnode.data) && isDef(hook = i.hook) && isDef(i = hook.prepatch)) { + i(oldVnode, vnode); + } + var elm = vnode.elm = oldVnode.elm; + var oldCh = oldVnode.children; + var ch = vnode.children; + if (oldVnode === vnode) + return; + if (vnode.data !== undefined) { + for (i = 0; i < cbs.update.length; ++i) + cbs.update[i](oldVnode, vnode); + i = vnode.data.hook; + if (isDef(i) && isDef(i = i.update)) + i(oldVnode, vnode); + } + if (isUndef(vnode.text)) { + if (isDef(oldCh) && isDef(ch)) { + if (oldCh !== ch) + updateChildren(elm, oldCh, ch, insertedVnodeQueue); + } + else if (isDef(ch)) { + if (isDef(oldVnode.text)) + api.setTextContent(elm, ''); + addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); + } + else if (isDef(oldCh)) { + removeVnodes(elm, oldCh, 0, oldCh.length - 1); + } + else if (isDef(oldVnode.text)) { + api.setTextContent(elm, ''); + } + } + else if (oldVnode.text !== vnode.text) { + if (isDef(oldCh)) { + removeVnodes(elm, oldCh, 0, oldCh.length - 1); + } + api.setTextContent(elm, vnode.text); + } + if (isDef(hook) && isDef(i = hook.postpatch)) { + i(oldVnode, vnode); + } + } + return function patch(oldVnode, vnode) { + var i, elm, parent; + var insertedVnodeQueue = []; + for (i = 0; i < cbs.pre.length; ++i) + cbs.pre[i](); + if (!isVnode(oldVnode)) { + oldVnode = emptyNodeAt(oldVnode); + } + if (sameVnode(oldVnode, vnode)) { + patchVnode(oldVnode, vnode, insertedVnodeQueue); + } + else { + elm = oldVnode.elm; + parent = api.parentNode(elm); + createElm(vnode, insertedVnodeQueue); + if (parent !== null) { + api.insertBefore(parent, vnode.elm, api.nextSibling(elm)); + removeVnodes(parent, [oldVnode], 0, 0); + } + } + for (i = 0; i < insertedVnodeQueue.length; ++i) { + insertedVnodeQueue[i].data.hook.insert(insertedVnodeQueue[i]); + } + for (i = 0; i < cbs.post.length; ++i) + cbs.post[i](); + return vnode; + }; +} +exports.init = init; + +},{"./h":34,"./htmldomapi":35,"./is":36,"./thunk":43,"./vnode":45}],43:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var h_1 = require("./h"); +function copyToThunk(vnode, thunk) { + thunk.elm = vnode.elm; + vnode.data.fn = thunk.data.fn; + vnode.data.args = thunk.data.args; + thunk.data = vnode.data; + thunk.children = vnode.children; + thunk.text = vnode.text; + thunk.elm = vnode.elm; +} +function init(thunk) { + var cur = thunk.data; + var vnode = cur.fn.apply(undefined, cur.args); + copyToThunk(vnode, thunk); +} +function prepatch(oldVnode, thunk) { + var i, old = oldVnode.data, cur = thunk.data; + var oldArgs = old.args, args = cur.args; + if (old.fn !== cur.fn || oldArgs.length !== args.length) { + copyToThunk(cur.fn.apply(undefined, args), thunk); + return; + } + for (i = 0; i < args.length; ++i) { + if (oldArgs[i] !== args[i]) { + copyToThunk(cur.fn.apply(undefined, args), thunk); + return; + } + } + copyToThunk(oldVnode, thunk); +} +exports.thunk = function thunk(sel, key, fn, args) { + if (args === undefined) { + args = fn; + fn = key; + key = undefined; + } + return h_1.h(sel, { + key: key, + hook: { init: init, prepatch: prepatch }, + fn: fn, + args: args + }); +}; +exports.default = exports.thunk; + +},{"./h":34}],44:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var vnode_1 = require("./vnode"); +var htmldomapi_1 = require("./htmldomapi"); +function toVNode(node, domApi) { + var api = domApi !== undefined ? domApi : htmldomapi_1.default; + var text; + if (api.isElement(node)) { + var id = node.id ? '#' + node.id : ''; + var cn = node.getAttribute('class'); + var c = cn ? '.' + cn.split(' ').join('.') : ''; + var sel = api.tagName(node).toLowerCase() + id + c; + var attrs = {}; + var children = []; + var name_1; + var i = void 0, n = void 0; + var elmAttrs = node.attributes; + var elmChildren = node.childNodes; + for (i = 0, n = elmAttrs.length; i < n; i++) { + name_1 = elmAttrs[i].nodeName; + if (name_1 !== 'id' && name_1 !== 'class') { + attrs[name_1] = elmAttrs[i].nodeValue; + } + } + for (i = 0, n = elmChildren.length; i < n; i++) { + children.push(toVNode(elmChildren[i], domApi)); + } + return vnode_1.default(sel, { attrs: attrs }, children, undefined, node); + } + else if (api.isText(node)) { + text = api.getTextContent(node); + return vnode_1.default(undefined, undefined, undefined, text, node); + } + else if (api.isComment(node)) { + text = api.getTextContent(node); + return vnode_1.default('!', {}, [], text, node); + } + else { + return vnode_1.default('', {}, [], undefined, node); + } +} +exports.toVNode = toVNode; +exports.default = toVNode; + +},{"./htmldomapi":35,"./vnode":45}],45:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function vnode(sel, data, children, text, elm) { + var key = data === undefined ? undefined : data.key; + return { sel: sel, data: data, children: children, + text: text, elm: elm, key: key }; +} +exports.vnode = vnode; +exports.default = vnode; + +},{}],46:[function(require,module,exports){ +(function (global){ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _ponyfill = require('./ponyfill.js'); + +var _ponyfill2 = _interopRequireDefault(_ponyfill); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +var root; /* global window */ + + +if (typeof self !== 'undefined') { + root = self; +} else if (typeof window !== 'undefined') { + root = window; +} else if (typeof global !== 'undefined') { + root = global; +} else if (typeof module !== 'undefined') { + root = module; +} else { + root = Function('return this')(); +} + +var result = (0, _ponyfill2['default'])(root); +exports['default'] = result; +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) + +},{"./ponyfill.js":47}],47:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports['default'] = symbolObservablePonyfill; +function symbolObservablePonyfill(root) { + var result; + var _Symbol = root.Symbol; + + if (typeof _Symbol === 'function') { + if (_Symbol.observable) { + result = _Symbol.observable; + } else { + result = _Symbol('observable'); + _Symbol.observable = result; + } + } else { + result = '@@observable'; + } + + return result; +}; +},{}],48:[function(require,module,exports){ +(function (setImmediate,clearImmediate){ +var nextTick = require('process/browser.js').nextTick; +var apply = Function.prototype.apply; +var slice = Array.prototype.slice; +var immediateIds = {}; +var nextImmediateId = 0; + +// DOM APIs, for completeness + +exports.setTimeout = function() { + return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); +}; +exports.setInterval = function() { + return new Timeout(apply.call(setInterval, window, arguments), clearInterval); +}; +exports.clearTimeout = +exports.clearInterval = function(timeout) { timeout.close(); }; + +function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; +} +Timeout.prototype.unref = Timeout.prototype.ref = function() {}; +Timeout.prototype.close = function() { + this._clearFn.call(window, this._id); +}; + +// Does not start the time, just sets up the members needed. +exports.enroll = function(item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; +}; + +exports.unenroll = function(item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; +}; + +exports._unrefActive = exports.active = function(item) { + clearTimeout(item._idleTimeoutId); + + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } +}; + +// That's not how node.js implements it but the exposed api is the same. +exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) { + var id = nextImmediateId++; + var args = arguments.length < 2 ? false : slice.call(arguments, 1); + + immediateIds[id] = true; + + nextTick(function onNextTick() { + if (immediateIds[id]) { + // fn.call() is faster so we optimize for the common use-case + // @see http://jsperf.com/call-apply-segu + if (args) { + fn.apply(null, args); + } else { + fn.call(null); + } + // Prevent ids from leaking + exports.clearImmediate(id); + } + }); + + return id; +}; + +exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) { + delete immediateIds[id]; +}; +}).call(this,require("timers").setImmediate,require("timers").clearImmediate) + +},{"process/browser.js":25,"timers":48}],49:[function(require,module,exports){ +"use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("./selectorParser")); +var matches_1 = require("./matches"); +exports.createMatches = matches_1.createMatches; +var querySelector_1 = require("./querySelector"); +exports.createQuerySelector = querySelector_1.createQuerySelector; + +},{"./matches":50,"./querySelector":51,"./selectorParser":52}],50:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var selectorParser_1 = require("./selectorParser"); +function createMatches(opts) { + return function matches(selector, node) { + var _a = typeof selector === 'object' ? selector : selectorParser_1.parseSelector(selector), tag = _a.tag, id = _a.id, classList = _a.classList, attributes = _a.attributes, nextSelector = _a.nextSelector, pseudos = _a.pseudos; + if (nextSelector !== undefined) { + throw new Error('matches can only process selectors that target a single element'); + } + if (!node) { + return false; + } + if (tag && tag.toLowerCase() !== opts.tag(node).toLowerCase()) { + return false; + } + if (id && id !== opts.id(node)) { + return false; + } + var classes = opts.className(node).split(' '); + for (var i = 0; i < classList.length; i++) { + if (classes.indexOf(classList[i]) === -1) { + return false; + } + } + for (var key in attributes) { + var attr = opts.attr(node, key); + var t = attributes[key][0]; + var v = attributes[key][1]; + if (attr === undefined) { + return false; + } + if (t === 'has') { + return true; + } + if (t === 'exact' && attr !== v) { + return false; + } + else if (t !== 'exact') { + if (typeof v !== 'string') { + throw new Error('All non-string values have to be an exact match'); + } + if (t === 'startsWith' && !attr.startsWith(v)) { + return false; + } + if (t === 'endsWith' && !attr.endsWith(v)) { + return false; + } + if (t === 'contains' && attr.indexOf(v) === -1) { + return false; + } + if (t === 'whitespace' && attr.split(' ').indexOf(v) === -1) { + return false; + } + if (t === 'dash' && attr.split('-').indexOf(v) === -1) { + return false; + } + } + } + for (var i = 0; i < pseudos.length; i++) { + var _b = pseudos[i], t = _b[0], data = _b[1]; + if (t === 'contains' && data !== opts.contents(node)) { + return false; + } + if (t === 'empty' && + (opts.contents(node) || opts.children(node).length !== 0)) { + return false; + } + if (t === 'root' && opts.parent(node) !== undefined) { + return false; + } + if (t.indexOf('child') !== -1) { + if (!opts.parent(node)) { + return false; + } + var siblings = opts.children(opts.parent(node)); + if (t === 'first-child' && siblings.indexOf(node) !== 0) { + return false; + } + if (t === 'last-child' && + siblings.indexOf(node) !== siblings.length - 1) { + return false; + } + if (t === 'nth-child') { + var regex = /([\+-]?)(\d*)(n?)(\+\d+)?/; + var parseResult = regex.exec(data).slice(1); + var index = siblings.indexOf(node); + if (!parseResult[0]) { + parseResult[0] = '+'; + } + var factor = parseResult[1] + ? parseInt(parseResult[0] + parseResult[1]) + : undefined; + var add = parseInt(parseResult[3] || '0'); + if (factor && + parseResult[2] === 'n' && + index % factor !== add) { + return false; + } + else if (!factor && + parseResult[2] && + ((parseResult[0] === '+' && index - add < 0) || + (parseResult[0] === '-' && index - add >= 0))) { + return false; + } + else if (!parseResult[2] && factor && + index !== factor - 1) { + return false; + } + } + } + } + return true; + }; +} +exports.createMatches = createMatches; + +},{"./selectorParser":52}],51:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var selectorParser_1 = require("./selectorParser"); +var matches_1 = require("./matches"); +function createQuerySelector(options, matches) { + var _matches = matches || matches_1.createMatches(options); + function findSubtree(selector, depth, node) { + if (!node) { + return []; + } + var n = _matches(selector, node); + var matched = n ? (typeof n === 'object' ? [n] : [node]) : []; + if (depth === 0) { + return matched; + } + var childMatched = options + .children(node) + .filter(function (c) { return typeof c !== 'string'; }) + .map(function (c) { return findSubtree(selector, depth - 1, c); }) + .reduce(function (acc, curr) { return acc.concat(curr); }, []); + return matched.concat(childMatched); + } + function findSibling(selector, next, node) { + if (!node || options.parent(node) === undefined) { + return []; + } + var results = []; + var siblings = options.children(options.parent(node)); + for (var i = siblings.indexOf(node) + 1; i < siblings.length; i++) { + if (typeof siblings[i] === 'string') { + continue; + } + var n = _matches(selector, siblings[i]); + if (n) { + if (typeof n === 'object') { + results.push(n); + } + else { + results.push(siblings[i]); + } + } + if (next) { + break; + } + } + return results; + } + return function querySelector(selector, node) { + if (!node) { + return []; + } + var sel = typeof selector === 'object' ? selector : selectorParser_1.parseSelector(selector); + var results = [node]; + var currentSelector = sel; + var currentCombinator = 'subtree'; + var tail = undefined; + var _loop_1 = function () { + tail = currentSelector.nextSelector; + currentSelector.nextSelector = undefined; + if (currentCombinator === 'subtree' || + currentCombinator === 'child') { + var depth_1 = currentCombinator === 'subtree' ? Infinity : 1; + results = results + .map(function (n) { return findSubtree(currentSelector, depth_1, n); }) + .reduce(function (acc, curr) { return acc.concat(curr); }, []); + } + else { + var next_1 = currentCombinator === 'nextSibling'; + results = results + .map(function (n) { return findSibling(currentSelector, next_1, n); }) + .reduce(function (acc, curr) { return acc.concat(curr); }, []); + } + if (tail) { + currentSelector = tail[1]; + currentCombinator = tail[0]; + } + }; + do { + _loop_1(); + } while (tail !== undefined); + return results; + }; +} +exports.createQuerySelector = createQuerySelector; + +},{"./matches":50,"./selectorParser":52}],52:[function(require,module,exports){ +"use strict"; +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var IDENT = '[\\w-]+'; +var SPACE = '[ \t]*'; +var VALUE = "[^\\]]+"; +var CLASS = "(?:\\." + IDENT + ")"; +var ID = "(?:#" + IDENT + ")"; +var OP = "(?:=|\\$=|\\^=|\\*=|~=|\\|=)"; +var ATTR = "(?:\\[" + SPACE + IDENT + SPACE + "(?:" + OP + SPACE + VALUE + SPACE + ")?\\])"; +var SUBTREE = "(?:[ \t]+)"; +var CHILD = "(?:" + SPACE + "(>)" + SPACE + ")"; +var NEXT_SIBLING = "(?:" + SPACE + "(\\+)" + SPACE + ")"; +var SIBLING = "(?:" + SPACE + "(~)" + SPACE + ")"; +var COMBINATOR = "(?:" + SUBTREE + "|" + CHILD + "|" + NEXT_SIBLING + "|" + SIBLING + ")"; +var CONTAINS = "contains\\(\"[^\"]*\"\\)"; +var FORMULA = "(?:even|odd|\\d*(?:-?n(?:\\+\\d+)?)?)"; +var NTH_CHILD = "nth-child\\(" + FORMULA + "\\)"; +var PSEUDO = ":(?:first-child|last-child|" + NTH_CHILD + "|empty|root|" + CONTAINS + ")"; +var TAG = "(:?" + IDENT + ")?"; +var TOKENS = CLASS + "|" + ID + "|" + ATTR + "|" + PSEUDO + "|" + COMBINATOR; +var combinatorRegex = new RegExp("^" + COMBINATOR + "$"); +/** + * Parses a css selector into a normalized object. + * Expects a selector for a single element only, no `>` or the like! + */ +function parseSelector(selector) { + var sel = selector.trim(); + var tagRegex = new RegExp(TAG, 'y'); + var tag = tagRegex.exec(sel)[0]; + var regex = new RegExp(TOKENS, 'y'); + regex.lastIndex = tagRegex.lastIndex; + var matches = []; + var nextSelector = undefined; + var lastCombinator = undefined; + var index = -1; + while (regex.lastIndex < sel.length) { + var match = regex.exec(sel); + if (!match && lastCombinator === undefined) { + throw new Error('Parse error, invalid selector'); + } + else if (match && combinatorRegex.test(match[0])) { + var comb = combinatorRegex.exec(match[0])[0]; + lastCombinator = comb; + index = regex.lastIndex; + } + else { + if (lastCombinator !== undefined) { + nextSelector = [ + getCombinator(lastCombinator), + parseSelector(sel.substring(index)) + ]; + break; + } + matches.push(match[0]); + } + } + var classList = matches + .filter(function (s) { return s.startsWith('.'); }) + .map(function (s) { return s.substring(1); }); + var ids = matches.filter(function (s) { return s.startsWith('#'); }).map(function (s) { return s.substring(1); }); + if (ids.length > 1) { + throw new Error('Invalid selector, only one id is allowed'); + } + var postprocessRegex = new RegExp("(" + IDENT + ")" + SPACE + "(" + OP + ")?" + SPACE + "(" + VALUE + ")?"); + var attrs = matches + .filter(function (s) { return s.startsWith('['); }) + .map(function (s) { return postprocessRegex.exec(s).slice(1, 4); }) + .map(function (_a) { + var attr = _a[0], op = _a[1], val = _a[2]; + var _b; + return (_b = {}, + _b[attr] = [getOp(op), val ? parseAttrValue(val) : val], + _b); + }) + .reduce(function (acc, curr) { return (__assign({}, acc, curr)); }, {}); + var pseudos = matches + .filter(function (s) { return s.startsWith(':'); }) + .map(function (s) { return postProcessPseudos(s.substring(1)); }); + return { + id: ids[0] || '', + tag: tag, + classList: classList, + attributes: attrs, + nextSelector: nextSelector, + pseudos: pseudos + }; +} +exports.parseSelector = parseSelector; +function parseAttrValue(v) { + if (v.startsWith('"')) { + return v.slice(1, -1); + } + if (v === "true") { + return true; + } + if (v === "false") { + return false; + } + var f = parseFloat(v); + if (isNaN(f)) { + return v; + } + return f; +} +function postProcessPseudos(sel) { + if (sel === 'first-child' || + sel === 'last-child' || + sel === 'root' || + sel === 'empty') { + return [sel, undefined]; + } + if (sel.startsWith('contains')) { + var text = sel.slice(10, -2); + return ['contains', text]; + } + var content = sel.slice(10, -1); + if (content === 'even') { + content = '2n'; + } + if (content === 'odd') { + content = '2n+1'; + } + return ['nth-child', content]; +} +function getOp(op) { + switch (op) { + case '=': + return 'exact'; + case '^=': + return 'startsWith'; + case '$=': + return 'endsWith'; + case '*=': + return 'contains'; + case '~=': + return 'whitespace'; + case '|=': + return 'dash'; + default: + return 'has'; + } +} +function getCombinator(comb) { + switch (comb.trim()) { + case '>': + return 'child'; + case '+': + return 'nextSibling'; + case '~': + return 'sibling'; + default: + return 'subtree'; + } +} + +},{}],53:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var index_1 = require("../index"); +var ConcatProducer = /** @class */ (function () { + function ConcatProducer(streams) { + this.streams = streams; + this.type = 'concat'; + this.out = null; + this.i = 0; + } + ConcatProducer.prototype._start = function (out) { + this.out = out; + this.streams[this.i]._add(this); + }; + ConcatProducer.prototype._stop = function () { + var streams = this.streams; + if (this.i < streams.length) { + streams[this.i]._remove(this); + } + this.i = 0; + this.out = null; + }; + ConcatProducer.prototype._n = function (t) { + var u = this.out; + if (!u) + return; + u._n(t); + }; + ConcatProducer.prototype._e = function (err) { + var u = this.out; + if (!u) + return; + u._e(err); + }; + ConcatProducer.prototype._c = function () { + var u = this.out; + if (!u) + return; + var streams = this.streams; + streams[this.i]._remove(this); + if (++this.i < streams.length) { + streams[this.i]._add(this); + } + else { + u._c(); + } + }; + return ConcatProducer; +}()); +/** + * Puts one stream after the other. *concat* is a factory that takes multiple + * streams as arguments, and starts the `n+1`-th stream only when the `n`-th + * stream has completed. It concatenates those streams together. + * + * Marble diagram: + * + * ```text + * --1--2---3---4-| + * ...............--a-b-c--d-| + * concat + * --1--2---3---4---a-b-c--d-| + * ``` + * + * Example: + * + * ```js + * import concat from 'xstream/extra/concat' + * + * const streamA = xs.of('a', 'b', 'c') + * const streamB = xs.of(10, 20, 30) + * const streamC = xs.of('X', 'Y', 'Z') + * + * const outputStream = concat(streamA, streamB, streamC) + * + * outputStream.addListener({ + * next: (x) => console.log(x), + * error: (err) => console.error(err), + * complete: () => console.log('concat completed'), + * }) + * ``` + * + * @factory true + * @param {Stream} stream1 A stream to concatenate together with other streams. + * @param {Stream} stream2 A stream to concatenate together with other streams. Two + * or more streams may be given as arguments. + * @return {Stream} + */ +function concat() { + var streams = []; + for (var _i = 0; _i < arguments.length; _i++) { + streams[_i] = arguments[_i]; + } + return new index_1.Stream(new ConcatProducer(streams)); +} +exports.default = concat; + +},{"../index":55}],54:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var index_1 = require("../index"); +var NO = {}; +var SampleCombineListener = /** @class */ (function () { + function SampleCombineListener(i, p) { + this.i = i; + this.p = p; + p.ils[i] = this; + } + SampleCombineListener.prototype._n = function (t) { + var p = this.p; + if (p.out === NO) + return; + p.up(t, this.i); + }; + SampleCombineListener.prototype._e = function (err) { + this.p._e(err); + }; + SampleCombineListener.prototype._c = function () { + this.p.down(this.i, this); + }; + return SampleCombineListener; +}()); +exports.SampleCombineListener = SampleCombineListener; +var SampleCombineOperator = /** @class */ (function () { + function SampleCombineOperator(ins, streams) { + this.type = 'sampleCombine'; + this.ins = ins; + this.others = streams; + this.out = NO; + this.ils = []; + this.Nn = 0; + this.vals = []; + } + SampleCombineOperator.prototype._start = function (out) { + this.out = out; + var s = this.others; + var n = this.Nn = s.length; + var vals = this.vals = new Array(n); + for (var i = 0; i < n; i++) { + vals[i] = NO; + s[i]._add(new SampleCombineListener(i, this)); + } + this.ins._add(this); + }; + SampleCombineOperator.prototype._stop = function () { + var s = this.others; + var n = s.length; + var ils = this.ils; + this.ins._remove(this); + for (var i = 0; i < n; i++) { + s[i]._remove(ils[i]); + } + this.out = NO; + this.vals = []; + this.ils = []; + }; + SampleCombineOperator.prototype._n = function (t) { + var out = this.out; + if (out === NO) + return; + if (this.Nn > 0) + return; + out._n([t].concat(this.vals)); + }; + SampleCombineOperator.prototype._e = function (err) { + var out = this.out; + if (out === NO) + return; + out._e(err); + }; + SampleCombineOperator.prototype._c = function () { + var out = this.out; + if (out === NO) + return; + out._c(); + }; + SampleCombineOperator.prototype.up = function (t, i) { + var v = this.vals[i]; + if (this.Nn > 0 && v === NO) { + this.Nn--; + } + this.vals[i] = t; + }; + SampleCombineOperator.prototype.down = function (i, l) { + this.others[i]._remove(l); + }; + return SampleCombineOperator; +}()); +exports.SampleCombineOperator = SampleCombineOperator; +var sampleCombine; +/** + * + * Combines a source stream with multiple other streams. The result stream + * will emit the latest events from all input streams, but only when the + * source stream emits. + * + * If the source, or any input stream, throws an error, the result stream + * will propagate the error. If any input streams end, their final emitted + * value will remain in the array of any subsequent events from the result + * stream. + * + * The result stream will only complete upon completion of the source stream. + * + * Marble diagram: + * + * ```text + * --1----2-----3--------4--- (source) + * ----a-----b-----c--d------ (other) + * sampleCombine + * -------2a----3b-------4d-- + * ``` + * + * Examples: + * + * ```js + * import sampleCombine from 'xstream/extra/sampleCombine' + * import xs from 'xstream' + * + * const sampler = xs.periodic(1000).take(3) + * const other = xs.periodic(100) + * + * const stream = sampler.compose(sampleCombine(other)) + * + * stream.addListener({ + * next: i => console.log(i), + * error: err => console.error(err), + * complete: () => console.log('completed') + * }) + * ``` + * + * ```text + * > [0, 8] + * > [1, 18] + * > [2, 28] + * ``` + * + * ```js + * import sampleCombine from 'xstream/extra/sampleCombine' + * import xs from 'xstream' + * + * const sampler = xs.periodic(1000).take(3) + * const other = xs.periodic(100).take(2) + * + * const stream = sampler.compose(sampleCombine(other)) + * + * stream.addListener({ + * next: i => console.log(i), + * error: err => console.error(err), + * complete: () => console.log('completed') + * }) + * ``` + * + * ```text + * > [0, 1] + * > [1, 1] + * > [2, 1] + * ``` + * + * @param {...Stream} streams One or more streams to combine with the sampler + * stream. + * @return {Stream} + */ +sampleCombine = function sampleCombine() { + var streams = []; + for (var _i = 0; _i < arguments.length; _i++) { + streams[_i] = arguments[_i]; + } + return function sampleCombineOperator(sampler) { + return new index_1.Stream(new SampleCombineOperator(sampler, streams)); + }; +}; +exports.default = sampleCombine; + +},{"../index":55}],55:[function(require,module,exports){ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var symbol_observable_1 = require("symbol-observable"); +var NO = {}; +exports.NO = NO; +function noop() { } +function cp(a) { + var l = a.length; + var b = Array(l); + for (var i = 0; i < l; ++i) + b[i] = a[i]; + return b; +} +function and(f1, f2) { + return function andFn(t) { + return f1(t) && f2(t); + }; +} +function _try(c, t, u) { + try { + return c.f(t); + } + catch (e) { + u._e(e); + return NO; + } +} +var NO_IL = { + _n: noop, + _e: noop, + _c: noop, +}; +exports.NO_IL = NO_IL; +// mutates the input +function internalizeProducer(producer) { + producer._start = function _start(il) { + il.next = il._n; + il.error = il._e; + il.complete = il._c; + this.start(il); + }; + producer._stop = producer.stop; +} +var StreamSub = /** @class */ (function () { + function StreamSub(_stream, _listener) { + this._stream = _stream; + this._listener = _listener; + } + StreamSub.prototype.unsubscribe = function () { + this._stream._remove(this._listener); + }; + return StreamSub; +}()); +var Observer = /** @class */ (function () { + function Observer(_listener) { + this._listener = _listener; + } + Observer.prototype.next = function (value) { + this._listener._n(value); + }; + Observer.prototype.error = function (err) { + this._listener._e(err); + }; + Observer.prototype.complete = function () { + this._listener._c(); + }; + return Observer; +}()); +var FromObservable = /** @class */ (function () { + function FromObservable(observable) { + this.type = 'fromObservable'; + this.ins = observable; + this.active = false; + } + FromObservable.prototype._start = function (out) { + this.out = out; + this.active = true; + this._sub = this.ins.subscribe(new Observer(out)); + if (!this.active) + this._sub.unsubscribe(); + }; + FromObservable.prototype._stop = function () { + if (this._sub) + this._sub.unsubscribe(); + this.active = false; + }; + return FromObservable; +}()); +var Merge = /** @class */ (function () { + function Merge(insArr) { + this.type = 'merge'; + this.insArr = insArr; + this.out = NO; + this.ac = 0; + } + Merge.prototype._start = function (out) { + this.out = out; + var s = this.insArr; + var L = s.length; + this.ac = L; + for (var i = 0; i < L; i++) + s[i]._add(this); + }; + Merge.prototype._stop = function () { + var s = this.insArr; + var L = s.length; + for (var i = 0; i < L; i++) + s[i]._remove(this); + this.out = NO; + }; + Merge.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + u._n(t); + }; + Merge.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + Merge.prototype._c = function () { + if (--this.ac <= 0) { + var u = this.out; + if (u === NO) + return; + u._c(); + } + }; + return Merge; +}()); +var CombineListener = /** @class */ (function () { + function CombineListener(i, out, p) { + this.i = i; + this.out = out; + this.p = p; + p.ils.push(this); + } + CombineListener.prototype._n = function (t) { + var p = this.p, out = this.out; + if (out === NO) + return; + if (p.up(t, this.i)) { + var a = p.vals; + var l = a.length; + var b = Array(l); + for (var i = 0; i < l; ++i) + b[i] = a[i]; + out._n(b); + } + }; + CombineListener.prototype._e = function (err) { + var out = this.out; + if (out === NO) + return; + out._e(err); + }; + CombineListener.prototype._c = function () { + var p = this.p; + if (p.out === NO) + return; + if (--p.Nc === 0) + p.out._c(); + }; + return CombineListener; +}()); +var Combine = /** @class */ (function () { + function Combine(insArr) { + this.type = 'combine'; + this.insArr = insArr; + this.out = NO; + this.ils = []; + this.Nc = this.Nn = 0; + this.vals = []; + } + Combine.prototype.up = function (t, i) { + var v = this.vals[i]; + var Nn = !this.Nn ? 0 : v === NO ? --this.Nn : this.Nn; + this.vals[i] = t; + return Nn === 0; + }; + Combine.prototype._start = function (out) { + this.out = out; + var s = this.insArr; + var n = this.Nc = this.Nn = s.length; + var vals = this.vals = new Array(n); + if (n === 0) { + out._n([]); + out._c(); + } + else { + for (var i = 0; i < n; i++) { + vals[i] = NO; + s[i]._add(new CombineListener(i, out, this)); + } + } + }; + Combine.prototype._stop = function () { + var s = this.insArr; + var n = s.length; + var ils = this.ils; + for (var i = 0; i < n; i++) + s[i]._remove(ils[i]); + this.out = NO; + this.ils = []; + this.vals = []; + }; + return Combine; +}()); +var FromArray = /** @class */ (function () { + function FromArray(a) { + this.type = 'fromArray'; + this.a = a; + } + FromArray.prototype._start = function (out) { + var a = this.a; + for (var i = 0, n = a.length; i < n; i++) + out._n(a[i]); + out._c(); + }; + FromArray.prototype._stop = function () { + }; + return FromArray; +}()); +var FromPromise = /** @class */ (function () { + function FromPromise(p) { + this.type = 'fromPromise'; + this.on = false; + this.p = p; + } + FromPromise.prototype._start = function (out) { + var prod = this; + this.on = true; + this.p.then(function (v) { + if (prod.on) { + out._n(v); + out._c(); + } + }, function (e) { + out._e(e); + }).then(noop, function (err) { + setTimeout(function () { throw err; }); + }); + }; + FromPromise.prototype._stop = function () { + this.on = false; + }; + return FromPromise; +}()); +var Periodic = /** @class */ (function () { + function Periodic(period) { + this.type = 'periodic'; + this.period = period; + this.intervalID = -1; + this.i = 0; + } + Periodic.prototype._start = function (out) { + var self = this; + function intervalHandler() { out._n(self.i++); } + this.intervalID = setInterval(intervalHandler, this.period); + }; + Periodic.prototype._stop = function () { + if (this.intervalID !== -1) + clearInterval(this.intervalID); + this.intervalID = -1; + this.i = 0; + }; + return Periodic; +}()); +var Debug = /** @class */ (function () { + function Debug(ins, arg) { + this.type = 'debug'; + this.ins = ins; + this.out = NO; + this.s = noop; + this.l = ''; + if (typeof arg === 'string') + this.l = arg; + else if (typeof arg === 'function') + this.s = arg; + } + Debug.prototype._start = function (out) { + this.out = out; + this.ins._add(this); + }; + Debug.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + }; + Debug.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + var s = this.s, l = this.l; + if (s !== noop) { + try { + s(t); + } + catch (e) { + u._e(e); + } + } + else if (l) + console.log(l + ':', t); + else + console.log(t); + u._n(t); + }; + Debug.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + Debug.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + return Debug; +}()); +var Drop = /** @class */ (function () { + function Drop(max, ins) { + this.type = 'drop'; + this.ins = ins; + this.out = NO; + this.max = max; + this.dropped = 0; + } + Drop.prototype._start = function (out) { + this.out = out; + this.dropped = 0; + this.ins._add(this); + }; + Drop.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + }; + Drop.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + if (this.dropped++ >= this.max) + u._n(t); + }; + Drop.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + Drop.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + return Drop; +}()); +var EndWhenListener = /** @class */ (function () { + function EndWhenListener(out, op) { + this.out = out; + this.op = op; + } + EndWhenListener.prototype._n = function () { + this.op.end(); + }; + EndWhenListener.prototype._e = function (err) { + this.out._e(err); + }; + EndWhenListener.prototype._c = function () { + this.op.end(); + }; + return EndWhenListener; +}()); +var EndWhen = /** @class */ (function () { + function EndWhen(o, ins) { + this.type = 'endWhen'; + this.ins = ins; + this.out = NO; + this.o = o; + this.oil = NO_IL; + } + EndWhen.prototype._start = function (out) { + this.out = out; + this.o._add(this.oil = new EndWhenListener(out, this)); + this.ins._add(this); + }; + EndWhen.prototype._stop = function () { + this.ins._remove(this); + this.o._remove(this.oil); + this.out = NO; + this.oil = NO_IL; + }; + EndWhen.prototype.end = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + EndWhen.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + u._n(t); + }; + EndWhen.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + EndWhen.prototype._c = function () { + this.end(); + }; + return EndWhen; +}()); +var Filter = /** @class */ (function () { + function Filter(passes, ins) { + this.type = 'filter'; + this.ins = ins; + this.out = NO; + this.f = passes; + } + Filter.prototype._start = function (out) { + this.out = out; + this.ins._add(this); + }; + Filter.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + }; + Filter.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + var r = _try(this, t, u); + if (r === NO || !r) + return; + u._n(t); + }; + Filter.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + Filter.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + return Filter; +}()); +var FlattenListener = /** @class */ (function () { + function FlattenListener(out, op) { + this.out = out; + this.op = op; + } + FlattenListener.prototype._n = function (t) { + this.out._n(t); + }; + FlattenListener.prototype._e = function (err) { + this.out._e(err); + }; + FlattenListener.prototype._c = function () { + this.op.inner = NO; + this.op.less(); + }; + return FlattenListener; +}()); +var Flatten = /** @class */ (function () { + function Flatten(ins) { + this.type = 'flatten'; + this.ins = ins; + this.out = NO; + this.open = true; + this.inner = NO; + this.il = NO_IL; + } + Flatten.prototype._start = function (out) { + this.out = out; + this.open = true; + this.inner = NO; + this.il = NO_IL; + this.ins._add(this); + }; + Flatten.prototype._stop = function () { + this.ins._remove(this); + if (this.inner !== NO) + this.inner._remove(this.il); + this.out = NO; + this.open = true; + this.inner = NO; + this.il = NO_IL; + }; + Flatten.prototype.less = function () { + var u = this.out; + if (u === NO) + return; + if (!this.open && this.inner === NO) + u._c(); + }; + Flatten.prototype._n = function (s) { + var u = this.out; + if (u === NO) + return; + var _a = this, inner = _a.inner, il = _a.il; + if (inner !== NO && il !== NO_IL) + inner._remove(il); + (this.inner = s)._add(this.il = new FlattenListener(u, this)); + }; + Flatten.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + Flatten.prototype._c = function () { + this.open = false; + this.less(); + }; + return Flatten; +}()); +var Fold = /** @class */ (function () { + function Fold(f, seed, ins) { + var _this = this; + this.type = 'fold'; + this.ins = ins; + this.out = NO; + this.f = function (t) { return f(_this.acc, t); }; + this.acc = this.seed = seed; + } + Fold.prototype._start = function (out) { + this.out = out; + this.acc = this.seed; + out._n(this.acc); + this.ins._add(this); + }; + Fold.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + this.acc = this.seed; + }; + Fold.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + var r = _try(this, t, u); + if (r === NO) + return; + u._n(this.acc = r); + }; + Fold.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + Fold.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + return Fold; +}()); +var Last = /** @class */ (function () { + function Last(ins) { + this.type = 'last'; + this.ins = ins; + this.out = NO; + this.has = false; + this.val = NO; + } + Last.prototype._start = function (out) { + this.out = out; + this.has = false; + this.ins._add(this); + }; + Last.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + this.val = NO; + }; + Last.prototype._n = function (t) { + this.has = true; + this.val = t; + }; + Last.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + Last.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + if (this.has) { + u._n(this.val); + u._c(); + } + else + u._e(new Error('last() failed because input stream completed')); + }; + return Last; +}()); +var MapOp = /** @class */ (function () { + function MapOp(project, ins) { + this.type = 'map'; + this.ins = ins; + this.out = NO; + this.f = project; + } + MapOp.prototype._start = function (out) { + this.out = out; + this.ins._add(this); + }; + MapOp.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + }; + MapOp.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + var r = _try(this, t, u); + if (r === NO) + return; + u._n(r); + }; + MapOp.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + MapOp.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + return MapOp; +}()); +var Remember = /** @class */ (function () { + function Remember(ins) { + this.type = 'remember'; + this.ins = ins; + this.out = NO; + } + Remember.prototype._start = function (out) { + this.out = out; + this.ins._add(out); + }; + Remember.prototype._stop = function () { + this.ins._remove(this.out); + this.out = NO; + }; + return Remember; +}()); +var ReplaceError = /** @class */ (function () { + function ReplaceError(replacer, ins) { + this.type = 'replaceError'; + this.ins = ins; + this.out = NO; + this.f = replacer; + } + ReplaceError.prototype._start = function (out) { + this.out = out; + this.ins._add(this); + }; + ReplaceError.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + }; + ReplaceError.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + u._n(t); + }; + ReplaceError.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + try { + this.ins._remove(this); + (this.ins = this.f(err))._add(this); + } + catch (e) { + u._e(e); + } + }; + ReplaceError.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + return ReplaceError; +}()); +var StartWith = /** @class */ (function () { + function StartWith(ins, val) { + this.type = 'startWith'; + this.ins = ins; + this.out = NO; + this.val = val; + } + StartWith.prototype._start = function (out) { + this.out = out; + this.out._n(this.val); + this.ins._add(out); + }; + StartWith.prototype._stop = function () { + this.ins._remove(this.out); + this.out = NO; + }; + return StartWith; +}()); +var Take = /** @class */ (function () { + function Take(max, ins) { + this.type = 'take'; + this.ins = ins; + this.out = NO; + this.max = max; + this.taken = 0; + } + Take.prototype._start = function (out) { + this.out = out; + this.taken = 0; + if (this.max <= 0) + out._c(); + else + this.ins._add(this); + }; + Take.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + }; + Take.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + var m = ++this.taken; + if (m < this.max) + u._n(t); + else if (m === this.max) { + u._n(t); + u._c(); + } + }; + Take.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + Take.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + return Take; +}()); +var Stream = /** @class */ (function () { + function Stream(producer) { + this._prod = producer || NO; + this._ils = []; + this._stopID = NO; + this._dl = NO; + this._d = false; + this._target = NO; + this._err = NO; + } + Stream.prototype._n = function (t) { + var a = this._ils; + var L = a.length; + if (this._d) + this._dl._n(t); + if (L == 1) + a[0]._n(t); + else if (L == 0) + return; + else { + var b = cp(a); + for (var i = 0; i < L; i++) + b[i]._n(t); + } + }; + Stream.prototype._e = function (err) { + if (this._err !== NO) + return; + this._err = err; + var a = this._ils; + var L = a.length; + this._x(); + if (this._d) + this._dl._e(err); + if (L == 1) + a[0]._e(err); + else if (L == 0) + return; + else { + var b = cp(a); + for (var i = 0; i < L; i++) + b[i]._e(err); + } + if (!this._d && L == 0) + throw this._err; + }; + Stream.prototype._c = function () { + var a = this._ils; + var L = a.length; + this._x(); + if (this._d) + this._dl._c(); + if (L == 1) + a[0]._c(); + else if (L == 0) + return; + else { + var b = cp(a); + for (var i = 0; i < L; i++) + b[i]._c(); + } + }; + Stream.prototype._x = function () { + if (this._ils.length === 0) + return; + if (this._prod !== NO) + this._prod._stop(); + this._err = NO; + this._ils = []; + }; + Stream.prototype._stopNow = function () { + // WARNING: code that calls this method should + // first check if this._prod is valid (not `NO`) + this._prod._stop(); + this._err = NO; + this._stopID = NO; + }; + Stream.prototype._add = function (il) { + var ta = this._target; + if (ta !== NO) + return ta._add(il); + var a = this._ils; + a.push(il); + if (a.length > 1) + return; + if (this._stopID !== NO) { + clearTimeout(this._stopID); + this._stopID = NO; + } + else { + var p = this._prod; + if (p !== NO) + p._start(this); + } + }; + Stream.prototype._remove = function (il) { + var _this = this; + var ta = this._target; + if (ta !== NO) + return ta._remove(il); + var a = this._ils; + var i = a.indexOf(il); + if (i > -1) { + a.splice(i, 1); + if (this._prod !== NO && a.length <= 0) { + this._err = NO; + this._stopID = setTimeout(function () { return _this._stopNow(); }); + } + else if (a.length === 1) { + this._pruneCycles(); + } + } + }; + // If all paths stemming from `this` stream eventually end at `this` + // stream, then we remove the single listener of `this` stream, to + // force it to end its execution and dispose resources. This method + // assumes as a precondition that this._ils has just one listener. + Stream.prototype._pruneCycles = function () { + if (this._hasNoSinks(this, [])) + this._remove(this._ils[0]); + }; + // Checks whether *there is no* path starting from `x` that leads to an end + // listener (sink) in the stream graph, following edges A->B where B is a + // listener of A. This means these paths constitute a cycle somehow. Is given + // a trace of all visited nodes so far. + Stream.prototype._hasNoSinks = function (x, trace) { + if (trace.indexOf(x) !== -1) + return true; + else if (x.out === this) + return true; + else if (x.out && x.out !== NO) + return this._hasNoSinks(x.out, trace.concat(x)); + else if (x._ils) { + for (var i = 0, N = x._ils.length; i < N; i++) + if (!this._hasNoSinks(x._ils[i], trace.concat(x))) + return false; + return true; + } + else + return false; + }; + Stream.prototype.ctor = function () { + return this instanceof MemoryStream ? MemoryStream : Stream; + }; + /** + * Adds a Listener to the Stream. + * + * @param {Listener} listener + */ + Stream.prototype.addListener = function (listener) { + listener._n = listener.next || noop; + listener._e = listener.error || noop; + listener._c = listener.complete || noop; + this._add(listener); + }; + /** + * Removes a Listener from the Stream, assuming the Listener was added to it. + * + * @param {Listener} listener + */ + Stream.prototype.removeListener = function (listener) { + this._remove(listener); + }; + /** + * Adds a Listener to the Stream returning a Subscription to remove that + * listener. + * + * @param {Listener} listener + * @returns {Subscription} + */ + Stream.prototype.subscribe = function (listener) { + this.addListener(listener); + return new StreamSub(this, listener); + }; + /** + * Add interop between most.js and RxJS 5 + * + * @returns {Stream} + */ + Stream.prototype[symbol_observable_1.default] = function () { + return this; + }; + /** + * Creates a new Stream given a Producer. + * + * @factory true + * @param {Producer} producer An optional Producer that dictates how to + * start, generate events, and stop the Stream. + * @return {Stream} + */ + Stream.create = function (producer) { + if (producer) { + if (typeof producer.start !== 'function' + || typeof producer.stop !== 'function') + throw new Error('producer requires both start and stop functions'); + internalizeProducer(producer); // mutates the input + } + return new Stream(producer); + }; + /** + * Creates a new MemoryStream given a Producer. + * + * @factory true + * @param {Producer} producer An optional Producer that dictates how to + * start, generate events, and stop the Stream. + * @return {MemoryStream} + */ + Stream.createWithMemory = function (producer) { + if (producer) + internalizeProducer(producer); // mutates the input + return new MemoryStream(producer); + }; + /** + * Creates a Stream that does nothing when started. It never emits any event. + * + * Marble diagram: + * + * ```text + * never + * ----------------------- + * ``` + * + * @factory true + * @return {Stream} + */ + Stream.never = function () { + return new Stream({ _start: noop, _stop: noop }); + }; + /** + * Creates a Stream that immediately emits the "complete" notification when + * started, and that's it. + * + * Marble diagram: + * + * ```text + * empty + * -| + * ``` + * + * @factory true + * @return {Stream} + */ + Stream.empty = function () { + return new Stream({ + _start: function (il) { il._c(); }, + _stop: noop, + }); + }; + /** + * Creates a Stream that immediately emits an "error" notification with the + * value you passed as the `error` argument when the stream starts, and that's + * it. + * + * Marble diagram: + * + * ```text + * throw(X) + * -X + * ``` + * + * @factory true + * @param error The error event to emit on the created stream. + * @return {Stream} + */ + Stream.throw = function (error) { + return new Stream({ + _start: function (il) { il._e(error); }, + _stop: noop, + }); + }; + /** + * Creates a stream from an Array, Promise, or an Observable. + * + * @factory true + * @param {Array|PromiseLike|Observable} input The input to make a stream from. + * @return {Stream} + */ + Stream.from = function (input) { + if (typeof input[symbol_observable_1.default] === 'function') + return Stream.fromObservable(input); + else if (typeof input.then === 'function') + return Stream.fromPromise(input); + else if (Array.isArray(input)) + return Stream.fromArray(input); + throw new TypeError("Type of input to from() must be an Array, Promise, or Observable"); + }; + /** + * Creates a Stream that immediately emits the arguments that you give to + * *of*, then completes. + * + * Marble diagram: + * + * ```text + * of(1,2,3) + * 123| + * ``` + * + * @factory true + * @param a The first value you want to emit as an event on the stream. + * @param b The second value you want to emit as an event on the stream. One + * or more of these values may be given as arguments. + * @return {Stream} + */ + Stream.of = function () { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + return Stream.fromArray(items); + }; + /** + * Converts an array to a stream. The returned stream will emit synchronously + * all the items in the array, and then complete. + * + * Marble diagram: + * + * ```text + * fromArray([1,2,3]) + * 123| + * ``` + * + * @factory true + * @param {Array} array The array to be converted as a stream. + * @return {Stream} + */ + Stream.fromArray = function (array) { + return new Stream(new FromArray(array)); + }; + /** + * Converts a promise to a stream. The returned stream will emit the resolved + * value of the promise, and then complete. However, if the promise is + * rejected, the stream will emit the corresponding error. + * + * Marble diagram: + * + * ```text + * fromPromise( ----42 ) + * -----------------42| + * ``` + * + * @factory true + * @param {PromiseLike} promise The promise to be converted as a stream. + * @return {Stream} + */ + Stream.fromPromise = function (promise) { + return new Stream(new FromPromise(promise)); + }; + /** + * Converts an Observable into a Stream. + * + * @factory true + * @param {any} observable The observable to be converted as a stream. + * @return {Stream} + */ + Stream.fromObservable = function (obs) { + if (obs.endWhen) + return obs; + var o = typeof obs[symbol_observable_1.default] === 'function' ? obs[symbol_observable_1.default]() : obs; + return new Stream(new FromObservable(o)); + }; + /** + * Creates a stream that periodically emits incremental numbers, every + * `period` milliseconds. + * + * Marble diagram: + * + * ```text + * periodic(1000) + * ---0---1---2---3---4---... + * ``` + * + * @factory true + * @param {number} period The interval in milliseconds to use as a rate of + * emission. + * @return {Stream} + */ + Stream.periodic = function (period) { + return new Stream(new Periodic(period)); + }; + Stream.prototype._map = function (project) { + return new (this.ctor())(new MapOp(project, this)); + }; + /** + * Transforms each event from the input Stream through a `project` function, + * to get a Stream that emits those transformed events. + * + * Marble diagram: + * + * ```text + * --1---3--5-----7------ + * map(i => i * 10) + * --10--30-50----70----- + * ``` + * + * @param {Function} project A function of type `(t: T) => U` that takes event + * `t` of type `T` from the input Stream and produces an event of type `U`, to + * be emitted on the output Stream. + * @return {Stream} + */ + Stream.prototype.map = function (project) { + return this._map(project); + }; + /** + * It's like `map`, but transforms each input event to always the same + * constant value on the output Stream. + * + * Marble diagram: + * + * ```text + * --1---3--5-----7----- + * mapTo(10) + * --10--10-10----10---- + * ``` + * + * @param projectedValue A value to emit on the output Stream whenever the + * input Stream emits any value. + * @return {Stream} + */ + Stream.prototype.mapTo = function (projectedValue) { + var s = this.map(function () { return projectedValue; }); + var op = s._prod; + op.type = 'mapTo'; + return s; + }; + /** + * Only allows events that pass the test given by the `passes` argument. + * + * Each event from the input stream is given to the `passes` function. If the + * function returns `true`, the event is forwarded to the output stream, + * otherwise it is ignored and not forwarded. + * + * Marble diagram: + * + * ```text + * --1---2--3-----4-----5---6--7-8-- + * filter(i => i % 2 === 0) + * ------2--------4---------6----8-- + * ``` + * + * @param {Function} passes A function of type `(t: T) => boolean` that takes + * an event from the input stream and checks if it passes, by returning a + * boolean. + * @return {Stream} + */ + Stream.prototype.filter = function (passes) { + var p = this._prod; + if (p instanceof Filter) + return new Stream(new Filter(and(p.f, passes), p.ins)); + return new Stream(new Filter(passes, this)); + }; + /** + * Lets the first `amount` many events from the input stream pass to the + * output stream, then makes the output stream complete. + * + * Marble diagram: + * + * ```text + * --a---b--c----d---e-- + * take(3) + * --a---b--c| + * ``` + * + * @param {number} amount How many events to allow from the input stream + * before completing the output stream. + * @return {Stream} + */ + Stream.prototype.take = function (amount) { + return new (this.ctor())(new Take(amount, this)); + }; + /** + * Ignores the first `amount` many events from the input stream, and then + * after that starts forwarding events from the input stream to the output + * stream. + * + * Marble diagram: + * + * ```text + * --a---b--c----d---e-- + * drop(3) + * --------------d---e-- + * ``` + * + * @param {number} amount How many events to ignore from the input stream + * before forwarding all events from the input stream to the output stream. + * @return {Stream} + */ + Stream.prototype.drop = function (amount) { + return new Stream(new Drop(amount, this)); + }; + /** + * When the input stream completes, the output stream will emit the last event + * emitted by the input stream, and then will also complete. + * + * Marble diagram: + * + * ```text + * --a---b--c--d----| + * last() + * -----------------d| + * ``` + * + * @return {Stream} + */ + Stream.prototype.last = function () { + return new Stream(new Last(this)); + }; + /** + * Prepends the given `initial` value to the sequence of events emitted by the + * input stream. The returned stream is a MemoryStream, which means it is + * already `remember()`'d. + * + * Marble diagram: + * + * ```text + * ---1---2-----3--- + * startWith(0) + * 0--1---2-----3--- + * ``` + * + * @param initial The value or event to prepend. + * @return {MemoryStream} + */ + Stream.prototype.startWith = function (initial) { + return new MemoryStream(new StartWith(this, initial)); + }; + /** + * Uses another stream to determine when to complete the current stream. + * + * When the given `other` stream emits an event or completes, the output + * stream will complete. Before that happens, the output stream will behaves + * like the input stream. + * + * Marble diagram: + * + * ```text + * ---1---2-----3--4----5----6--- + * endWhen( --------a--b--| ) + * ---1---2-----3--4--| + * ``` + * + * @param other Some other stream that is used to know when should the output + * stream of this operator complete. + * @return {Stream} + */ + Stream.prototype.endWhen = function (other) { + return new (this.ctor())(new EndWhen(other, this)); + }; + /** + * "Folds" the stream onto itself. + * + * Combines events from the past throughout + * the entire execution of the input stream, allowing you to accumulate them + * together. It's essentially like `Array.prototype.reduce`. The returned + * stream is a MemoryStream, which means it is already `remember()`'d. + * + * The output stream starts by emitting the `seed` which you give as argument. + * Then, when an event happens on the input stream, it is combined with that + * seed value through the `accumulate` function, and the output value is + * emitted on the output stream. `fold` remembers that output value as `acc` + * ("accumulator"), and then when a new input event `t` happens, `acc` will be + * combined with that to produce the new `acc` and so forth. + * + * Marble diagram: + * + * ```text + * ------1-----1--2----1----1------ + * fold((acc, x) => acc + x, 3) + * 3-----4-----5--7----8----9------ + * ``` + * + * @param {Function} accumulate A function of type `(acc: R, t: T) => R` that + * takes the previous accumulated value `acc` and the incoming event from the + * input stream and produces the new accumulated value. + * @param seed The initial accumulated value, of type `R`. + * @return {MemoryStream} + */ + Stream.prototype.fold = function (accumulate, seed) { + return new MemoryStream(new Fold(accumulate, seed, this)); + }; + /** + * Replaces an error with another stream. + * + * When (and if) an error happens on the input stream, instead of forwarding + * that error to the output stream, *replaceError* will call the `replace` + * function which returns the stream that the output stream will replicate. + * And, in case that new stream also emits an error, `replace` will be called + * again to get another stream to start replicating. + * + * Marble diagram: + * + * ```text + * --1---2-----3--4-----X + * replaceError( () => --10--| ) + * --1---2-----3--4--------10--| + * ``` + * + * @param {Function} replace A function of type `(err) => Stream` that takes + * the error that occurred on the input stream or on the previous replacement + * stream and returns a new stream. The output stream will behave like the + * stream that this function returns. + * @return {Stream} + */ + Stream.prototype.replaceError = function (replace) { + return new (this.ctor())(new ReplaceError(replace, this)); + }; + /** + * Flattens a "stream of streams", handling only one nested stream at a time + * (no concurrency). + * + * If the input stream is a stream that emits streams, then this operator will + * return an output stream which is a flat stream: emits regular events. The + * flattening happens without concurrency. It works like this: when the input + * stream emits a nested stream, *flatten* will start imitating that nested + * one. However, as soon as the next nested stream is emitted on the input + * stream, *flatten* will forget the previous nested one it was imitating, and + * will start imitating the new nested one. + * + * Marble diagram: + * + * ```text + * --+--------+--------------- + * \ \ + * \ ----1----2---3-- + * --a--b----c----d-------- + * flatten + * -----a--b------1----2---3-- + * ``` + * + * @return {Stream} + */ + Stream.prototype.flatten = function () { + return new Stream(new Flatten(this)); + }; + /** + * Passes the input stream to a custom operator, to produce an output stream. + * + * *compose* is a handy way of using an existing function in a chained style. + * Instead of writing `outStream = f(inStream)` you can write + * `outStream = inStream.compose(f)`. + * + * @param {function} operator A function that takes a stream as input and + * returns a stream as well. + * @return {Stream} + */ + Stream.prototype.compose = function (operator) { + return operator(this); + }; + /** + * Returns an output stream that behaves like the input stream, but also + * remembers the most recent event that happens on the input stream, so that a + * newly added listener will immediately receive that memorised event. + * + * @return {MemoryStream} + */ + Stream.prototype.remember = function () { + return new MemoryStream(new Remember(this)); + }; + /** + * Returns an output stream that identically behaves like the input stream, + * but also runs a `spy` function for each event, to help you debug your app. + * + * *debug* takes a `spy` function as argument, and runs that for each event + * happening on the input stream. If you don't provide the `spy` argument, + * then *debug* will just `console.log` each event. This helps you to + * understand the flow of events through some operator chain. + * + * Please note that if the output stream has no listeners, then it will not + * start, which means `spy` will never run because no actual event happens in + * that case. + * + * Marble diagram: + * + * ```text + * --1----2-----3-----4-- + * debug + * --1----2-----3-----4-- + * ``` + * + * @param {function} labelOrSpy A string to use as the label when printing + * debug information on the console, or a 'spy' function that takes an event + * as argument, and does not need to return anything. + * @return {Stream} + */ + Stream.prototype.debug = function (labelOrSpy) { + return new (this.ctor())(new Debug(this, labelOrSpy)); + }; + /** + * *imitate* changes this current Stream to emit the same events that the + * `other` given Stream does. This method returns nothing. + * + * This method exists to allow one thing: **circular dependency of streams**. + * For instance, let's imagine that for some reason you need to create a + * circular dependency where stream `first$` depends on stream `second$` + * which in turn depends on `first$`: + * + * + * ```js + * import delay from 'xstream/extra/delay' + * + * var first$ = second$.map(x => x * 10).take(3); + * var second$ = first$.map(x => x + 1).startWith(1).compose(delay(100)); + * ``` + * + * However, that is invalid JavaScript, because `second$` is undefined + * on the first line. This is how *imitate* can help solve it: + * + * ```js + * import delay from 'xstream/extra/delay' + * + * var secondProxy$ = xs.create(); + * var first$ = secondProxy$.map(x => x * 10).take(3); + * var second$ = first$.map(x => x + 1).startWith(1).compose(delay(100)); + * secondProxy$.imitate(second$); + * ``` + * + * We create `secondProxy$` before the others, so it can be used in the + * declaration of `first$`. Then, after both `first$` and `second$` are + * defined, we hook `secondProxy$` with `second$` with `imitate()` to tell + * that they are "the same". `imitate` will not trigger the start of any + * stream, it just binds `secondProxy$` and `second$` together. + * + * The following is an example where `imitate()` is important in Cycle.js + * applications. A parent component contains some child components. A child + * has an action stream which is given to the parent to define its state: + * + * + * ```js + * const childActionProxy$ = xs.create(); + * const parent = Parent({...sources, childAction$: childActionProxy$}); + * const childAction$ = parent.state$.map(s => s.child.action$).flatten(); + * childActionProxy$.imitate(childAction$); + * ``` + * + * Note, though, that **`imitate()` does not support MemoryStreams**. If we + * would attempt to imitate a MemoryStream in a circular dependency, we would + * either get a race condition (where the symptom would be "nothing happens") + * or an infinite cyclic emission of values. It's useful to think about + * MemoryStreams as cells in a spreadsheet. It doesn't make any sense to + * define a spreadsheet cell `A1` with a formula that depends on `B1` and + * cell `B1` defined with a formula that depends on `A1`. + * + * If you find yourself wanting to use `imitate()` with a + * MemoryStream, you should rework your code around `imitate()` to use a + * Stream instead. Look for the stream in the circular dependency that + * represents an event stream, and that would be a candidate for creating a + * proxy Stream which then imitates the target Stream. + * + * @param {Stream} target The other stream to imitate on the current one. Must + * not be a MemoryStream. + */ + Stream.prototype.imitate = function (target) { + if (target instanceof MemoryStream) + throw new Error('A MemoryStream was given to imitate(), but it only ' + + 'supports a Stream. Read more about this restriction here: ' + + 'https://github.com/staltz/xstream#faq'); + this._target = target; + for (var ils = this._ils, N = ils.length, i = 0; i < N; i++) + target._add(ils[i]); + this._ils = []; + }; + /** + * Forces the Stream to emit the given value to its listeners. + * + * As the name indicates, if you use this, you are most likely doing something + * The Wrong Way. Please try to understand the reactive way before using this + * method. Use it only when you know what you are doing. + * + * @param value The "next" value you want to broadcast to all listeners of + * this Stream. + */ + Stream.prototype.shamefullySendNext = function (value) { + this._n(value); + }; + /** + * Forces the Stream to emit the given error to its listeners. + * + * As the name indicates, if you use this, you are most likely doing something + * The Wrong Way. Please try to understand the reactive way before using this + * method. Use it only when you know what you are doing. + * + * @param {any} error The error you want to broadcast to all the listeners of + * this Stream. + */ + Stream.prototype.shamefullySendError = function (error) { + this._e(error); + }; + /** + * Forces the Stream to emit the "completed" event to its listeners. + * + * As the name indicates, if you use this, you are most likely doing something + * The Wrong Way. Please try to understand the reactive way before using this + * method. Use it only when you know what you are doing. + */ + Stream.prototype.shamefullySendComplete = function () { + this._c(); + }; + /** + * Adds a "debug" listener to the stream. There can only be one debug + * listener, that's why this is 'setDebugListener'. To remove the debug + * listener, just call setDebugListener(null). + * + * A debug listener is like any other listener. The only difference is that a + * debug listener is "stealthy": its presence/absence does not trigger the + * start/stop of the stream (or the producer inside the stream). This is + * useful so you can inspect what is going on without changing the behavior + * of the program. If you have an idle stream and you add a normal listener to + * it, the stream will start executing. But if you set a debug listener on an + * idle stream, it won't start executing (not until the first normal listener + * is added). + * + * As the name indicates, we don't recommend using this method to build app + * logic. In fact, in most cases the debug operator works just fine. Only use + * this one if you know what you're doing. + * + * @param {Listener} listener + */ + Stream.prototype.setDebugListener = function (listener) { + if (!listener) { + this._d = false; + this._dl = NO; + } + else { + this._d = true; + listener._n = listener.next || noop; + listener._e = listener.error || noop; + listener._c = listener.complete || noop; + this._dl = listener; + } + }; + /** + * Blends multiple streams together, emitting events from all of them + * concurrently. + * + * *merge* takes multiple streams as arguments, and creates a stream that + * behaves like each of the argument streams, in parallel. + * + * Marble diagram: + * + * ```text + * --1----2-----3--------4--- + * ----a-----b----c---d------ + * merge + * --1-a--2--b--3-c---d--4--- + * ``` + * + * @factory true + * @param {Stream} stream1 A stream to merge together with other streams. + * @param {Stream} stream2 A stream to merge together with other streams. Two + * or more streams may be given as arguments. + * @return {Stream} + */ + Stream.merge = function merge() { + var streams = []; + for (var _i = 0; _i < arguments.length; _i++) { + streams[_i] = arguments[_i]; + } + return new Stream(new Merge(streams)); + }; + /** + * Combines multiple input streams together to return a stream whose events + * are arrays that collect the latest events from each input stream. + * + * *combine* internally remembers the most recent event from each of the input + * streams. When any of the input streams emits an event, that event together + * with all the other saved events are combined into an array. That array will + * be emitted on the output stream. It's essentially a way of joining together + * the events from multiple streams. + * + * Marble diagram: + * + * ```text + * --1----2-----3--------4--- + * ----a-----b-----c--d------ + * combine + * ----1a-2a-2b-3b-3c-3d-4d-- + * ``` + * + * @factory true + * @param {Stream} stream1 A stream to combine together with other streams. + * @param {Stream} stream2 A stream to combine together with other streams. + * Multiple streams, not just two, may be given as arguments. + * @return {Stream} + */ + Stream.combine = function combine() { + var streams = []; + for (var _i = 0; _i < arguments.length; _i++) { + streams[_i] = arguments[_i]; + } + return new Stream(new Combine(streams)); + }; + return Stream; +}()); +exports.Stream = Stream; +var MemoryStream = /** @class */ (function (_super) { + __extends(MemoryStream, _super); + function MemoryStream(producer) { + var _this = _super.call(this, producer) || this; + _this._has = false; + return _this; + } + MemoryStream.prototype._n = function (x) { + this._v = x; + this._has = true; + _super.prototype._n.call(this, x); + }; + MemoryStream.prototype._add = function (il) { + var ta = this._target; + if (ta !== NO) + return ta._add(il); + var a = this._ils; + a.push(il); + if (a.length > 1) { + if (this._has) + il._n(this._v); + return; + } + if (this._stopID !== NO) { + if (this._has) + il._n(this._v); + clearTimeout(this._stopID); + this._stopID = NO; + } + else if (this._has) + il._n(this._v); + else { + var p = this._prod; + if (p !== NO) + p._start(this); + } + }; + MemoryStream.prototype._stopNow = function () { + this._has = false; + _super.prototype._stopNow.call(this); + }; + MemoryStream.prototype._x = function () { + this._has = false; + _super.prototype._x.call(this); + }; + MemoryStream.prototype.map = function (project) { + return this._map(project); + }; + MemoryStream.prototype.mapTo = function (projectedValue) { + return _super.prototype.mapTo.call(this, projectedValue); + }; + MemoryStream.prototype.take = function (amount) { + return _super.prototype.take.call(this, amount); + }; + MemoryStream.prototype.endWhen = function (other) { + return _super.prototype.endWhen.call(this, other); + }; + MemoryStream.prototype.replaceError = function (replace) { + return _super.prototype.replaceError.call(this, replace); + }; + MemoryStream.prototype.remember = function () { + return this; + }; + MemoryStream.prototype.debug = function (labelOrSpy) { + return _super.prototype.debug.call(this, labelOrSpy); + }; + return MemoryStream; +}(Stream)); +exports.MemoryStream = MemoryStream; +var xs = Stream; +exports.default = xs; + +},{"symbol-observable":46}],56:[function(require,module,exports){ +'use strict'; + +var _run = require('@cycle/run'); + +var _dom = require('@cycle/dom'); + +function main(sources) { + var vdom$ = sources.DOM.select('.myinput').events('input').map(function (ev) { + return ev.target.value; + }).startWith('').map(function (name) { + return (0, _dom.div)([(0, _dom.label)('Name:'), (0, _dom.input)('.myinput', { attrs: { type: 'text' } }), (0, _dom.hr)(), (0, _dom.h1)('Hello ' + name)]); + }); + return { + DOM: vdom$ + }; +} + +(0, _run.run)(main, { + DOM: (0, _dom.makeDOMDriver)('#app') +}); + +},{"@cycle/dom":14,"@cycle/run":23}]},{},[56]) +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJub2RlX21vZHVsZXMvQGN5Y2xlL2RvbS9saWIvY2pzL0JvZHlET01Tb3VyY2UuanMiLCJub2RlX21vZHVsZXMvQGN5Y2xlL2RvbS9saWIvY2pzL0RvY3VtZW50RE9NU291cmNlLmpzIiwibm9kZV9tb2R1bGVzL0BjeWNsZS9kb20vbGliL2Nqcy9FbGVtZW50RmluZGVyLmpzIiwibm9kZV9tb2R1bGVzL0BjeWNsZS9kb20vbGliL2Nqcy9FdmVudERlbGVnYXRvci5qcyIsIm5vZGVfbW9kdWxlcy9AY3ljbGUvZG9tL2xpYi9janMvSXNvbGF0ZU1vZHVsZS5qcyIsIm5vZGVfbW9kdWxlcy9AY3ljbGUvZG9tL2xpYi9janMvTWFpbkRPTVNvdXJjZS5qcyIsIm5vZGVfbW9kdWxlcy9AY3ljbGUvZG9tL2xpYi9janMvUHJpb3JpdHlRdWV1ZS5qcyIsIm5vZGVfbW9kdWxlcy9AY3ljbGUvZG9tL2xpYi9janMvUmVtb3Zhb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AgICAgICAgICAgIF90aGlzLm9yaWdpbiA9IGVsO1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5yZXNldEV2ZW50TGlzdGVuZXJzKCk7XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLmRvbUxpc3RlbmVyc1RvQWRkLmZvckVhY2goZnVuY3Rpb24gKHBhc3NpdmUsIHR5cGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5zZXR1cERPTUxpc3RlbmVyKHR5cGUsIHBhc3NpdmUpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuZG9tTGlzdGVuZXJzVG9BZGQuY2xlYXIoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgX3RoaXMucmVzZXROb25CdWJibGluZ0xpc3RlbmVycygpO1xuICAgICAgICAgICAgICAgIF90aGlzLm5vbkJ1YmJsaW5nTGlzdGVuZXJzVG9BZGQuZm9yRWFjaChmdW5jdGlvbiAoYXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLnNldHVwTm9uQnViYmxpbmdMaXN0ZW5lcihhcnIpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIEV2ZW50RGVsZWdhdG9yLnByb3RvdHlwZS5hZGRFdmVudExpc3RlbmVyID0gZnVuY3Rpb24gKGV2ZW50VHlwZSwgbmFtZXNwYWNlLCBvcHRpb25zLCBidWJibGVzKSB7XG4gICAgICAgIHZhciBzdWJqZWN0ID0geHN0cmVhbV8xLmRlZmF1bHQubmV2ZXIoKTtcbiAgICAgICAgdmFyIHNjb3BlQ2hlY2tlciA9IG5ldyBTY29wZUNoZWNrZXJfMS5TY29wZUNoZWNrZXIobmFtZXNwYWNlLCB0aGlzLmlzb2xhdGVNb2R1bGUpO1xuICAgICAgICB2YXIgZGVzdCA9IHRoaXMuaW5zZXJ0TGlz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mdMaXN0ZW5lcnMuZm9yRWFjaChmdW5jdGlvbiAobWFwLCB0eXBlKSB7XG4gICAgICAgICAgICBpZiAobWFwLmhhcyhlbGVtZW50KSkge1xuICAgICAgICAgICAgICAgIHRvUmVtb3ZlLnB1c2goW3R5cGUsIGVsZW1lbnRdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdG9SZW1vdmUubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHZhciBtYXAgPSB0aGlzLm5vbkJ1YmJsaW5nTGlzdGVuZXJzLmdldCh0b1JlbW92ZVtpXVswXSk7XG4gICAgICAgICAgICBpZiAoIW1hcCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbWFwLmRlbGV0ZSh0b1JlbW92ZVtpXVsxXSk7XG4gICAgICAgICAgICBpZiAobWFwLnNpemUgPT09IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLm5vbkJ1YmJsaW5nTGlzdGVuZXJzLmRlbGV0ZSh0b1JlbW92ZVtpXVswXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLm5vbkJ1YmJsaW5nTGlzdGVuZXJzLnNldCh0b1JlbW92ZVtpXVswXSwgbWFwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgRXZlbnREZWxlZ2F0b3IucHJvdG90eXBlLmluc2VydExpc3RlbmVyID0gZnVuY3Rpb24gKHN1YmplY3QsIHNjb3BlQ2hlY2tlciwgZXZlbnRUeXBlLCBvcHRpb25zKSB7XG4gICAgICAgIHZhciByZWxldmFudFNldHMgPSBbXTtcbiAgICAgICAgdmFyIG4gPSBzY29wZUNoZWNrZXIuX25hbWVzcGFjZTtcbiAgICAgICAgdmFyIG1heCA9IG4ubGVuZ3RoO1xuICAgICAgICBkbyB7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zdWJzY3JpYmUoe1xuICAgICAgICAgICAgICAgIG5leHQ6IGZ1bmN0aW9uIChldmVudCkgeyByZXR1cm4gX3RoaXMub25FdmVudChldmVudFR5cGUsIGV2ZW50LCBwYXNzaXZlKTsgfSxcbiAgICAgICAgICAgICAgICBlcnJvcjogZnVuY3Rpb24gKCkgeyB9LFxuICAgICAgICAgICAgICAgIGNvbXBsZXRlOiBmdW5jdGlvbiAoKSB7IH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHRoaXMuZG9tTGlzdGVuZXJzLnNldChldmVudFR5cGUsIHsgc3ViOiBzdWIsIHBhc3NpdmU6IHBhc3NpdmUgfSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmRvbUxpc3RlbmVyc1RvQWRkLnNldChldmVudFR5cGUsIHBhc3NpdmUpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBFdmVudERlbGVnYXRvci5wcm90b3R5cGUuc2V0dXBOb25CdWJibGluZ0xpc3RlbmVyID0gZnVuY3Rpb24gKGlucHV0KSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHZhciBldmVudFR5cGUgPSBpbnB1dFswXSwgZWxlbWVudEZpbmRlciA9IGlucHV0WzFdLCBkZXN0aW5hdGlvbiA9IGlucHV0WzJdO1xuICAgICAgICBpZiAoIXRoaXMub3JpZ2luKSB7XG4gICAgICAgICAgICB0aGlzLm5vbkJ1YmJsaW5nTGlzdGVuZXJzVG9BZGQuYWRkKGlucHV0KTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICB2YXIgZWxlbWVudCA9IGVsZW1lbnRGaW5kZXIuY2FsbCgpWzBdO1xuICAgICAgICBpZiAoZWxlbWVudCkge1xuICAgICAgICAgICAgdGhpcy5ub25CdWJibGluZ0xpc3RlbmVyc1RvQWRkLmRlbGV0ZShpbnB1dCk7XG4gICAgICAgICAgICB2YXIgc3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gICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgZWxlbWVudEZpbmRlciA9IG5ldyBFbGVtZW50RmluZGVyXzEuRWxlbWVudEZpbmRlcihkZXN0aW5hdGlvbl8xLnNjb3BlQ2hlY2tlci5uYW1lc3BhY2UsIF90aGlzLmlzb2xhdGVNb2R1bGUpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgbmV3RWxtID0gZWxlbWVudEZpbmRlci5jYWxsKClbMF07XG4gICAgICAgICAgICAgICAgICAgIHZhciBuZXdTdWIgPSBmcm9tRXZlbnRfMS5mcm9tRXZlbnQobmV3RWxtLCB0eXBlLCBmYWxzZSwgZmFsc2UsIGRlc3RpbmF0aW9uXzEucGFzc2l2ZSkuc3Vic2NyaWJlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQ6IGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5vbkV2ZW50KHR5cGUsIGV2ZW50LCAhIWRlc3RpbmF0aW9uXzEucGFzc2l2ZSwgZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yOiBmdW5jdGlvbiAoKSB7IH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wbGV0ZTogZnVuY3Rpb24gKCkgeyB9LFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgaW5zZXJ0KHR5cGUsIG5ld0VsbSwgeyBzdWI6IG5ld1N1YiwgZGVzdGluYXRpb246IGRlc3RpbmF0aW9uXzEgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpbnNlcnQodHlwZSwgZWxtLCB2YWx1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBfdGhpcy5ub25Cd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IHNlbCA9IHV0aWxzXzEuZ2V0U2VsZWN0b3JzKGRlc3Quc2NvcGVDaGVja2VyLm5hbWVzcGFjZSk7XG4gICAgICAgICAgICAgICAgaWYgKCFldmVudC5wcm9wYWdhdGlvbkhhc0JlZW5TdG9wcGVkICYmXG4gICAgICAgICAgICAgICAgICAgIGRlc3Quc2NvcGVDaGVja2VyLmlzRGlyZWN0bHlJblNjb3BlKGVsbSkgJiZcbiAgICAgICAgICAgICAgICAgICAgKChzZWwgIT09ICcnICYmIGVsbS5tYXRjaGVzKHNlbCkpIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAoc2VsID09PSAnJyAmJiBlbG0gPT09IHJvb3RFbGVtZW50KSkpIHtcbiAgICAgICAgICAgICAgICAgICAgZnJvbUV2ZW50XzEucHJldmVudERlZmF1bHRDb25kaXRpb25hbChldmVudCwgZGVzdC5wcmV2ZW50RGVmYXVsdCk7XG4gICAgICAgICAgICAgICAgICAgIGRlc3Quc3ViamVjdC5zaGFtZWZ1bGx5U2VuZE5leHQoZXZlbnQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICBFdmVudERlbGVnYXRvci5wcm90b3R5cGUucGF0Y2hFdmVudCA9IGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICB2YXIgcEV2ZW50ID0gZXZlbnQ7XG4gICAgICAgIHBFdmVudC5wcm9wYWdhdGlvbkhhc0JlZW5TdG9wcGVkID0gZmFsc2U7XG4gICAgICAgIHZhciBvbGRTdG9wUHJvcGFnYXRpb24gPSBwRXZlbnQuc3RvcFByb3BhZ2F0aW9uO1xuICAgICAgICBwRXZlbnQuc3RvcFByb3BhZ2F0aW9uID0gZnVuY3Rpb24gc3RvcFByb3BhZ2F0aW9uKCkge1xuICAgICAgICAgICAgb2xkU3RvcFByb3BhZ2F0aW9uLmNhbGwodGhpcyk7XG4gICAgICAgICAgICB0aGlzLnByb3BhZ2F0aW9uSGF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ICAgICAgICAgICAgICAgIHZhciBuYW1lc3BhY2UgPSBkYXRhLmlzb2xhdGU7XG4gICAgICAgICAgICAgICAgaWYgKCF1dGlsc18xLmlzRXF1YWxOYW1lc3BhY2Uob2xkTmFtZXNwYWNlLCBuYW1lc3BhY2UpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9sZE5hbWVzcGFjZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYucmVtb3ZlRWxlbWVudChvbGRFbG0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG5hbWVzcGFjZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5pbnNlcnRFbGVtZW50KG5hbWVzcGFjZSwgZWxtKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZGVzdHJveTogZnVuY3Rpb24gKHZOb2RlKSB7XG4gICAgICAgICAgICAgICAgc2VsZi52bm9kZXNCZWluZ1JlbW92ZWQucHVzaCh2Tm9kZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVtb3ZlOiBmdW5jdGlvbiAodk5vZGUsIGNiKSB7XG4gICAgICAgICAgICAgICAgc2VsZi52bm9kZXNCZWluZ1JlbW92ZWQucHVzaCh2Tm9kZSk7XG4gICAgICAgICAgICAgICAgY2IoKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBwb3N0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHZub2Rlc0JlaW5nUmVtb3ZlZCA9IHNlbGYudm5vZGVzQmVpbmdSZW1vdmVkO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSB2bm9kZXNCZWluZ1JlbW92ZWQubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcbiAgICAgICAgICAgICAgICAgICAgdm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V0dXJucyB0aGUgcGF5bG9hZCBvZiB0aGUgcGF0aFxuICAgICAqIElmIGEgZGVmYXVsdCBlbGVtZW50IGNyZWF0b3IgaXMgZ2l2ZW4sIGl0IHdpbGwgaW5zZXJ0IGl0IGF0IHRoZSBwYXRoXG4gICAgICovXG4gICAgU3ltYm9sVHJlZS5wcm90b3R5cGUuZ2V0ID0gZnVuY3Rpb24gKHBhdGgsIG1rRGVmYXVsdEVsZW1lbnQsIG1heCkge1xuICAgICAgICB2YXIgY3VyciA9IHRoaXMudHJlZTtcbiAgICAgICAgdmFyIF9tYXggPSBtYXggIT09IHVuZGVmaW5lZCA/IG1heCA6IHBhdGgubGVuZ3RoO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IF9tYXg7IGkrKykge1xuICAgICAgICAgICAgdmFyIG4gPSB0aGlzLm1hcHBlcihwYXRoW2ldKTtcbiAgICAgICAgICAgIHZhciBjaGlsZCA9IGN1cnJbMV1bbl07XG4gICAgICAgICAgICBpZiAoIWNoaWxkKSB7XG4gICAgICAgICAgICAgICAgaWYgKG1rRGVmYXVsdEVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgY2hpbGQgPSBbdW5kZWZpbmVkLCB7fV07XG4gICAgICAgICAgICAgICAgICAgIGN1cnJbMV1bbl0gPSBjaGlsZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY3VyciA9IGNoaWxkO1xuICAgICAgICB9XG4gICAgICAgIGlmIChta0RlZmF1bHRFbGVtZW50ICYmICFjdXJyWzBdKSB7XG4gICAgICAgICAgICBjdXJyWzBdID0gbWtEZWZhdWx0RWxlbWVudCgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBjdXJyWzBdO1xuICAgIH07XG4gICAgU3ltYm9sV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wgcHJldmVudERlZmF1bHQpO1xuICAgICAgICAgICAgICAgICAgICBsaXN0ZW5lci5uZXh0KGV2ZW50KTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbmV4dCA9IGZ1bmN0aW9uIF9uZXh0KGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgIGxpc3RlbmVyLm5leHQoZXZlbnQpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbGVtZW50LmFkZEV2ZW50TGlzdGVuZXIoZXZlbnROYW1lLCBuZXh0LCB7XG4gICAgICAgICAgICAgICAgY2FwdHVyZTogdXNlQ2FwdHVyZSxcbiAgICAgICAgICAgICAgICBwYXNzaXZlOiBwYXNzaXZlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHN0b3A6IGZ1bmN0aW9uIHN0b3AoKSB7XG4gICAgICAgICAgICBlbGVtZW50LnJlbW92ZUV2ZW50TGlzdGVuZXIoZXZlbnROYW1lLCBuZXh0LCB1c2VDYXB0dXJlKTtcbiAgICAgICAgICAgIG5leHQgPSBudWxsO1xuICAgICAgICB9LFxuICAgIH0pO1xufVxuZXhwb3J0cy5mcm9tRXZlbnQgPSBmcm9tRXZlbnQ7XG5mdW5jdGlvbiBtYXRjaE9iamVjdChtYXRjaGVyLCBvYmopIHtcbiAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG1hdGNoZXIpO1xuICAgIHZhciBuID0ga2V5cy5sZW5ndGg7XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBuOyBpKyspIHtcbiAgICAgICAgdmFyIGsgPSBrZXlzW2ldO1xuICAgICAgICBpZiAodHlwZW9mIG1hdGNoZXJba10gPT09ICdvYmplY3QnICYmIHR5cGVvZiBvYmpba10gPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICBpZiAoIW1hdGNoT2JqZWN0KG1hdGNoZXJba10sIG9ialtrXSkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAobWF0Y2hlcltrXSAhPT0gb2JqW2tdKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHRydWU7XG59XG5mdW5jdGlvbiBwcmV2ZW50RGVmYXVsdENvbmRpdGlvbmFsKGV2ZW50LCBwcmV2ZW50RGVmYXVsdCkge1xuICAgIGlmIChwcmV2ZW50RGVmYXVsdCkge1xuICAgICAgICBpZiAodHlwZW9mIHByZXZlbnREZWZhdWx0ID09PSAnYm9vbGVhbicpIHtcbiAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoaXNQcmVkaWNhdGUocHJldmVudERlZmF1bHQpKSB7XG4gICAgICAgICAgICBpZiAocHJldmVudERlZmF1bHQoZXZlbnQpKSB7XG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0eXBlb2YgcHJldmVudERlZmF1bHQgPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICBpZiAobWF0Y2hPYmplY3QocHJldmVudERlZmF1bHQsIGV2ZW50KSkge1xuICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ3ByZXZlbnREZWZhdWx0IGhhcyB0byBiZSBlaXRoZXIgYSBib29sZWFuLCBwcmVkaWNhdGUgZnVuY3Rpb24gb3Igb2JqZWN0Jyk7XG4gICAgICAgIH1cbiAgICB9XG59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uICAgICAgICAgICAgICAgIHRbcF0gPSBzW3BdO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0O1xuICAgIH07XG4gICAgcmV0dXJuIF9fYXNzaWduLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG59O1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiB0cnVlIH0pO1xudmFyIHV0aWxzXzEgPSByZXF1aXJlKFwiLi91dGlsc1wiKTtcbmZ1bmN0aW9uIG1ha2VJc29sYXRlU2luayhuYW1lc3BhY2UpIHtcbiAgICByZXR1cm4gZnVuY3Rpb24gKHNpbmssIHNjb3BlKSB7XG4gICAgICAgIGlmIChzY29wZSA9PT0gJzpyb290Jykge1xuICAgICAgICAgICAgcmV0dXJuIHNpbms7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHNpbmsubWFwKGZ1bmN0aW9uIChub2RlKSB7XG4gICAgICAgICAgICBpZiAoIW5vZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBzY29wZU9iaiA9IGdldFNjb3BlT2JqKHNjb3BlKTtcbiAgICAgICAgICAgIHZhciBuZXdOb2RlID0gX19hc3NpZ24oe30sIG5vZGUsIHsgZGF0YTogX19hc3NpZ24oe30sIG5vZGUuZGF0YSwgeyBpc29sYXRlOiAhbm9kZS5kYXRhIHx8ICFBcnJheS5pc0FycmF5KG5vZGUuZGF0YS5pc29sYXRlKVxuICAgICAgICAgICAgICAgICAgICAgICAgPyBuYW1lc3BhY2UuY29uY2F0KFtzY29wZU9ial0pXG4gICAgICAgICAgICAgICAgICAgICAgICA6IG5vZGUuZGF0YS5pc29sYXRlIH0pIH0pO1xuICAgICAgICAgICAgcmV0dXJuIF9fYXNzaWduKHt9LCBuZXdOb2RlLCB7IGtleTogbmV3Tm9kZS5rZXkgIT09IHVuZGVmaW5lZF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gdm5vZGUuZWxtO1xufVxuZnVuY3Rpb24gcmVwb3J0U25hYmJkb21FcnJvcihlcnIpIHtcbiAgICAoY29uc29sZS5lcnJvciB8fCBjb25zb2xlLmxvZykoZXJyKTtcbn1cbmZ1bmN0aW9uIG1ha2VET01SZWFkeSQoKSB7XG4gICAgcmV0dXJuIHhzdHJlYW1fMS5kZWZhdWx0LmNyZWF0ZSh7XG4gICAgICAgIHN0YXJ0OiBmdW5jdGlvbiAobGlzKSB7XG4gICAgICAgICAgICBpZiAoZG9jdW1lbnQucmVhZHlTdGF0ZSA9PT0gJ2xvYWRpbmcnKSB7XG4gICAgICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcigncmVhZHlzdGF0ZWNoYW5nZScsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHN0YXRlID0gZG9jdW1lbnQucmVhZHlTdGF0ZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXRlID09PSAnaW50ZXJhY3RpdmUnIHx8IHN0YXRlID09PSAnY29tcGxldGUnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaXMubmV4dChudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpcy5jb21wbGV0ZSgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsaXMubmV4dChudWxsKTtcbiAgICAgICAgICAgICAgICBsaXMuY29tcGxldGUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgc3RvcDogZnVuY3Rpb24gKCkgeyB9LFxuICAgIH0pO1xufVxuZnVuY3Rpb24gYWRkUm9vdFNjb3BlKHZub2RlKSB7XG4gICAgdm5vZGUuZGF0YSA9IHZub2RlLmRhdGEgfHwge307XG4gICAgdm5vZGUuZGF0YS5pc29sYXRlID0gW107XG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AgICAgICByZW1lbWJlcmVkVk5vZGUkLmFkZExpc3RlbmVyKHt9KTtcbiAgICAgICAgLy8gVGhlIG11dGF0aW9uIG9ic2VydmVyIGludGVybmFsIHRvIG11dGF0aW9uQ29uZmlybWVkJCBzaG91bGRcbiAgICAgICAgLy8gZXhpc3QgYmVmb3JlIGVsZW1lbnRBZnRlclBhdGNoJCBjYWxscyBtdXRhdGlvbk9ic2VydmVyLm9ic2VydmUoKVxuICAgICAgICBtdXRhdGlvbkNvbmZpcm1lZCQuYWRkTGlzdGVuZXIoe30pO1xuICAgICAgICB2YXIgZWxlbWVudEFmdGVyUGF0Y2gkID0gZmlyc3RSb290JFxuICAgICAgICAgICAgLm1hcChmdW5jdGlvbiAoZmlyc3RSb290KSB7XG4gICAgICAgICAgICByZXR1cm4geHN0cmVhbV8xLmRlZmF1bHRcbiAgICAgICAgICAgICAgICAubWVyZ2UocmVtZW1iZXJlZFZOb2RlJC5lbmRXaGVuKHNhbml0YXRpb24kKSwgc2FuaXRhdGlvbiQpXG4gICAgICAgICAgICAgICAgLm1hcChmdW5jdGlvbiAodm5vZGUpIHsgcmV0dXJuIHZub2RlV3JhcHBlci5jYWxsKHZub2RlKTsgfSlcbiAgICAgICAgICAgICAgICAuc3RhcnRXaXRoKGFkZFJvb3RTY29wZSh0b3Zub2RlXzEudG9WTm9kZShmaXJzdFJvb3QpKSlcbiAgICAgICAgICAgICAgICAuZm9sZChwYXRjaCwgdG92bm9kZV8xLnRvVk5vZGUoZmlyc3RSb290KSlcbiAgICAgICAgICAgICAgICAuZHJvcCgxKVxuICAgICAgICAgICAgICAgIC5tYXAodW53cmFwRWxlbWVudEZyb21WTm9kZSlcbiAgICAgICAgICAgICAgICAuc3RhcnRXaXRoKGZpcnN0Um9vdClcbiAgICAgICAgICAgICAgICAubWFwKGZ1bmN0aW9uIChlbCkge1xuICAgICAgICAgICAgICAgIG11dGF0aW9uT2JzZXJ2ZXIub2JzZXJ2ZShlbCwge1xuICAgICAgICAgICAgICAgICAgICBjaGlsZExpc3Q6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZXM6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgIGNoYXJhY3RlckRhdGE6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgIHN1YnRyZWU6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU9sZFZhbHVlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICBjaGFyYWN0ZXJEYXRhT2xkVmFsdWU6IHRydWUsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGVsO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuY29tcG9zZShkcm9wQ29tcGxldGlvbik7XG4gICAgICAgIH0gLy8gZG9uJ3QgY29tcGxldGUgdGhpcyBzdHJlYW1cbiAgICAgICAgKVxuICAgICAgICAgICAgLmZsYXR0ZW4oKTtcbiAgICAgICAgdmFyIHJvb3RFbGVtZW50JCA9IGNvbmNhdF8xLmRlZmF1bHQoZG9tUmVhZHkkLCBtdXRhdGlvbkNvbmZpcm1lZCQpXG4gICAgICAgICAgICAuZW5kV2hlbihzYW5pdGF0aW9uJClcbiAgICAgICAgICAgIC5jb21wb3NlKHNhbXBsZUNvbWJpbmVfMS5kZWZhdWx0KGVsZW1lbnRBZnRlclBhdGNoJCkpXG4gICAgICAgICAgICAubWFwKGZ1bmN0aW9uIChhcnIpIHsgcmV0dXJuIGFyclsxXTsgfSlcbiAgICAgICAgICAgIC5yZW1lbWJlcigpO1xuICAgICAgICAvLyBTdGFydCB0aGUgc25hYmJkb20gcGF0Y2hpbmcsIG92ZXIgdGltZVxuICAgICAgICByb290RWxlbWVudCQuYWRkTGlzdGVuZXIoeyBlcnJvcjogcmVwb3J0U25hYmJkb21FcnJvciB9KTtcbiAgICAgICAgdmFyIGRlbGVnYXRvciA9IG5ldyBFdmVudERlbGVnYXRvcl8xLkV2ZW50RGVsZW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AgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGlsZHJlbi5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgdmFyIGNoaWxkRGF0YSA9IGNoaWxkcmVuW2ldLmRhdGE7XG4gICAgICAgICAgICBpZiAoY2hpbGREYXRhICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICBhZGROUyhjaGlsZERhdGEsIGNoaWxkcmVuW2ldLmNoaWxkcmVuLCBjaGlsZHJlbltpXS5zZWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufVxuZnVuY3Rpb24gaChzZWwsIGIsIGMpIHtcbiAgICB2YXIgZGF0YSA9IHt9LCBjaGlsZHJlbiwgdGV4dCwgaTtcbiAgICBpZiAoYyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGRhdGEgPSBiO1xuICAgICAgICBpZiAoaXMuYXJyYXkoYykpIHtcbiAgICAgICAgICAgIGNoaWxkcmVuID0gYztcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChpcy5wcmltaXRpdmUoYykpIHtcbiAgICAgICAgICAgIHRleHQgPSBjO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGMgJiYgYy5zZWwpIHtcbiAgICAgICAgICAgIGNoaWxkcmVuID0gW2NdO1xuICAgICAgICB9XG4gICAgfVxuICAgIGVsc2UgaWYgKGIgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAoaXMuYXJyYXkoYikpIHtcbiAgICAgICAgICAgIGNoaWxkcmVuID0gYjtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChpcy5wcmltaXRpdmUoYikpIHtcbiAgICAgICAgICAgIHRleHQgPSBiO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGIgJiYgYi5zZWwpIHtcbiAgICAgICAgICAgIGNoaWxkcmVuID0gW2JdO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgZGF0YS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mFyIG9sZCA9IG9sZEF0dHJzW2tleV07XG4gICAgICAgIGlmIChvbGQgIT09IGN1cikge1xuICAgICAgICAgICAgaWYgKGN1ciA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgIGVsbS5zZXRBdHRyaWJ1dGUoa2V5LCBcIlwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGN1ciA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICBlbG0ucmVtb3ZlQXR0cmlidXRlKGtleSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoa2V5LmNoYXJDb2RlQXQoMCkgIT09IHhDaGFyKSB7XG4gICAgICAgICAgICAgICAgICAgIGVsbS5zZXRBdHRyaWJ1dGUoa2V5LCBjdXIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChrZXkuY2hhckNvZGVBdCgzKSA9PT0gY29sb25DaGFyKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEFzc3VtZSB4bWwgbmFtZXNwYWNlXG4gICAgICAgICAgICAgICAgICAgIGVsbS5zZXRBdHRyaWJ1dGVOUyh4bWxOUywga2V5LCBjdXIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChrZXkuY2hhckNvZGVBdCg1KSA9PT0gY29sb25DaGFyKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEFzc3VtZSB4bGluayBuYW1lc3BhY2VcbiAgICAgICAgICAgICAgICAgICAgZWxtLnNldEF0dHJpYnV0ZU5TKHhsaW5rTlMsIGtleSwgY3VyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGVsbS5zZXRBdHRyaWJ1dGUoa2V5LCBjdXIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbi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V0KVxuICAgICAgICByZXR1cm47XG4gICAgaWYgKG9sZERhdGFzZXQgPT09IGRhdGFzZXQpXG4gICAgICAgIHJldHVybjtcbiAgICBvbGREYXRhc2V0ID0gb2xkRGF0YXNldCB8fCB7fTtcbiAgICBkYXRhc2V0ID0gZGF0YXNldCB8fCB7fTtcbiAgICB2YXIgZCA9IGVsbS5kYXRhc2V0O1xuICAgIGZvciAoa2V5IGluIG9sZERhdGFzZXQpIHtcbiAgICAgICAgaWYgKCFkYXRhc2V0W2tleV0pIHtcbiAgICAgICAgICAgIGlmIChkKSB7XG4gICAgICAgICAgICAgICAgaWYgKGtleSBpbiBkKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBkW2tleV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgZWxtLnJlbW92ZUF0dHJpYnV0ZSgnZGF0YS0nICsga2V5LnJlcGxhY2UoQ0FQU19SRUdFWCwgJy0kJicpLnRvTG93ZXJDYXNlKCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIGZvciAoa2V5IGluIGRhdGFzZXQpIHtcbiAgICAgICAgaWYgKG9sZERhdGFzZXRba2V5XSAhPT0gZGF0YXNldFtrZXldKSB7XG4gICAgICAgICAgICBpZiAoZCkge1xuICAgICAgICAgICAgICAgIGRba2V5XSA9IGRhdGFzZXRba2V5XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGVsbS5zZXRBdHRyaWJ1dGUoJ2RhdGEtJyArIGtleS5yZXBsYWNlKENBUFNfUkVHRVgsICctJCYnKS50b0xvd2VyQ2FzZSgpLCBkYXRhc2V0W2tleV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufVxuZXhwb3J0cy5kYXRhc2V0TW9kdWxlID0geyBjcmVhdGU6IHVwZGF0ZURhdGF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ZFN0eWxlID0gb2xkU3R5bGUgfHwge307XG4gICAgc3R5bGUgPSBzdHlsZSB8fCB7fTtcbiAgICB2YXIgb2xkSGFzRGVsID0gJ2RlbGF5ZWQnIGluIG9sZFN0eWxlO1xuICAgIGZvciAobmFtZSBpbiBvbGRTdHlsZSkge1xuICAgICAgICBpZiAoIXN0eWxlW25hbWVdKSB7XG4gICAgICAgICAgICBpZiAobmFtZVswXSA9PT0gJy0nICYmIG5hbWVbMV0gPT09ICctJykge1xuICAgICAgICAgICAgICAgIGVsbS5zdHlsZS5yZW1vdmVQcm9wZXJ0eShuYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGVsbS5zdHlsZVtuYW1lXSA9ICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIGZvciAobmFtZSBpbiBzdHlsZSkge1xuICAgICAgICBjdXIgPSBzdHlsZVtuYW1lXTtcbiAgICAgICAgaWYgKG5hbWUgPT09ICdkZWxheWVkJyAmJiBzdHlsZS5kZWxheWVkKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBuYW1lMiBpbiBzdHlsZS5kZWxheWVkKSB7XG4gICAgICAgICAgICAgICAgY3VyID0gc3R5bGUuZGVsYXllZFtuYW1lMl07XG4gICAgICAgICAgICAgICAgaWYgKCFvbGRIYXNEZWwgfHwgY3VyICE9PSBvbGRTdHlsZS5kZWxheWVkW25hbWUyXSkge1xuICAgICAgICAgICAgICAgICAgICBzZXROZXh0RnJhbWUoZWxtLnN0eWxlLCBuYW1lMiwgY3VyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAobmFtZSAhPT0gJ3JlbW92ZScgJiYgY3VyICE9PSBvbGRTdHlsZVtuYW1lXSkge1xuICAgICAgICAgICAgaWYgKG5hbWVbMF0gPT09ICctJyAmJiBuYW1lWzFdID09PSAnLScpI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ByZXR1cm4gZnVuY3Rpb24gcm1DYigpIHtcbiAgICAgICAgICAgIGlmICgtLWxpc3RlbmVycyA9PT0gMCkge1xuICAgICAgICAgICAgICAgIHZhciBwYXJlbnRfMSA9IGFwaS5wYXJlbnROb2RlKGNoaWxkRWxtKTtcbiAgICAgICAgICAgICAgICBhcGkucmVtb3ZlQ2hpbGQocGFyZW50XzEsIGNoaWxkRWxtKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICB9XG4gICAgZnVuY3Rpb24gY3JlYXRlRWxtKHZub2RlLCBpbnNlcnRlZFZub2RlUXVldWUpIHtcbiAgICAgICAgdmFyIGksIGRhdGEgPSB2bm9kZS5kYXRhO1xuICAgICAgICBpZiAoZGF0YSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBpZiAoaXNEZWYoaSA9IGRhdGEuaG9vaykgJiYgaXNEZWYoaSA9IGkuaW5pdCkpIHtcbiAgICAgICAgICAgICAgICBpKHZub2RlKTtcbiAgICAgICAgICAgICAgICBkYXRhID0gdm5vZGUuZGF0YTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB2YXIgY2hpbGRyZW4gPSB2bm9kZS5jaGlsZHJlbiwgc2VsID0gdm5vZGUuc2VsO1xuICAgICAgICBpZiAoc2VsID09PSAnIScpIHtcbiAgICAgICAgICAgIGlmIChpc1VuZGVmKHZub2RlLnRleHQpKSB7XG4gICAgICAgICAgICAgICAgdm5vZGUudGV4dCA9ICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdm5vZGUuZWxtID0gYXBpLmNyZWF0ZUNvbW1lbnQodm5vZGUudGV4dCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoc2VsICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIC8vIFBhcnNlIHNlbGVjdG9yXG4gICAgICAgICAgICB2YXIgaGFzaElkeCA9IHNlbC5pbmRleE9mKCcjJyk7XG4gICAgICAgICA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A9IGNoaWxkcmVuW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY2ggIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYXBpLmFwcGVuZENoaWxkKGVsbSwgY3JlYXRlRWxtKGNoLCBpbnNlcnRlZFZub2RlUXVldWUpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGlzLnByaW1pdGl2ZSh2bm9kZS50ZXh0KSkge1xuICAgICAgICAgICAgICAgIGFwaS5hcHBlbmRDaGlsZChlbG0sIGFwaS5jcmVhdGVUZXh0Tm9kZSh2bm9kZS50ZXh0KSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpID0gdm5vZGUuZGF0YS5ob29rOyAvLyBSZXVzZSB2YXJpYWJsZVxuICAgICAgICAgICAgaWYgKGlzRGVmKGkpKSB7XG4gICAgICAgICAgICAgICAgaWYgKGkuY3JlYXRlKVxuICAgICAgICAgICAgICAgICAgICBpLmNyZWF0ZShlbXB0eU5vZGUsIHZub2RlKTtcbiAgICAgICAgICAgICAgICBpZiAoaS5pbnNlcnQpXG4gICAgICAgICAgICAgICAgICAgIGluc2VydGVkVm5vZGVRdWV1ZS5wdXNoKHZub2RlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHZub2RlLmVsbSA9IGFwaS5jcmVhdGVUZXh0Tm9kZSh2bm9kZS50ZXh0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdm5vZGUuZWxtO1xuICAgIH1cbiAgICBmdW5jdGlvbiBhZGRWbm9kZXMocGFyZW50RWxtLCBiZWZvcmUsIHZub2Rlcywgc3RhcnRJZHgsIGVuZElkeCwgaW5zZXJ0ZWRWbm9kZVF1ZXVlKSB7XG4gICAgICAgIGZvciAoOyBzdGFydElkeCA8PSBlbmRJZHg7ICsrc3RhcnRJZHgpIHtcbiAgICAgICAgICAgIHZhciBjaCA9IHZub2Rlc1tzdGFydElkeF07XG4gICAgICAgICAgICBpZiAoY2ggIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGFwaS5pbnNlcnRCZWZvcmUocGFyZW50RWxtLCBjcmVhdGVFbG0oY2gsIGluc2VydGVkVm5vZGVRdWV1ZSksIGJlZm9yZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gaW52b2tlRGVzdHJveUhvb2sodm5vZGUpIHtcbiAgICAgICAgdmFyIGksIGosIGRhdGEgPSB2bm9kZS5kYXRhO1xuICAgICAgICBpZiAoZGF0YSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBpZiAoaXNEZWYoaSA9IGRhdGEuaG9vaykgJiYgaXNEZWYoaSA9IGkuZGVzdHJveSkpXG4gICAgICAgICAgICAgICAgaSh2bm9kZSk7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY2JzLmRlc3Ryb3kubGVuZ3RoOyArK2kpXG4gICAgICAgICAgICAgICAgY2JzLmRlc3Ryb3lbaV0odm5vZGUpO1xuICAgICAgICAgICAgaWYgKHZub2RlLmNoaWxkcmVuICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgdm5vZGUuY2hpbGRyZW4ubGVuZ3RoOyArK2opIHtcbiAgICAgICAgICAgICAgICAgICAgaSA9IHZub2RlLmNoaWxkcmVuW2pdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaSAhPSBudWxsICYmIHR5cGVvZiBpICE9PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbnZva2VEZXN0cm95SG9vayhpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiByZW1vdmVWbm9kZXMocGFyZW50RWxtLCB2bm9kZXMsIHN0YXJ0SWR4LCBlbmRJZHgpIHtcbiAgICAgICAgZm9yICg7IHN0YXJ0SWR4IDw9IGVuZElkeDsgKytzdGFydElkeCkge1xuICAgICAgICAgICAgdmFyIGlfMSA9IHZvaWQgMCwgbGlzdGVuZXJzID0gdm9pZCAwLCBybSA9IHZvaWQgMCwgY2ggPSB2bm9kZXNbc3RhcnRJZHhdO1xuICAgICAgICAgICAgaWYgKGNoICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNEZWYoY2guc2VsKSkge1xuICAgICAgICAgICAgICAgICAgICBpbnZva2VEZXN0cm95SG9vayhjaCk7XG4gICAgICAgICAgICAgICAgICAgIGxpc3RlbmVycyA9IGNicy5yZW1vdmUubGVuZ3RoICsgMTtcbiAgICAgICAgICAgICAgICAgICAgcm0gPSBjcmVhdGVSbUNiKGNoLmVsbSwgbGlzdGVuZXJzKTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpXzEgPSAwOyBpXzEgPCBjYnMucmVtb3ZlLmxlbmd0aDsgKytpXzEpXG4gICAgICAgICAgICAgICAgICAgICAgICBjYnMucmVtb3ZlW2lfMV0oY2gsIHJtKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzRGVmKGlfMSA9IGNoLmRhdGEpICYmIGlzRGVmKGlfMSA9IGlfMS5ob29rKSAmJiBpc0RlZihpXzEgPSBpXzEucmVtb3ZlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaV8xKGNoLCBybSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBybSgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBhcGkucmVtb3ZlQ2hpbGQocGFyZW50RWxtLCB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9sZEVuZElkeF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChuZXdTdGFydFZub2RlID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICBuZXdTdGFydFZub2RlID0gbmV3Q2hbKytuZXdTdGFydElkeF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChuZXdFbmRWbm9kZSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgbmV3RW5kVm5vZGUgPSBuZXdDaFstLW5ld0VuZElkeF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChzYW1lVm5vZGUob2xkU3RhcnRWbm9kZSwgbmV3U3RhcnRWbm9kZSkpIHtcbiAgICAgICAgICAgICAgICBwYXRjaFZub2RlKG9sZFN0YXJ0Vm5vZGUsIG5ld1N0YXJ0Vm5vZGUsIGluc2VydGVkVm5vZGVRdWV1ZSk7XG4gICAgICAgICAgICAgICAgb2xkU3RhcnRWbm9kZSA9IG9sZENoWysrb2xkU3RhcnRJZHhdO1xuICAgICAgICAgICAgICAgIG5ld1N0YXJ0Vm5vZGUgPSBuZXdDaFsrK25ld1N0YXJ0SWR4XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHNhbWVWbm9kZShvbGRFbmRWbm9kZSwgbmV3RW5kVm5vZGUpKSB7XG4gICAgICAgICAgICAgICAgcGF0Y2hWbm9kZShvbGRFbmRWbm9kZSwgbmV3RW5kVm5vZGUsIGluc2VydGVkVm5vZGVRdWV1ZSk7XG4gICAgICAgICAgICAgICAgb2xkRW5kVm5vZGUgPSBvbGRDaFstLW9sZEVuZElkeF07XG4gICAgICAgICAgICAgICAgbmV3RW5kVm5vZGUgPSBuZXdDaFstLW5ld0VuZElkeF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChzYW1lVm5vZGUob2xkU3RhcnRWbm9kZSwgbmV3RW5kVm5vZGUpKSB7XG4gICAgICAgICAg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oID0gdm5vZGUuY2hpbGRyZW47XG4gICAgICAgIGlmIChvbGRWbm9kZSA9PT0gdm5vZGUpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIGlmICh2bm9kZS5kYXRhICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjYnMudXBkYXRlLmxlbmd0aDsgKytpKVxuICAgICAgICAgICAgICAgIGNicy51cGRhdGVbaV0ob2xkVm5vZGUsIHZub2RlKTtcbiAgICAgICAgICAgIGkgPSB2bm9kZS5kYXRhLmhvb2s7XG4gICAgICAgICAgICBpZiAoaXNEZWYoaSkgJiYgaXNEZWYoaSA9IGkudXBkYXRlKSlcbiAgICAgICAgICAgICAgICBpKG9sZFZub2RlLCB2bm9kZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGlzVW5kZWYodm5vZGUudGV4dCkpIHtcbiAgICAgICAgICAgIGlmIChpc0RlZihvbGRDaCkgJiYgaXNEZWYoY2gpKSB7XG4gICAgICAgICAgICAgICAgaWYgKG9sZENoICE9PSBjaClcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlQ2hpbGRyZW4oZWxtLCBvbGRDaCwgY2gsIGluc2VydGVkVm5vZGVRdWV1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChpc0RlZihjaCkpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNEZWYob2xkVm5vZGUudGV4dCkpXG4gICAgICAgICAgICAgICAgICAgIGFwaS5zZXRUZXh0Q29udGVudChlbG0sICcnKTtcbiAgICAgICAgICAgICAgICBhZGRWbm9kZXMoZWxtLCBudWxsLCBjaCwgMCwgY2gubGVuZ3RoIC0gMSwgaW5zZXJ0ZWRWbm9kZVF1ZXVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGlzRGVmKG9sZENoKSkge1xuICAgICAgICAgICAgICAgIHJlbW92ZVZub2RlcyhlbG0sIG9sZENoLCAwLCBvbGRDaC5sZW5ndGggLSAxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGlzRGVmKG9sZFZub2RlLnRleHQpKSB7XG4gICAgICAgICAgICAgICAgYXBpLnNldFRleHRDb250ZW50KGVsbSwgJycpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKG9sZFZub2RlLnRleHQgIT09IHZub2RlLnRleHQpIHtcbiAgICAgICAgICAgIGlmIChpc0RlZihvbGRDaCkpIHtcbiAgICAgICAgICAgICAgICByZW1vdmVWbm9kZXMoZWxtLCBvbGRDaCwgMCwgb2xkQ2gubGVuZ3RoIC0gMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhcGkuc2V0VGV4dENvbnRlbnQoZWxtLCB2bm9kZS50ZXh0KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaXNEZWYoaG9vaykgJiYgaXNEZWYoaSA9IGhvb2sucG9zdHBhdGNoKSkge1xuICAgICAgICAgICAgaShvbGRWbm9kZSwgdm5vZGUpO1xuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiBmdW5jdGlvbiBwYXRjaChvbGRWbm9kZSwgdm5vZGUpIHtcbiAgICAgICAgdmFyIGksIGVsbSwgcGFyZW50O1xuICAgICAgICB2YXIgaW5zZXJ0ZWRWbm9kZVF1ZXVlID0gW107XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBjYnMucHJlLmxlbmd0aDsgKytpKVxuICAgICAgICAgICAgY2JzLnByZVtpXSgpO1xuICAgICAgICBpZiAoIWlzVm5vZGUob2xkVm5vZGUpKSB7XG4gICAgICAgICAgICBvbGRWbm9kZSA9IGVtcHR5Tm9kZUF0KG9sZFZub2RlKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoc2FtZVZub2RlKG9sZFZub2RlLCB2bm9kZSkpIHtcbiAgICAgICAgICAgIHBhdGNoVm5vZGUob2xkVm5vZGUsIHZub2R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PT0gLTEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZm9yICh2YXIga2V5IGluIGF0dHJpYnV0ZXMpIHtcbiAgICAgICAgICAgIHZhciBhdHRyID0gb3B0cy5hdHRyKG5vZGUsIGtleSk7XG4gICAgICAgICAgICB2YXIgdCA9IGF0dHJpYnV0ZXNba2V5XVswXTtcbiAgICAgICAgICAgIHZhciB2ID0gYXR0cmlidXRlc1trZXldWzFdO1xuICAgICAgICAgICAgaWYgKGF0dHIgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0ID09PSAnaGFzJykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHQgPT09ICdleGFjdCcgJiYgYXR0ciAhPT0gdikge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHQgIT09ICdleGFjdCcpIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHYgIT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignQWxsIG5vbi1zdHJpbmcgdmFsdWVzIGhhdmUgdG8gYmUgYW4gZXhhY3QgbWF0Y2gnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHQgPT09ICdzdGFydHNXaXRoJyAmJiAhYXR0ci5zdGFydHNXaXRoKHYpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHQgPT09ICdlbmRzV2l0aCcgJiYgIWF0dHIuZW5kc1dpdGgodikpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAodCA9PT0gJ2NvbnRhaW5zJyAmJiBhdHRyLmluZGV4T2YodikgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHQgPT09ICd3aGl0ZXNwYWNlJyAmJiBhdHRyLnNwbGl0KCcgJykuaW5kZXhPZih2KSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAodCA9PT0gJ2Rhc2gnICYmIGF0dHIuc3BsaXQoJy0nKS5pbmRleE9mKHYpID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcHNldWRvcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIF9iID0gcHNldWRvc1tpXSwgdCA9IF9iWzBdLCBkYXRhID0gX2JbMV07XG4gICAgICAgICAgICBpZiAodCA9PT0gJ2NvbnRhaW5zJyAmJiBkYXRhICE9PSBvcHRzLmNvbnRlbnRzKG5vZGUpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHQgPT09ICdlbXB0eScgJiZcbiAgICAgICAgICAgICAgICAob3B0cy5jb250ZW50cyhub2RlKSB8fCBvcHRzLmNoaWxkcmVuKG5vZGUpLmxlbmd0aCAhPT0gMCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodCA9PT0gJ3Jvb3QnICYmIG9wdHMucGFyZW50KG5vZGUpICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodC5pbmRleE9mKCdjaGlsZCcpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgIGlmICghb3B0cy5wYXJlbnQobm9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgc2libGluZ3MgPSBvcHRzLmNoaWxkcmVuKG9wdHMucGFyZW50KG5vZGUpKTtcbiAgICAgICAgICAgICAgICBpZiAodCA9PT0gJ2ZpcnN0LWNoaWxkJyAmJiBzaWJsaW5ncy5pbmRleE9mKG5vZGUpICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHQgPT09ICdsYXN0LWNoaWxkJyAmJlxuICAgICAgICAgICAgICAgICAgICBzaWJsaW5ncy5pbmRleE9mKG5vZGUpICE9PSBzaWJsaW5ncy5sZW5ndGggLSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHQgPT09ICdudGgtY2hpbGQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZWdleCA9IC8oW1xcKy1dPykoXFxkKikobj8pKFxcK1xcZCspPy87XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXJzZVJlc3VsdCA9IHJlZ2V4LmV4ZWMoZGF0YSkuc2xpY2UoMSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IHNpYmxpbmdzLmluZGV4T2Yobm9kZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcGFyc2VSZXN1bHRbMF0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlUmVzdWx0WzBdID0gJysnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHZhciBmYWN0b3IgPSBwYXJzZVJlc3VsdFsxXVxuICAgICAgICAgICAgICAgICAgICAgICAgPyBwYXJzZUludChwYXJzZVJlc3VsdFswXSArIHBhcnNlUmVzdWx0WzFdKVxuICAgICAgICAgICAgICAgICAgICAgICAgOiB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgIHZhciBhZGQgPSBwYXJzZUludChwYXJzZVJlc3VsdFszXSB8fCAnMCcpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZmFjdG9yICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZVJlc3VsdFsyXSA9PT0gJ24nICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmRleCAlIGZhY3RvciAhPT0gYWRkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWZhY3RvciAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VSZXN1bHRbMl0gJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICgocGFyc2VSZXN1bHRbMF0gPT09ICcrJyAmJiBpbmRleCAtIGFkZCA8IDApIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBhcnNlUmVzdWx0WzBdID09PSAnLScgJiYgaW5kZXggLSBhZGQgPj0gMCkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIXBhcnNlUmVzdWx0WzJdICYmIGZhY3RvciAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggIT09IGZhY3RvciAtIDEpIHtcbiAgICAgICAgICAgICAgICAg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1xuICAgICAgICAgICAgLmNoaWxkcmVuKG5vZGUpXG4gICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uIChjKSB7IHJldHVybiB0eXBlb2YgYyAhPT0gJ3N0cmluZyc7IH0pXG4gICAgICAgICAgICAubWFwKGZ1bmN0aW9uIChjKSB7IHJldHVybiBmaW5kU3VidHJlZShzZWxlY3RvciwgZGVwdGggLSAxLCBjKTsgfSlcbiAgICAgICAgICAgIC5yZWR1Y2UoZnVuY3Rpb24gKGFjYywgY3VycikgeyByZXR1cm4gYWNjLmNvbmNhdChjdXJyKTsgfSwgW10pO1xuICAgICAgICByZXR1cm4gbWF0Y2hlZC5jb25jYXQoY2hpbGRNYXRjaGVkKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gZmluZFNpYmxpbmcoc2VsZWN0b3IsIG5leHQsIG5vZGUpIHtcbiAgICAgICAgaWYgKCFub2RlIHx8IG9wdGlvbnMucGFyZW50KG5vZGUpID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgcmVzdWx0cyA9IFtdO1xuICAgICAgICB2YXIgc2libGluZ3MgPSBvcHRpb25zLmNoaWxkcmVuKG9wdGlvbnMucGFyZW50KG5vZGUpKTtcbiAgICAgICAgZm9yICh2YXIgaSA9IHNpYmxpbmdzLmluZGV4T2Yobm9kZSkgKyAxOyBpIDwgc2libGluZ3MubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygc2libGluZ3NbaV0gPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgbiA9IF9tYXRjaGVzKHNlbGVjdG9yLCBzaWJsaW5nc1tpXSk7XG4gICAgICAgICAgICBpZiAobikge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgbiA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0cy5wdXNoKG4pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0cy5wdXNoKHNpYmxpbmdzW2ldKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobmV4dCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHRzO1xuICAgIH1cbiAgICByZXR1cm4gZnVuY3Rpb24gcXVlcnlTZWxlY3RvcihzZWxlY3Rvciwgbm9kZSkge1xuICAgICAgICBpZiAoIW5vZGUpIHtcbiAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgc2VsID0gdHlwZW9mIHNlbGVjdG9yID09PSAnb2JqZWN0JyA/IHNlbGVjdG9yIDogc2VsZWN0b3JQYXJzZXJfMS5wYXJzZVNlbGVjdG9yKHNlbGVjdG9yKTtcbiAgICAgICAgdmFyIHJlc3VsdHMgPSBbbm9kZV07XG4gICAgICAgIHZhciBjdXJyZW50U2VsZWN0b3IgPSBzZWw7XG4gICAgICAgIHZhciBjdXJyZW50Q29tYmluYXRvciA9ICdzdWJ0cmVlJztcbiAgICAgICAgdmFyIHRhaWwgPSB1bmRlZmluZWQ7XG4gICAgICAgIHZhciBfbG9vcF8xID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdGFpbCA9IGN1cnJlbnRTZWxlY3Rvci5uZXh0U2VsZWN0b3I7XG4gICAgICAgICAgICBjdXJyZW50U2VsZWN0b3IubmV4dFNlbGVjdG9yID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGN1cnJlbnRDb21iaW5hdG9yID09PSAnc3VidHJlZScgfHxcbiAgICAgICAgICAgICAgICBjdXJyZW50Q29tYmluYXRvciA9PT0gJ2NoaWxkJykge1xuICAgICAgICAgICAgICAgIHZhciBkZXB0aF8xID0gY3VycmVudENvbWJpbmF0b3IgPT09ICdzdWJ0cmVlJyA/IEluZmluaXR5IDogMTtcbiAgICAgICAgICAgICAgICByZXN1bHRzID0gcmVzdWx0c1xuICAgICAgICAgICAgICAgICAgICAubWFwKGZ1bmN0aW9uIChuKSB7IHJldHVybiBmaW5kU3VidHJlZShjdXJyZW50U2VsZWN0b3IsIGRlcHRoXzEsIG4pOyB9KVxuICAgICAgICAgICAgICAgICAgICAucmVkdWNlKGZ1bmN0aW9uIChhY2MsIGN1cnIpIHsgcmV0dXJuIGFjYy5jb25jYXQoY3Vycik7IH0sIFtdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciBuZXh0XzEgPSBjdXJyZW50Q29tYmluYXRvciA9PT0gJ25leHRTaWJsaW5nJztcbiAgICAgICAgICAgICAgICByZXN1bHRzID0gcmVzdWx0c1xuICAgICAgICAgICAgICAgICAgICAubWFwKGZ1bmN0aW9uIChuKSB7IHJldHVybiBmaW5kU2libGluZyhjdXJyZW50U2VsZWN0b3IsIG5leHRfMSwgbik7IH0pXG4gICAgICAgICAgICAgICAgICAgIC5yZWR1Y2UoZnVuY3Rpb24gKGFjYywgY3VycikgeyByZXR1cm4gYWNjLmNvbmNhdChjdXJyKTsgfSwgW10pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRhaWwpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW50U2VsZWN0b3IgPSB0YWlsWzFdO1xuICAgICAgICAgICAgICAgIGN1cnJlbnRDb21iaW5hdG9yID0gdGFpbFswXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgZG8ge1xuICAgICAgICAgICAgX2xvb3BfMSgpO1xuICAgICAgICB9IHdoaWxlICh0YWlsICE9PSB1bmRlZmluZWQpO1xuICAgICAgICByZXR1cm4gcmVzdWx0cztcbiAgICB9O1xuf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ZWxlY3RvcjtcbmZ1bmN0aW9uIHBhcnNlQXR0clZhbHVlKHYpIHtcbiAgICBpZiAodi5zdGFydHNXaXRoKCdcIicpKSB7XG4gICAgICAgIHJldHVybiB2LnNsaWNlKDEsIC0xKTtcbiAgICB9XG4gICAgaWYgKHYgPT09IFwidHJ1ZVwiKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cbiAgICBpZiAodiA9PT0gXCJmYWxzZVwiKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG4gICAgdmFyIGYgPSBwYXJzZUZsb2F0KHYpO1xuICAgIGlmIChpc05hTihmKSkge1xuICAgICAgICByZXR1cm4gdjtcbiAgICB9XG4gICAgcmV0dXJuIGY7XG59XG5mdW5jdGlvbiBwb3N0UHJvY2Vzc1BzZXVkb3Moc2VsKSB7XG4gICAgaWYgKHNlbCA9PT0gJ2ZpcnN0LWNoaWxkJyB8fFxuICAgICAgICBzZWwgPT09ICdsYXN0LWNoaWxkJyB8fFxuICAgICAgICBzZWwgPT09ICdyb290JyB8fFxuICAgICAgICBzZWwgPT09ICdlbXB0eScpIHtcbiAgICAgICAgcmV0dXJuIFtzZWwsIHVuZGVmaW5lZF07XG4gICAgfVxuICAgIGlmIChzZWwuc3RhcnRzV2l0aCgnY29udGFpbnMnKSkge1xuICAgICAgICB2YXIgdGV4dCA9IHNlbC5zbGljZSgxMCwgLTIpO1xuICAgICAgICByZXR1cm4gWydjb250YWlucycsIHRleHRdO1xuICAgIH1cbiAgICB2YXIgY29udGVudCA9IHNlbC5zbGljZSgxMCwgLTEpO1xuICAgIGlmIChjb250ZW50ID09PSAnZXZlbicpIHtcbiAgICAgICAgY29udGVudCA9ICcybic7XG4gICAgfVxuICAgIGlmIChjb250ZW50ID09PSAnb2RkJykge1xuICAgICAgICBjb250ZW50ID0gJzJuKzEnO1xuICAgIH1cbiAgICByZXR1cm4gWydudGgtY2hpbGQnLCBjb250ZW50XTtcbn1cbmZ1bmN0aW9uIGdldE9wKG9wKSB7XG4gICAgc3dpdGNoIChvcCkge1xuICAgICAgICBjYXNlICc9JzpcbiAgICAgICAgICAgIHJldHVybiAnZXhhY3QnO1xuICAgICAgICBjYXNlICdePSc6XG4gICAgICAgICAgICByZXR1cm4gJ3N0YXJ0c1dpdGgnO1xuICAgICAgICBjYXNlICckPSc6XG4gICAgICAgICAgICByZXR1cm4gJ2VuZHNXaXRoJztcbiAgICAgICAgY2FzZSAnKj0nOlxuICAgICAgICAgICAgcmV0dXJuICdjb250YWlucyc7XG4gICAgICAgIGNhc2UgJ349JzpcbiAgICAgICAgICAgIHJldHVybiAnd2hpdGVzcGFjZSc7XG4gICAgICAgIGNhc2UgJ3w9JzpcbiAgICAgICAgICAgIHJldHVybiAnZGFzaCc7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICByZXR1cm4gJ2hhcyc7XG4gICAgfVxufVxuZnVuY3Rpb24gZ2V0Q29tYmluYXRvcihjb21iKSB7XG4gICAgc3dpdGNoIChjb21iLnRyaW0oKSkge1xuICAgICAgICBjYXNlICc+JzpcbiAgICAgICAgICAgIHJldHVybiAnY2hpbGQnO1xuICAgICAgICBjYXNlICcrJzpcbiAgICAgICAgICAgIHJldHVybiAnbmV4dFNpYmxpbmcnO1xuICAgICAgICBjYXNlICd+JzpcbiAgICAgICAgICAgIHJldHVybiAnc2libGluZyc7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICByZXR1cm4gJ3N1YnRyZWUnO1xuICAgIH1cbn1cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXNlbGVjdG9yUGFyc2VyLmpzLm1hcCIsImltcG9ydCB7U3RyZWFtLCBJbnRlcm5hbFByb2R1Y2VyLCBJbnRlcm5hbExpc3RlbmVyLCBPdXRTZW5kZXJ9IGZyb20gJy4uL2luZGV4JztcblxuY2xhc3MgQ29uY2F0UHJvZHVjZXI8VD4gaW1wbGVtZW50cyBJbnRlcm5hbFByb2R1Y2VyPFQ+LCB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UPjtcbmV4cG9ydCBkZWZhdWx0IHhzO1xuIiwiaW1wb3J0IHtydW59IGZyb20gJ0BjeWNsZS9ydW4nO1xuaW1wb3J0IHtkaXYsIGxhYmVsLCBpbnB1dCwgaHIsIGgxLCBtYWtlRE9NRHJpdmVyfSBmcm9tICdAY3ljbGUvZG9tJztcblxuZnVuY3Rpb24gbWFpbihzb3VyY2VzKSB7XG4gIGNvbnN0IHZkb20kID0gc291cmNlcy5ET01cbiAgICAuc2VsZWN0KCcubXlpbnB1dCcpLmV2ZW50cygnaW5wdXQnKVxuICAgIC5tYXAoZXYgPT4gZXYudGFyZ2V0LnZhbHVlKVxuICAgIC5zdGFydFdpdGgoJycpXG4gICAgLm1hcChuYW1lID0+XG4gICAgICBkaXYoW1xuICAgICAgICBsYWJlbCgnTmFtZTonKSxcbiAgICAgICAgaW5wdXQoJy5teWlucHV0Jywge2F0dHJzOiB7dHlwZTogJ3RleHQnfX0pLFxuICAgICAgICBocigpLFxuICAgICAgICBoMShgSGVsbG8gJHtuYW1lfWApXG4gICAgICBdKVxuICAgICk7XG4gIHJldHVybiB7XG4gICAgRE9NOiB2ZG9tJCxcbiAgfTtcbn1cblxucnVuKG1haW4sIHtcbiAgRE9NOiBtYWtlRE9NRHJpdmVyKCcjYXBwJylcbn0pO1xuIl19 diff --git a/index.html b/index.html new file mode 100644 index 0000000..47b5430 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + example + + +
+ + + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..7751f17 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,4718 @@ +{ + "name": "example", + "version": "0.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@cycle/dom": { + "version": "22.3.0", + "resolved": "https://registry.npmjs.org/@cycle/dom/-/dom-22.3.0.tgz", + "integrity": "sha512-7VMGsiQsHp8cHD+o3HcuOrvHkTlS7TY1aNyLoEJD0p5cWmxzaiotapFH+6rDpNq4FzuiIeZLR5SPHVNEt9pBQA==", + "requires": { + "@cycle/run": "5.2.0", + "snabbdom": "0.7.3", + "snabbdom-selector": "4.1.0", + "xstream": "11.10.0" + } + }, + "@cycle/run": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@cycle/run/-/run-5.2.0.tgz", + "integrity": "sha512-FTXtJ13I8MkBo7BGBH6S41/vt/Z/s23ZjyhmyTrFGCFxBH5rtIJGcuVPwbSVRlpjFq7G2Vjxd585u+0kANhNvA==", + "requires": { + "quicktask": "1.1.0", + "xstream": "11.10.0" + } + }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "requires": { + "jsonparse": "1.3.1", + "through": "2.3.8" + } + }, + "accepts": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "dev": true, + "requires": { + "mime-types": "2.1.24", + "negotiator": "0.6.1" + } + }, + "acorn": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", + "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", + "dev": true + }, + "acorn-dynamic-import": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", + "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", + "dev": true + }, + "acorn-node": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.6.2.tgz", + "integrity": "sha512-rIhNEZuNI8ibQcL7ANm/mGyPukIaZsRNX9psFNQURyJW0nu6k8wjSDld20z6v2mDBWqX13pIEnk9gGZJHIlEXg==", + "dev": true, + "requires": { + "acorn": "6.1.1", + "acorn-dynamic-import": "4.0.0", + "acorn-walk": "6.1.1", + "xtend": "4.0.1" + } + }, + "acorn-walk": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", + "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "3.1.10", + "normalize-path": "2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + } + } + }, + "apache-crypt": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/apache-crypt/-/apache-crypt-1.2.1.tgz", + "integrity": "sha1-1vxyqm0n2ZyVqU/RiNcx7v/6Zjw=", + "dev": true, + "requires": { + "unix-crypt-td-js": "1.0.0" + } + }, + "apache-md5": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/apache-md5/-/apache-md5-1.1.2.tgz", + "integrity": "sha1-7klza2ObTxCLbp5ibG2pkwa0FpI=", + "dev": true + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, + "array-map": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "dev": true, + "requires": { + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-generator": "6.26.1", + "babel-helpers": "6.24.1", + "babel-messages": "6.23.0", + "babel-register": "6.26.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "convert-source-map": "1.6.0", + "debug": "2.6.9", + "json5": "0.5.1", + "lodash": "4.17.11", + "minimatch": "3.0.4", + "path-is-absolute": "1.0.1", + "private": "0.1.8", + "slash": "1.0.0", + "source-map": "0.5.7" + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "requires": { + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "detect-indent": "4.0.0", + "jsesc": "1.3.0", + "lodash": "4.17.11", + "source-map": "0.5.7", + "trim-right": "1.0.1" + } + }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "6.24.1", + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-define-map": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", + "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "dev": true, + "requires": { + "babel-helper-function-name": "6.24.1", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "lodash": "4.17.11" + } + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "dev": true, + "requires": { + "babel-helper-get-function-arity": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "lodash": "4.17.11" + } + }, + "babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "dev": true, + "requires": { + "babel-helper-optimise-call-expression": "6.24.1", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", + "dev": true + }, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-block-scoping": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", + "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "lodash": "4.17.11" + } + }, + "babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "dev": true, + "requires": { + "babel-helper-define-map": "6.26.0", + "babel-helper-function-name": "6.24.1", + "babel-helper-optimise-call-expression": "6.24.1", + "babel-helper-replace-supers": "6.24.1", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "dev": true, + "requires": { + "babel-helper-function-name": "6.24.1", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", + "dev": true, + "requires": { + "babel-plugin-transform-strict-mode": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-amd": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "dev": true, + "requires": { + "babel-helper-replace-supers": "6.24.1", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "dev": true, + "requires": { + "babel-helper-call-delegate": "6.24.1", + "babel-helper-get-function-arity": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "dev": true, + "requires": { + "babel-helper-regex": "6.26.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "dev": true, + "requires": { + "babel-helper-regex": "6.26.0", + "babel-runtime": "6.26.0", + "regexpu-core": "2.0.0" + } + }, + "babel-plugin-transform-object-rest-spread": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", + "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", + "dev": true, + "requires": { + "babel-plugin-syntax-object-rest-spread": "6.13.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-regenerator": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", + "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "dev": true, + "requires": { + "regenerator-transform": "0.10.1" + } + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-preset-es2015": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", + "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", + "babel-plugin-transform-es2015-block-scoping": "6.26.0", + "babel-plugin-transform-es2015-classes": "6.24.1", + "babel-plugin-transform-es2015-computed-properties": "6.24.1", + "babel-plugin-transform-es2015-destructuring": "6.23.0", + "babel-plugin-transform-es2015-duplicate-keys": "6.24.1", + "babel-plugin-transform-es2015-for-of": "6.23.0", + "babel-plugin-transform-es2015-function-name": "6.24.1", + "babel-plugin-transform-es2015-literals": "6.22.0", + "babel-plugin-transform-es2015-modules-amd": "6.24.1", + "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", + "babel-plugin-transform-es2015-modules-systemjs": "6.24.1", + "babel-plugin-transform-es2015-modules-umd": "6.24.1", + "babel-plugin-transform-es2015-object-super": "6.24.1", + "babel-plugin-transform-es2015-parameters": "6.24.1", + "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", + "babel-plugin-transform-es2015-spread": "6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "6.24.1", + "babel-plugin-transform-es2015-template-literals": "6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "6.23.0", + "babel-plugin-transform-es2015-unicode-regex": "6.24.1", + "babel-plugin-transform-regenerator": "6.26.0" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "babel-core": "6.26.3", + "babel-runtime": "6.26.0", + "core-js": "2.6.5", + "home-or-tmp": "2.0.0", + "lodash": "4.17.11", + "mkdirp": "0.5.1", + "source-map-support": "0.4.18" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "2.6.5", + "regenerator-runtime": "0.11.1" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "lodash": "4.17.11" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "debug": "2.6.9", + "globals": "9.18.0", + "invariant": "2.2.4", + "lodash": "4.17.11" + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "esutils": "2.0.2", + "lodash": "4.17.11", + "to-fast-properties": "1.0.3" + } + }, + "babelify": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/babelify/-/babelify-8.0.0.tgz", + "integrity": "sha512-xVr63fKEvMWUrrIbqlHYsMcc5Zdw4FSVesAHgkgajyCE1W8gbm9rbMakqavhxKvikGYMhEcqxTwB/gQmQ6lBtw==", + "dev": true + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "1.0.1", + "class-utils": "0.3.6", + "component-emitter": "1.3.0", + "define-property": "1.0.0", + "isobject": "3.0.1", + "mixin-deep": "1.3.1", + "pascalcase": "0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "base64-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", + "dev": true + }, + "basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", + "dev": true + }, + "bcryptjs": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", + "integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=", + "dev": true + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "repeat-element": "1.1.3", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-pack": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", + "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", + "dev": true, + "requires": { + "JSONStream": "1.3.5", + "combine-source-map": "0.8.0", + "defined": "1.0.0", + "safe-buffer": "5.1.2", + "through2": "2.0.5", + "umd": "3.0.3" + } + }, + "browser-resolve": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", + "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", + "dev": true, + "requires": { + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } + } + }, + "browserify": { + "version": "16.2.3", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.2.3.tgz", + "integrity": "sha512-zQt/Gd1+W+IY+h/xX2NYMW4orQWhqSwyV+xsblycTtpOuB27h1fZhhNQuipJ4t79ohw4P4mMem0jp/ZkISQtjQ==", + "dev": true, + "requires": { + "JSONStream": "1.3.5", + "assert": "1.4.1", + "browser-pack": "6.1.0", + "browser-resolve": "1.11.3", + "browserify-zlib": "0.2.0", + "buffer": "5.2.1", + "cached-path-relative": "1.0.2", + "concat-stream": "1.6.2", + "console-browserify": "1.1.0", + "constants-browserify": "1.0.0", + "crypto-browserify": "3.12.0", + "defined": "1.0.0", + "deps-sort": "2.0.0", + "domain-browser": "1.2.0", + "duplexer2": "0.1.4", + "events": "2.1.0", + "glob": "7.1.3", + "has": "1.0.3", + "htmlescape": "1.1.1", + "https-browserify": "1.0.0", + "inherits": "2.0.3", + "insert-module-globals": "7.2.0", + "labeled-stream-splicer": "2.0.1", + "mkdirp": "0.5.1", + "module-deps": "6.2.0", + "os-browserify": "0.3.0", + "parents": "1.0.1", + "path-browserify": "0.0.1", + "process": "0.11.10", + "punycode": "1.4.1", + "querystring-es3": "0.2.1", + "read-only-stream": "2.0.0", + "readable-stream": "2.3.6", + "resolve": "1.10.0", + "shasum": "1.0.2", + "shell-quote": "1.6.1", + "stream-browserify": "2.0.2", + "stream-http": "2.8.3", + "string_decoder": "1.2.0", + "subarg": "1.0.0", + "syntax-error": "1.4.0", + "through2": "2.0.5", + "timers-browserify": "1.4.2", + "tty-browserify": "0.0.1", + "url": "0.11.0", + "util": "0.10.4", + "vm-browserify": "1.1.0", + "xtend": "4.0.1" + } + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "1.0.3", + "cipher-base": "1.0.4", + "create-hash": "1.2.0", + "evp_bytestokey": "1.0.3", + "inherits": "2.0.3", + "safe-buffer": "5.1.2" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "1.2.0", + "browserify-des": "1.0.2", + "evp_bytestokey": "1.0.3" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "des.js": "1.0.0", + "inherits": "2.0.3", + "safe-buffer": "5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "randombytes": "2.1.0" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "elliptic": "6.4.1", + "inherits": "2.0.3", + "parse-asn1": "5.1.4" + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "1.0.10" + } + }, + "buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", + "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", + "dev": true, + "requires": { + "base64-js": "1.3.0", + "ieee754": "1.1.13" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "1.0.0", + "component-emitter": "1.3.0", + "get-value": "2.0.6", + "has-value": "1.0.0", + "isobject": "3.0.1", + "set-value": "2.0.0", + "to-object-path": "0.3.0", + "union-value": "1.0.0", + "unset-value": "1.0.0" + } + }, + "cached-path-relative": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.2.tgz", + "integrity": "sha512-5r2GqsoEb4qMTTN9J+WzXfjov+hjxT+j3u5K+kIVNIwAd99DLCJE9pBIMP1qVeybV6JiijL385Oz0DcYxfbOIg==", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "chokidar": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz", + "integrity": "sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A==", + "dev": true, + "requires": { + "anymatch": "2.0.0", + "async-each": "1.0.3", + "braces": "2.3.2", + "fsevents": "1.2.8", + "glob-parent": "3.1.0", + "inherits": "2.0.3", + "is-binary-path": "1.0.1", + "is-glob": "4.0.1", + "normalize-path": "3.0.0", + "path-is-absolute": "1.0.1", + "readdirp": "2.2.1", + "upath": "1.1.2" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.2" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "3.1.0", + "define-property": "0.2.5", + "isobject": "3.0.1", + "static-extend": "0.1.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + } + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "1.0.0", + "object-visit": "1.0.1" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colors": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", + "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==", + "dev": true + }, + "combine-source-map": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", + "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", + "dev": true, + "requires": { + "convert-source-map": "1.1.3", + "inline-source-map": "0.6.2", + "lodash.memoize": "3.0.4", + "source-map": "0.5.7" + }, + "dependencies": { + "convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "dev": true + } + } + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "1.1.1", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "typedarray": "0.0.6" + } + }, + "connect": { + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.6.tgz", + "integrity": "sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ=", + "dev": true, + "requires": { + "debug": "2.6.9", + "finalhandler": "1.1.0", + "parseurl": "1.3.3", + "utils-merge": "1.0.1" + } + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "0.1.4" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-js": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", + "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "requires": { + "object-assign": "4.1.1", + "vary": "1.1.2" + } + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.4.1" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "inherits": "2.0.3", + "md5.js": "1.3.5", + "ripemd160": "2.0.2", + "sha.js": "2.4.11" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "create-hash": "1.2.0", + "inherits": "2.0.3", + "ripemd160": "2.0.2", + "safe-buffer": "5.1.2", + "sha.js": "2.4.11" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "1.0.5", + "path-key": "2.0.1", + "semver": "5.7.0", + "shebang-command": "1.2.0", + "which": "1.3.1" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "1.0.1", + "browserify-sign": "4.0.4", + "create-ecdh": "4.0.3", + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "diffie-hellman": "5.0.3", + "inherits": "2.0.3", + "pbkdf2": "3.0.17", + "public-encrypt": "4.0.3", + "randombytes": "2.1.0", + "randomfill": "1.0.4" + } + }, + "dash-ast": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz", + "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==", + "dev": true + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "1.1.1" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "1.0.2", + "isobject": "3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "deps-sort": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", + "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", + "dev": true, + "requires": { + "JSONStream": "1.3.5", + "shasum": "1.0.2", + "subarg": "1.0.0", + "through2": "2.0.5" + } + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "detective": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz", + "integrity": "sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==", + "dev": true, + "requires": { + "acorn-node": "1.6.2", + "defined": "1.0.0", + "minimist": "1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "miller-rabin": "4.0.1", + "randombytes": "2.1.0" + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "dev": true + }, + "duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "dev": true, + "requires": { + "readable-stream": "2.3.6" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "elliptic": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", + "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.7", + "hmac-drbg": "1.0.1", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es-abstract": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "dev": true, + "requires": { + "es-to-primitive": "1.2.0", + "function-bind": "1.1.1", + "has": "1.0.3", + "is-callable": "1.1.4", + "is-regex": "1.0.4", + "object-keys": "1.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "1.1.4", + "is-date-object": "1.0.1", + "is-symbol": "1.0.2" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true + }, + "event-stream": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", + "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", + "dev": true, + "requires": { + "duplexer": "0.1.1", + "from": "0.1.7", + "map-stream": "0.1.0", + "pause-stream": "0.0.11", + "split": "0.3.3", + "stream-combiner": "0.0.4", + "through": "2.3.8" + } + }, + "events": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/events/-/events-2.1.0.tgz", + "integrity": "sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg==", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "1.3.5", + "safe-buffer": "5.1.2" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "1.0.0", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "faye-websocket": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz", + "integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=", + "dev": true, + "requires": { + "websocket-driver": "0.7.0" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "finalhandler": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", + "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.3", + "statuses": "1.3.1", + "unpipe": "1.0.0" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "0.2.2" + } + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, + "from": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.8.tgz", + "integrity": "sha512-tPvHgPGB7m40CZ68xqFGkKuzN+RnpGmSV+hgeKxhRpbxdqKXUFJGC3yonBOLzQBcJyGpdZFDfCsdOC2KFsXzeA==", + "dev": true, + "optional": true, + "requires": { + "nan": "2.13.2", + "node-pre-gyp": "0.12.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.3.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "2.3.5" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.3" + } + }, + "glob": { + "version": "7.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": "2.1.2" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "minipass": { + "version": "2.3.5", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.1.2", + "yallist": "3.0.3" + } + }, + "minizlib": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "2.3.5" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.3.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "4.1.1", + "iconv-lite": "0.4.24", + "sax": "1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "1.0.3", + "mkdirp": "0.5.1", + "needle": "2.3.0", + "nopt": "4.0.1", + "npm-packlist": "1.4.1", + "npmlog": "4.1.2", + "rc": "1.2.8", + "rimraf": "2.6.3", + "semver": "5.7.0", + "tar": "4.4.8" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.1", + "osenv": "0.1.5" + } + }, + "npm-bundled": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "3.0.1", + "npm-bundled": "1.0.6" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.5", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "0.6.0", + "ini": "1.3.5", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "rimraf": { + "version": "2.6.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.7.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "1.1.1", + "fs-minipass": "1.2.5", + "minipass": "2.3.5", + "minizlib": "1.2.1", + "mkdirp": "0.5.1", + "safe-buffer": "5.1.2", + "yallist": "3.0.3" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "3.0.3", + "bundled": true, + "dev": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "get-assigned-identifiers": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", + "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "3.1.0", + "path-dirname": "1.0.2" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "2.1.1" + } + } + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "2.0.6", + "has-values": "1.0.0", + "isobject": "3.0.1" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.2" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "1.1.7", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "htmlescape": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", + "dev": true + }, + "http-auth": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/http-auth/-/http-auth-3.1.3.tgz", + "integrity": "sha1-lFz63WZSHq+PfISRPTd9exXyTjE=", + "dev": true, + "requires": { + "apache-crypt": "1.2.1", + "apache-md5": "1.1.2", + "bcryptjs": "2.4.3", + "uuid": "3.3.2" + } + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "dev": true, + "requires": { + "depd": "1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": "1.5.0" + }, + "dependencies": { + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true + } + } + }, + "http-parser-js": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.0.tgz", + "integrity": "sha512-cZdEF7r4gfRIq7ezX9J0T+kQmJNOub71dWbgAXVHDct80TKP4MCETtZQ31xyv38UwgzkWPYF/Xc0ge55dW9Z9w==", + "dev": true + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inline-source-map": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "insert-module-globals": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.0.tgz", + "integrity": "sha512-VE6NlW+WGn2/AeOMd496AHFYmE7eLKkUY6Ty31k4og5vmA3Fjuwe9v6ifH6Xx/Hz27QvdoMoviw1/pqWRB09Sw==", + "dev": true, + "requires": { + "JSONStream": "1.3.5", + "acorn-node": "1.6.2", + "combine-source-map": "0.8.0", + "concat-stream": "1.6.2", + "is-buffer": "1.1.6", + "path-is-absolute": "1.0.1", + "process": "0.11.10", + "through2": "2.0.5", + "undeclared-identifiers": "1.1.3", + "xtend": "4.0.1" + } + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "1.4.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "1.13.1" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "3.0.1" + } + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "1.0.3" + } + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "1.0.0" + } + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-stable-stringify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", + "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "labeled-stream-splicer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.1.tgz", + "integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "isarray": "2.0.4", + "stream-splicer": "2.0.0" + }, + "dependencies": { + "isarray": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz", + "integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==", + "dev": true + } + } + }, + "live-server": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/live-server/-/live-server-1.2.1.tgz", + "integrity": "sha512-Yn2XCVjErTkqnM3FfTmM7/kWy3zP7+cEtC7x6u+wUzlQ+1UW3zEYbbyJrc0jNDwiMDZI0m4a0i3dxlGHVyXczw==", + "dev": true, + "requires": { + "chokidar": "2.1.5", + "colors": "1.3.3", + "connect": "3.6.6", + "cors": "2.8.5", + "event-stream": "3.3.4", + "faye-websocket": "0.11.1", + "http-auth": "3.1.3", + "morgan": "1.9.1", + "object-assign": "4.1.1", + "opn": "6.0.0", + "proxy-middleware": "0.15.0", + "send": "0.16.2", + "serve-index": "1.9.1" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "4.1.15", + "parse-json": "4.0.0", + "pify": "3.0.0", + "strip-bom": "3.0.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "lodash.memoize": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "3.0.2" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-stream": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", + "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "1.0.1" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "3.0.4", + "inherits": "2.0.3", + "safe-buffer": "5.1.2" + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.13", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0" + } + }, + "mime": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", + "dev": true + }, + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "dev": true + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "dev": true, + "requires": { + "mime-db": "1.40.0" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "1.0.2", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "module-deps": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.0.tgz", + "integrity": "sha512-hKPmO06so6bL/ZvqVNVqdTVO8UAYsi3tQWlCa+z9KuWhoN4KDQtb5hcqQQv58qYiDE21wIvnttZEPiDgEbpwbA==", + "dev": true, + "requires": { + "JSONStream": "1.3.5", + "browser-resolve": "1.11.3", + "cached-path-relative": "1.0.2", + "concat-stream": "1.6.2", + "defined": "1.0.0", + "detective": "5.2.0", + "duplexer2": "0.1.4", + "inherits": "2.0.3", + "parents": "1.0.1", + "readable-stream": "2.3.6", + "resolve": "1.10.0", + "stream-combiner2": "1.1.1", + "subarg": "1.0.0", + "through2": "2.0.5", + "xtend": "4.0.1" + } + }, + "morgan": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.1.tgz", + "integrity": "sha512-HQStPIV4y3afTiCYVxirakhlCfGkI161c76kKFca7Fk1JusM//Qeo1ej2XaMniiNeaZklMVrh3vTtIzpzwbpmA==", + "dev": true, + "requires": { + "basic-auth": "2.0.1", + "debug": "2.6.9", + "depd": "1.1.2", + "on-finished": "2.3.0", + "on-headers": "1.0.2" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "nan": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "fragment-cache": "0.2.1", + "is-windows": "1.0.2", + "kind-of": "6.0.2", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "2.7.1", + "resolve": "1.10.0", + "semver": "5.7.0", + "validate-npm-package-license": "3.0.4" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "chalk": "2.4.2", + "cross-spawn": "6.0.5", + "memorystream": "0.3.1", + "minimatch": "3.0.4", + "pidtree": "0.3.0", + "read-pkg": "3.0.0", + "shell-quote": "1.6.1", + "string.prototype.padend": "3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.3" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.5.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "0.1.1", + "define-property": "0.2.5", + "kind-of": "3.2.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "3.0.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "3.0.1" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "opn": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-6.0.0.tgz", + "integrity": "sha512-I9PKfIZC+e4RXZ/qr1RhgyCnGgYX0UEIlXgWnCOVACIvFgaC9rz6Won7xbdhoHrd8IIhV7YEpHjreNUNkqCGkQ==", + "dev": true, + "requires": { + "is-wsl": "1.1.0" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "outpipe": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/outpipe/-/outpipe-1.1.1.tgz", + "integrity": "sha1-UM+GFjZeh+Ax4ppeyTOaPaRyX6I=", + "dev": true, + "requires": { + "shell-quote": "1.6.1" + } + }, + "pako": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", + "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", + "dev": true + }, + "parents": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "dev": true, + "requires": { + "path-platform": "0.11.15" + } + }, + "parse-asn1": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", + "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", + "dev": true, + "requires": { + "asn1.js": "4.10.1", + "browserify-aes": "1.2.0", + "create-hash": "1.2.0", + "evp_bytestokey": "1.0.3", + "pbkdf2": "3.0.17", + "safe-buffer": "5.1.2" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "1.3.2", + "json-parse-better-errors": "1.0.2" + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-platform": { + "version": "0.11.15", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "3.0.0" + } + }, + "pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "dev": true, + "requires": { + "through": "2.3.8" + } + }, + "pbkdf2": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "dev": true, + "requires": { + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "ripemd160": "2.0.2", + "safe-buffer": "5.1.2", + "sha.js": "2.4.11" + } + }, + "pidtree": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.0.tgz", + "integrity": "sha512-9CT4NFlDcosssyg8KVFltgokyKZIFjoBxw8CTGy+5F38Y1eQWrt8tRayiUOXE+zVKQnYu5BR8JjCtvK3BcnBhg==", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "proxy-middleware": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/proxy-middleware/-/proxy-middleware-0.15.0.tgz", + "integrity": "sha1-o/3xvvtzD5UZZYcqwvYHTGFHelY=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.2.0", + "parse-asn1": "5.1.4", + "randombytes": "2.1.0", + "safe-buffer": "5.1.2" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "quicktask": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quicktask/-/quicktask-1.1.0.tgz", + "integrity": "sha512-b3w19IEXnt5auacLAbePVsqPyVQUwmuhJQrrWnVhm4pP8PAMg2U9vFHbAD9XYXXbMDjdLJs0x5NLqwTV8uFK4g==" + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "2.1.0", + "safe-buffer": "5.1.2" + } + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "dev": true + }, + "read-only-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "dev": true, + "requires": { + "readable-stream": "2.3.6" + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "4.0.0", + "normalize-package-data": "2.5.0", + "path-type": "3.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + }, + "dependencies": { + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + } + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "4.1.15", + "micromatch": "3.1.10", + "readable-stream": "2.3.6" + } + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "regenerator-transform": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "private": "0.1.8" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "3.0.2", + "safe-regex": "1.1.0" + } + }, + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "requires": { + "regenerate": "1.4.0", + "regjsgen": "0.2.0", + "regjsparser": "0.1.5" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "1.0.2" + } + }, + "resolve": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", + "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "dev": true, + "requires": { + "path-parse": "1.0.6" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "3.0.4", + "inherits": "2.0.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "0.1.15" + } + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + }, + "send": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "1.1.2", + "destroy": "1.0.4", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "fresh": "0.5.2", + "http-errors": "1.6.3", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.4.0" + }, + "dependencies": { + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", + "dev": true + } + } + }, + "serve-index": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", + "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", + "dev": true, + "requires": { + "accepts": "1.3.5", + "batch": "0.6.1", + "debug": "2.6.9", + "escape-html": "1.0.3", + "http-errors": "1.6.3", + "mime-types": "2.1.24", + "parseurl": "1.3.3" + } + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "split-string": "3.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.2" + } + }, + "shasum": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", + "dev": true, + "requires": { + "json-stable-stringify": "0.0.1", + "sha.js": "2.4.11" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "0.0.1", + "array-map": "0.0.0", + "array-reduce": "0.0.0", + "jsonify": "0.0.0" + } + }, + "simple-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", + "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", + "dev": true + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "snabbdom": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/snabbdom/-/snabbdom-0.7.3.tgz", + "integrity": "sha512-XNh90GQiV36hWdfSL46fIVrSSvmBuZlWk3++qaEgBeQWQJCqTphcbjTODPv8/vyZHJaB3VhePsWfGxi/zBxXyw==" + }, + "snabbdom-selector": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/snabbdom-selector/-/snabbdom-selector-4.1.0.tgz", + "integrity": "sha512-NDWOVSUR6yPlxH2F9XRwnF59UObLnItfSXcIw6+azkyrEDqT2c8pZ85UHvjijsgdve3g19qsC0/69tB5eZqTvA==", + "requires": { + "tree-selector": "2.1.0" + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "0.11.2", + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "map-cache": "0.2.2", + "source-map": "0.5.7", + "source-map-resolve": "0.5.2", + "use": "3.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "1.0.0", + "isobject": "3.0.1", + "snapdragon-util": "3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "2.1.2", + "decode-uri-component": "0.2.0", + "resolve-url": "0.2.1", + "source-map-url": "0.4.0", + "urix": "0.1.0" + } + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.4" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "2.2.0", + "spdx-license-ids": "3.0.4" + } + }, + "spdx-license-ids": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", + "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", + "dev": true + }, + "split": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", + "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", + "dev": true, + "requires": { + "through": "2.3.8" + } + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "3.0.2" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "0.2.5", + "object-copy": "0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + } + } + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", + "dev": true + }, + "stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.6" + } + }, + "stream-combiner": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", + "dev": true, + "requires": { + "duplexer": "0.1.1" + } + }, + "stream-combiner2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "dev": true, + "requires": { + "duplexer2": "0.1.4", + "readable-stream": "2.3.6" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dev": true, + "requires": { + "builtin-status-codes": "3.0.0", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "to-arraybuffer": "1.0.1", + "xtend": "4.0.1" + } + }, + "stream-splicer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", + "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.6" + } + }, + "string.prototype.padend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz", + "integrity": "sha1-86rvfBcZ8XDF6rHDK/eA2W4h8vA=", + "dev": true, + "requires": { + "define-properties": "1.1.3", + "es-abstract": "1.13.0", + "function-bind": "1.1.1" + } + }, + "string_decoder": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", + "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "subarg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "dev": true, + "requires": { + "minimist": "1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" + }, + "syntax-error": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", + "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", + "dev": true, + "requires": { + "acorn-node": "1.6.2" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "2.3.6", + "xtend": "4.0.1" + } + }, + "timers-browserify": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "dev": true, + "requires": { + "process": "0.11.10" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "regex-not": "1.0.2", + "safe-regex": "1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "3.0.0", + "repeat-string": "1.6.1" + } + }, + "tree-selector": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tree-selector/-/tree-selector-2.1.0.tgz", + "integrity": "sha512-Giao15zxN5PvdzJv7HDubn3aSrlsWD9TG9xngYkiuChhIgPH6cQqvCGV5sJ/sWahm7nRtPx46hKax81eyz1sOg==" + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "umd": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", + "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", + "dev": true + }, + "undeclared-identifiers": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz", + "integrity": "sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==", + "dev": true, + "requires": { + "acorn-node": "1.6.2", + "dash-ast": "1.0.0", + "get-assigned-identifiers": "1.2.0", + "simple-concat": "1.0.0", + "xtend": "4.0.1" + } + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "3.1.0", + "get-value": "2.0.6", + "is-extendable": "0.1.1", + "set-value": "0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" + } + } + } + }, + "unix-crypt-td-js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unix-crypt-td-js/-/unix-crypt-td-js-1.0.0.tgz", + "integrity": "sha1-HAgkFQSBvHoB1J6Y8exmjYJBLzs=", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "0.3.1", + "isobject": "3.0.1" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "2.0.6", + "has-values": "0.1.4", + "isobject": "2.1.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "upath": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", + "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", + "dev": true + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "3.1.0", + "spdx-expression-parse": "3.0.0" + } + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true + }, + "vm-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", + "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", + "dev": true + }, + "watchify": { + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/watchify/-/watchify-3.11.1.tgz", + "integrity": "sha512-WwnUClyFNRMB2NIiHgJU9RQPQNqVeFk7OmZaWf5dC5EnNa0Mgr7imBydbaJ7tGTuPM2hz1Cb4uiBvK9NVxMfog==", + "dev": true, + "requires": { + "anymatch": "2.0.0", + "browserify": "16.2.3", + "chokidar": "2.1.5", + "defined": "1.0.0", + "outpipe": "1.1.1", + "through2": "2.0.5", + "xtend": "4.0.1" + } + }, + "websocket-driver": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz", + "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=", + "dev": true, + "requires": { + "http-parser-js": "0.5.0", + "websocket-extensions": "0.1.3" + } + }, + "websocket-extensions": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", + "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xstream": { + "version": "11.10.0", + "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.10.0.tgz", + "integrity": "sha512-jzFCiRqGtrJi2S1/RPxVFgJwWVBzy4suMPBXlhOi0BJC7VvsXgo2yOHWnOasnj24n2Dlj2Mgfl6fJXPOYmpHFA==", + "requires": { + "symbol-observable": "1.2.0" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..0d45422 --- /dev/null +++ b/package.json @@ -0,0 +1,30 @@ +{ + "name": "example", + "version": "0.0.0", + "description": "", + "scripts": { + "build": "browserify src/index.js -t babelify --outfile dist/index.js -dv", + "watch": "mkdirp dist && watchify src/index.js -t babelify --outfile dist/index.js -dv", + "live-server": "\"live-server --watch=./dist/index.js,./index.html\"", + "start": "npm-run-all watch live-server" + }, + "repository": "", + "author": "Michael Jae-Yoon Chung", + "license": "MIT", + "dependencies": { + "@cycle/dom": "^22.3.0", + "@cycle/run": "^5.2.0", + "xstream": "^11.10.0" + }, + "devDependencies": { + "babel-core": "^6.26.3", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-preset-es2015": "^6.24.1", + "babelify": "^8.0.0", + "browserify": "^16.2.2", + "live-server": "^1.2.0", + "mkdirp": "~0.5.0", + "npm-run-all": "^4.1.5", + "watchify": "^3.11.0" + } +} diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..2f0e95c --- /dev/null +++ b/src/index.js @@ -0,0 +1,24 @@ +import {run} from '@cycle/run'; +import {div, label, input, hr, h1, makeDOMDriver} from '@cycle/dom'; + +function main(sources) { + const vdom$ = sources.DOM + .select('.myinput').events('input') + .map(ev => ev.target.value) + .startWith('') + .map(name => + div([ + label('Name:'), + input('.myinput', {attrs: {type: 'text'}}), + hr(), + h1(`Hello ${name}`) + ]) + ); + return { + DOM: vdom$, + }; +} + +run(main, { + DOM: makeDOMDriver('#app') +});