removed npm frontend assets from repo, installed using npm install postinstall script

This commit is contained in:
Torkel Ödegaard
2016-01-28 14:37:24 -05:00
parent 600ffa727e
commit 9914714eeb
85 changed files with 3 additions and 231901 deletions

View File

@@ -59,7 +59,8 @@
},
"scripts": {
"test": "grunt test",
"coveralls": "grunt karma:coveralls && rm -rf ./coverage"
"coveralls": "grunt karma:coveralls && rm -rf ./coverage",
"postinstall": "grunt copy:node_modules"
},
"license": "Apache-2.0",
"dependencies": {

View File

@@ -1,5 +0,0 @@
export { Animation } from './src/animate/animation';
export { AnimationBuilder } from './src/animate/animation_builder';
export { BrowserDetails } from './src/animate/browser_details';
export { CssAnimationBuilder } from './src/animate/css_animation_builder';
export { CssAnimationOptions } from './src/animate/css_animation_options';

View File

@@ -1,6 +0,0 @@
/**
* See {@link bootstrap} for more information.
* @deprecated
*/
export { bootstrap } from 'angular2/platform/browser';
export { AngularEntrypoint } from 'angular2/src/core/angular_entrypoint';

View File

@@ -1,6 +0,0 @@
/**
* See {@link bootstrap} for more information.
* @deprecated
*/
export { bootstrapStatic } from 'angular2/platform/browser_static';
export { AngularEntrypoint } from 'angular2/src/core/angular_entrypoint';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -1,774 +0,0 @@
"format register";
System.register("angular2/src/upgrade/metadata", ["angular2/core"], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
var core_1 = require("angular2/core");
var COMPONENT_SELECTOR = /^[\w|-]*$/;
var SKEWER_CASE = /-(\w)/g;
var directiveResolver = new core_1.DirectiveResolver();
function getComponentInfo(type) {
var resolvedMetadata = directiveResolver.resolve(type);
var selector = resolvedMetadata.selector;
if (!selector.match(COMPONENT_SELECTOR)) {
throw new Error('Only selectors matching element names are supported, got: ' + selector);
}
var selector = selector.replace(SKEWER_CASE, function(all, letter) {
return letter.toUpperCase();
});
return {
type: type,
selector: selector,
inputs: parseFields(resolvedMetadata.inputs),
outputs: parseFields(resolvedMetadata.outputs)
};
}
exports.getComponentInfo = getComponentInfo;
function parseFields(names) {
var attrProps = [];
if (names) {
for (var i = 0; i < names.length; i++) {
var parts = names[i].split(':');
var prop = parts[0].trim();
var attr = (parts[1] || parts[0]).trim();
var capitalAttr = attr.charAt(0).toUpperCase() + attr.substr(1);
attrProps.push({
prop: prop,
attr: attr,
bracketAttr: "[" + attr + "]",
parenAttr: "(" + attr + ")",
bracketParenAttr: "[(" + attr + ")]",
onAttr: "on" + capitalAttr,
bindAttr: "bind" + capitalAttr,
bindonAttr: "bindon" + capitalAttr
});
}
}
return attrProps;
}
exports.parseFields = parseFields;
global.define = __define;
return module.exports;
});
System.register("angular2/src/upgrade/util", [], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
function stringify(obj) {
if (typeof obj == 'function')
return obj.name || obj.toString();
return '' + obj;
}
exports.stringify = stringify;
function onError(e) {
console.log(e, e.stack);
throw e;
}
exports.onError = onError;
function controllerKey(name) {
return '$' + name + 'Controller';
}
exports.controllerKey = controllerKey;
global.define = __define;
return module.exports;
});
System.register("angular2/src/upgrade/constants", [], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
exports.NG2_APP_VIEW_MANAGER = 'ng2.AppViewManager';
exports.NG2_COMPILER = 'ng2.Compiler';
exports.NG2_INJECTOR = 'ng2.Injector';
exports.NG2_PROTO_VIEW_REF_MAP = 'ng2.ProtoViewRefMap';
exports.NG2_ZONE = 'ng2.NgZone';
exports.NG1_CONTROLLER = '$controller';
exports.NG1_SCOPE = '$scope';
exports.NG1_ROOT_SCOPE = '$rootScope';
exports.NG1_COMPILE = '$compile';
exports.NG1_HTTP_BACKEND = '$httpBackend';
exports.NG1_INJECTOR = '$injector';
exports.NG1_PARSE = '$parse';
exports.NG1_TEMPLATE_CACHE = '$templateCache';
exports.REQUIRE_INJECTOR = '^' + exports.NG2_INJECTOR;
global.define = __define;
return module.exports;
});
System.register("angular2/src/upgrade/downgrade_ng2_adapter", ["angular2/core", "angular2/src/upgrade/constants"], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
var core_1 = require("angular2/core");
var constants_1 = require("angular2/src/upgrade/constants");
var INITIAL_VALUE = {__UNINITIALIZED__: true};
var DowngradeNg2ComponentAdapter = (function() {
function DowngradeNg2ComponentAdapter(id, info, element, attrs, scope, parentInjector, parse, viewManager, protoView) {
this.id = id;
this.info = info;
this.element = element;
this.attrs = attrs;
this.scope = scope;
this.parentInjector = parentInjector;
this.parse = parse;
this.viewManager = viewManager;
this.protoView = protoView;
this.component = null;
this.inputChangeCount = 0;
this.inputChanges = null;
this.hostViewRef = null;
this.changeDetector = null;
this.contentInserctionPoint = null;
this.element[0].id = id;
this.componentScope = scope.$new();
this.childNodes = element.contents();
}
DowngradeNg2ComponentAdapter.prototype.bootstrapNg2 = function() {
var childInjector = this.parentInjector.resolveAndCreateChild([core_1.provide(constants_1.NG1_SCOPE, {useValue: this.componentScope})]);
this.hostViewRef = this.viewManager.createRootHostView(this.protoView, '#' + this.id, childInjector);
var renderer = this.hostViewRef.render;
var hostElement = this.viewManager.getHostElement(this.hostViewRef);
this.changeDetector = this.hostViewRef.changeDetectorRef;
this.component = this.viewManager.getComponent(hostElement);
this.contentInserctionPoint = renderer.rootContentInsertionPoints[0];
};
DowngradeNg2ComponentAdapter.prototype.setupInputs = function() {
var _this = this;
var attrs = this.attrs;
var inputs = this.info.inputs;
for (var i = 0; i < inputs.length; i++) {
var input = inputs[i];
var expr = null;
if (attrs.hasOwnProperty(input.attr)) {
var observeFn = (function(prop) {
var prevValue = INITIAL_VALUE;
return function(value) {
if (_this.inputChanges !== null) {
_this.inputChangeCount++;
_this.inputChanges[prop] = new Ng1Change(value, prevValue === INITIAL_VALUE ? value : prevValue);
prevValue = value;
}
_this.component[prop] = value;
};
})(input.prop);
attrs.$observe(input.attr, observeFn);
} else if (attrs.hasOwnProperty(input.bindAttr)) {
expr = attrs[input.bindAttr];
} else if (attrs.hasOwnProperty(input.bracketAttr)) {
expr = attrs[input.bracketAttr];
} else if (attrs.hasOwnProperty(input.bindonAttr)) {
expr = attrs[input.bindonAttr];
} else if (attrs.hasOwnProperty(input.bracketParenAttr)) {
expr = attrs[input.bracketParenAttr];
}
if (expr != null) {
var watchFn = (function(prop) {
return function(value, prevValue) {
if (_this.inputChanges != null) {
_this.inputChangeCount++;
_this.inputChanges[prop] = new Ng1Change(prevValue, value);
}
_this.component[prop] = value;
};
})(input.prop);
this.componentScope.$watch(expr, watchFn);
}
}
var prototype = this.info.type.prototype;
if (prototype && prototype.ngOnChanges) {
this.inputChanges = {};
this.componentScope.$watch(function() {
return _this.inputChangeCount;
}, function() {
var inputChanges = _this.inputChanges;
_this.inputChanges = {};
_this.component.ngOnChanges(inputChanges);
});
}
this.componentScope.$watch(function() {
return _this.changeDetector && _this.changeDetector.detectChanges();
});
};
DowngradeNg2ComponentAdapter.prototype.projectContent = function() {
var childNodes = this.childNodes;
if (this.contentInserctionPoint) {
var parent = this.contentInserctionPoint.parentNode;
for (var i = 0,
ii = childNodes.length; i < ii; i++) {
parent.insertBefore(childNodes[i], this.contentInserctionPoint);
}
}
};
DowngradeNg2ComponentAdapter.prototype.setupOutputs = function() {
var _this = this;
var attrs = this.attrs;
var outputs = this.info.outputs;
for (var j = 0; j < outputs.length; j++) {
var output = outputs[j];
var expr = null;
var assignExpr = false;
var bindonAttr = output.bindonAttr ? output.bindonAttr.substring(0, output.bindonAttr.length - 6) : null;
var bracketParenAttr = output.bracketParenAttr ? "[(" + output.bracketParenAttr.substring(2, output.bracketParenAttr.length - 8) + ")]" : null;
if (attrs.hasOwnProperty(output.onAttr)) {
expr = attrs[output.onAttr];
} else if (attrs.hasOwnProperty(output.parenAttr)) {
expr = attrs[output.parenAttr];
} else if (attrs.hasOwnProperty(bindonAttr)) {
expr = attrs[bindonAttr];
assignExpr = true;
} else if (attrs.hasOwnProperty(bracketParenAttr)) {
expr = attrs[bracketParenAttr];
assignExpr = true;
}
if (expr != null && assignExpr != null) {
var getter = this.parse(expr);
var setter = getter.assign;
if (assignExpr && !setter) {
throw new Error("Expression '" + expr + "' is not assignable!");
}
var emitter = this.component[output.prop];
if (emitter) {
emitter.subscribe({next: assignExpr ? (function(setter) {
return function(value) {
return setter(_this.scope, value);
};
})(setter) : (function(getter) {
return function(value) {
return getter(_this.scope, {$event: value});
};
})(getter)});
} else {
throw new Error("Missing emitter '" + output.prop + "' on component '" + this.info.selector + "'!");
}
}
}
};
DowngradeNg2ComponentAdapter.prototype.registerCleanup = function() {
var _this = this;
this.element.bind('$remove', function() {
return _this.viewManager.destroyRootHostView(_this.hostViewRef);
});
};
return DowngradeNg2ComponentAdapter;
})();
exports.DowngradeNg2ComponentAdapter = DowngradeNg2ComponentAdapter;
var Ng1Change = (function() {
function Ng1Change(previousValue, currentValue) {
this.previousValue = previousValue;
this.currentValue = currentValue;
}
Ng1Change.prototype.isFirstChange = function() {
return this.previousValue === this.currentValue;
};
return Ng1Change;
})();
global.define = __define;
return module.exports;
});
System.register("angular2/src/upgrade/angular_js", [], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
function noNg() {
throw new Error('AngularJS v1.x is not loaded!');
}
var angular = {
bootstrap: noNg,
module: noNg,
element: noNg,
version: noNg
};
try {
if (window.hasOwnProperty('angular')) {
angular = window.angular;
}
} catch (e) {}
exports.bootstrap = angular.bootstrap;
exports.module = angular.module;
exports.element = angular.element;
exports.version = angular.version;
global.define = __define;
return module.exports;
});
System.register("angular2/src/upgrade/upgrade_ng1_adapter", ["angular2/core", "angular2/src/upgrade/constants", "angular2/src/upgrade/util", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
var core_1 = require("angular2/core");
var constants_1 = require("angular2/src/upgrade/constants");
var util_1 = require("angular2/src/upgrade/util");
var angular = require("angular2/src/upgrade/angular_js");
var CAMEL_CASE = /([A-Z])/g;
var INITIAL_VALUE = {__UNINITIALIZED__: true};
var NOT_SUPPORTED = 'NOT_SUPPORTED';
var UpgradeNg1ComponentAdapterBuilder = (function() {
function UpgradeNg1ComponentAdapterBuilder(name) {
this.name = name;
this.inputs = [];
this.inputsRename = [];
this.outputs = [];
this.outputsRename = [];
this.propertyOutputs = [];
this.checkProperties = [];
this.propertyMap = {};
this.linkFn = null;
this.directive = null;
this.$controller = null;
var selector = name.replace(CAMEL_CASE, function(all, next) {
return '-' + next.toLowerCase();
});
var self = this;
this.type = core_1.Directive({
selector: selector,
inputs: this.inputsRename,
outputs: this.outputsRename
}).Class({
constructor: [new core_1.Inject(constants_1.NG1_SCOPE), core_1.ElementRef, function(scope, elementRef) {
return new UpgradeNg1ComponentAdapter(self.linkFn, scope, self.directive, elementRef, self.$controller, self.inputs, self.outputs, self.propertyOutputs, self.checkProperties, self.propertyMap);
}],
ngOnChanges: function() {},
ngDoCheck: function() {}
});
}
UpgradeNg1ComponentAdapterBuilder.prototype.extractDirective = function(injector) {
var directives = injector.get(this.name + 'Directive');
if (directives.length > 1) {
throw new Error('Only support single directive definition for: ' + this.name);
}
var directive = directives[0];
if (directive.replace)
this.notSupported('replace');
if (directive.terminal)
this.notSupported('terminal');
var link = directive.link;
if (typeof link == 'object') {
if (link.post)
this.notSupported('link.post');
}
return directive;
};
UpgradeNg1ComponentAdapterBuilder.prototype.notSupported = function(feature) {
throw new Error("Upgraded directive '" + this.name + "' does not support '" + feature + "'.");
};
UpgradeNg1ComponentAdapterBuilder.prototype.extractBindings = function() {
var scope = this.directive.scope;
if (typeof scope == 'object') {
for (var name in scope) {
if (scope.hasOwnProperty(name)) {
var localName = scope[name];
var type = localName.charAt(0);
localName = localName.substr(1) || name;
var outputName = 'output_' + name;
var outputNameRename = outputName + ': ' + name;
var outputNameRenameChange = outputName + ': ' + name + 'Change';
var inputName = 'input_' + name;
var inputNameRename = inputName + ': ' + name;
switch (type) {
case '=':
this.propertyOutputs.push(outputName);
this.checkProperties.push(localName);
this.outputs.push(outputName);
this.outputsRename.push(outputNameRenameChange);
this.propertyMap[outputName] = localName;
case '@':
this.inputs.push(inputName);
this.inputsRename.push(inputNameRename);
this.propertyMap[inputName] = localName;
break;
case '&':
this.outputs.push(outputName);
this.outputsRename.push(outputNameRename);
this.propertyMap[outputName] = localName;
break;
default:
var json = JSON.stringify(scope);
throw new Error("Unexpected mapping '" + type + "' in '" + json + "' in '" + this.name + "' directive.");
}
}
}
}
};
UpgradeNg1ComponentAdapterBuilder.prototype.compileTemplate = function(compile, templateCache, httpBackend) {
var _this = this;
if (this.directive.template !== undefined) {
this.linkFn = compileHtml(this.directive.template);
} else if (this.directive.templateUrl) {
var url = this.directive.templateUrl;
var html = templateCache.get(url);
if (html !== undefined) {
this.linkFn = compileHtml(html);
} else {
return new Promise(function(resolve, err) {
httpBackend('GET', url, null, function(status, response) {
if (status == 200) {
resolve(_this.linkFn = compileHtml(templateCache.put(url, response)));
} else {
err("GET " + url + " returned " + status + ": " + response);
}
});
});
}
} else {
throw new Error("Directive '" + this.name + "' is not a component, it is missing template.");
}
return null;
function compileHtml(html) {
var div = document.createElement('div');
div.innerHTML = html;
return compile(div.childNodes);
}
};
UpgradeNg1ComponentAdapterBuilder.resolve = function(exportedComponents, injector) {
var promises = [];
var compile = injector.get(constants_1.NG1_COMPILE);
var templateCache = injector.get(constants_1.NG1_TEMPLATE_CACHE);
var httpBackend = injector.get(constants_1.NG1_HTTP_BACKEND);
var $controller = injector.get(constants_1.NG1_CONTROLLER);
for (var name in exportedComponents) {
if (exportedComponents.hasOwnProperty(name)) {
var exportedComponent = exportedComponents[name];
exportedComponent.directive = exportedComponent.extractDirective(injector);
exportedComponent.$controller = $controller;
exportedComponent.extractBindings();
var promise = exportedComponent.compileTemplate(compile, templateCache, httpBackend);
if (promise)
promises.push(promise);
}
}
return Promise.all(promises);
};
return UpgradeNg1ComponentAdapterBuilder;
})();
exports.UpgradeNg1ComponentAdapterBuilder = UpgradeNg1ComponentAdapterBuilder;
var UpgradeNg1ComponentAdapter = (function() {
function UpgradeNg1ComponentAdapter(linkFn, scope, directive, elementRef, $controller, inputs, outputs, propOuts, checkProperties, propertyMap) {
this.directive = directive;
this.inputs = inputs;
this.outputs = outputs;
this.propOuts = propOuts;
this.checkProperties = checkProperties;
this.propertyMap = propertyMap;
this.destinationObj = null;
this.checkLastValues = [];
var element = elementRef.nativeElement;
var childNodes = [];
var childNode;
while (childNode = element.firstChild) {
element.removeChild(childNode);
childNodes.push(childNode);
}
var componentScope = scope.$new(!!directive.scope);
var $element = angular.element(element);
var controllerType = directive.controller;
var controller = null;
if (controllerType) {
var locals = {
$scope: componentScope,
$element: $element
};
controller = $controller(controllerType, locals, null, directive.controllerAs);
$element.data(util_1.controllerKey(directive.name), controller);
}
var link = directive.link;
if (typeof link == 'object')
link = link.pre;
if (link) {
var attrs = NOT_SUPPORTED;
var transcludeFn = NOT_SUPPORTED;
var linkController = this.resolveRequired($element, directive.require);
directive.link(componentScope, $element, attrs, linkController, transcludeFn);
}
this.destinationObj = directive.bindToController && controller ? controller : componentScope;
linkFn(componentScope, function(clonedElement, scope) {
for (var i = 0,
ii = clonedElement.length; i < ii; i++) {
element.appendChild(clonedElement[i]);
}
}, {parentBoundTranscludeFn: function(scope, cloneAttach) {
cloneAttach(childNodes);
}});
for (var i = 0; i < inputs.length; i++) {
this[inputs[i]] = null;
}
for (var j = 0; j < outputs.length; j++) {
var emitter = this[outputs[j]] = new core_1.EventEmitter();
this.setComponentProperty(outputs[j], (function(emitter) {
return function(value) {
return emitter.emit(value);
};
})(emitter));
}
for (var k = 0; k < propOuts.length; k++) {
this[propOuts[k]] = new core_1.EventEmitter();
this.checkLastValues.push(INITIAL_VALUE);
}
}
UpgradeNg1ComponentAdapter.prototype.ngOnChanges = function(changes) {
for (var name in changes) {
if (changes.hasOwnProperty(name)) {
var change = changes[name];
this.setComponentProperty(name, change.currentValue);
}
}
};
UpgradeNg1ComponentAdapter.prototype.ngDoCheck = function() {
var count = 0;
var destinationObj = this.destinationObj;
var lastValues = this.checkLastValues;
var checkProperties = this.checkProperties;
for (var i = 0; i < checkProperties.length; i++) {
var value = destinationObj[checkProperties[i]];
var last = lastValues[i];
if (value !== last) {
if (typeof value == 'number' && isNaN(value) && typeof last == 'number' && isNaN(last)) {} else {
var eventEmitter = this[this.propOuts[i]];
eventEmitter.emit(lastValues[i] = value);
}
}
}
return count;
};
UpgradeNg1ComponentAdapter.prototype.setComponentProperty = function(name, value) {
this.destinationObj[this.propertyMap[name]] = value;
};
UpgradeNg1ComponentAdapter.prototype.resolveRequired = function($element, require) {
if (!require) {
return undefined;
} else if (typeof require == 'string') {
var name = require;
var isOptional = false;
var startParent = false;
var searchParents = false;
var ch;
if (name.charAt(0) == '?') {
isOptional = true;
name = name.substr(1);
}
if (name.charAt(0) == '^') {
searchParents = true;
name = name.substr(1);
}
if (name.charAt(0) == '^') {
startParent = true;
name = name.substr(1);
}
var key = util_1.controllerKey(name);
if (startParent)
$element = $element.parent();
var dep = searchParents ? $element.inheritedData(key) : $element.data(key);
if (!dep && !isOptional) {
throw new Error("Can not locate '" + require + "' in '" + this.directive.name + "'.");
}
return dep;
} else if (require instanceof Array) {
var deps = [];
for (var i = 0; i < require.length; i++) {
deps.push(this.resolveRequired($element, require[i]));
}
return deps;
}
throw new Error("Directive '" + this.directive.name + "' require syntax unrecognized: " + this.directive.require);
};
return UpgradeNg1ComponentAdapter;
})();
global.define = __define;
return module.exports;
});
System.register("angular2/src/upgrade/upgrade_adapter", ["angular2/core", "angular2/src/facade/async", "angular2/platform/browser", "angular2/src/upgrade/metadata", "angular2/src/upgrade/util", "angular2/src/upgrade/constants", "angular2/src/upgrade/downgrade_ng2_adapter", "angular2/src/upgrade/upgrade_ng1_adapter", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
var core_1 = require("angular2/core");
var async_1 = require("angular2/src/facade/async");
var browser_1 = require("angular2/platform/browser");
var metadata_1 = require("angular2/src/upgrade/metadata");
var util_1 = require("angular2/src/upgrade/util");
var constants_1 = require("angular2/src/upgrade/constants");
var downgrade_ng2_adapter_1 = require("angular2/src/upgrade/downgrade_ng2_adapter");
var upgrade_ng1_adapter_1 = require("angular2/src/upgrade/upgrade_ng1_adapter");
var angular = require("angular2/src/upgrade/angular_js");
var upgradeCount = 0;
var UpgradeAdapter = (function() {
function UpgradeAdapter() {
this.idPrefix = "NG2_UPGRADE_" + upgradeCount++ + "_";
this.upgradedComponents = [];
this.downgradedComponents = {};
this.providers = [];
}
UpgradeAdapter.prototype.downgradeNg2Component = function(type) {
this.upgradedComponents.push(type);
var info = metadata_1.getComponentInfo(type);
return ng1ComponentDirective(info, "" + this.idPrefix + info.selector + "_c");
};
UpgradeAdapter.prototype.upgradeNg1Component = function(name) {
if (this.downgradedComponents.hasOwnProperty(name)) {
return this.downgradedComponents[name].type;
} else {
return (this.downgradedComponents[name] = new upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder(name)).type;
}
};
UpgradeAdapter.prototype.bootstrap = function(element, modules, config) {
var _this = this;
var upgrade = new UpgradeAdapterRef();
var ng1Injector = null;
var platformRef = core_1.platform(browser_1.BROWSER_PROVIDERS);
var applicationRef = platformRef.application([browser_1.BROWSER_APP_PROVIDERS, core_1.provide(constants_1.NG1_INJECTOR, {useFactory: function() {
return ng1Injector;
}}), core_1.provide(constants_1.NG1_COMPILE, {useFactory: function() {
return ng1Injector.get(constants_1.NG1_COMPILE);
}}), this.providers]);
var injector = applicationRef.injector;
var ngZone = injector.get(core_1.NgZone);
var compiler = injector.get(core_1.Compiler);
var delayApplyExps = [];
var original$applyFn;
var rootScopePrototype;
var rootScope;
var protoViewRefMap = {};
var ng1Module = angular.module(this.idPrefix, modules);
var ng1compilePromise = null;
ng1Module.value(constants_1.NG2_INJECTOR, injector).value(constants_1.NG2_ZONE, ngZone).value(constants_1.NG2_COMPILER, compiler).value(constants_1.NG2_PROTO_VIEW_REF_MAP, protoViewRefMap).value(constants_1.NG2_APP_VIEW_MANAGER, injector.get(core_1.AppViewManager)).config(['$provide', function(provide) {
provide.decorator(constants_1.NG1_ROOT_SCOPE, ['$delegate', function(rootScopeDelegate) {
rootScopePrototype = rootScopeDelegate.constructor.prototype;
if (rootScopePrototype.hasOwnProperty('$apply')) {
original$applyFn = rootScopePrototype.$apply;
rootScopePrototype.$apply = function(exp) {
return delayApplyExps.push(exp);
};
} else {
throw new Error("Failed to find '$apply' on '$rootScope'!");
}
return rootScope = rootScopeDelegate;
}]);
}]).run(['$injector', '$rootScope', function(injector, rootScope) {
ng1Injector = injector;
async_1.ObservableWrapper.subscribe(ngZone.onTurnDone, function(_) {
ngZone.run(function() {
return rootScope.$apply();
});
});
ng1compilePromise = upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder.resolve(_this.downgradedComponents, injector);
}]);
angular.element(element).data(util_1.controllerKey(constants_1.NG2_INJECTOR), injector);
ngZone.run(function() {
angular.bootstrap(element, [_this.idPrefix], config);
});
Promise.all([this.compileNg2Components(compiler, protoViewRefMap), ng1compilePromise]).then(function() {
ngZone.run(function() {
if (rootScopePrototype) {
rootScopePrototype.$apply = original$applyFn;
while (delayApplyExps.length) {
rootScope.$apply(delayApplyExps.shift());
}
upgrade._bootstrapDone(applicationRef, ng1Injector);
rootScopePrototype = null;
}
});
}, util_1.onError);
return upgrade;
};
UpgradeAdapter.prototype.addProvider = function(provider) {
this.providers.push(provider);
};
UpgradeAdapter.prototype.upgradeNg1Provider = function(name, options) {
var token = options && options.asToken || name;
this.providers.push(core_1.provide(token, {
useFactory: function(ng1Injector) {
return ng1Injector.get(name);
},
deps: [constants_1.NG1_INJECTOR]
}));
};
UpgradeAdapter.prototype.downgradeNg2Provider = function(token) {
var factory = function(injector) {
return injector.get(token);
};
factory.$inject = [constants_1.NG2_INJECTOR];
return factory;
};
UpgradeAdapter.prototype.compileNg2Components = function(compiler, protoViewRefMap) {
var _this = this;
var promises = [];
var types = this.upgradedComponents;
for (var i = 0; i < types.length; i++) {
promises.push(compiler.compileInHost(types[i]));
}
return Promise.all(promises).then(function(protoViews) {
var types = _this.upgradedComponents;
for (var i = 0; i < protoViews.length; i++) {
protoViewRefMap[metadata_1.getComponentInfo(types[i]).selector] = protoViews[i];
}
return protoViewRefMap;
}, util_1.onError);
};
return UpgradeAdapter;
})();
exports.UpgradeAdapter = UpgradeAdapter;
function ng1ComponentDirective(info, idPrefix) {
directiveFactory.$inject = [constants_1.NG2_PROTO_VIEW_REF_MAP, constants_1.NG2_APP_VIEW_MANAGER, constants_1.NG1_PARSE];
function directiveFactory(protoViewRefMap, viewManager, parse) {
var protoView = protoViewRefMap[info.selector];
if (!protoView)
throw new Error('Expecting ProtoViewRef for: ' + info.selector);
var idCount = 0;
return {
restrict: 'E',
require: constants_1.REQUIRE_INJECTOR,
link: {post: function(scope, element, attrs, parentInjector, transclude) {
var domElement = element[0];
var facade = new downgrade_ng2_adapter_1.DowngradeNg2ComponentAdapter(idPrefix + (idCount++), info, element, attrs, scope, parentInjector, parse, viewManager, protoView);
facade.setupInputs();
facade.bootstrapNg2();
facade.projectContent();
facade.setupOutputs();
facade.registerCleanup();
}}
};
}
return directiveFactory;
}
var UpgradeAdapterRef = (function() {
function UpgradeAdapterRef() {
this._readyFn = null;
this.ng1RootScope = null;
this.ng1Injector = null;
this.ng2ApplicationRef = null;
this.ng2Injector = null;
}
UpgradeAdapterRef.prototype._bootstrapDone = function(applicationRef, ng1Injector) {
this.ng2ApplicationRef = applicationRef;
this.ng2Injector = applicationRef.injector;
this.ng1Injector = ng1Injector;
this.ng1RootScope = ng1Injector.get(constants_1.NG1_ROOT_SCOPE);
this._readyFn && this._readyFn(this);
};
UpgradeAdapterRef.prototype.ready = function(fn) {
this._readyFn = fn;
};
UpgradeAdapterRef.prototype.dispose = function() {
this.ng1Injector.get(constants_1.NG1_ROOT_SCOPE).$destroy();
this.ng2ApplicationRef.dispose();
};
return UpgradeAdapterRef;
})();
exports.UpgradeAdapterRef = UpgradeAdapterRef;
global.define = __define;
return module.exports;
});
System.register("angular2/upgrade", ["angular2/src/upgrade/upgrade_adapter"], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
var upgrade_adapter_1 = require("angular2/src/upgrade/upgrade_adapter");
exports.UpgradeAdapter = upgrade_adapter_1.UpgradeAdapter;
exports.UpgradeAdapterRef = upgrade_adapter_1.UpgradeAdapterRef;
global.define = __define;
return module.exports;
});
//# sourceMappingURLDisabled=upgrade.dev.js.map

View File

@@ -1,774 +0,0 @@
"format register";
System.register("angular2/src/upgrade/metadata", ["angular2/core"], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
var core_1 = require("angular2/core");
var COMPONENT_SELECTOR = /^[\w|-]*$/;
var SKEWER_CASE = /-(\w)/g;
var directiveResolver = new core_1.DirectiveResolver();
function getComponentInfo(type) {
var resolvedMetadata = directiveResolver.resolve(type);
var selector = resolvedMetadata.selector;
if (!selector.match(COMPONENT_SELECTOR)) {
throw new Error('Only selectors matching element names are supported, got: ' + selector);
}
var selector = selector.replace(SKEWER_CASE, function(all, letter) {
return letter.toUpperCase();
});
return {
type: type,
selector: selector,
inputs: parseFields(resolvedMetadata.inputs),
outputs: parseFields(resolvedMetadata.outputs)
};
}
exports.getComponentInfo = getComponentInfo;
function parseFields(names) {
var attrProps = [];
if (names) {
for (var i = 0; i < names.length; i++) {
var parts = names[i].split(':');
var prop = parts[0].trim();
var attr = (parts[1] || parts[0]).trim();
var capitalAttr = attr.charAt(0).toUpperCase() + attr.substr(1);
attrProps.push({
prop: prop,
attr: attr,
bracketAttr: "[" + attr + "]",
parenAttr: "(" + attr + ")",
bracketParenAttr: "[(" + attr + ")]",
onAttr: "on" + capitalAttr,
bindAttr: "bind" + capitalAttr,
bindonAttr: "bindon" + capitalAttr
});
}
}
return attrProps;
}
exports.parseFields = parseFields;
global.define = __define;
return module.exports;
});
System.register("angular2/src/upgrade/util", [], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
function stringify(obj) {
if (typeof obj == 'function')
return obj.name || obj.toString();
return '' + obj;
}
exports.stringify = stringify;
function onError(e) {
console.log(e, e.stack);
throw e;
}
exports.onError = onError;
function controllerKey(name) {
return '$' + name + 'Controller';
}
exports.controllerKey = controllerKey;
global.define = __define;
return module.exports;
});
System.register("angular2/src/upgrade/constants", [], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
exports.NG2_APP_VIEW_MANAGER = 'ng2.AppViewManager';
exports.NG2_COMPILER = 'ng2.Compiler';
exports.NG2_INJECTOR = 'ng2.Injector';
exports.NG2_PROTO_VIEW_REF_MAP = 'ng2.ProtoViewRefMap';
exports.NG2_ZONE = 'ng2.NgZone';
exports.NG1_CONTROLLER = '$controller';
exports.NG1_SCOPE = '$scope';
exports.NG1_ROOT_SCOPE = '$rootScope';
exports.NG1_COMPILE = '$compile';
exports.NG1_HTTP_BACKEND = '$httpBackend';
exports.NG1_INJECTOR = '$injector';
exports.NG1_PARSE = '$parse';
exports.NG1_TEMPLATE_CACHE = '$templateCache';
exports.REQUIRE_INJECTOR = '^' + exports.NG2_INJECTOR;
global.define = __define;
return module.exports;
});
System.register("angular2/src/upgrade/downgrade_ng2_adapter", ["angular2/core", "angular2/src/upgrade/constants"], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
var core_1 = require("angular2/core");
var constants_1 = require("angular2/src/upgrade/constants");
var INITIAL_VALUE = {__UNINITIALIZED__: true};
var DowngradeNg2ComponentAdapter = (function() {
function DowngradeNg2ComponentAdapter(id, info, element, attrs, scope, parentInjector, parse, viewManager, protoView) {
this.id = id;
this.info = info;
this.element = element;
this.attrs = attrs;
this.scope = scope;
this.parentInjector = parentInjector;
this.parse = parse;
this.viewManager = viewManager;
this.protoView = protoView;
this.component = null;
this.inputChangeCount = 0;
this.inputChanges = null;
this.hostViewRef = null;
this.changeDetector = null;
this.contentInserctionPoint = null;
this.element[0].id = id;
this.componentScope = scope.$new();
this.childNodes = element.contents();
}
DowngradeNg2ComponentAdapter.prototype.bootstrapNg2 = function() {
var childInjector = this.parentInjector.resolveAndCreateChild([core_1.provide(constants_1.NG1_SCOPE, {useValue: this.componentScope})]);
this.hostViewRef = this.viewManager.createRootHostView(this.protoView, '#' + this.id, childInjector);
var renderer = this.hostViewRef.render;
var hostElement = this.viewManager.getHostElement(this.hostViewRef);
this.changeDetector = this.hostViewRef.changeDetectorRef;
this.component = this.viewManager.getComponent(hostElement);
this.contentInserctionPoint = renderer.rootContentInsertionPoints[0];
};
DowngradeNg2ComponentAdapter.prototype.setupInputs = function() {
var _this = this;
var attrs = this.attrs;
var inputs = this.info.inputs;
for (var i = 0; i < inputs.length; i++) {
var input = inputs[i];
var expr = null;
if (attrs.hasOwnProperty(input.attr)) {
var observeFn = (function(prop) {
var prevValue = INITIAL_VALUE;
return function(value) {
if (_this.inputChanges !== null) {
_this.inputChangeCount++;
_this.inputChanges[prop] = new Ng1Change(value, prevValue === INITIAL_VALUE ? value : prevValue);
prevValue = value;
}
_this.component[prop] = value;
};
})(input.prop);
attrs.$observe(input.attr, observeFn);
} else if (attrs.hasOwnProperty(input.bindAttr)) {
expr = attrs[input.bindAttr];
} else if (attrs.hasOwnProperty(input.bracketAttr)) {
expr = attrs[input.bracketAttr];
} else if (attrs.hasOwnProperty(input.bindonAttr)) {
expr = attrs[input.bindonAttr];
} else if (attrs.hasOwnProperty(input.bracketParenAttr)) {
expr = attrs[input.bracketParenAttr];
}
if (expr != null) {
var watchFn = (function(prop) {
return function(value, prevValue) {
if (_this.inputChanges != null) {
_this.inputChangeCount++;
_this.inputChanges[prop] = new Ng1Change(prevValue, value);
}
_this.component[prop] = value;
};
})(input.prop);
this.componentScope.$watch(expr, watchFn);
}
}
var prototype = this.info.type.prototype;
if (prototype && prototype.ngOnChanges) {
this.inputChanges = {};
this.componentScope.$watch(function() {
return _this.inputChangeCount;
}, function() {
var inputChanges = _this.inputChanges;
_this.inputChanges = {};
_this.component.ngOnChanges(inputChanges);
});
}
this.componentScope.$watch(function() {
return _this.changeDetector && _this.changeDetector.detectChanges();
});
};
DowngradeNg2ComponentAdapter.prototype.projectContent = function() {
var childNodes = this.childNodes;
if (this.contentInserctionPoint) {
var parent = this.contentInserctionPoint.parentNode;
for (var i = 0,
ii = childNodes.length; i < ii; i++) {
parent.insertBefore(childNodes[i], this.contentInserctionPoint);
}
}
};
DowngradeNg2ComponentAdapter.prototype.setupOutputs = function() {
var _this = this;
var attrs = this.attrs;
var outputs = this.info.outputs;
for (var j = 0; j < outputs.length; j++) {
var output = outputs[j];
var expr = null;
var assignExpr = false;
var bindonAttr = output.bindonAttr ? output.bindonAttr.substring(0, output.bindonAttr.length - 6) : null;
var bracketParenAttr = output.bracketParenAttr ? "[(" + output.bracketParenAttr.substring(2, output.bracketParenAttr.length - 8) + ")]" : null;
if (attrs.hasOwnProperty(output.onAttr)) {
expr = attrs[output.onAttr];
} else if (attrs.hasOwnProperty(output.parenAttr)) {
expr = attrs[output.parenAttr];
} else if (attrs.hasOwnProperty(bindonAttr)) {
expr = attrs[bindonAttr];
assignExpr = true;
} else if (attrs.hasOwnProperty(bracketParenAttr)) {
expr = attrs[bracketParenAttr];
assignExpr = true;
}
if (expr != null && assignExpr != null) {
var getter = this.parse(expr);
var setter = getter.assign;
if (assignExpr && !setter) {
throw new Error("Expression '" + expr + "' is not assignable!");
}
var emitter = this.component[output.prop];
if (emitter) {
emitter.subscribe({next: assignExpr ? (function(setter) {
return function(value) {
return setter(_this.scope, value);
};
})(setter) : (function(getter) {
return function(value) {
return getter(_this.scope, {$event: value});
};
})(getter)});
} else {
throw new Error("Missing emitter '" + output.prop + "' on component '" + this.info.selector + "'!");
}
}
}
};
DowngradeNg2ComponentAdapter.prototype.registerCleanup = function() {
var _this = this;
this.element.bind('$remove', function() {
return _this.viewManager.destroyRootHostView(_this.hostViewRef);
});
};
return DowngradeNg2ComponentAdapter;
})();
exports.DowngradeNg2ComponentAdapter = DowngradeNg2ComponentAdapter;
var Ng1Change = (function() {
function Ng1Change(previousValue, currentValue) {
this.previousValue = previousValue;
this.currentValue = currentValue;
}
Ng1Change.prototype.isFirstChange = function() {
return this.previousValue === this.currentValue;
};
return Ng1Change;
})();
global.define = __define;
return module.exports;
});
System.register("angular2/src/upgrade/angular_js", [], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
function noNg() {
throw new Error('AngularJS v1.x is not loaded!');
}
var angular = {
bootstrap: noNg,
module: noNg,
element: noNg,
version: noNg
};
try {
if (window.hasOwnProperty('angular')) {
angular = window.angular;
}
} catch (e) {}
exports.bootstrap = angular.bootstrap;
exports.module = angular.module;
exports.element = angular.element;
exports.version = angular.version;
global.define = __define;
return module.exports;
});
System.register("angular2/src/upgrade/upgrade_ng1_adapter", ["angular2/core", "angular2/src/upgrade/constants", "angular2/src/upgrade/util", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
var core_1 = require("angular2/core");
var constants_1 = require("angular2/src/upgrade/constants");
var util_1 = require("angular2/src/upgrade/util");
var angular = require("angular2/src/upgrade/angular_js");
var CAMEL_CASE = /([A-Z])/g;
var INITIAL_VALUE = {__UNINITIALIZED__: true};
var NOT_SUPPORTED = 'NOT_SUPPORTED';
var UpgradeNg1ComponentAdapterBuilder = (function() {
function UpgradeNg1ComponentAdapterBuilder(name) {
this.name = name;
this.inputs = [];
this.inputsRename = [];
this.outputs = [];
this.outputsRename = [];
this.propertyOutputs = [];
this.checkProperties = [];
this.propertyMap = {};
this.linkFn = null;
this.directive = null;
this.$controller = null;
var selector = name.replace(CAMEL_CASE, function(all, next) {
return '-' + next.toLowerCase();
});
var self = this;
this.type = core_1.Directive({
selector: selector,
inputs: this.inputsRename,
outputs: this.outputsRename
}).Class({
constructor: [new core_1.Inject(constants_1.NG1_SCOPE), core_1.ElementRef, function(scope, elementRef) {
return new UpgradeNg1ComponentAdapter(self.linkFn, scope, self.directive, elementRef, self.$controller, self.inputs, self.outputs, self.propertyOutputs, self.checkProperties, self.propertyMap);
}],
ngOnChanges: function() {},
ngDoCheck: function() {}
});
}
UpgradeNg1ComponentAdapterBuilder.prototype.extractDirective = function(injector) {
var directives = injector.get(this.name + 'Directive');
if (directives.length > 1) {
throw new Error('Only support single directive definition for: ' + this.name);
}
var directive = directives[0];
if (directive.replace)
this.notSupported('replace');
if (directive.terminal)
this.notSupported('terminal');
var link = directive.link;
if (typeof link == 'object') {
if (link.post)
this.notSupported('link.post');
}
return directive;
};
UpgradeNg1ComponentAdapterBuilder.prototype.notSupported = function(feature) {
throw new Error("Upgraded directive '" + this.name + "' does not support '" + feature + "'.");
};
UpgradeNg1ComponentAdapterBuilder.prototype.extractBindings = function() {
var scope = this.directive.scope;
if (typeof scope == 'object') {
for (var name in scope) {
if (scope.hasOwnProperty(name)) {
var localName = scope[name];
var type = localName.charAt(0);
localName = localName.substr(1) || name;
var outputName = 'output_' + name;
var outputNameRename = outputName + ': ' + name;
var outputNameRenameChange = outputName + ': ' + name + 'Change';
var inputName = 'input_' + name;
var inputNameRename = inputName + ': ' + name;
switch (type) {
case '=':
this.propertyOutputs.push(outputName);
this.checkProperties.push(localName);
this.outputs.push(outputName);
this.outputsRename.push(outputNameRenameChange);
this.propertyMap[outputName] = localName;
case '@':
this.inputs.push(inputName);
this.inputsRename.push(inputNameRename);
this.propertyMap[inputName] = localName;
break;
case '&':
this.outputs.push(outputName);
this.outputsRename.push(outputNameRename);
this.propertyMap[outputName] = localName;
break;
default:
var json = JSON.stringify(scope);
throw new Error("Unexpected mapping '" + type + "' in '" + json + "' in '" + this.name + "' directive.");
}
}
}
}
};
UpgradeNg1ComponentAdapterBuilder.prototype.compileTemplate = function(compile, templateCache, httpBackend) {
var _this = this;
if (this.directive.template !== undefined) {
this.linkFn = compileHtml(this.directive.template);
} else if (this.directive.templateUrl) {
var url = this.directive.templateUrl;
var html = templateCache.get(url);
if (html !== undefined) {
this.linkFn = compileHtml(html);
} else {
return new Promise(function(resolve, err) {
httpBackend('GET', url, null, function(status, response) {
if (status == 200) {
resolve(_this.linkFn = compileHtml(templateCache.put(url, response)));
} else {
err("GET " + url + " returned " + status + ": " + response);
}
});
});
}
} else {
throw new Error("Directive '" + this.name + "' is not a component, it is missing template.");
}
return null;
function compileHtml(html) {
var div = document.createElement('div');
div.innerHTML = html;
return compile(div.childNodes);
}
};
UpgradeNg1ComponentAdapterBuilder.resolve = function(exportedComponents, injector) {
var promises = [];
var compile = injector.get(constants_1.NG1_COMPILE);
var templateCache = injector.get(constants_1.NG1_TEMPLATE_CACHE);
var httpBackend = injector.get(constants_1.NG1_HTTP_BACKEND);
var $controller = injector.get(constants_1.NG1_CONTROLLER);
for (var name in exportedComponents) {
if (exportedComponents.hasOwnProperty(name)) {
var exportedComponent = exportedComponents[name];
exportedComponent.directive = exportedComponent.extractDirective(injector);
exportedComponent.$controller = $controller;
exportedComponent.extractBindings();
var promise = exportedComponent.compileTemplate(compile, templateCache, httpBackend);
if (promise)
promises.push(promise);
}
}
return Promise.all(promises);
};
return UpgradeNg1ComponentAdapterBuilder;
})();
exports.UpgradeNg1ComponentAdapterBuilder = UpgradeNg1ComponentAdapterBuilder;
var UpgradeNg1ComponentAdapter = (function() {
function UpgradeNg1ComponentAdapter(linkFn, scope, directive, elementRef, $controller, inputs, outputs, propOuts, checkProperties, propertyMap) {
this.directive = directive;
this.inputs = inputs;
this.outputs = outputs;
this.propOuts = propOuts;
this.checkProperties = checkProperties;
this.propertyMap = propertyMap;
this.destinationObj = null;
this.checkLastValues = [];
var element = elementRef.nativeElement;
var childNodes = [];
var childNode;
while (childNode = element.firstChild) {
element.removeChild(childNode);
childNodes.push(childNode);
}
var componentScope = scope.$new(!!directive.scope);
var $element = angular.element(element);
var controllerType = directive.controller;
var controller = null;
if (controllerType) {
var locals = {
$scope: componentScope,
$element: $element
};
controller = $controller(controllerType, locals, null, directive.controllerAs);
$element.data(util_1.controllerKey(directive.name), controller);
}
var link = directive.link;
if (typeof link == 'object')
link = link.pre;
if (link) {
var attrs = NOT_SUPPORTED;
var transcludeFn = NOT_SUPPORTED;
var linkController = this.resolveRequired($element, directive.require);
directive.link(componentScope, $element, attrs, linkController, transcludeFn);
}
this.destinationObj = directive.bindToController && controller ? controller : componentScope;
linkFn(componentScope, function(clonedElement, scope) {
for (var i = 0,
ii = clonedElement.length; i < ii; i++) {
element.appendChild(clonedElement[i]);
}
}, {parentBoundTranscludeFn: function(scope, cloneAttach) {
cloneAttach(childNodes);
}});
for (var i = 0; i < inputs.length; i++) {
this[inputs[i]] = null;
}
for (var j = 0; j < outputs.length; j++) {
var emitter = this[outputs[j]] = new core_1.EventEmitter();
this.setComponentProperty(outputs[j], (function(emitter) {
return function(value) {
return emitter.emit(value);
};
})(emitter));
}
for (var k = 0; k < propOuts.length; k++) {
this[propOuts[k]] = new core_1.EventEmitter();
this.checkLastValues.push(INITIAL_VALUE);
}
}
UpgradeNg1ComponentAdapter.prototype.ngOnChanges = function(changes) {
for (var name in changes) {
if (changes.hasOwnProperty(name)) {
var change = changes[name];
this.setComponentProperty(name, change.currentValue);
}
}
};
UpgradeNg1ComponentAdapter.prototype.ngDoCheck = function() {
var count = 0;
var destinationObj = this.destinationObj;
var lastValues = this.checkLastValues;
var checkProperties = this.checkProperties;
for (var i = 0; i < checkProperties.length; i++) {
var value = destinationObj[checkProperties[i]];
var last = lastValues[i];
if (value !== last) {
if (typeof value == 'number' && isNaN(value) && typeof last == 'number' && isNaN(last)) {} else {
var eventEmitter = this[this.propOuts[i]];
eventEmitter.emit(lastValues[i] = value);
}
}
}
return count;
};
UpgradeNg1ComponentAdapter.prototype.setComponentProperty = function(name, value) {
this.destinationObj[this.propertyMap[name]] = value;
};
UpgradeNg1ComponentAdapter.prototype.resolveRequired = function($element, require) {
if (!require) {
return undefined;
} else if (typeof require == 'string') {
var name = require;
var isOptional = false;
var startParent = false;
var searchParents = false;
var ch;
if (name.charAt(0) == '?') {
isOptional = true;
name = name.substr(1);
}
if (name.charAt(0) == '^') {
searchParents = true;
name = name.substr(1);
}
if (name.charAt(0) == '^') {
startParent = true;
name = name.substr(1);
}
var key = util_1.controllerKey(name);
if (startParent)
$element = $element.parent();
var dep = searchParents ? $element.inheritedData(key) : $element.data(key);
if (!dep && !isOptional) {
throw new Error("Can not locate '" + require + "' in '" + this.directive.name + "'.");
}
return dep;
} else if (require instanceof Array) {
var deps = [];
for (var i = 0; i < require.length; i++) {
deps.push(this.resolveRequired($element, require[i]));
}
return deps;
}
throw new Error("Directive '" + this.directive.name + "' require syntax unrecognized: " + this.directive.require);
};
return UpgradeNg1ComponentAdapter;
})();
global.define = __define;
return module.exports;
});
System.register("angular2/src/upgrade/upgrade_adapter", ["angular2/core", "angular2/src/facade/async", "angular2/platform/browser", "angular2/src/upgrade/metadata", "angular2/src/upgrade/util", "angular2/src/upgrade/constants", "angular2/src/upgrade/downgrade_ng2_adapter", "angular2/src/upgrade/upgrade_ng1_adapter", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
var core_1 = require("angular2/core");
var async_1 = require("angular2/src/facade/async");
var browser_1 = require("angular2/platform/browser");
var metadata_1 = require("angular2/src/upgrade/metadata");
var util_1 = require("angular2/src/upgrade/util");
var constants_1 = require("angular2/src/upgrade/constants");
var downgrade_ng2_adapter_1 = require("angular2/src/upgrade/downgrade_ng2_adapter");
var upgrade_ng1_adapter_1 = require("angular2/src/upgrade/upgrade_ng1_adapter");
var angular = require("angular2/src/upgrade/angular_js");
var upgradeCount = 0;
var UpgradeAdapter = (function() {
function UpgradeAdapter() {
this.idPrefix = "NG2_UPGRADE_" + upgradeCount++ + "_";
this.upgradedComponents = [];
this.downgradedComponents = {};
this.providers = [];
}
UpgradeAdapter.prototype.downgradeNg2Component = function(type) {
this.upgradedComponents.push(type);
var info = metadata_1.getComponentInfo(type);
return ng1ComponentDirective(info, "" + this.idPrefix + info.selector + "_c");
};
UpgradeAdapter.prototype.upgradeNg1Component = function(name) {
if (this.downgradedComponents.hasOwnProperty(name)) {
return this.downgradedComponents[name].type;
} else {
return (this.downgradedComponents[name] = new upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder(name)).type;
}
};
UpgradeAdapter.prototype.bootstrap = function(element, modules, config) {
var _this = this;
var upgrade = new UpgradeAdapterRef();
var ng1Injector = null;
var platformRef = core_1.platform(browser_1.BROWSER_PROVIDERS);
var applicationRef = platformRef.application([browser_1.BROWSER_APP_PROVIDERS, core_1.provide(constants_1.NG1_INJECTOR, {useFactory: function() {
return ng1Injector;
}}), core_1.provide(constants_1.NG1_COMPILE, {useFactory: function() {
return ng1Injector.get(constants_1.NG1_COMPILE);
}}), this.providers]);
var injector = applicationRef.injector;
var ngZone = injector.get(core_1.NgZone);
var compiler = injector.get(core_1.Compiler);
var delayApplyExps = [];
var original$applyFn;
var rootScopePrototype;
var rootScope;
var protoViewRefMap = {};
var ng1Module = angular.module(this.idPrefix, modules);
var ng1compilePromise = null;
ng1Module.value(constants_1.NG2_INJECTOR, injector).value(constants_1.NG2_ZONE, ngZone).value(constants_1.NG2_COMPILER, compiler).value(constants_1.NG2_PROTO_VIEW_REF_MAP, protoViewRefMap).value(constants_1.NG2_APP_VIEW_MANAGER, injector.get(core_1.AppViewManager)).config(['$provide', function(provide) {
provide.decorator(constants_1.NG1_ROOT_SCOPE, ['$delegate', function(rootScopeDelegate) {
rootScopePrototype = rootScopeDelegate.constructor.prototype;
if (rootScopePrototype.hasOwnProperty('$apply')) {
original$applyFn = rootScopePrototype.$apply;
rootScopePrototype.$apply = function(exp) {
return delayApplyExps.push(exp);
};
} else {
throw new Error("Failed to find '$apply' on '$rootScope'!");
}
return rootScope = rootScopeDelegate;
}]);
}]).run(['$injector', '$rootScope', function(injector, rootScope) {
ng1Injector = injector;
async_1.ObservableWrapper.subscribe(ngZone.onTurnDone, function(_) {
ngZone.run(function() {
return rootScope.$apply();
});
});
ng1compilePromise = upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder.resolve(_this.downgradedComponents, injector);
}]);
angular.element(element).data(util_1.controllerKey(constants_1.NG2_INJECTOR), injector);
ngZone.run(function() {
angular.bootstrap(element, [_this.idPrefix], config);
});
Promise.all([this.compileNg2Components(compiler, protoViewRefMap), ng1compilePromise]).then(function() {
ngZone.run(function() {
if (rootScopePrototype) {
rootScopePrototype.$apply = original$applyFn;
while (delayApplyExps.length) {
rootScope.$apply(delayApplyExps.shift());
}
upgrade._bootstrapDone(applicationRef, ng1Injector);
rootScopePrototype = null;
}
});
}, util_1.onError);
return upgrade;
};
UpgradeAdapter.prototype.addProvider = function(provider) {
this.providers.push(provider);
};
UpgradeAdapter.prototype.upgradeNg1Provider = function(name, options) {
var token = options && options.asToken || name;
this.providers.push(core_1.provide(token, {
useFactory: function(ng1Injector) {
return ng1Injector.get(name);
},
deps: [constants_1.NG1_INJECTOR]
}));
};
UpgradeAdapter.prototype.downgradeNg2Provider = function(token) {
var factory = function(injector) {
return injector.get(token);
};
factory.$inject = [constants_1.NG2_INJECTOR];
return factory;
};
UpgradeAdapter.prototype.compileNg2Components = function(compiler, protoViewRefMap) {
var _this = this;
var promises = [];
var types = this.upgradedComponents;
for (var i = 0; i < types.length; i++) {
promises.push(compiler.compileInHost(types[i]));
}
return Promise.all(promises).then(function(protoViews) {
var types = _this.upgradedComponents;
for (var i = 0; i < protoViews.length; i++) {
protoViewRefMap[metadata_1.getComponentInfo(types[i]).selector] = protoViews[i];
}
return protoViewRefMap;
}, util_1.onError);
};
return UpgradeAdapter;
})();
exports.UpgradeAdapter = UpgradeAdapter;
function ng1ComponentDirective(info, idPrefix) {
directiveFactory.$inject = [constants_1.NG2_PROTO_VIEW_REF_MAP, constants_1.NG2_APP_VIEW_MANAGER, constants_1.NG1_PARSE];
function directiveFactory(protoViewRefMap, viewManager, parse) {
var protoView = protoViewRefMap[info.selector];
if (!protoView)
throw new Error('Expecting ProtoViewRef for: ' + info.selector);
var idCount = 0;
return {
restrict: 'E',
require: constants_1.REQUIRE_INJECTOR,
link: {post: function(scope, element, attrs, parentInjector, transclude) {
var domElement = element[0];
var facade = new downgrade_ng2_adapter_1.DowngradeNg2ComponentAdapter(idPrefix + (idCount++), info, element, attrs, scope, parentInjector, parse, viewManager, protoView);
facade.setupInputs();
facade.bootstrapNg2();
facade.projectContent();
facade.setupOutputs();
facade.registerCleanup();
}}
};
}
return directiveFactory;
}
var UpgradeAdapterRef = (function() {
function UpgradeAdapterRef() {
this._readyFn = null;
this.ng1RootScope = null;
this.ng1Injector = null;
this.ng2ApplicationRef = null;
this.ng2Injector = null;
}
UpgradeAdapterRef.prototype._bootstrapDone = function(applicationRef, ng1Injector) {
this.ng2ApplicationRef = applicationRef;
this.ng2Injector = applicationRef.injector;
this.ng1Injector = ng1Injector;
this.ng1RootScope = ng1Injector.get(constants_1.NG1_ROOT_SCOPE);
this._readyFn && this._readyFn(this);
};
UpgradeAdapterRef.prototype.ready = function(fn) {
this._readyFn = fn;
};
UpgradeAdapterRef.prototype.dispose = function() {
this.ng1Injector.get(constants_1.NG1_ROOT_SCOPE).$destroy();
this.ng2ApplicationRef.dispose();
};
return UpgradeAdapterRef;
})();
exports.UpgradeAdapterRef = UpgradeAdapterRef;
global.define = __define;
return module.exports;
});
System.register("angular2/upgrade", ["angular2/src/upgrade/upgrade_adapter"], true, function(require, exports, module) {
var global = System.global,
__define = global.define;
global.define = undefined;
var upgrade_adapter_1 = require("angular2/src/upgrade/upgrade_adapter");
exports.UpgradeAdapter = upgrade_adapter_1.UpgradeAdapter;
exports.UpgradeAdapterRef = upgrade_adapter_1.UpgradeAdapterRef;
global.define = __define;
return module.exports;
});
//# sourceMappingURLDisabled=upgrade.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +0,0 @@
export * from './src/common/pipes';
export * from './src/common/directives';
export * from './src/common/forms';
export * from './src/common/common_directives';

View File

@@ -1,8 +0,0 @@
/**
* @module
* @description
* Starting point to import all compiler APIs.
*/
export * from './src/compiler/url_resolver';
export * from './src/compiler/xhr';
export * from './src/compiler/compiler';

View File

@@ -1,24 +0,0 @@
/**
* @module
* @description
* Starting point to import all public core APIs.
*/
export * from './src/core/metadata';
export * from './src/core/util';
export * from './src/core/prod_mode';
export * from './src/core/di';
export * from './src/facade/facade';
export { enableProdMode } from 'angular2/src/facade/lang';
export { platform, createNgZone, PlatformRef, ApplicationRef } from './src/core/application_ref';
export { APP_ID, APP_COMPONENT, APP_INITIALIZER, PACKAGE_ROOT_URL, PLATFORM_INITIALIZER } from './src/core/application_tokens';
export * from './src/core/zone';
export * from './src/core/render';
export * from './src/core/linker';
export { DebugElement, Scope, inspectElement, asNativeElements } from './src/core/debug/debug_element';
export * from './src/core/testability/testability';
export * from './src/core/change_detection';
export * from './src/core/platform_directives_and_pipes';
export * from './src/core/platform_common_providers';
export * from './src/core/application_common_providers';
export * from './src/core/reflection/reflection';
import "./manual_typings/globals-es6.d.ts";

View File

@@ -1,248 +0,0 @@
export { Request } from './src/http/static_request';
export { Response } from './src/http/static_response';
export { RequestOptionsArgs, ResponseOptionsArgs, Connection, ConnectionBackend } from './src/http/interfaces';
export { BrowserXhr } from './src/http/backends/browser_xhr';
export { BaseRequestOptions, RequestOptions } from './src/http/base_request_options';
export { BaseResponseOptions, ResponseOptions } from './src/http/base_response_options';
export { XHRBackend, XHRConnection } from './src/http/backends/xhr_backend';
export { JSONPBackend, JSONPConnection } from './src/http/backends/jsonp_backend';
export { Http, Jsonp } from './src/http/http';
export { Headers } from './src/http/headers';
export { ResponseType, ReadyState, RequestMethod } from './src/http/enums';
export { URLSearchParams } from './src/http/url_search_params';
/**
* Provides a basic set of injectables to use the {@link Http} service in any application.
*
* The `HTTP_PROVIDERS` should be included either in a component's injector,
* or in the root injector when bootstrapping an application.
*
* ### Example ([live demo](http://plnkr.co/edit/snj7Nv?p=preview))
*
* ```
* import {Component} from 'angular2/core';
* import {bootstrap} from 'angular2/platform/browser';
* import {NgFor} from 'angular2/common';
* import {HTTP_PROVIDERS, Http} from 'angular2/http';
*
* @Component({
* selector: 'app',
* providers: [HTTP_PROVIDERS],
* template: `
* <div>
* <h1>People</h1>
* <ul>
* <li *ngFor="#person of people">
* {{person.name}}
* </li>
* </ul>
* </div>
* `,
* directives: [NgFor]
* })
* export class App {
* people: Object[];
* constructor(http:Http) {
* http.get('people.json').subscribe(res => {
* this.people = res.json();
* });
* }
* active:boolean = false;
* toggleActiveState() {
* this.active = !this.active;
* }
* }
*
* bootstrap(App)
* .catch(err => console.error(err));
* ```
*
* The primary public API included in `HTTP_PROVIDERS` is the {@link Http} class.
* However, other providers required by `Http` are included,
* which may be beneficial to override in certain cases.
*
* The providers included in `HTTP_PROVIDERS` include:
* * {@link Http}
* * {@link XHRBackend}
* * `BrowserXHR` - Private factory to create `XMLHttpRequest` instances
* * {@link RequestOptions} - Bound to {@link BaseRequestOptions} class
* * {@link ResponseOptions} - Bound to {@link BaseResponseOptions} class
*
* There may be cases where it makes sense to extend the base request options,
* such as to add a search string to be appended to all URLs.
* To accomplish this, a new provider for {@link RequestOptions} should
* be added in the same injector as `HTTP_PROVIDERS`.
*
* ### Example ([live demo](http://plnkr.co/edit/aCMEXi?p=preview))
*
* ```
* import {provide} from 'angular2/core';
* import {bootstrap} from 'angular2/platform/browser';
* import {HTTP_PROVIDERS, BaseRequestOptions, RequestOptions} from 'angular2/http';
*
* class MyOptions extends BaseRequestOptions {
* search: string = 'coreTeam=true';
* }
*
* bootstrap(App, [HTTP_PROVIDERS, provide(RequestOptions, {useClass: MyOptions})])
* .catch(err => console.error(err));
* ```
*
* Likewise, to use a mock backend for unit tests, the {@link XHRBackend}
* provider should be bound to {@link MockBackend}.
*
* ### Example ([live demo](http://plnkr.co/edit/7LWALD?p=preview))
*
* ```
* import {provide} from 'angular2/core';
* import {bootstrap} from 'angular2/platform/browser';
* import {HTTP_PROVIDERS, Http, Response, XHRBackend} from 'angular2/http';
* import {MockBackend} from 'angular2/http/testing';
*
* var people = [{name: 'Jeff'}, {name: 'Tobias'}];
*
* var injector = Injector.resolveAndCreate([
* HTTP_PROVIDERS,
* MockBackend,
* provide(XHRBackend, {useExisting: MockBackend})
* ]);
* var http = injector.get(Http);
* var backend = injector.get(MockBackend);
*
* // Listen for any new requests
* backend.connections.observer({
* next: connection => {
* var response = new Response({body: people});
* setTimeout(() => {
* // Send a response to the request
* connection.mockRespond(response);
* });
* });
*
* http.get('people.json').observer({
* next: res => {
* // Response came from mock backend
* console.log('first person', res.json()[0].name);
* }
* });
* ```
*/
export declare const HTTP_PROVIDERS: any[];
/**
* See {@link HTTP_PROVIDERS} instead.
*
* @deprecated
*/
export declare const HTTP_BINDINGS: any[];
/**
* Provides a basic set of providers to use the {@link Jsonp} service in any application.
*
* The `JSONP_PROVIDERS` should be included either in a component's injector,
* or in the root injector when bootstrapping an application.
*
* ### Example ([live demo](http://plnkr.co/edit/vmeN4F?p=preview))
*
* ```
* import {Component} from 'angular2/core';
* import {NgFor} from 'angular2/common';
* import {JSONP_PROVIDERS, Jsonp} from 'angular2/http';
*
* @Component({
* selector: 'app',
* providers: [JSONP_PROVIDERS],
* template: `
* <div>
* <h1>People</h1>
* <ul>
* <li *ngFor="#person of people">
* {{person.name}}
* </li>
* </ul>
* </div>
* `,
* directives: [NgFor]
* })
* export class App {
* people: Array<Object>;
* constructor(jsonp:Jsonp) {
* jsonp.request('people.json').subscribe(res => {
* this.people = res.json();
* })
* }
* }
* ```
*
* The primary public API included in `JSONP_PROVIDERS` is the {@link Jsonp} class.
* However, other providers required by `Jsonp` are included,
* which may be beneficial to override in certain cases.
*
* The providers included in `JSONP_PROVIDERS` include:
* * {@link Jsonp}
* * {@link JSONPBackend}
* * `BrowserJsonp` - Private factory
* * {@link RequestOptions} - Bound to {@link BaseRequestOptions} class
* * {@link ResponseOptions} - Bound to {@link BaseResponseOptions} class
*
* There may be cases where it makes sense to extend the base request options,
* such as to add a search string to be appended to all URLs.
* To accomplish this, a new provider for {@link RequestOptions} should
* be added in the same injector as `JSONP_PROVIDERS`.
*
* ### Example ([live demo](http://plnkr.co/edit/TFug7x?p=preview))
*
* ```
* import {provide} from 'angular2/core';
* import {bootstrap} from 'angular2/platform/browser';
* import {JSONP_PROVIDERS, BaseRequestOptions, RequestOptions} from 'angular2/http';
*
* class MyOptions extends BaseRequestOptions {
* search: string = 'coreTeam=true';
* }
*
* bootstrap(App, [JSONP_PROVIDERS, provide(RequestOptions, {useClass: MyOptions})])
* .catch(err => console.error(err));
* ```
*
* Likewise, to use a mock backend for unit tests, the {@link JSONPBackend}
* provider should be bound to {@link MockBackend}.
*
* ### Example ([live demo](http://plnkr.co/edit/HDqZWL?p=preview))
*
* ```
* import {provide, Injector} from 'angular2/core';
* import {JSONP_PROVIDERS, Jsonp, Response, JSONPBackend} from 'angular2/http';
* import {MockBackend} from 'angular2/http/testing';
*
* var people = [{name: 'Jeff'}, {name: 'Tobias'}];
* var injector = Injector.resolveAndCreate([
* JSONP_PROVIDERS,
* MockBackend,
* provide(JSONPBackend, {useExisting: MockBackend})
* ]);
* var jsonp = injector.get(Jsonp);
* var backend = injector.get(MockBackend);
*
* // Listen for any new requests
* backend.connections.observer({
* next: connection => {
* var response = new Response({body: people});
* setTimeout(() => {
* // Send a response to the request
* connection.mockRespond(response);
* });
* });
* jsonp.get('people.json').observer({
* next: res => {
* // Response came from mock backend
* console.log('first person', res.json()[0].name);
* }
* });
* ```
*/
export declare const JSONP_PROVIDERS: any[];
/**
* See {@link JSONP_PROVIDERS} instead.
*
* @deprecated
*/
export declare const JSON_BINDINGS: any[];

View File

@@ -1 +0,0 @@
export { wtfCreateScope, wtfLeave, wtfStartTimeRange, wtfEndTimeRange, WtfScopeFn } from './src/core/profile/profile';

View File

@@ -1,37 +0,0 @@
/**
* Declarations angular depends on for compilation to ES6.
* This file is also used to propagate our transitive typings
* to users.
*/
/// <reference path="../typings/zone/zone.d.ts"/>
/// <reference path="../typings/hammerjs/hammerjs.d.ts"/>
/// <reference path="../typings/jasmine/jasmine.d.ts"/>
/// <reference path="../typings/angular-protractor/angular-protractor.d.ts"/>
// TODO: ideally the node.d.ts reference should be scoped only for files that need and not to all
// the code including client code
/// <reference path="../typings/node/node.d.ts" />
declare var assert: any;
interface BrowserNodeGlobal {
Object: typeof Object;
Array: typeof Array;
Map: typeof Map;
Set: typeof Set;
Date: typeof Date;
RegExp: typeof RegExp;
JSON: typeof JSON;
Math: typeof Math;
assert(condition: any): void;
Reflect: any;
zone: Zone;
getAngularTestability: Function;
getAllAngularTestabilities: Function;
setTimeout: Function;
clearTimeout: Function;
setInterval: Function;
clearInterval: Function;
}

View File

@@ -1,7 +0,0 @@
/**
* Declarations angular depends on for compilation to ES6.
* This file is also used to propagate our transitive typings
* to users.
*/
/// <reference path="../typings/es6-shim/es6-shim.d.ts"/>
/// <reference path="./globals-es6.d.ts"/>

View File

@@ -1,75 +0,0 @@
/**
* @module
* @description
* Maps application URLs into application states, to support deep-linking and navigation.
*/
export { Router } from './src/router/router';
export { RouterOutlet } from './src/router/router_outlet';
export { RouterLink } from './src/router/router_link';
export { RouteParams, RouteData } from './src/router/instruction';
export { PlatformLocation } from './src/router/platform_location';
export { RouteRegistry, ROUTER_PRIMARY_COMPONENT } from './src/router/route_registry';
export { LocationStrategy, APP_BASE_HREF } from './src/router/location_strategy';
export { HashLocationStrategy } from './src/router/hash_location_strategy';
export { PathLocationStrategy } from './src/router/path_location_strategy';
export { Location } from './src/router/location';
export * from './src/router/route_config_decorator';
export * from './src/router/route_definition';
export { OnActivate, OnDeactivate, OnReuse, CanDeactivate, CanReuse } from './src/router/interfaces';
export { CanActivate } from './src/router/lifecycle_annotations';
export { Instruction, ComponentInstruction } from './src/router/instruction';
export { OpaqueToken } from 'angular2/core';
/**
* A list of directives. To use the router directives like {@link RouterOutlet} and
* {@link RouterLink}, add this to your `directives` array in the {@link View} decorator of your
* component.
*
* ### Example ([live demo](http://plnkr.co/edit/iRUP8B5OUbxCWQ3AcIDm))
*
* ```
* import {Component} from 'angular2/core';
* import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router';
*
* @Component({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([
* {...},
* ])
* class AppCmp {
* // ...
* }
*
* bootstrap(AppCmp, [ROUTER_PROVIDERS]);
* ```
*/
export declare const ROUTER_DIRECTIVES: any[];
/**
* A list of {@link Provider}s. To use the router, you must add this to your application.
*
* ### Example ([live demo](http://plnkr.co/edit/iRUP8B5OUbxCWQ3AcIDm))
*
* ```
* import {Component} from 'angular2/core';
* import {
* ROUTER_DIRECTIVES,
* ROUTER_PROVIDERS,
* RouteConfig
* } from 'angular2/router';
*
* @Component({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([
* {...},
* ])
* class AppCmp {
* // ...
* }
*
* bootstrap(AppCmp, [ROUTER_PROVIDERS]);
* ```
*/
export declare const ROUTER_PROVIDERS: any[];
/**
* Use {@link ROUTER_PROVIDERS} instead.
*
* @deprecated
*/
export declare const ROUTER_BINDINGS: any[];

View File

@@ -1,17 +0,0 @@
/**
* @module
* @description
* This module is used for writing tests for applications written in Angular.
*
* This module is not included in the `angular2` module; you must import the test module explicitly.
*
*/
export * from './src/testing/testing';
export { ComponentFixture, TestComponentBuilder } from './src/testing/test_component_builder';
export * from './src/testing/test_injector';
export * from './src/testing/fake_async';
export { MockViewResolver } from 'angular2/src/mock/view_resolver_mock';
export { MockXHR } from 'angular2/src/compiler/xhr_mock';
export { MockNgZone } from 'angular2/src/mock/ng_zone_mock';
export { MockApplicationRef } from 'angular2/src/mock/mock_application_ref';
export { MockDirectiveResolver } from 'angular2/src/mock/directive_resolver_mock';

View File

@@ -1,5 +0,0 @@
export * from './src/testing/testing_internal';
export * from './src/testing/test_component_builder';
export * from './src/testing/test_injector';
export * from './src/testing/fake_async';
export * from './src/testing/utils';

View File

@@ -1,668 +0,0 @@
// Type definitions for es6-shim v0.31.2
// Project: https://github.com/paulmillr/es6-shim
// Definitions by: Ron Buckton <http://github.com/rbuckton>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare type PropertyKey = string | number | symbol;
interface IteratorResult<T> {
done: boolean;
value?: T;
}
interface IterableShim<T> {
/**
* Shim for an ES6 iterable. Not intended for direct use by user code.
*/
"_es6-shim iterator_"(): Iterator<T>;
}
interface Iterator<T> {
next(value?: any): IteratorResult<T>;
return?(value?: any): IteratorResult<T>;
throw?(e?: any): IteratorResult<T>;
}
interface IterableIteratorShim<T> extends IterableShim<T>, Iterator<T> {
/**
* Shim for an ES6 iterable iterator. Not intended for direct use by user code.
*/
"_es6-shim iterator_"(): IterableIteratorShim<T>;
}
interface StringConstructor {
/**
* Return the String value whose elements are, in order, the elements in the List elements.
* If length is 0, the empty string is returned.
*/
fromCodePoint(...codePoints: number[]): string;
/**
* String.raw is intended for use as a tag function of a Tagged Template String. When called
* as such the first argument will be a well formed template call site object and the rest
* parameter will contain the substitution values.
* @param template A well-formed template string call site representation.
* @param substitutions A set of substitution values.
*/
raw(template: TemplateStringsArray, ...substitutions: any[]): string;
}
interface String {
/**
* Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
* value of the UTF-16 encoded code point starting at the string element at position pos in
* the String resulting from converting this object to a String.
* If there is no element at that position, the result is undefined.
* If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
*/
codePointAt(pos: number): number;
/**
* Returns true if searchString appears as a substring of the result of converting this
* object to a String, at one or more positions that are
* greater than or equal to position; otherwise, returns false.
* @param searchString search string
* @param position If position is undefined, 0 is assumed, so as to search all of the String.
*/
includes(searchString: string, position?: number): boolean;
/**
* Returns true if the sequence of elements of searchString converted to a String is the
* same as the corresponding elements of this object (converted to a String) starting at
* endPosition length(this). Otherwise returns false.
*/
endsWith(searchString: string, endPosition?: number): boolean;
/**
* Returns a String value that is made from count copies appended together. If count is 0,
* T is the empty String is returned.
* @param count number of copies to append
*/
repeat(count: number): string;
/**
* Returns true if the sequence of elements of searchString converted to a String is the
* same as the corresponding elements of this object (converted to a String) starting at
* position. Otherwise returns false.
*/
startsWith(searchString: string, position?: number): boolean;
/**
* Returns an <a> HTML anchor element and sets the name attribute to the text value
* @param name
*/
anchor(name: string): string;
/** Returns a <big> HTML element */
big(): string;
/** Returns a <blink> HTML element */
blink(): string;
/** Returns a <b> HTML element */
bold(): string;
/** Returns a <tt> HTML element */
fixed(): string
/** Returns a <font> HTML element and sets the color attribute value */
fontcolor(color: string): string
/** Returns a <font> HTML element and sets the size attribute value */
fontsize(size: number): string;
/** Returns a <font> HTML element and sets the size attribute value */
fontsize(size: string): string;
/** Returns an <i> HTML element */
italics(): string;
/** Returns an <a> HTML element and sets the href attribute value */
link(url: string): string;
/** Returns a <small> HTML element */
small(): string;
/** Returns a <strike> HTML element */
strike(): string;
/** Returns a <sub> HTML element */
sub(): string;
/** Returns a <sup> HTML element */
sup(): string;
/**
* Shim for an ES6 iterable. Not intended for direct use by user code.
*/
"_es6-shim iterator_"(): IterableIteratorShim<string>;
}
interface ArrayConstructor {
/**
* Creates an array from an array-like object.
* @param arrayLike An array-like object to convert to an array.
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
/**
* Creates an array from an iterable object.
* @param iterable An iterable object to convert to an array.
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T, U>(iterable: IterableShim<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
/**
* Creates an array from an array-like object.
* @param arrayLike An array-like object to convert to an array.
*/
from<T>(arrayLike: ArrayLike<T>): Array<T>;
/**
* Creates an array from an iterable object.
* @param iterable An iterable object to convert to an array.
*/
from<T>(iterable: IterableShim<T>): Array<T>;
/**
* Returns a new array from a set of elements.
* @param items A set of elements to include in the new array object.
*/
of<T>(...items: T[]): Array<T>;
}
interface Array<T> {
/**
* Returns the value of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T;
/**
* Returns the index of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
/**
* Returns the this object after filling the section identified by start and end with value
* @param value value to fill array section with
* @param start index to start filling the array at. If start is negative, it is treated as
* length+start where length is the length of the array.
* @param end index to stop filling the array at. If end is negative, it is treated as
* length+end.
*/
fill(value: T, start?: number, end?: number): T[];
/**
* Returns the this object after copying a section of the array identified by start and end
* to the same array starting at position target
* @param target If target is negative, it is treated as length+target where length is the
* length of the array.
* @param start If start is negative, it is treated as length+start. If end is negative, it
* is treated as length+end.
* @param end If not specified, length of the this object is used as its default value.
*/
copyWithin(target: number, start: number, end?: number): T[];
/**
* Returns an array of key, value pairs for every entry in the array
*/
entries(): IterableIteratorShim<[number, T]>;
/**
* Returns an list of keys in the array
*/
keys(): IterableIteratorShim<number>;
/**
* Returns an list of values in the array
*/
values(): IterableIteratorShim<T>;
/**
* Shim for an ES6 iterable. Not intended for direct use by user code.
*/
"_es6-shim iterator_"(): IterableIteratorShim<T>;
}
interface NumberConstructor {
/**
* The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1
* that is representable as a Number value, which is approximately:
* 2.2204460492503130808472633361816 x 1016.
*/
EPSILON: number;
/**
* Returns true if passed value is finite.
* Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a
* number. Only finite values of the type number, result in true.
* @param number A numeric value.
*/
isFinite(number: number): boolean;
/**
* Returns true if the value passed is an integer, false otherwise.
* @param number A numeric value.
*/
isInteger(number: number): boolean;
/**
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
* to a number. Only values of the type number, that are also NaN, result in true.
* @param number A numeric value.
*/
isNaN(number: number): boolean;
/**
* Returns true if the value passed is a safe integer.
* @param number A numeric value.
*/
isSafeInteger(number: number): boolean;
/**
* The value of the largest integer n such that n and n + 1 are both exactly representable as
* a Number value.
* The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 1.
*/
MAX_SAFE_INTEGER: number;
/**
* The value of the smallest integer n such that n and n 1 are both exactly representable as
* a Number value.
* The value of Number.MIN_SAFE_INTEGER is 9007199254740991 ((2^53 1)).
*/
MIN_SAFE_INTEGER: number;
/**
* Converts a string to a floating-point number.
* @param string A string that contains a floating-point number.
*/
parseFloat(string: string): number;
/**
* Converts A string to an integer.
* @param s A string to convert into a number.
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
* All other strings are considered decimal.
*/
parseInt(string: string, radix?: number): number;
}
interface ObjectConstructor {
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param sources One or more source objects to copy properties from.
*/
assign(target: any, ...sources: any[]): any;
/**
* Returns true if the values are the same value, false otherwise.
* @param value1 The first value.
* @param value2 The second value.
*/
is(value1: any, value2: any): boolean;
/**
* Sets the prototype of a specified object o to object proto or null. Returns the object o.
* @param o The object to change its prototype.
* @param proto The value of the new prototype or null.
* @remarks Requires `__proto__` support.
*/
setPrototypeOf(o: any, proto: any): any;
}
interface RegExp {
/**
* Returns a string indicating the flags of the regular expression in question. This field is read-only.
* The characters in this string are sequenced and concatenated in the following order:
*
* - "g" for global
* - "i" for ignoreCase
* - "m" for multiline
* - "u" for unicode
* - "y" for sticky
*
* If no flags are set, the value is the empty string.
*/
flags: string;
}
interface Math {
/**
* Returns the number of leading zero bits in the 32-bit binary representation of a number.
* @param x A numeric expression.
*/
clz32(x: number): number;
/**
* Returns the result of 32-bit multiplication of two numbers.
* @param x First number
* @param y Second number
*/
imul(x: number, y: number): number;
/**
* Returns the sign of the x, indicating whether x is positive, negative or zero.
* @param x The numeric expression to test
*/
sign(x: number): number;
/**
* Returns the base 10 logarithm of a number.
* @param x A numeric expression.
*/
log10(x: number): number;
/**
* Returns the base 2 logarithm of a number.
* @param x A numeric expression.
*/
log2(x: number): number;
/**
* Returns the natural logarithm of 1 + x.
* @param x A numeric expression.
*/
log1p(x: number): number;
/**
* Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of
* the natural logarithms).
* @param x A numeric expression.
*/
expm1(x: number): number;
/**
* Returns the hyperbolic cosine of a number.
* @param x A numeric expression that contains an angle measured in radians.
*/
cosh(x: number): number;
/**
* Returns the hyperbolic sine of a number.
* @param x A numeric expression that contains an angle measured in radians.
*/
sinh(x: number): number;
/**
* Returns the hyperbolic tangent of a number.
* @param x A numeric expression that contains an angle measured in radians.
*/
tanh(x: number): number;
/**
* Returns the inverse hyperbolic cosine of a number.
* @param x A numeric expression that contains an angle measured in radians.
*/
acosh(x: number): number;
/**
* Returns the inverse hyperbolic sine of a number.
* @param x A numeric expression that contains an angle measured in radians.
*/
asinh(x: number): number;
/**
* Returns the inverse hyperbolic tangent of a number.
* @param x A numeric expression that contains an angle measured in radians.
*/
atanh(x: number): number;
/**
* Returns the square root of the sum of squares of its arguments.
* @param values Values to compute the square root for.
* If no arguments are passed, the result is +0.
* If there is only one argument, the result is the absolute value.
* If any argument is +Infinity or -Infinity, the result is +Infinity.
* If any argument is NaN, the result is NaN.
* If all arguments are either +0 or 0, the result is +0.
*/
hypot(...values: number[]): number;
/**
* Returns the integral part of the a numeric expression, x, removing any fractional digits.
* If x is already an integer, the result is x.
* @param x A numeric expression.
*/
trunc(x: number): number;
/**
* Returns the nearest single precision float representation of a number.
* @param x A numeric expression.
*/
fround(x: number): number;
/**
* Returns an implementation-dependent approximation to the cube root of number.
* @param x A numeric expression.
*/
cbrt(x: number): number;
}
interface PromiseLike<T> {
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>;
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>;
}
/**
* Represents the completion of an asynchronous operation
*/
interface Promise<T> {
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<TResult>;
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): Promise<TResult>;
/**
* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of the callback.
*/
catch(onrejected?: (reason: any) => T | PromiseLike<T>): Promise<T>;
catch(onrejected?: (reason: any) => void): Promise<T>;
}
interface PromiseConstructor {
/**
* A reference to the prototype.
*/
prototype: Promise<any>;
/**
* Creates a new Promise.
* @param executor A callback used to initialize the promise. This callback is passed two arguments:
* a resolve callback used resolve the promise with a value or the result of another promise,
* and a reject callback used to reject the promise with a provided reason or error.
*/
new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
/**
* Creates a Promise that is resolved with an array of results when all of the provided Promises
* resolve, or rejected when any Promise is rejected.
* @param values An array of Promises.
* @returns A new Promise.
*/
all<T>(values: IterableShim<T | PromiseLike<T>>): Promise<T[]>;
/**
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
* or rejected.
* @param values An array of Promises.
* @returns A new Promise.
*/
race<T>(values: IterableShim<T | PromiseLike<T>>): Promise<T>;
/**
* Creates a new rejected promise for the provided reason.
* @param reason The reason the promise was rejected.
* @returns A new rejected Promise.
*/
reject(reason: any): Promise<void>;
/**
* Creates a new rejected promise for the provided reason.
* @param reason The reason the promise was rejected.
* @returns A new rejected Promise.
*/
reject<T>(reason: any): Promise<T>;
/**
* Creates a new resolved promise for the provided value.
* @param value A promise.
* @returns A promise whose internal state matches the provided promise.
*/
resolve<T>(value: T | PromiseLike<T>): Promise<T>;
/**
* Creates a new resolved promise .
* @returns A resolved promise.
*/
resolve(): Promise<void>;
}
declare var Promise: PromiseConstructor;
interface Map<K, V> {
clear(): void;
delete(key: K): boolean;
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
get(key: K): V;
has(key: K): boolean;
set(key: K, value?: V): Map<K, V>;
size: number;
entries(): IterableIteratorShim<[K, V]>;
keys(): IterableIteratorShim<K>;
values(): IterableIteratorShim<V>;
}
interface MapConstructor {
new <K, V>(): Map<K, V>;
new <K, V>(iterable: IterableShim<[K, V]>): Map<K, V>;
prototype: Map<any, any>;
}
declare var Map: MapConstructor;
interface Set<T> {
add(value: T): Set<T>;
clear(): void;
delete(value: T): boolean;
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
has(value: T): boolean;
size: number;
entries(): IterableIteratorShim<[T, T]>;
keys(): IterableIteratorShim<T>;
values(): IterableIteratorShim<T>;
}
interface SetConstructor {
new <T>(): Set<T>;
new <T>(iterable: IterableShim<T>): Set<T>;
prototype: Set<any>;
}
declare var Set: SetConstructor;
interface WeakMap<K, V> {
delete(key: K): boolean;
get(key: K): V;
has(key: K): boolean;
set(key: K, value?: V): WeakMap<K, V>;
}
interface WeakMapConstructor {
new <K, V>(): WeakMap<K, V>;
new <K, V>(iterable: IterableShim<[K, V]>): WeakMap<K, V>;
prototype: WeakMap<any, any>;
}
declare var WeakMap: WeakMapConstructor;
interface WeakSet<T> {
add(value: T): WeakSet<T>;
delete(value: T): boolean;
has(value: T): boolean;
}
interface WeakSetConstructor {
new <T>(): WeakSet<T>;
new <T>(iterable: IterableShim<T>): WeakSet<T>;
prototype: WeakSet<any>;
}
declare var WeakSet: WeakSetConstructor;
declare module Reflect {
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
function construct(target: Function, argumentsList: ArrayLike<any>): any;
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
function enumerate(target: any): IterableIteratorShim<any>;
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
function getPrototypeOf(target: any): any;
function has(target: any, propertyKey: PropertyKey): boolean;
function isExtensible(target: any): boolean;
function ownKeys(target: any): Array<PropertyKey>;
function preventExtensions(target: any): boolean;
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
function setPrototypeOf(target: any, proto: any): boolean;
}
declare module "es6-shim" {
var String: StringConstructor;
var Array: ArrayConstructor;
var Number: NumberConstructor;
var Math: Math;
var Object: ObjectConstructor;
var Map: MapConstructor;
var Set: SetConstructor;
var WeakMap: WeakMapConstructor;
var WeakSet: WeakSetConstructor;
var Promise: PromiseConstructor;
module Reflect {
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
function construct(target: Function, argumentsList: ArrayLike<any>): any;
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
function enumerate(target: any): Iterator<any>;
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
function getPrototypeOf(target: any): any;
function has(target: any, propertyKey: PropertyKey): boolean;
function isExtensible(target: any): boolean;
function ownKeys(target: any): Array<PropertyKey>;
function preventExtensions(target: any): boolean;
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
function setPrototypeOf(target: any, proto: any): boolean;
}
}

View File

@@ -1,331 +0,0 @@
// Type definitions for Hammer.js 2.0.4
// Project: http://hammerjs.github.io/
// Definitions by: Philip Bulley <https://github.com/milkisevil/>, Han Lin Yap <https://github.com/codler>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare var Hammer:HammerStatic;
declare module "Hammer" {
export = Hammer;
}
interface HammerStatic
{
new( element:HTMLElement, options?:any ): HammerManager;
defaults:HammerDefaults;
VERSION: number;
INPUT_START: number;
INPUT_MOVE: number;
INPUT_END: number;
INPUT_CANCEL: number;
STATE_POSSIBLE: number;
STATE_BEGAN: number;
STATE_CHANGED: number;
STATE_ENDED: number;
STATE_RECOGNIZED: number;
STATE_CANCELLED: number;
STATE_FAILED: number;
DIRECTION_NONE: number;
DIRECTION_LEFT: number;
DIRECTION_RIGHT: number;
DIRECTION_UP: number;
DIRECTION_DOWN: number;
DIRECTION_HORIZONTAL: number;
DIRECTION_VERTICAL: number;
DIRECTION_ALL: number;
Manager: HammerManager;
Input: HammerInput;
TouchAction: TouchAction;
TouchInput: TouchInput;
MouseInput: MouseInput;
PointerEventInput: PointerEventInput;
TouchMouseInput: TouchMouseInput;
SingleTouchInput: SingleTouchInput;
Recognizer: RecognizerStatic;
AttrRecognizer: AttrRecognizerStatic;
Tap: TapRecognizerStatic;
Pan: PanRecognizerStatic;
Swipe: SwipeRecognizerStatic;
Pinch: PinchRecognizerStatic;
Rotate: RotateRecognizerStatic;
Press: PressRecognizerStatic;
on( target:EventTarget, types:string, handler:Function ):void;
off( target:EventTarget, types:string, handler:Function ):void;
each( obj:any, iterator:Function, context:any ): void;
merge( dest:any, src:any ): any;
extend( dest:any, src:any, merge:boolean ): any;
inherit( child:Function, base:Function, properties:any ):any;
bindFn( fn:Function, context:any ):Function;
prefixed( obj:any, property:string ):string;
}
interface HammerDefaults
{
domEvents:boolean;
enable:boolean;
preset:any[];
touchAction:string;
cssProps:CssProps;
inputClass():void;
inputTarget():void;
}
interface CssProps
{
contentZooming:string;
tapHighlightColor:string;
touchCallout:string;
touchSelect:string;
userDrag:string;
userSelect:string;
}
interface HammerOptions extends HammerDefaults
{
}
interface HammerManager
{
new( element:HTMLElement, options?:any ):HammerManager;
add( recogniser:Recognizer ):Recognizer;
add( recogniser:Recognizer ):HammerManager;
add( recogniser:Recognizer[] ):Recognizer;
add( recogniser:Recognizer[] ):HammerManager;
destroy():void;
emit( event:string, data:any ):void;
get( recogniser:Recognizer ):Recognizer;
get( recogniser:string ):Recognizer;
off( events:string, handler:( event:HammerInput ) => void ):void;
on( events:string, handler:( event:HammerInput ) => void ):void;
recognize( inputData:any ):void;
remove( recogniser:Recognizer ):HammerManager;
remove( recogniser:string ):HammerManager;
set( options:HammerOptions ):HammerManager;
stop( force:boolean ):void;
}
declare class HammerInput
{
constructor( manager:HammerManager, callback:Function );
destroy():void;
handler():void;
init():void;
/** Name of the event. Like panstart. */
type:string;
/** Movement of the X axis. */
deltaX:number;
/** Movement of the Y axis. */
deltaY:number;
/** Total time in ms since the first input. */
deltaTime:number;
/** Distance moved. */
distance:number;
/** Angle moved. */
angle:number;
/** Velocity on the X axis, in px/ms. */
velocityX:number;
/** Velocity on the Y axis, in px/ms */
velocityY:number;
/** Highest velocityX/Y value. */
velocity:number;
/** Direction moved. Matches the DIRECTION constants. */
direction:number;
/** Direction moved from it's starting point. Matches the DIRECTION constants. */
offsetDirection:string;
/** Scaling that has been done when multi-touch. 1 on a single touch. */
scale:number;
/** Rotation that has been done when multi-touch. 0 on a single touch. */
rotation:number;
/** Center position for multi-touch, or just the single pointer. */
center:HammerPoint;
/** Source event object, type TouchEvent, MouseEvent or PointerEvent. */
srcEvent:TouchEvent | MouseEvent | PointerEvent;
/** Target that received the event. */
target:HTMLElement;
/** Primary pointer type, could be touch, mouse, pen or kinect. */
pointerType:string;
/** Event type, matches the INPUT constants. */
eventType:string;
/** true when the first input. */
isFirst:boolean;
/** true when the final (last) input. */
isFinal:boolean;
/** Array with all pointers, including the ended pointers (touchend, mouseup). */
pointers:any[];
/** Array with all new/moved/lost pointers. */
changedPointers:any[];
/** Reference to the srcEvent.preventDefault() method. Only for experts! */
preventDefault:Function;
}
declare class MouseInput extends HammerInput
{
constructor( manager:HammerManager, callback:Function );
}
declare class PointerEventInput extends HammerInput
{
constructor( manager:HammerManager, callback:Function );
}
declare class SingleTouchInput extends HammerInput
{
constructor( manager:HammerManager, callback:Function );
}
declare class TouchInput extends HammerInput
{
constructor( manager:HammerManager, callback:Function );
}
declare class TouchMouseInput extends HammerInput
{
constructor( manager:HammerManager, callback:Function );
}
interface RecognizerStatic
{
new( options?:any ):Recognizer;
}
interface Recognizer
{
defaults:any;
canEmit():boolean;
canRecognizeWith( otherRecognizer:Recognizer ):boolean;
dropRecognizeWith( otherRecognizer:Recognizer ):Recognizer;
dropRecognizeWith( otherRecognizer:string ):Recognizer;
dropRequireFailure( otherRecognizer:Recognizer ):Recognizer;
dropRequireFailure( otherRecognizer:string ):Recognizer;
emit( input:HammerInput ):void;
getTouchAction():any[];
hasRequireFailures():boolean;
process( inputData:HammerInput ):string;
recognize( inputData:HammerInput ):void;
recognizeWith( otherRecognizer:Recognizer ):Recognizer;
recognizeWith( otherRecognizer:string ):Recognizer;
requireFailure( otherRecognizer:Recognizer ):Recognizer;
requireFailure( otherRecognizer:string ):Recognizer;
reset():void;
set( options?:any ):Recognizer;
tryEmit( input:HammerInput ):void;
}
interface AttrRecognizerStatic
{
attrTest( input:HammerInput ):boolean;
process( input:HammerInput ):any;
}
interface AttrRecognizer extends Recognizer
{
new( options?:any ):AttrRecognizer;
}
interface PanRecognizerStatic
{
new( options?:any ):PanRecognizer;
}
interface PanRecognizer extends AttrRecognizer
{
}
interface PinchRecognizerStatic
{
new( options?:any ):PinchRecognizer;
}
interface PinchRecognizer extends AttrRecognizer
{
}
interface PressRecognizerStatic
{
new( options?:any ):PressRecognizer;
}
interface PressRecognizer extends AttrRecognizer
{
}
interface RotateRecognizerStatic
{
new( options?:any ):RotateRecognizer;
}
interface RotateRecognizer extends AttrRecognizer
{
}
interface SwipeRecognizerStatic
{
new( options?:any ):SwipeRecognizer;
}
interface SwipeRecognizer
{
}
interface TapRecognizerStatic
{
new( options?:any ):TapRecognizer;
}
interface TapRecognizer extends AttrRecognizer
{
}
declare class TouchAction
{
constructor( manager:HammerManager, value:string );
compute():string;
preventDefaults( input:HammerInput ):void;
preventSrc( srcEvent:any ):void;
set( value:string ):void;
update():void;
}
interface HammerPoint
{
x: number;
y: number;
}

View File

@@ -1,534 +0,0 @@
// Type definitions for Jasmine 2.2
// Project: http://jasmine.github.io/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Theodore Brown <https://github.com/theodorejb>, David Pärsson <https://github.com/davidparsson/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// For ddescribe / iit use : https://github.com/borisyankov/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts
declare function describe(description: string, specDefinitions: () => void): void;
declare function fdescribe(description: string, specDefinitions: () => void): void;
declare function xdescribe(description: string, specDefinitions: () => void): void;
declare function it(expectation: string, assertion?: () => void, timeout?: number): void;
declare function it(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
declare function fit(expectation: string, assertion?: () => void, timeout?: number): void;
declare function fit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
declare function xit(expectation: string, assertion?: () => void, timeout?: number): void;
declare function xit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
/** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */
declare function pending(reason?: string): void;
declare function beforeEach(action: () => void, timeout?: number): void;
declare function beforeEach(action: (done: () => void) => void, timeout?: number): void;
declare function afterEach(action: () => void, timeout?: number): void;
declare function afterEach(action: (done: () => void) => void, timeout?: number): void;
declare function beforeAll(action: () => void, timeout?: number): void;
declare function beforeAll(action: (done: () => void) => void, timeout?: number): void;
declare function afterAll(action: () => void, timeout?: number): void;
declare function afterAll(action: (done: () => void) => void, timeout?: number): void;
declare function expect(spy: Function): jasmine.Matchers;
declare function expect(actual: any): jasmine.Matchers;
declare function fail(e?: any): void;
declare function spyOn(object: any, method: string): jasmine.Spy;
declare function runs(asyncMethod: Function): void;
declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void;
declare function waits(timeout?: number): void;
declare module jasmine {
var clock: () => Clock;
function any(aclass: any): Any;
function anything(): Any;
function arrayContaining(sample: any[]): ArrayContaining;
function objectContaining(sample: any): ObjectContaining;
function createSpy(name: string, originalFn?: Function): Spy;
function createSpyObj(baseName: string, methodNames: any[]): any;
function createSpyObj<T>(baseName: string, methodNames: any[]): T;
function pp(value: any): string;
function getEnv(): Env;
function addCustomEqualityTester(equalityTester: CustomEqualityTester): void;
function addMatchers(matchers: CustomMatcherFactories): void;
function stringMatching(str: string): Any;
function stringMatching(str: RegExp): Any;
interface Any {
new (expectedClass: any): any;
jasmineMatches(other: any): boolean;
jasmineToString(): string;
}
// taken from TypeScript lib.core.es6.d.ts, applicable to CustomMatchers.contains()
interface ArrayLike<T> {
length: number;
[n: number]: T;
}
interface ArrayContaining {
new (sample: any[]): any;
asymmetricMatch(other: any): boolean;
jasmineToString(): string;
}
interface ObjectContaining {
new (sample: any): any;
jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean;
jasmineToString(): string;
}
interface Block {
new (env: Env, func: SpecFunction, spec: Spec): any;
execute(onComplete: () => void): void;
}
interface WaitsBlock extends Block {
new (env: Env, timeout: number, spec: Spec): any;
}
interface WaitsForBlock extends Block {
new (env: Env, timeout: number, latchFunction: SpecFunction, message: string, spec: Spec): any;
}
interface Clock {
install(): void;
uninstall(): void;
/** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */
tick(ms: number): void;
mockDate(date?: Date): void;
}
interface CustomEqualityTester {
(first: any, second: any): boolean;
}
interface CustomMatcher {
compare<T>(actual: T, expected: T): CustomMatcherResult;
compare(actual: any, expected: any): CustomMatcherResult;
}
interface CustomMatcherFactory {
(util: MatchersUtil, customEqualityTesters: Array<CustomEqualityTester>): CustomMatcher;
}
interface CustomMatcherFactories {
[index: string]: CustomMatcherFactory;
}
interface CustomMatcherResult {
pass: boolean;
message?: string;
}
interface MatchersUtil {
equals(a: any, b: any, customTesters?: Array<CustomEqualityTester>): boolean;
contains<T>(haystack: ArrayLike<T> | string, needle: any, customTesters?: Array<CustomEqualityTester>): boolean;
buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array<any>): string;
}
interface Env {
setTimeout: any;
clearTimeout: void;
setInterval: any;
clearInterval: void;
updateInterval: number;
currentSpec: Spec;
matchersClass: Matchers;
version(): any;
versionString(): string;
nextSpecId(): number;
addReporter(reporter: Reporter): void;
execute(): void;
describe(description: string, specDefinitions: () => void): Suite;
// ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these
beforeEach(beforeEachFunction: () => void): void;
beforeAll(beforeAllFunction: () => void): void;
currentRunner(): Runner;
afterEach(afterEachFunction: () => void): void;
afterAll(afterAllFunction: () => void): void;
xdescribe(desc: string, specDefinitions: () => void): XSuite;
it(description: string, func: () => void): Spec;
// iit(description: string, func: () => void): Spec; Not a part of jasmine. Angular team adds these
xit(desc: string, func: () => void): XSpec;
compareRegExps_(a: RegExp, b: RegExp, mismatchKeys: string[], mismatchValues: string[]): boolean;
compareObjects_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean;
equals_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean;
contains_(haystack: any, needle: any): boolean;
addCustomEqualityTester(equalityTester: CustomEqualityTester): void;
addMatchers(matchers: CustomMatcherFactories): void;
specFilter(spec: Spec): boolean;
}
interface FakeTimer {
new (): any;
reset(): void;
tick(millis: number): void;
runFunctionsWithinRange(oldMillis: number, nowMillis: number): void;
scheduleFunction(timeoutKey: any, funcToCall: () => void, millis: number, recurring: boolean): void;
}
interface HtmlReporter {
new (): any;
}
interface HtmlSpecFilter {
new (): any;
}
interface Result {
type: string;
}
interface NestedResults extends Result {
description: string;
totalCount: number;
passedCount: number;
failedCount: number;
skipped: boolean;
rollupCounts(result: NestedResults): void;
log(values: any): void;
getItems(): Result[];
addResult(result: Result): void;
passed(): boolean;
}
interface MessageResult extends Result {
values: any;
trace: Trace;
}
interface ExpectationResult extends Result {
matcherName: string;
passed(): boolean;
expected: any;
actual: any;
message: string;
trace: Trace;
}
interface Trace {
name: string;
message: string;
stack: any;
}
interface PrettyPrinter {
new (): any;
format(value: any): void;
iterateObject(obj: any, fn: (property: string, isGetter: boolean) => void): void;
emitScalar(value: any): void;
emitString(value: string): void;
emitArray(array: any[]): void;
emitObject(obj: any): void;
append(value: any): void;
}
interface StringPrettyPrinter extends PrettyPrinter {
}
interface Queue {
new (env: any): any;
env: Env;
ensured: boolean[];
blocks: Block[];
running: boolean;
index: number;
offset: number;
abort: boolean;
addBefore(block: Block, ensure?: boolean): void;
add(block: any, ensure?: boolean): void;
insertNext(block: any, ensure?: boolean): void;
start(onComplete?: () => void): void;
isRunning(): boolean;
next_(): void;
results(): NestedResults;
}
interface Matchers {
new (env: Env, actual: any, spec: Env, isNot?: boolean): any;
env: Env;
actual: any;
spec: Env;
isNot?: boolean;
message(): any;
(expected: any): boolean;
toBe(expected: any, expectationFailOutput?: any): boolean;
toEqual(expected: any, expectationFailOutput?: any): boolean;
toMatch(expected: any, expectationFailOutput?: any): boolean;
toBeDefined(expectationFailOutput?: any): boolean;
toBeUndefined(expectationFailOutput?: any): boolean;
toBeNull(expectationFailOutput?: any): boolean;
toBeNaN(): boolean;
toBeTruthy(expectationFailOutput?: any): boolean;
toBeFalsy(expectationFailOutput?: any): boolean;
toHaveBeenCalled(): boolean;
toHaveBeenCalledWith(...params: any[]): boolean;
toContain(expected: any, expectationFailOutput?: any): boolean;
toBeLessThan(expected: any, expectationFailOutput?: any): boolean;
toBeGreaterThan(expected: any, expectationFailOutput?: any): boolean;
toBeCloseTo(expected: any, precision: any, expectationFailOutput?: any): boolean;
toContainHtml(expected: string): boolean;
toContainText(expected: string): boolean;
toThrow(expected?: any): boolean;
toThrowError(expected?: any, message?: string): boolean;
not: Matchers;
Any: Any;
}
interface Reporter {
reportRunnerStarting(runner: Runner): void;
reportRunnerResults(runner: Runner): void;
reportSuiteResults(suite: Suite): void;
reportSpecStarting(spec: Spec): void;
reportSpecResults(spec: Spec): void;
log(str: string): void;
}
interface MultiReporter extends Reporter {
addReporter(reporter: Reporter): void;
}
interface Runner {
new (env: Env): any;
execute(): void;
beforeEach(beforeEachFunction: SpecFunction): void;
afterEach(afterEachFunction: SpecFunction): void;
beforeAll(beforeAllFunction: SpecFunction): void;
afterAll(afterAllFunction: SpecFunction): void;
finishCallback(): void;
addSuite(suite: Suite): void;
add(block: Block): void;
specs(): Spec[];
suites(): Suite[];
topLevelSuites(): Suite[];
results(): NestedResults;
}
interface SpecFunction {
(spec?: Spec): void;
}
interface SuiteOrSpec {
id: number;
env: Env;
description: string;
queue: Queue;
}
interface Spec extends SuiteOrSpec {
new (env: Env, suite: Suite, description: string): any;
suite: Suite;
afterCallbacks: SpecFunction[];
spies_: Spy[];
results_: NestedResults;
matchersClass: Matchers;
getFullName(): string;
results(): NestedResults;
log(arguments: any): any;
runs(func: SpecFunction): Spec;
addToQueue(block: Block): void;
addMatcherResult(result: Result): void;
expect(actual: any): any;
waits(timeout: number): Spec;
waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec;
fail(e?: any): void;
getMatchersClass_(): Matchers;
addMatchers(matchersPrototype: CustomMatcherFactories): void;
finishCallback(): void;
finish(onComplete?: () => void): void;
after(doAfter: SpecFunction): void;
execute(onComplete?: () => void): any;
addBeforesAndAftersToQueue(): void;
explodes(): void;
spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy;
removeAllSpies(): void;
}
interface XSpec {
id: number;
runs(): void;
}
interface Suite extends SuiteOrSpec {
new (env: Env, description: string, specDefinitions: () => void, parentSuite: Suite): any;
parentSuite: Suite;
getFullName(): string;
finish(onComplete?: () => void): void;
beforeEach(beforeEachFunction: SpecFunction): void;
afterEach(afterEachFunction: SpecFunction): void;
beforeAll(beforeAllFunction: SpecFunction): void;
afterAll(afterAllFunction: SpecFunction): void;
results(): NestedResults;
add(suiteOrSpec: SuiteOrSpec): void;
specs(): Spec[];
suites(): Suite[];
children(): any[];
execute(onComplete?: () => void): void;
}
interface XSuite {
execute(): void;
}
interface Spy {
(...params: any[]): any;
identity: string;
and: SpyAnd;
calls: Calls;
mostRecentCall: { args: any[]; };
argsForCall: any[];
wasCalled: boolean;
callCount: number;
}
interface SpyAnd {
/** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */
callThrough(): Spy;
/** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */
returnValue(val: any): void;
/** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */
callFake(fn: Function): Spy;
/** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */
throwError(msg: string): void;
/** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */
stub(): Spy;
}
interface Calls {
/** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. **/
any(): boolean;
/** By chaining the spy with calls.count(), will return the number of times the spy was called **/
count(): number;
/** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index **/
argsFor(index: number): any[];
/** By chaining the spy with calls.allArgs(), will return the arguments to all calls **/
allArgs(): any[];
/** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls **/
all(): CallInfo[];
/** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call **/
mostRecent(): CallInfo;
/** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call **/
first(): CallInfo;
/** By chaining the spy with calls.reset(), will clears all tracking for a spy **/
reset(): void;
}
interface CallInfo {
/** The context (the this) for the call */
object: any;
/** All arguments passed to the call */
args: any[];
}
interface Util {
inherit(childClass: Function, parentClass: Function): any;
formatException(e: any): any;
htmlEscape(str: string): string;
argsToArray(args: any): any;
extend(destination: any, source: any): any;
}
interface JsApiReporter extends Reporter {
started: boolean;
finished: boolean;
result: any;
messages: any;
new (): any;
suites(): Suite[];
summarize_(suiteOrSpec: SuiteOrSpec): any;
results(): any;
resultsForSpec(specId: any): any;
log(str: any): any;
resultsForSpecs(specIds: any): any;
summarizeResult_(result: any): any;
}
interface Jasmine {
Spec: Spec;
clock: Clock;
util: Util;
}
export var HtmlReporter: HtmlReporter;
export var HtmlSpecFilter: HtmlSpecFilter;
export var DEFAULT_TIMEOUT_INTERVAL: number;
export interface GlobalPolluter {
describe(description: string, specDefinitions: () => void): void;
fdescribe(description: string, specDefinitions: () => void): void;
xdescribe(description: string, specDefinitions: () => void): void;
it(expectation: string, assertion?: () => void): void;
it(expectation: string, assertion?: (done: () => void) => void): void;
fit(expectation: string, assertion?: () => void): void;
fit(expectation: string, assertion?: (done: () => void) => void): void;
xit(expectation: string, assertion?: () => void): void;
xit(expectation: string, assertion?: (done: () => void) => void): void;
pending(): void;
beforeEach(action: () => void): void;
beforeEach(action: (done: () => void) => void): void;
afterEach(action: () => void): void;
afterEach(action: (done: () => void) => void): void;
beforeAll(action: () => void): void;
beforeAll(action: (done: () => void) => void): void;
afterAll(action: () => void): void;
afterAll(action: (done: () => void) => void): void;
expect(spy: Function): jasmine.Matchers;
expect(actual: any): jasmine.Matchers;
fail(e?: any): void;
spyOn(object: any, method: string): jasmine.Spy;
runs(asyncMethod: Function): void;
waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void;
waits(timeout?: number): void;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
/// <reference path="angular-protractor/angular-protractor.d.ts" />
/// <reference path="es6-shim/es6-shim.d.ts" />
/// <reference path="hammerjs/hammerjs.d.ts" />
/// <reference path="jasmine/jasmine.d.ts" />
/// <reference path="node/node.d.ts" />
/// <reference path="selenium-webdriver/selenium-webdriver.d.ts" />
/// <reference path="zone/zone.d.ts" />

View File

@@ -1,15 +0,0 @@
/// <reference path="../es6-shim/es6-shim.d.ts" />
declare class Zone {
constructor(parentZone: Zone, data: any);
fork(locals: {[key: string]: any}): Zone;
bind(fn: Function, skipEnqueue?: boolean): void;
bindOnce(fn: Function): any;
run(fn: Function, applyTo?: any, applyWith?: any): void;
isRootZone(): boolean;
static bindPromiseFn<T extends () => Promise<any>>(fn: T): T;
static longStackTraceZone: {[key: string]: any};
}

View File

@@ -1,6 +0,0 @@
/**
* @module
* @description
* Adapter allowing AngularJS v1 and Angular v2 to run side by side in the same application.
*/
export { UpgradeAdapter, UpgradeAdapterRef } from './src/upgrade/upgrade_adapter';

View File

@@ -1,556 +0,0 @@
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
*/
// vim: ts=4 sts=4 sw=4 expandtab
// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
;
// UMD (Universal Module Definition)
// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js
(function (root, factory) {
'use strict';
/* global define, exports, module */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like enviroments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.returnExports = factory();
}
}(this, function () {
var call = Function.call;
var prototypeOfObject = Object.prototype;
var owns = call.bind(prototypeOfObject.hasOwnProperty);
var isEnumerable = call.bind(prototypeOfObject.propertyIsEnumerable);
var toStr = call.bind(prototypeOfObject.toString);
// If JS engine supports accessors creating shortcuts.
var defineGetter;
var defineSetter;
var lookupGetter;
var lookupSetter;
var supportsAccessors = owns(prototypeOfObject, '__defineGetter__');
if (supportsAccessors) {
/* eslint-disable no-underscore-dangle */
defineGetter = call.bind(prototypeOfObject.__defineGetter__);
defineSetter = call.bind(prototypeOfObject.__defineSetter__);
lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
/* eslint-enable no-underscore-dangle */
}
// ES5 15.2.3.2
// http://es5.github.com/#x15.2.3.2
if (!Object.getPrototypeOf) {
// https://github.com/es-shims/es5-shim/issues#issue/2
// http://ejohn.org/blog/objectgetprototypeof/
// recommended by fschaefer on github
//
// sure, and webreflection says ^_^
// ... this will nerever possibly return null
// ... Opera Mini breaks here with infinite loops
Object.getPrototypeOf = function getPrototypeOf(object) {
/* eslint-disable no-proto */
var proto = object.__proto__;
/* eslint-enable no-proto */
if (proto || proto === null) {
return proto;
} else if (toStr(object.constructor) === '[object Function]') {
return object.constructor.prototype;
} else if (object instanceof Object) {
return prototypeOfObject;
} else {
// Correctly return null for Objects created with `Object.create(null)`
// (shammed or native) or `{ __proto__: null}`. Also returns null for
// cross-realm objects on browsers that lack `__proto__` support (like
// IE <11), but that's the best we can do.
return null;
}
};
}
// ES5 15.2.3.3
// http://es5.github.com/#x15.2.3.3
var doesGetOwnPropertyDescriptorWork = function doesGetOwnPropertyDescriptorWork(object) {
try {
object.sentinel = 0;
return Object.getOwnPropertyDescriptor(object, 'sentinel').value === 0;
} catch (exception) {
return false;
}
};
// check whether getOwnPropertyDescriptor works if it's given. Otherwise, shim partially.
if (Object.defineProperty) {
var getOwnPropertyDescriptorWorksOnObject = doesGetOwnPropertyDescriptorWork({});
var getOwnPropertyDescriptorWorksOnDom = typeof document === 'undefined' ||
doesGetOwnPropertyDescriptorWork(document.createElement('div'));
if (!getOwnPropertyDescriptorWorksOnDom || !getOwnPropertyDescriptorWorksOnObject) {
var getOwnPropertyDescriptorFallback = Object.getOwnPropertyDescriptor;
}
}
if (!Object.getOwnPropertyDescriptor || getOwnPropertyDescriptorFallback) {
var ERR_NON_OBJECT = 'Object.getOwnPropertyDescriptor called on a non-object: ';
/* eslint-disable no-proto */
Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
if ((typeof object !== 'object' && typeof object !== 'function') || object === null) {
throw new TypeError(ERR_NON_OBJECT + object);
}
// make a valiant attempt to use the real getOwnPropertyDescriptor
// for I8's DOM elements.
if (getOwnPropertyDescriptorFallback) {
try {
return getOwnPropertyDescriptorFallback.call(Object, object, property);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
var descriptor;
// If object does not owns property return undefined immediately.
if (!owns(object, property)) {
return descriptor;
}
// If object has a property then it's for sure `configurable`, and
// probably `enumerable`. Detect enumerability though.
descriptor = {
enumerable: isEnumerable(object, property),
configurable: true
};
// If JS engine supports accessor properties then property may be a
// getter or setter.
if (supportsAccessors) {
// Unfortunately `__lookupGetter__` will return a getter even
// if object has own non getter property along with a same named
// inherited getter. To avoid misbehavior we temporary remove
// `__proto__` so that `__lookupGetter__` will return getter only
// if it's owned by an object.
var prototype = object.__proto__;
var notPrototypeOfObject = object !== prototypeOfObject;
// avoid recursion problem, breaking in Opera Mini when
// Object.getOwnPropertyDescriptor(Object.prototype, 'toString')
// or any other Object.prototype accessor
if (notPrototypeOfObject) {
object.__proto__ = prototypeOfObject;
}
var getter = lookupGetter(object, property);
var setter = lookupSetter(object, property);
if (notPrototypeOfObject) {
// Once we have getter and setter we can put values back.
object.__proto__ = prototype;
}
if (getter || setter) {
if (getter) {
descriptor.get = getter;
}
if (setter) {
descriptor.set = setter;
}
// If it was accessor property we're done and return here
// in order to avoid adding `value` to the descriptor.
return descriptor;
}
}
// If we got this far we know that object has an own property that is
// not an accessor so we set it as a value and return descriptor.
descriptor.value = object[property];
descriptor.writable = true;
return descriptor;
};
/* eslint-enable no-proto */
}
// ES5 15.2.3.4
// http://es5.github.com/#x15.2.3.4
if (!Object.getOwnPropertyNames) {
Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
return Object.keys(object);
};
}
// ES5 15.2.3.5
// http://es5.github.com/#x15.2.3.5
if (!Object.create) {
// Contributed by Brandon Benvie, October, 2012
var createEmpty;
var supportsProto = !({ __proto__: null } instanceof Object);
// the following produces false positives
// in Opera Mini => not a reliable check
// Object.prototype.__proto__ === null
// Check for document.domain and active x support
// No need to use active x approach when document.domain is not set
// see https://github.com/es-shims/es5-shim/issues/150
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
/* global ActiveXObject */
var shouldUseActiveX = function shouldUseActiveX() {
// return early if document.domain not set
if (!document.domain) {
return false;
}
try {
return !!new ActiveXObject('htmlfile');
} catch (exception) {
return false;
}
};
// This supports IE8 when document.domain is used
// see https://github.com/es-shims/es5-shim/issues/150
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
var getEmptyViaActiveX = function getEmptyViaActiveX() {
var empty;
var xDoc;
xDoc = new ActiveXObject('htmlfile');
xDoc.write('<script><\/script>');
xDoc.close();
empty = xDoc.parentWindow.Object.prototype;
xDoc = null;
return empty;
};
// The original implementation using an iframe
// before the activex approach was added
// see https://github.com/es-shims/es5-shim/issues/150
var getEmptyViaIFrame = function getEmptyViaIFrame() {
var iframe = document.createElement('iframe');
var parent = document.body || document.documentElement;
var empty;
iframe.style.display = 'none';
parent.appendChild(iframe);
/* eslint-disable no-script-url */
iframe.src = 'javascript:';
/* eslint-enable no-script-url */
empty = iframe.contentWindow.Object.prototype;
parent.removeChild(iframe);
iframe = null;
return empty;
};
/* global document */
if (supportsProto || typeof document === 'undefined') {
createEmpty = function () {
return { __proto__: null };
};
} else {
// In old IE __proto__ can't be used to manually set `null`, nor does
// any other method exist to make an object that inherits from nothing,
// aside from Object.prototype itself. Instead, create a new global
// object and *steal* its Object.prototype and strip it bare. This is
// used as the prototype to create nullary objects.
createEmpty = function () {
// Determine which approach to use
// see https://github.com/es-shims/es5-shim/issues/150
var empty = shouldUseActiveX() ? getEmptyViaActiveX() : getEmptyViaIFrame();
delete empty.constructor;
delete empty.hasOwnProperty;
delete empty.propertyIsEnumerable;
delete empty.isPrototypeOf;
delete empty.toLocaleString;
delete empty.toString;
delete empty.valueOf;
var Empty = function Empty() {};
Empty.prototype = empty;
// short-circuit future calls
createEmpty = function () {
return new Empty();
};
return new Empty();
};
}
Object.create = function create(prototype, properties) {
var object;
var Type = function Type() {}; // An empty constructor.
if (prototype === null) {
object = createEmpty();
} else {
if (typeof prototype !== 'object' && typeof prototype !== 'function') {
// In the native implementation `parent` can be `null`
// OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc)
// Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object`
// like they are in modern browsers. Using `Object.create` on DOM elements
// is...err...probably inappropriate, but the native version allows for it.
throw new TypeError('Object prototype may only be an Object or null'); // same msg as Chrome
}
Type.prototype = prototype;
object = new Type();
// IE has no built-in implementation of `Object.getPrototypeOf`
// neither `__proto__`, but this manually setting `__proto__` will
// guarantee that `Object.getPrototypeOf` will work as expected with
// objects created using `Object.create`
/* eslint-disable no-proto */
object.__proto__ = prototype;
/* eslint-enable no-proto */
}
if (properties !== void 0) {
Object.defineProperties(object, properties);
}
return object;
};
}
// ES5 15.2.3.6
// http://es5.github.com/#x15.2.3.6
// Patch for WebKit and IE8 standard mode
// Designed by hax <hax.github.com>
// related issue: https://github.com/es-shims/es5-shim/issues#issue/5
// IE8 Reference:
// http://msdn.microsoft.com/en-us/library/dd282900.aspx
// http://msdn.microsoft.com/en-us/library/dd229916.aspx
// WebKit Bugs:
// https://bugs.webkit.org/show_bug.cgi?id=36423
var doesDefinePropertyWork = function doesDefinePropertyWork(object) {
try {
Object.defineProperty(object, 'sentinel', {});
return 'sentinel' in object;
} catch (exception) {
return false;
}
};
// check whether defineProperty works if it's given. Otherwise,
// shim partially.
if (Object.defineProperty) {
var definePropertyWorksOnObject = doesDefinePropertyWork({});
var definePropertyWorksOnDom = typeof document === 'undefined' ||
doesDefinePropertyWork(document.createElement('div'));
if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) {
var definePropertyFallback = Object.defineProperty,
definePropertiesFallback = Object.defineProperties;
}
}
if (!Object.defineProperty || definePropertyFallback) {
var ERR_NON_OBJECT_DESCRIPTOR = 'Property description must be an object: ';
var ERR_NON_OBJECT_TARGET = 'Object.defineProperty called on non-object: ';
var ERR_ACCESSORS_NOT_SUPPORTED = 'getters & setters can not be defined on this javascript engine';
Object.defineProperty = function defineProperty(object, property, descriptor) {
if ((typeof object !== 'object' && typeof object !== 'function') || object === null) {
throw new TypeError(ERR_NON_OBJECT_TARGET + object);
}
if ((typeof descriptor !== 'object' && typeof descriptor !== 'function') || descriptor === null) {
throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);
}
// make a valiant attempt to use the real defineProperty
// for I8's DOM elements.
if (definePropertyFallback) {
try {
return definePropertyFallback.call(Object, object, property, descriptor);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
// If it's a data property.
if ('value' in descriptor) {
// fail silently if 'writable', 'enumerable', or 'configurable'
// are requested but not supported
/*
// alternate approach:
if ( // can't implement these features; allow false but not true
('writable' in descriptor && !descriptor.writable) ||
('enumerable' in descriptor && !descriptor.enumerable) ||
('configurable' in descriptor && !descriptor.configurable)
))
throw new RangeError(
'This implementation of Object.defineProperty does not support configurable, enumerable, or writable.'
);
*/
if (supportsAccessors && (lookupGetter(object, property) || lookupSetter(object, property))) {
// As accessors are supported only on engines implementing
// `__proto__` we can safely override `__proto__` while defining
// a property to make sure that we don't hit an inherited
// accessor.
/* eslint-disable no-proto */
var prototype = object.__proto__;
object.__proto__ = prototypeOfObject;
// Deleting a property anyway since getter / setter may be
// defined on object itself.
delete object[property];
object[property] = descriptor.value;
// Setting original `__proto__` back now.
object.__proto__ = prototype;
/* eslint-enable no-proto */
} else {
object[property] = descriptor.value;
}
} else {
if (!supportsAccessors && (('get' in descriptor) || ('set' in descriptor))) {
throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
}
// If we got that far then getters and setters can be defined !!
if ('get' in descriptor) {
defineGetter(object, property, descriptor.get);
}
if ('set' in descriptor) {
defineSetter(object, property, descriptor.set);
}
}
return object;
};
}
// ES5 15.2.3.7
// http://es5.github.com/#x15.2.3.7
if (!Object.defineProperties || definePropertiesFallback) {
Object.defineProperties = function defineProperties(object, properties) {
// make a valiant attempt to use the real defineProperties
if (definePropertiesFallback) {
try {
return definePropertiesFallback.call(Object, object, properties);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
Object.keys(properties).forEach(function (property) {
if (property !== '__proto__') {
Object.defineProperty(object, property, properties[property]);
}
});
return object;
};
}
// ES5 15.2.3.8
// http://es5.github.com/#x15.2.3.8
if (!Object.seal) {
Object.seal = function seal(object) {
if (Object(object) !== object) {
throw new TypeError('Object.seal can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// ES5 15.2.3.9
// http://es5.github.com/#x15.2.3.9
if (!Object.freeze) {
Object.freeze = function freeze(object) {
if (Object(object) !== object) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// detect a Rhino bug and patch it
try {
Object.freeze(function () {});
} catch (exception) {
Object.freeze = (function (freezeObject) {
return function freeze(object) {
if (typeof object === 'function') {
return object;
} else {
return freezeObject(object);
}
};
}(Object.freeze));
}
// ES5 15.2.3.10
// http://es5.github.com/#x15.2.3.10
if (!Object.preventExtensions) {
Object.preventExtensions = function preventExtensions(object) {
if (Object(object) !== object) {
throw new TypeError('Object.preventExtensions can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// ES5 15.2.3.11
// http://es5.github.com/#x15.2.3.11
if (!Object.isSealed) {
Object.isSealed = function isSealed(object) {
if (Object(object) !== object) {
throw new TypeError('Object.isSealed can only be called on Objects.');
}
return false;
};
}
// ES5 15.2.3.12
// http://es5.github.com/#x15.2.3.12
if (!Object.isFrozen) {
Object.isFrozen = function isFrozen(object) {
if (Object(object) !== object) {
throw new TypeError('Object.isFrozen can only be called on Objects.');
}
return false;
};
}
// ES5 15.2.3.13
// http://es5.github.com/#x15.2.3.13
if (!Object.isExtensible) {
Object.isExtensible = function isExtensible(object) {
// 1. If Type(O) is not Object throw a TypeError exception.
if (Object(object) !== object) {
throw new TypeError('Object.isExtensible can only be called on Objects.');
}
// 2. Return the Boolean value of the [[Extensible]] internal property of O.
var name = '';
while (owns(object, name)) {
name += '?';
}
object[name] = true;
var returnValue = owns(object, name);
delete object[name];
return returnValue;
};
}
}));

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,29 +0,0 @@
# Master
# 3.0.2
* correctly bump both bower and package.json versions
# 3.0.1
* no longer include dist/test in npm releases
# 3.0.0
* use nextTick() instead of setImmediate() to schedule microtasks with node 0.10. Later versions of
nodes are not affected as they were already using nextTick(). Note that using nextTick() might
trigger a depreciation warning on 0.10 as described at https://github.com/cujojs/when/issues/410.
The reason why nextTick() is preferred is that is setImmediate() would schedule a macrotask
instead of a microtask and might result in a different scheduling.
If needed you can revert to the former behavior as follow:
var Promise = require('es6-promise').Promise;
Promise._setScheduler(setImmediate);
# 2.0.0
* re-sync with RSVP. Many large performance improvements and bugfixes.
# 1.0.0
* first subset of RSVP

View File

@@ -1,19 +0,0 @@
Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,61 +0,0 @@
# ES6-Promise (subset of [rsvp.js](https://github.com/tildeio/rsvp.js))
This is a polyfill of the [ES6 Promise](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-constructor). The implementation is a subset of [rsvp.js](https://github.com/tildeio/rsvp.js), if you're wanting extra features and more debugging options, check out the [full library](https://github.com/tildeio/rsvp.js).
For API details and how to use promises, see the <a href="http://www.html5rocks.com/en/tutorials/es6/promises/">JavaScript Promises HTML5Rocks article</a>.
## Downloads
* [es6-promise](https://raw.githubusercontent.com/jakearchibald/es6-promise/master/dist/es6-promise.js)
* [es6-promise-min](https://raw.githubusercontent.com/jakearchibald/es6-promise/master/dist/es6-promise.min.js)
## Node.js
To install:
```sh
npm install es6-promise
```
To use:
```js
var Promise = require('es6-promise').Promise;
```
## Usage in IE<9
`catch` is a reserved word in IE<9, meaning `promise.catch(func)` throws a syntax error. To work around this, you can use a string to access the property as shown in the following example.
However, please remember that such technique is already provided by most common minifiers, making the resulting code safe for old browsers and production:
```js
promise['catch'](function(err) {
// ...
});
```
Or use `.then` instead:
```js
promise.then(undefined, function(err) {
// ...
});
```
## Auto-polyfill
To polyfill the global environment (either in Node or in the browser via CommonJS) use the following code snippet:
```js
require('es6-promise').polyfill();
```
Notice that we don't assign the result of `polyfill()` to any variable. The `polyfill()` method will patch the global environment (in this case to the `Promise` name) when called.
## Building & Testing
* `npm run build` to build
* `npm test` to run tests
* `npm start` to run a build watcher, and webserver to test
* `npm run test:server` for a testem test runner and watching builder

View File

@@ -1,967 +0,0 @@
/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
* @version 3.0.2
*/
(function() {
"use strict";
function lib$es6$promise$utils$$objectOrFunction(x) {
return typeof x === 'function' || (typeof x === 'object' && x !== null);
}
function lib$es6$promise$utils$$isFunction(x) {
return typeof x === 'function';
}
function lib$es6$promise$utils$$isMaybeThenable(x) {
return typeof x === 'object' && x !== null;
}
var lib$es6$promise$utils$$_isArray;
if (!Array.isArray) {
lib$es6$promise$utils$$_isArray = function (x) {
return Object.prototype.toString.call(x) === '[object Array]';
};
} else {
lib$es6$promise$utils$$_isArray = Array.isArray;
}
var lib$es6$promise$utils$$isArray = lib$es6$promise$utils$$_isArray;
var lib$es6$promise$asap$$len = 0;
var lib$es6$promise$asap$$toString = {}.toString;
var lib$es6$promise$asap$$vertxNext;
var lib$es6$promise$asap$$customSchedulerFn;
var lib$es6$promise$asap$$asap = function asap(callback, arg) {
lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len] = callback;
lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len + 1] = arg;
lib$es6$promise$asap$$len += 2;
if (lib$es6$promise$asap$$len === 2) {
// If len is 2, that means that we need to schedule an async flush.
// If additional callbacks are queued before the queue is flushed, they
// will be processed by this flush that we are scheduling.
if (lib$es6$promise$asap$$customSchedulerFn) {
lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush);
} else {
lib$es6$promise$asap$$scheduleFlush();
}
}
}
function lib$es6$promise$asap$$setScheduler(scheduleFn) {
lib$es6$promise$asap$$customSchedulerFn = scheduleFn;
}
function lib$es6$promise$asap$$setAsap(asapFn) {
lib$es6$promise$asap$$asap = asapFn;
}
var lib$es6$promise$asap$$browserWindow = (typeof window !== 'undefined') ? window : undefined;
var lib$es6$promise$asap$$browserGlobal = lib$es6$promise$asap$$browserWindow || {};
var lib$es6$promise$asap$$BrowserMutationObserver = lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;
var lib$es6$promise$asap$$isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
// test for web worker but not in IE10
var lib$es6$promise$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' &&
typeof importScripts !== 'undefined' &&
typeof MessageChannel !== 'undefined';
// node
function lib$es6$promise$asap$$useNextTick() {
// node version 0.10.x displays a deprecation warning when nextTick is used recursively
// see https://github.com/cujojs/when/issues/410 for details
return function() {
process.nextTick(lib$es6$promise$asap$$flush);
};
}
// vertx
function lib$es6$promise$asap$$useVertxTimer() {
return function() {
lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush);
};
}
function lib$es6$promise$asap$$useMutationObserver() {
var iterations = 0;
var observer = new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);
var node = document.createTextNode('');
observer.observe(node, { characterData: true });
return function() {
node.data = (iterations = ++iterations % 2);
};
}
// web worker
function lib$es6$promise$asap$$useMessageChannel() {
var channel = new MessageChannel();
channel.port1.onmessage = lib$es6$promise$asap$$flush;
return function () {
channel.port2.postMessage(0);
};
}
function lib$es6$promise$asap$$useSetTimeout() {
return function() {
setTimeout(lib$es6$promise$asap$$flush, 1);
};
}
var lib$es6$promise$asap$$queue = new Array(1000);
function lib$es6$promise$asap$$flush() {
for (var i = 0; i < lib$es6$promise$asap$$len; i+=2) {
var callback = lib$es6$promise$asap$$queue[i];
var arg = lib$es6$promise$asap$$queue[i+1];
callback(arg);
lib$es6$promise$asap$$queue[i] = undefined;
lib$es6$promise$asap$$queue[i+1] = undefined;
}
lib$es6$promise$asap$$len = 0;
}
function lib$es6$promise$asap$$attemptVertx() {
try {
var r = require;
var vertx = r('vertx');
lib$es6$promise$asap$$vertxNext = vertx.runOnLoop || vertx.runOnContext;
return lib$es6$promise$asap$$useVertxTimer();
} catch(e) {
return lib$es6$promise$asap$$useSetTimeout();
}
}
var lib$es6$promise$asap$$scheduleFlush;
// Decide what async method to use to triggering processing of queued callbacks:
if (lib$es6$promise$asap$$isNode) {
lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useNextTick();
} else if (lib$es6$promise$asap$$BrowserMutationObserver) {
lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMutationObserver();
} else if (lib$es6$promise$asap$$isWorker) {
lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMessageChannel();
} else if (lib$es6$promise$asap$$browserWindow === undefined && typeof require === 'function') {
lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertx();
} else {
lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useSetTimeout();
}
function lib$es6$promise$$internal$$noop() {}
var lib$es6$promise$$internal$$PENDING = void 0;
var lib$es6$promise$$internal$$FULFILLED = 1;
var lib$es6$promise$$internal$$REJECTED = 2;
var lib$es6$promise$$internal$$GET_THEN_ERROR = new lib$es6$promise$$internal$$ErrorObject();
function lib$es6$promise$$internal$$selfFulfillment() {
return new TypeError("You cannot resolve a promise with itself");
}
function lib$es6$promise$$internal$$cannotReturnOwn() {
return new TypeError('A promises callback cannot return that same promise.');
}
function lib$es6$promise$$internal$$getThen(promise) {
try {
return promise.then;
} catch(error) {
lib$es6$promise$$internal$$GET_THEN_ERROR.error = error;
return lib$es6$promise$$internal$$GET_THEN_ERROR;
}
}
function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {
try {
then.call(value, fulfillmentHandler, rejectionHandler);
} catch(e) {
return e;
}
}
function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) {
lib$es6$promise$asap$$asap(function(promise) {
var sealed = false;
var error = lib$es6$promise$$internal$$tryThen(then, thenable, function(value) {
if (sealed) { return; }
sealed = true;
if (thenable !== value) {
lib$es6$promise$$internal$$resolve(promise, value);
} else {
lib$es6$promise$$internal$$fulfill(promise, value);
}
}, function(reason) {
if (sealed) { return; }
sealed = true;
lib$es6$promise$$internal$$reject(promise, reason);
}, 'Settle: ' + (promise._label || ' unknown promise'));
if (!sealed && error) {
sealed = true;
lib$es6$promise$$internal$$reject(promise, error);
}
}, promise);
}
function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) {
if (thenable._state === lib$es6$promise$$internal$$FULFILLED) {
lib$es6$promise$$internal$$fulfill(promise, thenable._result);
} else if (thenable._state === lib$es6$promise$$internal$$REJECTED) {
lib$es6$promise$$internal$$reject(promise, thenable._result);
} else {
lib$es6$promise$$internal$$subscribe(thenable, undefined, function(value) {
lib$es6$promise$$internal$$resolve(promise, value);
}, function(reason) {
lib$es6$promise$$internal$$reject(promise, reason);
});
}
}
function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) {
if (maybeThenable.constructor === promise.constructor) {
lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable);
} else {
var then = lib$es6$promise$$internal$$getThen(maybeThenable);
if (then === lib$es6$promise$$internal$$GET_THEN_ERROR) {
lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error);
} else if (then === undefined) {
lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
} else if (lib$es6$promise$utils$$isFunction(then)) {
lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then);
} else {
lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
}
}
}
function lib$es6$promise$$internal$$resolve(promise, value) {
if (promise === value) {
lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFulfillment());
} else if (lib$es6$promise$utils$$objectOrFunction(value)) {
lib$es6$promise$$internal$$handleMaybeThenable(promise, value);
} else {
lib$es6$promise$$internal$$fulfill(promise, value);
}
}
function lib$es6$promise$$internal$$publishRejection(promise) {
if (promise._onerror) {
promise._onerror(promise._result);
}
lib$es6$promise$$internal$$publish(promise);
}
function lib$es6$promise$$internal$$fulfill(promise, value) {
if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; }
promise._result = value;
promise._state = lib$es6$promise$$internal$$FULFILLED;
if (promise._subscribers.length !== 0) {
lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise);
}
}
function lib$es6$promise$$internal$$reject(promise, reason) {
if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; }
promise._state = lib$es6$promise$$internal$$REJECTED;
promise._result = reason;
lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise);
}
function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) {
var subscribers = parent._subscribers;
var length = subscribers.length;
parent._onerror = null;
subscribers[length] = child;
subscribers[length + lib$es6$promise$$internal$$FULFILLED] = onFulfillment;
subscribers[length + lib$es6$promise$$internal$$REJECTED] = onRejection;
if (length === 0 && parent._state) {
lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent);
}
}
function lib$es6$promise$$internal$$publish(promise) {
var subscribers = promise._subscribers;
var settled = promise._state;
if (subscribers.length === 0) { return; }
var child, callback, detail = promise._result;
for (var i = 0; i < subscribers.length; i += 3) {
child = subscribers[i];
callback = subscribers[i + settled];
if (child) {
lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail);
} else {
callback(detail);
}
}
promise._subscribers.length = 0;
}
function lib$es6$promise$$internal$$ErrorObject() {
this.error = null;
}
var lib$es6$promise$$internal$$TRY_CATCH_ERROR = new lib$es6$promise$$internal$$ErrorObject();
function lib$es6$promise$$internal$$tryCatch(callback, detail) {
try {
return callback(detail);
} catch(e) {
lib$es6$promise$$internal$$TRY_CATCH_ERROR.error = e;
return lib$es6$promise$$internal$$TRY_CATCH_ERROR;
}
}
function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) {
var hasCallback = lib$es6$promise$utils$$isFunction(callback),
value, error, succeeded, failed;
if (hasCallback) {
value = lib$es6$promise$$internal$$tryCatch(callback, detail);
if (value === lib$es6$promise$$internal$$TRY_CATCH_ERROR) {
failed = true;
error = value.error;
value = null;
} else {
succeeded = true;
}
if (promise === value) {
lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn());
return;
}
} else {
value = detail;
succeeded = true;
}
if (promise._state !== lib$es6$promise$$internal$$PENDING) {
// noop
} else if (hasCallback && succeeded) {
lib$es6$promise$$internal$$resolve(promise, value);
} else if (failed) {
lib$es6$promise$$internal$$reject(promise, error);
} else if (settled === lib$es6$promise$$internal$$FULFILLED) {
lib$es6$promise$$internal$$fulfill(promise, value);
} else if (settled === lib$es6$promise$$internal$$REJECTED) {
lib$es6$promise$$internal$$reject(promise, value);
}
}
function lib$es6$promise$$internal$$initializePromise(promise, resolver) {
try {
resolver(function resolvePromise(value){
lib$es6$promise$$internal$$resolve(promise, value);
}, function rejectPromise(reason) {
lib$es6$promise$$internal$$reject(promise, reason);
});
} catch(e) {
lib$es6$promise$$internal$$reject(promise, e);
}
}
function lib$es6$promise$enumerator$$Enumerator(Constructor, input) {
var enumerator = this;
enumerator._instanceConstructor = Constructor;
enumerator.promise = new Constructor(lib$es6$promise$$internal$$noop);
if (enumerator._validateInput(input)) {
enumerator._input = input;
enumerator.length = input.length;
enumerator._remaining = input.length;
enumerator._init();
if (enumerator.length === 0) {
lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
} else {
enumerator.length = enumerator.length || 0;
enumerator._enumerate();
if (enumerator._remaining === 0) {
lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
}
}
} else {
lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError());
}
}
lib$es6$promise$enumerator$$Enumerator.prototype._validateInput = function(input) {
return lib$es6$promise$utils$$isArray(input);
};
lib$es6$promise$enumerator$$Enumerator.prototype._validationError = function() {
return new Error('Array Methods must be provided an Array');
};
lib$es6$promise$enumerator$$Enumerator.prototype._init = function() {
this._result = new Array(this.length);
};
var lib$es6$promise$enumerator$$default = lib$es6$promise$enumerator$$Enumerator;
lib$es6$promise$enumerator$$Enumerator.prototype._enumerate = function() {
var enumerator = this;
var length = enumerator.length;
var promise = enumerator.promise;
var input = enumerator._input;
for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) {
enumerator._eachEntry(input[i], i);
}
};
lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry = function(entry, i) {
var enumerator = this;
var c = enumerator._instanceConstructor;
if (lib$es6$promise$utils$$isMaybeThenable(entry)) {
if (entry.constructor === c && entry._state !== lib$es6$promise$$internal$$PENDING) {
entry._onerror = null;
enumerator._settledAt(entry._state, i, entry._result);
} else {
enumerator._willSettleAt(c.resolve(entry), i);
}
} else {
enumerator._remaining--;
enumerator._result[i] = entry;
}
};
lib$es6$promise$enumerator$$Enumerator.prototype._settledAt = function(state, i, value) {
var enumerator = this;
var promise = enumerator.promise;
if (promise._state === lib$es6$promise$$internal$$PENDING) {
enumerator._remaining--;
if (state === lib$es6$promise$$internal$$REJECTED) {
lib$es6$promise$$internal$$reject(promise, value);
} else {
enumerator._result[i] = value;
}
}
if (enumerator._remaining === 0) {
lib$es6$promise$$internal$$fulfill(promise, enumerator._result);
}
};
lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt = function(promise, i) {
var enumerator = this;
lib$es6$promise$$internal$$subscribe(promise, undefined, function(value) {
enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value);
}, function(reason) {
enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason);
});
};
function lib$es6$promise$promise$all$$all(entries) {
return new lib$es6$promise$enumerator$$default(this, entries).promise;
}
var lib$es6$promise$promise$all$$default = lib$es6$promise$promise$all$$all;
function lib$es6$promise$promise$race$$race(entries) {
/*jshint validthis:true */
var Constructor = this;
var promise = new Constructor(lib$es6$promise$$internal$$noop);
if (!lib$es6$promise$utils$$isArray(entries)) {
lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.'));
return promise;
}
var length = entries.length;
function onFulfillment(value) {
lib$es6$promise$$internal$$resolve(promise, value);
}
function onRejection(reason) {
lib$es6$promise$$internal$$reject(promise, reason);
}
for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) {
lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
}
return promise;
}
var lib$es6$promise$promise$race$$default = lib$es6$promise$promise$race$$race;
function lib$es6$promise$promise$resolve$$resolve(object) {
/*jshint validthis:true */
var Constructor = this;
if (object && typeof object === 'object' && object.constructor === Constructor) {
return object;
}
var promise = new Constructor(lib$es6$promise$$internal$$noop);
lib$es6$promise$$internal$$resolve(promise, object);
return promise;
}
var lib$es6$promise$promise$resolve$$default = lib$es6$promise$promise$resolve$$resolve;
function lib$es6$promise$promise$reject$$reject(reason) {
/*jshint validthis:true */
var Constructor = this;
var promise = new Constructor(lib$es6$promise$$internal$$noop);
lib$es6$promise$$internal$$reject(promise, reason);
return promise;
}
var lib$es6$promise$promise$reject$$default = lib$es6$promise$promise$reject$$reject;
var lib$es6$promise$promise$$counter = 0;
function lib$es6$promise$promise$$needsResolver() {
throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
}
function lib$es6$promise$promise$$needsNew() {
throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
}
var lib$es6$promise$promise$$default = lib$es6$promise$promise$$Promise;
/**
Promise objects represent the eventual result of an asynchronous operation. The
primary way of interacting with a promise is through its `then` method, which
registers callbacks to receive either a promise's eventual value or the reason
why the promise cannot be fulfilled.
Terminology
-----------
- `promise` is an object or function with a `then` method whose behavior conforms to this specification.
- `thenable` is an object or function that defines a `then` method.
- `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
- `exception` is a value that is thrown using the throw statement.
- `reason` is a value that indicates why a promise was rejected.
- `settled` the final resting state of a promise, fulfilled or rejected.
A promise can be in one of three states: pending, fulfilled, or rejected.
Promises that are fulfilled have a fulfillment value and are in the fulfilled
state. Promises that are rejected have a rejection reason and are in the
rejected state. A fulfillment value is never a thenable.
Promises can also be said to *resolve* a value. If this value is also a
promise, then the original promise's settled state will match the value's
settled state. So a promise that *resolves* a promise that rejects will
itself reject, and a promise that *resolves* a promise that fulfills will
itself fulfill.
Basic Usage:
------------
```js
var promise = new Promise(function(resolve, reject) {
// on success
resolve(value);
// on failure
reject(reason);
});
promise.then(function(value) {
// on fulfillment
}, function(reason) {
// on rejection
});
```
Advanced Usage:
---------------
Promises shine when abstracting away asynchronous interactions such as
`XMLHttpRequest`s.
```js
function getJSON(url) {
return new Promise(function(resolve, reject){
var xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.onreadystatechange = handler;
xhr.responseType = 'json';
xhr.setRequestHeader('Accept', 'application/json');
xhr.send();
function handler() {
if (this.readyState === this.DONE) {
if (this.status === 200) {
resolve(this.response);
} else {
reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
}
}
};
});
}
getJSON('/posts.json').then(function(json) {
// on fulfillment
}, function(reason) {
// on rejection
});
```
Unlike callbacks, promises are great composable primitives.
```js
Promise.all([
getJSON('/posts'),
getJSON('/comments')
]).then(function(values){
values[0] // => postsJSON
values[1] // => commentsJSON
return values;
});
```
@class Promise
@param {function} resolver
Useful for tooling.
@constructor
*/
function lib$es6$promise$promise$$Promise(resolver) {
this._id = lib$es6$promise$promise$$counter++;
this._state = undefined;
this._result = undefined;
this._subscribers = [];
if (lib$es6$promise$$internal$$noop !== resolver) {
if (!lib$es6$promise$utils$$isFunction(resolver)) {
lib$es6$promise$promise$$needsResolver();
}
if (!(this instanceof lib$es6$promise$promise$$Promise)) {
lib$es6$promise$promise$$needsNew();
}
lib$es6$promise$$internal$$initializePromise(this, resolver);
}
}
lib$es6$promise$promise$$Promise.all = lib$es6$promise$promise$all$$default;
lib$es6$promise$promise$$Promise.race = lib$es6$promise$promise$race$$default;
lib$es6$promise$promise$$Promise.resolve = lib$es6$promise$promise$resolve$$default;
lib$es6$promise$promise$$Promise.reject = lib$es6$promise$promise$reject$$default;
lib$es6$promise$promise$$Promise._setScheduler = lib$es6$promise$asap$$setScheduler;
lib$es6$promise$promise$$Promise._setAsap = lib$es6$promise$asap$$setAsap;
lib$es6$promise$promise$$Promise._asap = lib$es6$promise$asap$$asap;
lib$es6$promise$promise$$Promise.prototype = {
constructor: lib$es6$promise$promise$$Promise,
/**
The primary way of interacting with a promise is through its `then` method,
which registers callbacks to receive either a promise's eventual value or the
reason why the promise cannot be fulfilled.
```js
findUser().then(function(user){
// user is available
}, function(reason){
// user is unavailable, and you are given the reason why
});
```
Chaining
--------
The return value of `then` is itself a promise. This second, 'downstream'
promise is resolved with the return value of the first promise's fulfillment
or rejection handler, or rejected if the handler throws an exception.
```js
findUser().then(function (user) {
return user.name;
}, function (reason) {
return 'default name';
}).then(function (userName) {
// If `findUser` fulfilled, `userName` will be the user's name, otherwise it
// will be `'default name'`
});
findUser().then(function (user) {
throw new Error('Found user, but still unhappy');
}, function (reason) {
throw new Error('`findUser` rejected and we're unhappy');
}).then(function (value) {
// never reached
}, function (reason) {
// if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
// If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
});
```
If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
```js
findUser().then(function (user) {
throw new PedagogicalException('Upstream error');
}).then(function (value) {
// never reached
}).then(function (value) {
// never reached
}, function (reason) {
// The `PedgagocialException` is propagated all the way down to here
});
```
Assimilation
------------
Sometimes the value you want to propagate to a downstream promise can only be
retrieved asynchronously. This can be achieved by returning a promise in the
fulfillment or rejection handler. The downstream promise will then be pending
until the returned promise is settled. This is called *assimilation*.
```js
findUser().then(function (user) {
return findCommentsByAuthor(user);
}).then(function (comments) {
// The user's comments are now available
});
```
If the assimliated promise rejects, then the downstream promise will also reject.
```js
findUser().then(function (user) {
return findCommentsByAuthor(user);
}).then(function (comments) {
// If `findCommentsByAuthor` fulfills, we'll have the value here
}, function (reason) {
// If `findCommentsByAuthor` rejects, we'll have the reason here
});
```
Simple Example
--------------
Synchronous Example
```javascript
var result;
try {
result = findResult();
// success
} catch(reason) {
// failure
}
```
Errback Example
```js
findResult(function(result, err){
if (err) {
// failure
} else {
// success
}
});
```
Promise Example;
```javascript
findResult().then(function(result){
// success
}, function(reason){
// failure
});
```
Advanced Example
--------------
Synchronous Example
```javascript
var author, books;
try {
author = findAuthor();
books = findBooksByAuthor(author);
// success
} catch(reason) {
// failure
}
```
Errback Example
```js
function foundBooks(books) {
}
function failure(reason) {
}
findAuthor(function(author, err){
if (err) {
failure(err);
// failure
} else {
try {
findBoooksByAuthor(author, function(books, err) {
if (err) {
failure(err);
} else {
try {
foundBooks(books);
} catch(reason) {
failure(reason);
}
}
});
} catch(error) {
failure(err);
}
// success
}
});
```
Promise Example;
```javascript
findAuthor().
then(findBooksByAuthor).
then(function(books){
// found books
}).catch(function(reason){
// something went wrong
});
```
@method then
@param {Function} onFulfilled
@param {Function} onRejected
Useful for tooling.
@return {Promise}
*/
then: function(onFulfillment, onRejection) {
var parent = this;
var state = parent._state;
if (state === lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state === lib$es6$promise$$internal$$REJECTED && !onRejection) {
return this;
}
var child = new this.constructor(lib$es6$promise$$internal$$noop);
var result = parent._result;
if (state) {
var callback = arguments[state - 1];
lib$es6$promise$asap$$asap(function(){
lib$es6$promise$$internal$$invokeCallback(state, child, callback, result);
});
} else {
lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection);
}
return child;
},
/**
`catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
as the catch block of a try/catch statement.
```js
function findAuthor(){
throw new Error('couldn't find that author');
}
// synchronous
try {
findAuthor();
} catch(reason) {
// something went wrong
}
// async with promises
findAuthor().catch(function(reason){
// something went wrong
});
```
@method catch
@param {Function} onRejection
Useful for tooling.
@return {Promise}
*/
'catch': function(onRejection) {
return this.then(null, onRejection);
}
};
function lib$es6$promise$polyfill$$polyfill() {
var local;
if (typeof global !== 'undefined') {
local = global;
} else if (typeof self !== 'undefined') {
local = self;
} else {
try {
local = Function('return this')();
} catch (e) {
throw new Error('polyfill failed because global object is unavailable in this environment');
}
}
var P = local.Promise;
if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) {
return;
}
local.Promise = lib$es6$promise$promise$$default;
}
var lib$es6$promise$polyfill$$default = lib$es6$promise$polyfill$$polyfill;
var lib$es6$promise$umd$$ES6Promise = {
'Promise': lib$es6$promise$promise$$default,
'polyfill': lib$es6$promise$polyfill$$default
};
/* global define:true module:true window: true */
if (typeof define === 'function' && define['amd']) {
define(function() { return lib$es6$promise$umd$$ES6Promise; });
} else if (typeof module !== 'undefined' && module['exports']) {
module['exports'] = lib$es6$promise$umd$$ES6Promise;
} else if (typeof this !== 'undefined') {
this['ES6Promise'] = lib$es6$promise$umd$$ES6Promise;
}
lib$es6$promise$polyfill$$default();
}).call(this);

File diff suppressed because one or more lines are too long

View File

@@ -1,18 +0,0 @@
import Promise from './es6-promise/promise';
import polyfill from './es6-promise/polyfill';
var ES6Promise = {
'Promise': Promise,
'polyfill': polyfill
};
/* global define:true module:true window: true */
if (typeof define === 'function' && define['amd']) {
define(function() { return ES6Promise; });
} else if (typeof module !== 'undefined' && module['exports']) {
module['exports'] = ES6Promise;
} else if (typeof this !== 'undefined') {
this['ES6Promise'] = ES6Promise;
}
polyfill();

View File

@@ -1,252 +0,0 @@
import {
objectOrFunction,
isFunction
} from './utils';
import {
asap
} from './asap';
function noop() {}
var PENDING = void 0;
var FULFILLED = 1;
var REJECTED = 2;
var GET_THEN_ERROR = new ErrorObject();
function selfFulfillment() {
return new TypeError("You cannot resolve a promise with itself");
}
function cannotReturnOwn() {
return new TypeError('A promises callback cannot return that same promise.');
}
function getThen(promise) {
try {
return promise.then;
} catch(error) {
GET_THEN_ERROR.error = error;
return GET_THEN_ERROR;
}
}
function tryThen(then, value, fulfillmentHandler, rejectionHandler) {
try {
then.call(value, fulfillmentHandler, rejectionHandler);
} catch(e) {
return e;
}
}
function handleForeignThenable(promise, thenable, then) {
asap(function(promise) {
var sealed = false;
var error = tryThen(then, thenable, function(value) {
if (sealed) { return; }
sealed = true;
if (thenable !== value) {
resolve(promise, value);
} else {
fulfill(promise, value);
}
}, function(reason) {
if (sealed) { return; }
sealed = true;
reject(promise, reason);
}, 'Settle: ' + (promise._label || ' unknown promise'));
if (!sealed && error) {
sealed = true;
reject(promise, error);
}
}, promise);
}
function handleOwnThenable(promise, thenable) {
if (thenable._state === FULFILLED) {
fulfill(promise, thenable._result);
} else if (thenable._state === REJECTED) {
reject(promise, thenable._result);
} else {
subscribe(thenable, undefined, function(value) {
resolve(promise, value);
}, function(reason) {
reject(promise, reason);
});
}
}
function handleMaybeThenable(promise, maybeThenable) {
if (maybeThenable.constructor === promise.constructor) {
handleOwnThenable(promise, maybeThenable);
} else {
var then = getThen(maybeThenable);
if (then === GET_THEN_ERROR) {
reject(promise, GET_THEN_ERROR.error);
} else if (then === undefined) {
fulfill(promise, maybeThenable);
} else if (isFunction(then)) {
handleForeignThenable(promise, maybeThenable, then);
} else {
fulfill(promise, maybeThenable);
}
}
}
function resolve(promise, value) {
if (promise === value) {
reject(promise, selfFulfillment());
} else if (objectOrFunction(value)) {
handleMaybeThenable(promise, value);
} else {
fulfill(promise, value);
}
}
function publishRejection(promise) {
if (promise._onerror) {
promise._onerror(promise._result);
}
publish(promise);
}
function fulfill(promise, value) {
if (promise._state !== PENDING) { return; }
promise._result = value;
promise._state = FULFILLED;
if (promise._subscribers.length !== 0) {
asap(publish, promise);
}
}
function reject(promise, reason) {
if (promise._state !== PENDING) { return; }
promise._state = REJECTED;
promise._result = reason;
asap(publishRejection, promise);
}
function subscribe(parent, child, onFulfillment, onRejection) {
var subscribers = parent._subscribers;
var length = subscribers.length;
parent._onerror = null;
subscribers[length] = child;
subscribers[length + FULFILLED] = onFulfillment;
subscribers[length + REJECTED] = onRejection;
if (length === 0 && parent._state) {
asap(publish, parent);
}
}
function publish(promise) {
var subscribers = promise._subscribers;
var settled = promise._state;
if (subscribers.length === 0) { return; }
var child, callback, detail = promise._result;
for (var i = 0; i < subscribers.length; i += 3) {
child = subscribers[i];
callback = subscribers[i + settled];
if (child) {
invokeCallback(settled, child, callback, detail);
} else {
callback(detail);
}
}
promise._subscribers.length = 0;
}
function ErrorObject() {
this.error = null;
}
var TRY_CATCH_ERROR = new ErrorObject();
function tryCatch(callback, detail) {
try {
return callback(detail);
} catch(e) {
TRY_CATCH_ERROR.error = e;
return TRY_CATCH_ERROR;
}
}
function invokeCallback(settled, promise, callback, detail) {
var hasCallback = isFunction(callback),
value, error, succeeded, failed;
if (hasCallback) {
value = tryCatch(callback, detail);
if (value === TRY_CATCH_ERROR) {
failed = true;
error = value.error;
value = null;
} else {
succeeded = true;
}
if (promise === value) {
reject(promise, cannotReturnOwn());
return;
}
} else {
value = detail;
succeeded = true;
}
if (promise._state !== PENDING) {
// noop
} else if (hasCallback && succeeded) {
resolve(promise, value);
} else if (failed) {
reject(promise, error);
} else if (settled === FULFILLED) {
fulfill(promise, value);
} else if (settled === REJECTED) {
reject(promise, value);
}
}
function initializePromise(promise, resolver) {
try {
resolver(function resolvePromise(value){
resolve(promise, value);
}, function rejectPromise(reason) {
reject(promise, reason);
});
} catch(e) {
reject(promise, e);
}
}
export {
noop,
resolve,
reject,
fulfill,
subscribe,
publish,
publishRejection,
initializePromise,
invokeCallback,
FULFILLED,
REJECTED,
PENDING
};

View File

@@ -1,120 +0,0 @@
var len = 0;
var toString = {}.toString;
var vertxNext;
var customSchedulerFn;
export var asap = function asap(callback, arg) {
queue[len] = callback;
queue[len + 1] = arg;
len += 2;
if (len === 2) {
// If len is 2, that means that we need to schedule an async flush.
// If additional callbacks are queued before the queue is flushed, they
// will be processed by this flush that we are scheduling.
if (customSchedulerFn) {
customSchedulerFn(flush);
} else {
scheduleFlush();
}
}
}
export function setScheduler(scheduleFn) {
customSchedulerFn = scheduleFn;
}
export function setAsap(asapFn) {
asap = asapFn;
}
var browserWindow = (typeof window !== 'undefined') ? window : undefined;
var browserGlobal = browserWindow || {};
var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
var isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
// test for web worker but not in IE10
var isWorker = typeof Uint8ClampedArray !== 'undefined' &&
typeof importScripts !== 'undefined' &&
typeof MessageChannel !== 'undefined';
// node
function useNextTick() {
// node version 0.10.x displays a deprecation warning when nextTick is used recursively
// see https://github.com/cujojs/when/issues/410 for details
return function() {
process.nextTick(flush);
};
}
// vertx
function useVertxTimer() {
return function() {
vertxNext(flush);
};
}
function useMutationObserver() {
var iterations = 0;
var observer = new BrowserMutationObserver(flush);
var node = document.createTextNode('');
observer.observe(node, { characterData: true });
return function() {
node.data = (iterations = ++iterations % 2);
};
}
// web worker
function useMessageChannel() {
var channel = new MessageChannel();
channel.port1.onmessage = flush;
return function () {
channel.port2.postMessage(0);
};
}
function useSetTimeout() {
return function() {
setTimeout(flush, 1);
};
}
var queue = new Array(1000);
function flush() {
for (var i = 0; i < len; i+=2) {
var callback = queue[i];
var arg = queue[i+1];
callback(arg);
queue[i] = undefined;
queue[i+1] = undefined;
}
len = 0;
}
function attemptVertx() {
try {
var r = require;
var vertx = r('vertx');
vertxNext = vertx.runOnLoop || vertx.runOnContext;
return useVertxTimer();
} catch(e) {
return useSetTimeout();
}
}
var scheduleFlush;
// Decide what async method to use to triggering processing of queued callbacks:
if (isNode) {
scheduleFlush = useNextTick();
} else if (BrowserMutationObserver) {
scheduleFlush = useMutationObserver();
} else if (isWorker) {
scheduleFlush = useMessageChannel();
} else if (browserWindow === undefined && typeof require === 'function') {
scheduleFlush = attemptVertx();
} else {
scheduleFlush = useSetTimeout();
}

View File

@@ -1,113 +0,0 @@
import {
isArray,
isMaybeThenable
} from './utils';
import {
noop,
reject,
fulfill,
subscribe,
FULFILLED,
REJECTED,
PENDING
} from './-internal';
function Enumerator(Constructor, input) {
var enumerator = this;
enumerator._instanceConstructor = Constructor;
enumerator.promise = new Constructor(noop);
if (enumerator._validateInput(input)) {
enumerator._input = input;
enumerator.length = input.length;
enumerator._remaining = input.length;
enumerator._init();
if (enumerator.length === 0) {
fulfill(enumerator.promise, enumerator._result);
} else {
enumerator.length = enumerator.length || 0;
enumerator._enumerate();
if (enumerator._remaining === 0) {
fulfill(enumerator.promise, enumerator._result);
}
}
} else {
reject(enumerator.promise, enumerator._validationError());
}
}
Enumerator.prototype._validateInput = function(input) {
return isArray(input);
};
Enumerator.prototype._validationError = function() {
return new Error('Array Methods must be provided an Array');
};
Enumerator.prototype._init = function() {
this._result = new Array(this.length);
};
export default Enumerator;
Enumerator.prototype._enumerate = function() {
var enumerator = this;
var length = enumerator.length;
var promise = enumerator.promise;
var input = enumerator._input;
for (var i = 0; promise._state === PENDING && i < length; i++) {
enumerator._eachEntry(input[i], i);
}
};
Enumerator.prototype._eachEntry = function(entry, i) {
var enumerator = this;
var c = enumerator._instanceConstructor;
if (isMaybeThenable(entry)) {
if (entry.constructor === c && entry._state !== PENDING) {
entry._onerror = null;
enumerator._settledAt(entry._state, i, entry._result);
} else {
enumerator._willSettleAt(c.resolve(entry), i);
}
} else {
enumerator._remaining--;
enumerator._result[i] = entry;
}
};
Enumerator.prototype._settledAt = function(state, i, value) {
var enumerator = this;
var promise = enumerator.promise;
if (promise._state === PENDING) {
enumerator._remaining--;
if (state === REJECTED) {
reject(promise, value);
} else {
enumerator._result[i] = value;
}
}
if (enumerator._remaining === 0) {
fulfill(promise, enumerator._result);
}
};
Enumerator.prototype._willSettleAt = function(promise, i) {
var enumerator = this;
subscribe(promise, undefined, function(value) {
enumerator._settledAt(FULFILLED, i, value);
}, function(reason) {
enumerator._settledAt(REJECTED, i, reason);
});
};

View File

@@ -1,26 +0,0 @@
/*global self*/
import Promise from './promise';
export default function polyfill() {
var local;
if (typeof global !== 'undefined') {
local = global;
} else if (typeof self !== 'undefined') {
local = self;
} else {
try {
local = Function('return this')();
} catch (e) {
throw new Error('polyfill failed because global object is unavailable in this environment');
}
}
var P = local.Promise;
if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) {
return;
}
local.Promise = Promise;
}

View File

@@ -1,415 +0,0 @@
import {
isFunction
} from './utils';
import {
noop,
subscribe,
initializePromise,
invokeCallback,
FULFILLED,
REJECTED
} from './-internal';
import {
asap,
setAsap,
setScheduler
} from './asap';
import all from './promise/all';
import race from './promise/race';
import Resolve from './promise/resolve';
import Reject from './promise/reject';
var counter = 0;
function needsResolver() {
throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
}
function needsNew() {
throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
}
export default Promise;
/**
Promise objects represent the eventual result of an asynchronous operation. The
primary way of interacting with a promise is through its `then` method, which
registers callbacks to receive either a promise's eventual value or the reason
why the promise cannot be fulfilled.
Terminology
-----------
- `promise` is an object or function with a `then` method whose behavior conforms to this specification.
- `thenable` is an object or function that defines a `then` method.
- `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
- `exception` is a value that is thrown using the throw statement.
- `reason` is a value that indicates why a promise was rejected.
- `settled` the final resting state of a promise, fulfilled or rejected.
A promise can be in one of three states: pending, fulfilled, or rejected.
Promises that are fulfilled have a fulfillment value and are in the fulfilled
state. Promises that are rejected have a rejection reason and are in the
rejected state. A fulfillment value is never a thenable.
Promises can also be said to *resolve* a value. If this value is also a
promise, then the original promise's settled state will match the value's
settled state. So a promise that *resolves* a promise that rejects will
itself reject, and a promise that *resolves* a promise that fulfills will
itself fulfill.
Basic Usage:
------------
```js
var promise = new Promise(function(resolve, reject) {
// on success
resolve(value);
// on failure
reject(reason);
});
promise.then(function(value) {
// on fulfillment
}, function(reason) {
// on rejection
});
```
Advanced Usage:
---------------
Promises shine when abstracting away asynchronous interactions such as
`XMLHttpRequest`s.
```js
function getJSON(url) {
return new Promise(function(resolve, reject){
var xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.onreadystatechange = handler;
xhr.responseType = 'json';
xhr.setRequestHeader('Accept', 'application/json');
xhr.send();
function handler() {
if (this.readyState === this.DONE) {
if (this.status === 200) {
resolve(this.response);
} else {
reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
}
}
};
});
}
getJSON('/posts.json').then(function(json) {
// on fulfillment
}, function(reason) {
// on rejection
});
```
Unlike callbacks, promises are great composable primitives.
```js
Promise.all([
getJSON('/posts'),
getJSON('/comments')
]).then(function(values){
values[0] // => postsJSON
values[1] // => commentsJSON
return values;
});
```
@class Promise
@param {function} resolver
Useful for tooling.
@constructor
*/
function Promise(resolver) {
this._id = counter++;
this._state = undefined;
this._result = undefined;
this._subscribers = [];
if (noop !== resolver) {
if (!isFunction(resolver)) {
needsResolver();
}
if (!(this instanceof Promise)) {
needsNew();
}
initializePromise(this, resolver);
}
}
Promise.all = all;
Promise.race = race;
Promise.resolve = Resolve;
Promise.reject = Reject;
Promise._setScheduler = setScheduler;
Promise._setAsap = setAsap;
Promise._asap = asap;
Promise.prototype = {
constructor: Promise,
/**
The primary way of interacting with a promise is through its `then` method,
which registers callbacks to receive either a promise's eventual value or the
reason why the promise cannot be fulfilled.
```js
findUser().then(function(user){
// user is available
}, function(reason){
// user is unavailable, and you are given the reason why
});
```
Chaining
--------
The return value of `then` is itself a promise. This second, 'downstream'
promise is resolved with the return value of the first promise's fulfillment
or rejection handler, or rejected if the handler throws an exception.
```js
findUser().then(function (user) {
return user.name;
}, function (reason) {
return 'default name';
}).then(function (userName) {
// If `findUser` fulfilled, `userName` will be the user's name, otherwise it
// will be `'default name'`
});
findUser().then(function (user) {
throw new Error('Found user, but still unhappy');
}, function (reason) {
throw new Error('`findUser` rejected and we're unhappy');
}).then(function (value) {
// never reached
}, function (reason) {
// if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
// If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
});
```
If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
```js
findUser().then(function (user) {
throw new PedagogicalException('Upstream error');
}).then(function (value) {
// never reached
}).then(function (value) {
// never reached
}, function (reason) {
// The `PedgagocialException` is propagated all the way down to here
});
```
Assimilation
------------
Sometimes the value you want to propagate to a downstream promise can only be
retrieved asynchronously. This can be achieved by returning a promise in the
fulfillment or rejection handler. The downstream promise will then be pending
until the returned promise is settled. This is called *assimilation*.
```js
findUser().then(function (user) {
return findCommentsByAuthor(user);
}).then(function (comments) {
// The user's comments are now available
});
```
If the assimliated promise rejects, then the downstream promise will also reject.
```js
findUser().then(function (user) {
return findCommentsByAuthor(user);
}).then(function (comments) {
// If `findCommentsByAuthor` fulfills, we'll have the value here
}, function (reason) {
// If `findCommentsByAuthor` rejects, we'll have the reason here
});
```
Simple Example
--------------
Synchronous Example
```javascript
var result;
try {
result = findResult();
// success
} catch(reason) {
// failure
}
```
Errback Example
```js
findResult(function(result, err){
if (err) {
// failure
} else {
// success
}
});
```
Promise Example;
```javascript
findResult().then(function(result){
// success
}, function(reason){
// failure
});
```
Advanced Example
--------------
Synchronous Example
```javascript
var author, books;
try {
author = findAuthor();
books = findBooksByAuthor(author);
// success
} catch(reason) {
// failure
}
```
Errback Example
```js
function foundBooks(books) {
}
function failure(reason) {
}
findAuthor(function(author, err){
if (err) {
failure(err);
// failure
} else {
try {
findBoooksByAuthor(author, function(books, err) {
if (err) {
failure(err);
} else {
try {
foundBooks(books);
} catch(reason) {
failure(reason);
}
}
});
} catch(error) {
failure(err);
}
// success
}
});
```
Promise Example;
```javascript
findAuthor().
then(findBooksByAuthor).
then(function(books){
// found books
}).catch(function(reason){
// something went wrong
});
```
@method then
@param {Function} onFulfilled
@param {Function} onRejected
Useful for tooling.
@return {Promise}
*/
then: function(onFulfillment, onRejection) {
var parent = this;
var state = parent._state;
if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) {
return this;
}
var child = new this.constructor(noop);
var result = parent._result;
if (state) {
var callback = arguments[state - 1];
asap(function(){
invokeCallback(state, child, callback, result);
});
} else {
subscribe(parent, child, onFulfillment, onRejection);
}
return child;
},
/**
`catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
as the catch block of a try/catch statement.
```js
function findAuthor(){
throw new Error('couldn't find that author');
}
// synchronous
try {
findAuthor();
} catch(reason) {
// something went wrong
}
// async with promises
findAuthor().catch(function(reason){
// something went wrong
});
```
@method catch
@param {Function} onRejection
Useful for tooling.
@return {Promise}
*/
'catch': function(onRejection) {
return this.then(null, onRejection);
}
};

View File

@@ -1,52 +0,0 @@
import Enumerator from '../enumerator';
/**
`Promise.all` accepts an array of promises, and returns a new promise which
is fulfilled with an array of fulfillment values for the passed promises, or
rejected with the reason of the first passed promise to be rejected. It casts all
elements of the passed iterable to promises as it runs this algorithm.
Example:
```javascript
var promise1 = resolve(1);
var promise2 = resolve(2);
var promise3 = resolve(3);
var promises = [ promise1, promise2, promise3 ];
Promise.all(promises).then(function(array){
// The array here would be [ 1, 2, 3 ];
});
```
If any of the `promises` given to `all` are rejected, the first promise
that is rejected will be given as an argument to the returned promises's
rejection handler. For example:
Example:
```javascript
var promise1 = resolve(1);
var promise2 = reject(new Error("2"));
var promise3 = reject(new Error("3"));
var promises = [ promise1, promise2, promise3 ];
Promise.all(promises).then(function(array){
// Code here never runs because there are rejected promises!
}, function(error) {
// error.message === "2"
});
```
@method all
@static
@param {Array} entries array of promises
@param {String} label optional string for labeling the promise.
Useful for tooling.
@return {Promise} promise that is fulfilled when all `promises` have been
fulfilled, or rejected if any of them become rejected.
@static
*/
export default function all(entries) {
return new Enumerator(this, entries).promise;
}

View File

@@ -1,104 +0,0 @@
import {
isArray
} from "../utils";
import {
noop,
resolve,
reject,
subscribe,
PENDING
} from '../-internal';
/**
`Promise.race` returns a new promise which is settled in the same way as the
first passed promise to settle.
Example:
```javascript
var promise1 = new Promise(function(resolve, reject){
setTimeout(function(){
resolve('promise 1');
}, 200);
});
var promise2 = new Promise(function(resolve, reject){
setTimeout(function(){
resolve('promise 2');
}, 100);
});
Promise.race([promise1, promise2]).then(function(result){
// result === 'promise 2' because it was resolved before promise1
// was resolved.
});
```
`Promise.race` is deterministic in that only the state of the first
settled promise matters. For example, even if other promises given to the
`promises` array argument are resolved, but the first settled promise has
become rejected before the other promises became fulfilled, the returned
promise will become rejected:
```javascript
var promise1 = new Promise(function(resolve, reject){
setTimeout(function(){
resolve('promise 1');
}, 200);
});
var promise2 = new Promise(function(resolve, reject){
setTimeout(function(){
reject(new Error('promise 2'));
}, 100);
});
Promise.race([promise1, promise2]).then(function(result){
// Code here never runs
}, function(reason){
// reason.message === 'promise 2' because promise 2 became rejected before
// promise 1 became fulfilled
});
```
An example real-world use case is implementing timeouts:
```javascript
Promise.race([ajax('foo.json'), timeout(5000)])
```
@method race
@static
@param {Array} promises array of promises to observe
Useful for tooling.
@return {Promise} a promise which settles in the same way as the first passed
promise to settle.
*/
export default function race(entries) {
/*jshint validthis:true */
var Constructor = this;
var promise = new Constructor(noop);
if (!isArray(entries)) {
reject(promise, new TypeError('You must pass an array to race.'));
return promise;
}
var length = entries.length;
function onFulfillment(value) {
resolve(promise, value);
}
function onRejection(reason) {
reject(promise, reason);
}
for (var i = 0; promise._state === PENDING && i < length; i++) {
subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
}
return promise;
}

View File

@@ -1,46 +0,0 @@
import {
noop,
reject as _reject
} from '../-internal';
/**
`Promise.reject` returns a promise rejected with the passed `reason`.
It is shorthand for the following:
```javascript
var promise = new Promise(function(resolve, reject){
reject(new Error('WHOOPS'));
});
promise.then(function(value){
// Code here doesn't run because the promise is rejected!
}, function(reason){
// reason.message === 'WHOOPS'
});
```
Instead of writing the above, your code now simply becomes the following:
```javascript
var promise = Promise.reject(new Error('WHOOPS'));
promise.then(function(value){
// Code here doesn't run because the promise is rejected!
}, function(reason){
// reason.message === 'WHOOPS'
});
```
@method reject
@static
@param {Any} reason value that the returned promise will be rejected with.
Useful for tooling.
@return {Promise} a promise rejected with the given `reason`.
*/
export default function reject(reason) {
/*jshint validthis:true */
var Constructor = this;
var promise = new Constructor(noop);
_reject(promise, reason);
return promise;
}

View File

@@ -1,48 +0,0 @@
import {
noop,
resolve as _resolve
} from '../-internal';
/**
`Promise.resolve` returns a promise that will become resolved with the
passed `value`. It is shorthand for the following:
```javascript
var promise = new Promise(function(resolve, reject){
resolve(1);
});
promise.then(function(value){
// value === 1
});
```
Instead of writing the above, your code now simply becomes the following:
```javascript
var promise = Promise.resolve(1);
promise.then(function(value){
// value === 1
});
```
@method resolve
@static
@param {Any} value value that the returned promise will be resolved with
Useful for tooling.
@return {Promise} a promise that will become fulfilled with the given
`value`
*/
export default function resolve(object) {
/*jshint validthis:true */
var Constructor = this;
if (object && typeof object === 'object' && object.constructor === Constructor) {
return object;
}
var promise = new Constructor(noop);
_resolve(promise, object);
return promise;
}

View File

@@ -1,22 +0,0 @@
export function objectOrFunction(x) {
return typeof x === 'function' || (typeof x === 'object' && x !== null);
}
export function isFunction(x) {
return typeof x === 'function';
}
export function isMaybeThenable(x) {
return typeof x === 'object' && x !== null;
}
var _isArray;
if (!Array.isArray) {
_isArray = function (x) {
return Object.prototype.toString.call(x) === '[object Array]';
};
} else {
_isArray = Array.isArray;
}
export var isArray = _isArray;

View File

@@ -1,94 +0,0 @@
{
"name": "es6-promise",
"namespace": "es6-promise",
"version": "3.0.2",
"description": "A lightweight library that provides tools for organizing asynchronous code",
"main": "dist/es6-promise.js",
"directories": {
"lib": "lib"
},
"files": [
"dist",
"lib",
"!dist/test"
],
"devDependencies": {
"bower": "^1.3.9",
"brfs": "0.0.8",
"broccoli-es3-safe-recast": "0.0.8",
"broccoli-es6-module-transpiler": "^0.5.0",
"broccoli-jshint": "^0.5.1",
"broccoli-merge-trees": "^0.1.4",
"broccoli-replace": "^0.2.0",
"broccoli-stew": "0.0.6",
"broccoli-uglify-js": "^0.1.3",
"broccoli-watchify": "^0.2.0",
"ember-cli": "0.2.3",
"ember-publisher": "0.0.7",
"git-repo-version": "0.0.2",
"json3": "^3.3.2",
"minimatch": "^2.0.1",
"mocha": "^1.20.1",
"promises-aplus-tests-phantom": "^2.1.0-revise",
"release-it": "0.0.10"
},
"scripts": {
"build": "ember build",
"start": "ember s",
"test": "ember test",
"test:server": "ember test --server",
"test:node": "ember build && mocha ./dist/test/browserify",
"lint": "jshint lib",
"prepublish": "ember build --environment production",
"dry-run-release": "ember build --environment production && release-it --dry-run --non-interactive"
},
"repository": {
"type": "git",
"url": "git://github.com/jakearchibald/ES6-Promises.git"
},
"bugs": {
"url": "https://github.com/jakearchibald/ES6-Promises/issues"
},
"browser": {
"vertx": false
},
"keywords": [
"promises",
"futures"
],
"author": {
"name": "Yehuda Katz, Tom Dale, Stefan Penner and contributors",
"url": "Conversion to ES6 API by Jake Archibald"
},
"license": "MIT",
"spm": {
"main": "dist/es6-promise.js"
},
"gitHead": "6c49ef79609737bac2b496d508806a3d5e37303e",
"homepage": "https://github.com/jakearchibald/ES6-Promises#readme",
"_id": "es6-promise@3.0.2",
"_shasum": "010d5858423a5f118979665f46486a95c6ee2bb6",
"_from": "es6-promise@>=3.0.2 <4.0.0",
"_npmVersion": "2.13.4",
"_nodeVersion": "2.2.1",
"_npmUser": {
"name": "stefanpenner",
"email": "stefan.penner@gmail.com"
},
"maintainers": [
{
"name": "jaffathecake",
"email": "jaffathecake@gmail.com"
},
{
"name": "stefanpenner",
"email": "stefan.penner@gmail.com"
}
],
"dist": {
"shasum": "010d5858423a5f118979665f46486a95c6ee2bb6",
"tarball": "http://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz"
},
"_resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -1,98 +0,0 @@
'use strict';
module.exports = function (grunt) {
var browsers = [
{ browserName: 'firefox', version: '19', platform: 'XP' },
{ browserName: 'firefox', platform: 'linux' },
{ browserName: 'firefox', platform: 'OS X 10.10' },
{ browserName: 'chrome', platform: 'linux' },
{ browserName: 'chrome', platform: 'OS X 10.9' },
{ browserName: 'chrome', platform: 'XP' },
{ browserName: 'internet explorer', platform: 'Windows 8.1', version: '11' },
{ browserName: 'internet explorer', platform: 'WIN8', version: '10' },
{ browserName: 'internet explorer', platform: 'VISTA', version: '9' },
{ browserName: 'safari', platform: 'OS X 10.6' },
{ browserName: 'safari', platform: 'OS X 10.8' },
{ browserName: 'safari', platform: 'OS X 10.9' },
{ browserName: 'safari', platform: 'OS X 10.10' },
{ browserName: 'iphone', platform: 'OS X 10.9', version: '7.1' },
{ browserName: 'android', platform: 'Linux', version: '4.4' },
];
var extraBrowsers = [
{ browserName: 'firefox', platform: 'linux', version: '30' },
{ browserName: 'firefox', platform: 'linux', version: '25' },
{ browserName: 'iphone', platform: 'OS X 10.8', version: '6.1' },
{ browserName: 'iphone', platform: 'OS X 10.8', version: '5.1' },
{ browserName: 'android', platform: 'Linux', version: '4.2' },
// XXX haven't investigated these:
// { browserName: 'opera', platform: 'Windows 7', version: '12' },
// { browserName: 'opera', platform: 'Windows 2008', version: '12' }
// { browserName: 'iphone', platform: 'OS X 10.6', version: '4.3' },
// { browserName: 'android', platform: 'Linux', version: '4.0' },
];
if (grunt.option('extra')) {
browsers = browsers.concat(extraBrowsers);
}
grunt.initConfig({
connect: {
server: {
options: {
base: '',
port: 9999,
useAvailablePort: true
}
}
},
'saucelabs-mocha': {
all: {
options: {
urls: (function () {
var urls = ['http://localhost:9999/test/'];
if (grunt.option('extra')) {
urls.push('http://localhost:9999/test-sham/');
}
return urls;
}()),
// tunnelTimeout: 5,
build: process.env.TRAVIS_BUILD_NUMBER,
tunneled: !process.env.SAUCE_HAS_TUNNEL,
identifier: process.env.TRAVIS_JOB_NUMBER,
sauceConfig: {
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER
},
// concurrency: 3,
browsers: browsers,
testname: (function () {
var testname = 'mocha';
if (process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST !== 'false') {
testname += ' (PR ' + process.env.TRAVIS_PULL_REQUEST + ')';
}
if (process.env.TRAVIS_BRANCH && process.env.TRAVIS_BRANCH !== 'false') {
testname += ' (branch ' + process.env.TRAVIS_BRANCH + ')';
}
return testname;
}()),
tags: (function () {
var tags = [];
if (process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST !== 'false') {
tags.push('PR-' + process.env.TRAVIS_PULL_REQUEST);
}
if (process.env.TRAVIS_BRANCH && process.env.TRAVIS_BRANCH !== 'false') {
tags.push(process.env.TRAVIS_BRANCH);
}
return tags;
}())
}
}
},
watch: {}
});
// Loading dependencies
for (var key in grunt.file.readJSON('package.json').devDependencies) {
if (key !== 'grunt' && key.indexOf('grunt') === 0) {
grunt.loadNpmTasks(key);
}
}
grunt.registerTask('dev', ['connect', 'watch']);
grunt.registerTask('sauce', ['connect', 'saucelabs-mocha']);
};

View File

@@ -1,132 +0,0 @@
/*!
* https://github.com/paulmillr/es6-shim
* @license es6-shim Copyright 2013-2015 by Paul Miller (http://paulmillr.com)
* and contributors, MIT License
* es6-sham: v0.33.13
* see https://github.com/paulmillr/es6-shim/blob/0.33.13/LICENSE
* Details and documentation:
* https://github.com/paulmillr/es6-shim/
*/
// UMD (Universal Module Definition)
// see https://github.com/umdjs/umd/blob/master/returnExports.js
(function (root, factory) {
/*global define, exports, module */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like enviroments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.returnExports = factory();
}
}(this, function () {
'use strict';
/*jshint evil: true */
/* eslint-disable no-new-func */
var getGlobal = new Function('return this;');
/* eslint-enable no-new-func */
/*jshint evil: false */
var globals = getGlobal();
var Object = globals.Object;
// NOTE: This versions needs object ownership
// beacuse every promoted object needs to be reassigned
// otherwise uncompatible browsers cannot work as expected
//
// NOTE: This might need es5-shim or polyfills upfront
// because it's based on ES5 API.
// (probably just an IE <= 8 problem)
//
// NOTE: nodejs is fine in version 0.8, 0.10, and future versions.
(function () {
if (Object.setPrototypeOf) { return; }
/*jshint proto: true */
// @author Andrea Giammarchi - @WebReflection
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var create = Object.create;
var defineProperty = Object.defineProperty;
var getPrototypeOf = Object.getPrototypeOf;
var objProto = Object.prototype;
var copyDescriptors = function (target, source) {
// define into target descriptors from source
getOwnPropertyNames(source).forEach(function (key) {
defineProperty(
target,
key,
getOwnPropertyDescriptor(source, key)
);
});
return target;
};
// used as fallback when no promotion is possible
var createAndCopy = function (origin, proto) {
return copyDescriptors(create(proto), origin);
};
var set, setPrototypeOf;
try {
// this might fail for various reasons
// ignore if Chrome cought it at runtime
set = getOwnPropertyDescriptor(objProto, '__proto__').set;
set.call({}, null);
// setter not poisoned, it can promote
// Firefox, Chrome
setPrototypeOf = function (origin, proto) {
set.call(origin, proto);
return origin;
};
} catch (e) {
// do one or more feature detections
set = { __proto__: null };
// if proto does not work, needs to fallback
// some Opera, Rhino, ducktape
if (set instanceof Object) {
setPrototypeOf = createAndCopy;
} else {
// verify if null objects are buggy
/* eslint-disable no-proto */
set.__proto__ = objProto;
/* eslint-enable no-proto */
// if null objects are buggy
// nodejs 0.8 to 0.10
if (set instanceof Object) {
setPrototypeOf = function (origin, proto) {
// use such bug to promote
/* eslint-disable no-proto */
origin.__proto__ = proto;
/* eslint-enable no-proto */
return origin;
};
} else {
// try to use proto or fallback
// Safari, old Firefox, many others
setPrototypeOf = function (origin, proto) {
// if proto is not null
if (getPrototypeOf(origin)) {
// use __proto__ to promote
/* eslint-disable no-proto */
origin.__proto__ = proto;
/* eslint-enable no-proto */
return origin;
} else {
// otherwise unable to promote: fallback
return createAndCopy(origin, proto);
}
};
}
}
}
Object.setPrototypeOf = setPrototypeOf;
}());
}));

View File

@@ -1,11 +0,0 @@
/*!
* https://github.com/paulmillr/es6-shim
* @license es6-shim Copyright 2013-2015 by Paul Miller (http://paulmillr.com)
* and contributors, MIT License
* es6-sham: v0.33.13
* see https://github.com/paulmillr/es6-shim/blob/0.33.13/LICENSE
* Details and documentation:
* https://github.com/paulmillr/es6-shim/
*/
(function(t,e){if(typeof define==="function"&&define.amd){define(e)}else if(typeof exports==="object"){module.exports=e()}else{t.returnExports=e()}})(this,function(){"use strict";var t=new Function("return this;");var e=t();var r=e.Object;(function(){if(r.setPrototypeOf){return}var t=r.getOwnPropertyNames;var e=r.getOwnPropertyDescriptor;var n=r.create;var o=r.defineProperty;var f=r.getPrototypeOf;var i=r.prototype;var u=function(r,n){t(n).forEach(function(t){o(r,t,e(n,t))});return r};var c=function(t,e){return u(n(e),t)};var a,_;try{a=e(i,"__proto__").set;a.call({},null);_=function(t,e){a.call(t,e);return t}}catch(p){a={__proto__:null};if(a instanceof r){_=c}else{a.__proto__=i;if(a instanceof r){_=function(t,e){t.__proto__=e;return t}}else{_=function(t,e){if(f(t)){t.__proto__=e;return t}else{return c(t,e)}}}}}r.setPrototypeOf=_})()});
//# sourceMappingURL=es6-sham.map

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,962 +0,0 @@
/*! *****************************************************************************
Copyright (C) Microsoft. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
"use strict";
var Reflect;
(function (Reflect) {
// Load global or shim versions of Map, Set, and WeakMap
var functionPrototype = Object.getPrototypeOf(Function);
var _Map = typeof Map === "function" ? Map : CreateMapPolyfill();
var _Set = typeof Set === "function" ? Set : CreateSetPolyfill();
var _WeakMap = typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
// [[Metadata]] internal slot
var __Metadata__ = new _WeakMap();
/**
* Applies a set of decorators to a property of a target object.
* @param decorators An array of decorators.
* @param target The target object.
* @param targetKey (Optional) The property key to decorate.
* @param targetDescriptor (Optional) The property descriptor for the target key
* @remarks Decorators are applied in reverse order.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* constructor(p) { }
* static staticMethod(p) { }
* method(p) { }
* }
*
* // constructor
* C = Reflect.decorate(decoratorsArray, C);
*
* // property (on constructor)
* Reflect.decorate(decoratorsArray, C, "staticProperty");
*
* // property (on prototype)
* Reflect.decorate(decoratorsArray, C.prototype, "property");
*
* // method (on constructor)
* Object.defineProperty(C, "staticMethod",
* Reflect.decorate(decoratorsArray, C, "staticMethod",
* Object.getOwnPropertyDescriptor(C, "staticMethod")));
*
* // method (on prototype)
* Object.defineProperty(C.prototype, "method",
* Reflect.decorate(decoratorsArray, C.prototype, "method",
* Object.getOwnPropertyDescriptor(C.prototype, "method")));
*
*/
function decorate(decorators, target, targetKey, targetDescriptor) {
if (!IsUndefined(targetDescriptor)) {
if (!IsArray(decorators)) {
throw new TypeError();
}
else if (!IsObject(target)) {
throw new TypeError();
}
else if (IsUndefined(targetKey)) {
throw new TypeError();
}
else if (!IsObject(targetDescriptor)) {
throw new TypeError();
}
targetKey = ToPropertyKey(targetKey);
return DecoratePropertyWithDescriptor(decorators, target, targetKey, targetDescriptor);
}
else if (!IsUndefined(targetKey)) {
if (!IsArray(decorators)) {
throw new TypeError();
}
else if (!IsObject(target)) {
throw new TypeError();
}
targetKey = ToPropertyKey(targetKey);
return DecoratePropertyWithoutDescriptor(decorators, target, targetKey);
}
else {
if (!IsArray(decorators)) {
throw new TypeError();
}
else if (!IsConstructor(target)) {
throw new TypeError();
}
return DecorateConstructor(decorators, target);
}
}
Reflect.decorate = decorate;
/**
* A default metadata decorator factory that can be used on a class, class member, or parameter.
* @param metadataKey The key for the metadata entry.
* @param metadataValue The value for the metadata entry.
* @returns A decorator function.
* @remarks
* If `metadataKey` is already defined for the target and target key, the
* metadataValue for that key will be overwritten.
* @example
*
* // constructor
* @Reflect.metadata(key, value)
* class C {
* }
*
* // property (on constructor, TypeScript only)
* class C {
* @Reflect.metadata(key, value)
* static staticProperty;
* }
*
* // property (on prototype, TypeScript only)
* class C {
* @Reflect.metadata(key, value)
* property;
* }
*
* // method (on constructor)
* class C {
* @Reflect.metadata(key, value)
* static staticMethod() { }
* }
*
* // method (on prototype)
* class C {
* @Reflect.metadata(key, value)
* method() { }
* }
*
*/
function metadata(metadataKey, metadataValue) {
function decorator(target, targetKey) {
if (!IsUndefined(targetKey)) {
if (!IsObject(target)) {
throw new TypeError();
}
targetKey = ToPropertyKey(targetKey);
OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey);
}
else {
if (!IsConstructor(target)) {
throw new TypeError();
}
OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, undefined);
}
}
return decorator;
}
Reflect.metadata = metadata;
/**
* Define a unique metadata entry on the target.
* @param metadataKey A key used to store and retrieve metadata.
* @param metadataValue A value that contains attached metadata.
* @param target The target object on which to define metadata.
* @param targetKey (Optional) The property key for the target.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* constructor(p) { }
* static staticMethod(p) { }
* method(p) { }
* }
*
* // constructor
* Reflect.defineMetadata("custom:annotation", options, C);
*
* // property (on constructor)
* Reflect.defineMetadata("custom:annotation", options, C, "staticProperty");
*
* // property (on prototype)
* Reflect.defineMetadata("custom:annotation", options, C.prototype, "property");
*
* // method (on constructor)
* Reflect.defineMetadata("custom:annotation", options, C, "staticMethod");
*
* // method (on prototype)
* Reflect.defineMetadata("custom:annotation", options, C.prototype, "method");
*
* // decorator factory as metadata-producing annotation.
* function MyAnnotation(options): Decorator {
* return (target, key?) => Reflect.defineMetadata("custom:annotation", options, target, key);
* }
*
*/
function defineMetadata(metadataKey, metadataValue, target, targetKey) {
if (!IsObject(target)) {
throw new TypeError();
}
else if (!IsUndefined(targetKey)) {
targetKey = ToPropertyKey(targetKey);
}
return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey);
}
Reflect.defineMetadata = defineMetadata;
/**
* Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey (Optional) The property key for the target.
* @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* constructor(p) { }
* static staticMethod(p) { }
* method(p) { }
* }
*
* // constructor
* result = Reflect.hasMetadata("custom:annotation", C);
*
* // property (on constructor)
* result = Reflect.hasMetadata("custom:annotation", C, "staticProperty");
*
* // property (on prototype)
* result = Reflect.hasMetadata("custom:annotation", C.prototype, "property");
*
* // method (on constructor)
* result = Reflect.hasMetadata("custom:annotation", C, "staticMethod");
*
* // method (on prototype)
* result = Reflect.hasMetadata("custom:annotation", C.prototype, "method");
*
*/
function hasMetadata(metadataKey, target, targetKey) {
if (!IsObject(target)) {
throw new TypeError();
}
else if (!IsUndefined(targetKey)) {
targetKey = ToPropertyKey(targetKey);
}
return OrdinaryHasMetadata(metadataKey, target, targetKey);
}
Reflect.hasMetadata = hasMetadata;
/**
* Gets a value indicating whether the target object has the provided metadata key defined.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey (Optional) The property key for the target.
* @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* constructor(p) { }
* static staticMethod(p) { }
* method(p) { }
* }
*
* // constructor
* result = Reflect.hasOwnMetadata("custom:annotation", C);
*
* // property (on constructor)
* result = Reflect.hasOwnMetadata("custom:annotation", C, "staticProperty");
*
* // property (on prototype)
* result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "property");
*
* // method (on constructor)
* result = Reflect.hasOwnMetadata("custom:annotation", C, "staticMethod");
*
* // method (on prototype)
* result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "method");
*
*/
function hasOwnMetadata(metadataKey, target, targetKey) {
if (!IsObject(target)) {
throw new TypeError();
}
else if (!IsUndefined(targetKey)) {
targetKey = ToPropertyKey(targetKey);
}
return OrdinaryHasOwnMetadata(metadataKey, target, targetKey);
}
Reflect.hasOwnMetadata = hasOwnMetadata;
/**
* Gets the metadata value for the provided metadata key on the target object or its prototype chain.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey (Optional) The property key for the target.
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* constructor(p) { }
* static staticMethod(p) { }
* method(p) { }
* }
*
* // constructor
* result = Reflect.getMetadata("custom:annotation", C);
*
* // property (on constructor)
* result = Reflect.getMetadata("custom:annotation", C, "staticProperty");
*
* // property (on prototype)
* result = Reflect.getMetadata("custom:annotation", C.prototype, "property");
*
* // method (on constructor)
* result = Reflect.getMetadata("custom:annotation", C, "staticMethod");
*
* // method (on prototype)
* result = Reflect.getMetadata("custom:annotation", C.prototype, "method");
*
*/
function getMetadata(metadataKey, target, targetKey) {
if (!IsObject(target)) {
throw new TypeError();
}
else if (!IsUndefined(targetKey)) {
targetKey = ToPropertyKey(targetKey);
}
return OrdinaryGetMetadata(metadataKey, target, targetKey);
}
Reflect.getMetadata = getMetadata;
/**
* Gets the metadata value for the provided metadata key on the target object.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey (Optional) The property key for the target.
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* constructor(p) { }
* static staticMethod(p) { }
* method(p) { }
* }
*
* // constructor
* result = Reflect.getOwnMetadata("custom:annotation", C);
*
* // property (on constructor)
* result = Reflect.getOwnMetadata("custom:annotation", C, "staticProperty");
*
* // property (on prototype)
* result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "property");
*
* // method (on constructor)
* result = Reflect.getOwnMetadata("custom:annotation", C, "staticMethod");
*
* // method (on prototype)
* result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "method");
*
*/
function getOwnMetadata(metadataKey, target, targetKey) {
if (!IsObject(target)) {
throw new TypeError();
}
else if (!IsUndefined(targetKey)) {
targetKey = ToPropertyKey(targetKey);
}
return OrdinaryGetOwnMetadata(metadataKey, target, targetKey);
}
Reflect.getOwnMetadata = getOwnMetadata;
/**
* Gets the metadata keys defined on the target object or its prototype chain.
* @param target The target object on which the metadata is defined.
* @param targetKey (Optional) The property key for the target.
* @returns An array of unique metadata keys.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* constructor(p) { }
* static staticMethod(p) { }
* method(p) { }
* }
*
* // constructor
* result = Reflect.getMetadataKeys(C);
*
* // property (on constructor)
* result = Reflect.getMetadataKeys(C, "staticProperty");
*
* // property (on prototype)
* result = Reflect.getMetadataKeys(C.prototype, "property");
*
* // method (on constructor)
* result = Reflect.getMetadataKeys(C, "staticMethod");
*
* // method (on prototype)
* result = Reflect.getMetadataKeys(C.prototype, "method");
*
*/
function getMetadataKeys(target, targetKey) {
if (!IsObject(target)) {
throw new TypeError();
}
else if (!IsUndefined(targetKey)) {
targetKey = ToPropertyKey(targetKey);
}
return OrdinaryMetadataKeys(target, targetKey);
}
Reflect.getMetadataKeys = getMetadataKeys;
/**
* Gets the unique metadata keys defined on the target object.
* @param target The target object on which the metadata is defined.
* @param targetKey (Optional) The property key for the target.
* @returns An array of unique metadata keys.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* constructor(p) { }
* static staticMethod(p) { }
* method(p) { }
* }
*
* // constructor
* result = Reflect.getOwnMetadataKeys(C);
*
* // property (on constructor)
* result = Reflect.getOwnMetadataKeys(C, "staticProperty");
*
* // property (on prototype)
* result = Reflect.getOwnMetadataKeys(C.prototype, "property");
*
* // method (on constructor)
* result = Reflect.getOwnMetadataKeys(C, "staticMethod");
*
* // method (on prototype)
* result = Reflect.getOwnMetadataKeys(C.prototype, "method");
*
*/
function getOwnMetadataKeys(target, targetKey) {
if (!IsObject(target)) {
throw new TypeError();
}
else if (!IsUndefined(targetKey)) {
targetKey = ToPropertyKey(targetKey);
}
return OrdinaryOwnMetadataKeys(target, targetKey);
}
Reflect.getOwnMetadataKeys = getOwnMetadataKeys;
/**
* Deletes the metadata entry from the target object with the provided key.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey (Optional) The property key for the target.
* @returns `true` if the metadata entry was found and deleted; otherwise, false.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* constructor(p) { }
* static staticMethod(p) { }
* method(p) { }
* }
*
* // constructor
* result = Reflect.deleteMetadata("custom:annotation", C);
*
* // property (on constructor)
* result = Reflect.deleteMetadata("custom:annotation", C, "staticProperty");
*
* // property (on prototype)
* result = Reflect.deleteMetadata("custom:annotation", C.prototype, "property");
*
* // method (on constructor)
* result = Reflect.deleteMetadata("custom:annotation", C, "staticMethod");
*
* // method (on prototype)
* result = Reflect.deleteMetadata("custom:annotation", C.prototype, "method");
*
*/
function deleteMetadata(metadataKey, target, targetKey) {
if (!IsObject(target)) {
throw new TypeError();
}
else if (!IsUndefined(targetKey)) {
targetKey = ToPropertyKey(targetKey);
}
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#deletemetadata-metadatakey-p-
var metadataMap = GetOrCreateMetadataMap(target, targetKey, false);
if (IsUndefined(metadataMap)) {
return false;
}
if (!metadataMap.delete(metadataKey)) {
return false;
}
if (metadataMap.size > 0) {
return true;
}
var targetMetadata = __Metadata__.get(target);
targetMetadata.delete(targetKey);
if (targetMetadata.size > 0) {
return true;
}
__Metadata__.delete(target);
return true;
}
Reflect.deleteMetadata = deleteMetadata;
function DecorateConstructor(decorators, target) {
for (var i = decorators.length - 1; i >= 0; --i) {
var decorator = decorators[i];
var decorated = decorator(target);
if (!IsUndefined(decorated)) {
if (!IsConstructor(decorated)) {
throw new TypeError();
}
target = decorated;
}
}
return target;
}
function DecoratePropertyWithDescriptor(decorators, target, propertyKey, descriptor) {
for (var i = decorators.length - 1; i >= 0; --i) {
var decorator = decorators[i];
var decorated = decorator(target, propertyKey, descriptor);
if (!IsUndefined(decorated)) {
if (!IsObject(decorated)) {
throw new TypeError();
}
descriptor = decorated;
}
}
return descriptor;
}
function DecoratePropertyWithoutDescriptor(decorators, target, propertyKey) {
for (var i = decorators.length - 1; i >= 0; --i) {
var decorator = decorators[i];
decorator(target, propertyKey);
}
}
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#getorcreatemetadatamap--o-p-create-
function GetOrCreateMetadataMap(target, targetKey, create) {
var targetMetadata = __Metadata__.get(target);
if (!targetMetadata) {
if (!create) {
return undefined;
}
targetMetadata = new _Map();
__Metadata__.set(target, targetMetadata);
}
var keyMetadata = targetMetadata.get(targetKey);
if (!keyMetadata) {
if (!create) {
return undefined;
}
keyMetadata = new _Map();
targetMetadata.set(targetKey, keyMetadata);
}
return keyMetadata;
}
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasmetadata--metadatakey-o-p-
function OrdinaryHasMetadata(MetadataKey, O, P) {
var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);
if (hasOwn) {
return true;
}
var parent = GetPrototypeOf(O);
if (parent !== null) {
return OrdinaryHasMetadata(MetadataKey, parent, P);
}
return false;
}
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasownmetadata--metadatakey-o-p-
function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
var metadataMap = GetOrCreateMetadataMap(O, P, false);
if (metadataMap === undefined) {
return false;
}
return Boolean(metadataMap.has(MetadataKey));
}
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetmetadata--metadatakey-o-p-
function OrdinaryGetMetadata(MetadataKey, O, P) {
var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);
if (hasOwn) {
return OrdinaryGetOwnMetadata(MetadataKey, O, P);
}
var parent = GetPrototypeOf(O);
if (parent !== null) {
return OrdinaryGetMetadata(MetadataKey, parent, P);
}
return undefined;
}
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetownmetadata--metadatakey-o-p-
function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
var metadataMap = GetOrCreateMetadataMap(O, P, false);
if (metadataMap === undefined) {
return undefined;
}
return metadataMap.get(MetadataKey);
}
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarydefineownmetadata--metadatakey-metadatavalue-o-p-
function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
var metadataMap = GetOrCreateMetadataMap(O, P, true);
metadataMap.set(MetadataKey, MetadataValue);
}
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarymetadatakeys--o-p-
function OrdinaryMetadataKeys(O, P) {
var ownKeys = OrdinaryOwnMetadataKeys(O, P);
var parent = GetPrototypeOf(O);
if (parent === null) {
return ownKeys;
}
var parentKeys = OrdinaryMetadataKeys(parent, P);
if (parentKeys.length <= 0) {
return ownKeys;
}
if (ownKeys.length <= 0) {
return parentKeys;
}
var set = new _Set();
var keys = [];
for (var _i = 0; _i < ownKeys.length; _i++) {
var key = ownKeys[_i];
var hasKey = set.has(key);
if (!hasKey) {
set.add(key);
keys.push(key);
}
}
for (var _a = 0; _a < parentKeys.length; _a++) {
var key = parentKeys[_a];
var hasKey = set.has(key);
if (!hasKey) {
set.add(key);
keys.push(key);
}
}
return keys;
}
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryownmetadatakeys--o-p-
function OrdinaryOwnMetadataKeys(target, targetKey) {
var metadataMap = GetOrCreateMetadataMap(target, targetKey, false);
var keys = [];
if (metadataMap) {
metadataMap.forEach(function (_, key) { return keys.push(key); });
}
return keys;
}
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-undefined-type
function IsUndefined(x) {
return x === undefined;
}
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray
function IsArray(x) {
return Array.isArray(x);
}
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object-type
function IsObject(x) {
return typeof x === "object" ? x !== null : typeof x === "function";
}
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor
function IsConstructor(x) {
return typeof x === "function";
}
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-symbol-type
function IsSymbol(x) {
return typeof x === "symbol";
}
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey
function ToPropertyKey(value) {
if (IsSymbol(value)) {
return value;
}
return String(value);
}
function GetPrototypeOf(O) {
var proto = Object.getPrototypeOf(O);
if (typeof O !== "function" || O === functionPrototype) {
return proto;
}
// TypeScript doesn't set __proto__ in ES5, as it's non-standard.
// Try to determine the superclass constructor. Compatible implementations
// must either set __proto__ on a subclass constructor to the superclass constructor,
// or ensure each class has a valid `constructor` property on its prototype that
// points back to the constructor.
// If this is not the same as Function.[[Prototype]], then this is definately inherited.
// This is the case when in ES6 or when using __proto__ in a compatible browser.
if (proto !== functionPrototype) {
return proto;
}
// If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.
var prototype = O.prototype;
var prototypeProto = Object.getPrototypeOf(prototype);
if (prototypeProto == null || prototypeProto === Object.prototype) {
return proto;
}
// if the constructor was not a function, then we cannot determine the heritage.
var constructor = prototypeProto.constructor;
if (typeof constructor !== "function") {
return proto;
}
// if we have some kind of self-reference, then we cannot determine the heritage.
if (constructor === O) {
return proto;
}
// we have a pretty good guess at the heritage.
return constructor;
}
// naive Map shim
function CreateMapPolyfill() {
var cacheSentinel = {};
function Map() {
this._keys = [];
this._values = [];
this._cache = cacheSentinel;
}
Map.prototype = {
get size() {
return this._keys.length;
},
has: function (key) {
if (key === this._cache) {
return true;
}
if (this._find(key) >= 0) {
this._cache = key;
return true;
}
return false;
},
get: function (key) {
var index = this._find(key);
if (index >= 0) {
this._cache = key;
return this._values[index];
}
return undefined;
},
set: function (key, value) {
this.delete(key);
this._keys.push(key);
this._values.push(value);
this._cache = key;
return this;
},
delete: function (key) {
var index = this._find(key);
if (index >= 0) {
this._keys.splice(index, 1);
this._values.splice(index, 1);
this._cache = cacheSentinel;
return true;
}
return false;
},
clear: function () {
this._keys.length = 0;
this._values.length = 0;
this._cache = cacheSentinel;
},
forEach: function (callback, thisArg) {
var size = this.size;
for (var i = 0; i < size; ++i) {
var key = this._keys[i];
var value = this._values[i];
this._cache = key;
callback.call(this, value, key, this);
}
},
_find: function (key) {
var keys = this._keys;
var size = keys.length;
for (var i = 0; i < size; ++i) {
if (keys[i] === key) {
return i;
}
}
return -1;
}
};
return Map;
}
// naive Set shim
function CreateSetPolyfill() {
var cacheSentinel = {};
function Set() {
this._map = new _Map();
}
Set.prototype = {
get size() {
return this._map.length;
},
has: function (value) {
return this._map.has(value);
},
add: function (value) {
this._map.set(value, value);
return this;
},
delete: function (value) {
return this._map.delete(value);
},
clear: function () {
this._map.clear();
},
forEach: function (callback, thisArg) {
this._map.forEach(callback, thisArg);
}
};
return Set;
}
// naive WeakMap shim
function CreateWeakMapPolyfill() {
var UUID_SIZE = 16;
var isNode = typeof global !== "undefined" && Object.prototype.toString.call(global.process) === '[object process]';
var nodeCrypto = isNode && require("crypto");
var hasOwn = Object.prototype.hasOwnProperty;
var keys = {};
var rootKey = CreateUniqueKey();
function WeakMap() {
this._key = CreateUniqueKey();
}
WeakMap.prototype = {
has: function (target) {
var table = GetOrCreateWeakMapTable(target, false);
if (table) {
return this._key in table;
}
return false;
},
get: function (target) {
var table = GetOrCreateWeakMapTable(target, false);
if (table) {
return table[this._key];
}
return undefined;
},
set: function (target, value) {
var table = GetOrCreateWeakMapTable(target, true);
table[this._key] = value;
return this;
},
delete: function (target) {
var table = GetOrCreateWeakMapTable(target, false);
if (table && this._key in table) {
return delete table[this._key];
}
return false;
},
clear: function () {
// NOTE: not a real clear, just makes the previous data unreachable
this._key = CreateUniqueKey();
}
};
function FillRandomBytes(buffer, size) {
for (var i = 0; i < size; ++i) {
buffer[i] = Math.random() * 255 | 0;
}
}
function GenRandomBytes(size) {
if (nodeCrypto) {
var data = nodeCrypto.randomBytes(size);
return data;
}
else if (typeof Uint8Array === "function") {
var data = new Uint8Array(size);
if (typeof crypto !== "undefined") {
crypto.getRandomValues(data);
}
else if (typeof msCrypto !== "undefined") {
msCrypto.getRandomValues(data);
}
else {
FillRandomBytes(data, size);
}
return data;
}
else {
var data = new Array(size);
FillRandomBytes(data, size);
return data;
}
}
function CreateUUID() {
var data = GenRandomBytes(UUID_SIZE);
// mark as random - RFC 4122 § 4.4
data[6] = data[6] & 0x4f | 0x40;
data[8] = data[8] & 0xbf | 0x80;
var result = "";
for (var offset = 0; offset < UUID_SIZE; ++offset) {
var byte = data[offset];
if (offset === 4 || offset === 6 || offset === 8) {
result += "-";
}
if (byte < 16) {
result += "0";
}
result += byte.toString(16).toLowerCase();
}
return result;
}
function CreateUniqueKey() {
var key;
do {
key = "@@WeakMap@@" + CreateUUID();
} while (hasOwn.call(keys, key));
keys[key] = true;
return key;
}
function GetOrCreateWeakMapTable(target, create) {
if (!hasOwn.call(target, rootKey)) {
if (!create) {
return undefined;
}
Object.defineProperty(target, rootKey, { value: Object.create(null) });
}
return target[rootKey];
}
return WeakMap;
}
// hook global Reflect
(function (__global) {
if (typeof __global.Reflect !== "undefined") {
if (__global.Reflect !== Reflect) {
for (var p in Reflect) {
__global.Reflect[p] = Reflect[p];
}
}
}
else {
__global.Reflect = Reflect;
}
})(typeof window !== "undefined" ? window :
typeof WorkerGlobalScope !== "undefined" ? self :
typeof global !== "undefined" ? global :
Function("return this;")());
})(Reflect || (Reflect = {}));
//# sourceMappingURL=Reflect.js.map

File diff suppressed because it is too large Load Diff

View File

@@ -1,486 +0,0 @@
/*! *****************************************************************************
Copyright (C) Microsoft. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
declare module "reflect-metadata" {
// The "reflect-metadata" module has no imports or exports, but can be used by modules to load the polyfill.
}
declare module Reflect {
/**
* Applies a set of decorators to a target object.
* @param decorators An array of decorators.
* @param target The target object.
* @returns The result of applying the provided decorators.
* @remarks Decorators are applied in reverse order of their positions in the array.
* @example
*
* class C { }
*
* // constructor
* C = Reflect.decorate(decoratorsArray, C);
*
*/
function decorate(decorators: ClassDecorator[], target: Function): Function;
/**
* Applies a set of decorators to a property of a target object.
* @param decorators An array of decorators.
* @param target The target object.
* @param targetKey The property key to decorate.
* @param descriptor A property descriptor
* @remarks Decorators are applied in reverse order.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* static staticMethod() { }
* method() { }
* }
*
* // property (on constructor)
* Reflect.decorate(decoratorsArray, C, "staticProperty");
*
* // property (on prototype)
* Reflect.decorate(decoratorsArray, C.prototype, "property");
*
* // method (on constructor)
* Object.defineProperty(C, "staticMethod",
* Reflect.decorate(decoratorsArray, C, "staticMethod",
* Object.getOwnPropertyDescriptor(C, "staticMethod")));
*
* // method (on prototype)
* Object.defineProperty(C.prototype, "method",
* Reflect.decorate(decoratorsArray, C.prototype, "method",
* Object.getOwnPropertyDescriptor(C.prototype, "method")));
*
*/
function decorate(decorators: (PropertyDecorator | MethodDecorator)[], target: Object, targetKey: string | symbol, descriptor?: PropertyDescriptor): PropertyDescriptor;
/**
* A default metadata decorator factory that can be used on a class, class member, or parameter.
* @param metadataKey The key for the metadata entry.
* @param metadataValue The value for the metadata entry.
* @returns A decorator function.
* @remarks
* If `metadataKey` is already defined for the target and target key, the
* metadataValue for that key will be overwritten.
* @example
*
* // constructor
* @Reflect.metadata(key, value)
* class C {
* }
*
* // property (on constructor, TypeScript only)
* class C {
* @Reflect.metadata(key, value)
* static staticProperty;
* }
*
* // property (on prototype, TypeScript only)
* class C {
* @Reflect.metadata(key, value)
* property;
* }
*
* // method (on constructor)
* class C {
* @Reflect.metadata(key, value)
* static staticMethod() { }
* }
*
* // method (on prototype)
* class C {
* @Reflect.metadata(key, value)
* method() { }
* }
*
*/
function metadata(metadataKey: any, metadataValue: any): ClassDecorator | MethodDecorator | PropertyDecorator;
/**
* Define a unique metadata entry on the target.
* @param metadataKey A key used to store and retrieve metadata.
* @param metadataValue A value that contains attached metadata.
* @param target The target object on which to define metadata.
* @example
*
* class C {
* }
*
* // constructor
* Reflect.defineMetadata("custom:annotation", options, C);
*
* // decorator factory as metadata-producing annotation.
* function MyAnnotation(options): ClassDecorator {
* return target => Reflect.defineMetadata("custom:annotation", options, target);
* }
*
*/
function defineMetadata(metadataKey: any, metadataValue: any, target: Object): void;
/**
* Define a unique metadata entry on the target.
* @param metadataKey A key used to store and retrieve metadata.
* @param metadataValue A value that contains attached metadata.
* @param target The target object on which to define metadata.
* @param targetKey The property key for the target.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* static staticMethod(p) { }
* method(p) { }
* }
*
* // property (on constructor)
* Reflect.defineMetadata("custom:annotation", Number, C, "staticProperty");
*
* // property (on prototype)
* Reflect.defineMetadata("custom:annotation", Number, C.prototype, "property");
*
* // method (on constructor)
* Reflect.defineMetadata("custom:annotation", Number, C, "staticMethod");
*
* // method (on prototype)
* Reflect.defineMetadata("custom:annotation", Number, C.prototype, "method");
*
* // decorator factory as metadata-producing annotation.
* function MyAnnotation(options): PropertyDecorator {
* return (target, key) => Reflect.defineMetadata("custom:annotation", options, target, key);
* }
*
*/
function defineMetadata(metadataKey: any, metadataValue: any, target: Object, targetKey: string | symbol): void;
/**
* Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
* @example
*
* class C {
* }
*
* // constructor
* result = Reflect.hasMetadata("custom:annotation", C);
*
*/
function hasMetadata(metadataKey: any, target: Object): boolean;
/**
* Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey The property key for the target.
* @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* static staticMethod(p) { }
* method(p) { }
* }
*
* // property (on constructor)
* result = Reflect.hasMetadata("custom:annotation", C, "staticProperty");
*
* // property (on prototype)
* result = Reflect.hasMetadata("custom:annotation", C.prototype, "property");
*
* // method (on constructor)
* result = Reflect.hasMetadata("custom:annotation", C, "staticMethod");
*
* // method (on prototype)
* result = Reflect.hasMetadata("custom:annotation", C.prototype, "method");
*
*/
function hasMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean;
/**
* Gets a value indicating whether the target object has the provided metadata key defined.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
* @example
*
* class C {
* }
*
* // constructor
* result = Reflect.hasOwnMetadata("custom:annotation", C);
*
*/
function hasOwnMetadata(metadataKey: any, target: Object): boolean;
/**
* Gets a value indicating whether the target object has the provided metadata key defined.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey The property key for the target.
* @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* static staticMethod(p) { }
* method(p) { }
* }
*
* // property (on constructor)
* result = Reflect.hasOwnMetadata("custom:annotation", C, "staticProperty");
*
* // property (on prototype)
* result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "property");
*
* // method (on constructor)
* result = Reflect.hasOwnMetadata("custom:annotation", C, "staticMethod");
*
* // method (on prototype)
* result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "method");
*
*/
function hasOwnMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean;
/**
* Gets the metadata value for the provided metadata key on the target object or its prototype chain.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
* @example
*
* class C {
* }
*
* // constructor
* result = Reflect.getMetadata("custom:annotation", C);
*
*/
function getMetadata(metadataKey: any, target: Object): any;
/**
* Gets the metadata value for the provided metadata key on the target object or its prototype chain.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey The property key for the target.
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* static staticMethod(p) { }
* method(p) { }
* }
*
* // property (on constructor)
* result = Reflect.getMetadata("custom:annotation", C, "staticProperty");
*
* // property (on prototype)
* result = Reflect.getMetadata("custom:annotation", C.prototype, "property");
*
* // method (on constructor)
* result = Reflect.getMetadata("custom:annotation", C, "staticMethod");
*
* // method (on prototype)
* result = Reflect.getMetadata("custom:annotation", C.prototype, "method");
*
*/
function getMetadata(metadataKey: any, target: Object, targetKey: string | symbol): any;
/**
* Gets the metadata value for the provided metadata key on the target object.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
* @example
*
* class C {
* }
*
* // constructor
* result = Reflect.getOwnMetadata("custom:annotation", C);
*
*/
function getOwnMetadata(metadataKey: any, target: Object): any;
/**
* Gets the metadata value for the provided metadata key on the target object.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey The property key for the target.
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* static staticMethod(p) { }
* method(p) { }
* }
*
* // property (on constructor)
* result = Reflect.getOwnMetadata("custom:annotation", C, "staticProperty");
*
* // property (on prototype)
* result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "property");
*
* // method (on constructor)
* result = Reflect.getOwnMetadata("custom:annotation", C, "staticMethod");
*
* // method (on prototype)
* result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "method");
*
*/
function getOwnMetadata(metadataKey: any, target: Object, targetKey: string | symbol): any;
/**
* Gets the metadata keys defined on the target object or its prototype chain.
* @param target The target object on which the metadata is defined.
* @returns An array of unique metadata keys.
* @example
*
* class C {
* }
*
* // constructor
* result = Reflect.getMetadataKeys(C);
*
*/
function getMetadataKeys(target: Object): any[];
/**
* Gets the metadata keys defined on the target object or its prototype chain.
* @param target The target object on which the metadata is defined.
* @param targetKey The property key for the target.
* @returns An array of unique metadata keys.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* static staticMethod(p) { }
* method(p) { }
* }
*
* // property (on constructor)
* result = Reflect.getMetadataKeys(C, "staticProperty");
*
* // property (on prototype)
* result = Reflect.getMetadataKeys(C.prototype, "property");
*
* // method (on constructor)
* result = Reflect.getMetadataKeys(C, "staticMethod");
*
* // method (on prototype)
* result = Reflect.getMetadataKeys(C.prototype, "method");
*
*/
function getMetadataKeys(target: Object, targetKey: string | symbol): any[];
/**
* Gets the unique metadata keys defined on the target object.
* @param target The target object on which the metadata is defined.
* @returns An array of unique metadata keys.
* @example
*
* class C {
* }
*
* // constructor
* result = Reflect.getOwnMetadataKeys(C);
*
*/
function getOwnMetadataKeys(target: Object): any[];
/**
* Gets the unique metadata keys defined on the target object.
* @param target The target object on which the metadata is defined.
* @param targetKey The property key for the target.
* @returns An array of unique metadata keys.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* static staticMethod(p) { }
* method(p) { }
* }
*
* // property (on constructor)
* result = Reflect.getOwnMetadataKeys(C, "staticProperty");
*
* // property (on prototype)
* result = Reflect.getOwnMetadataKeys(C.prototype, "property");
*
* // method (on constructor)
* result = Reflect.getOwnMetadataKeys(C, "staticMethod");
*
* // method (on prototype)
* result = Reflect.getOwnMetadataKeys(C.prototype, "method");
*
*/
function getOwnMetadataKeys(target: Object, targetKey: string | symbol): any[];
/**
* Deletes the metadata entry from the target object with the provided key.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @returns `true` if the metadata entry was found and deleted; otherwise, false.
* @example
*
* class C {
* }
*
* // constructor
* result = Reflect.deleteMetadata("custom:annotation", C);
*
*/
function deleteMetadata(metadataKey: any, target: Object): boolean;
/**
* Deletes the metadata entry from the target object with the provided key.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey The property key for the target.
* @returns `true` if the metadata entry was found and deleted; otherwise, false.
* @example
*
* class C {
* // property declarations are not part of ES6, though they are valid in TypeScript:
* // static staticProperty;
* // property;
*
* static staticMethod(p) { }
* method(p) { }
* }
*
* // property (on constructor)
* result = Reflect.deleteMetadata("custom:annotation", C, "staticProperty");
*
* // property (on prototype)
* result = Reflect.deleteMetadata("custom:annotation", C.prototype, "property");
*
* // method (on constructor)
* result = Reflect.deleteMetadata("custom:annotation", C, "staticMethod");
*
* // method (on prototype)
* result = Reflect.deleteMetadata("custom:annotation", C.prototype, "method");
*
*/
function deleteMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean;
}

View File

@@ -1,22 +0,0 @@
import { Subject } from './Subject';
import { Observable } from './Observable';
import { Subscription } from './Subscription';
import { Subscriber } from './Subscriber';
import { AsyncSubject } from './subject/AsyncSubject';
import { ReplaySubject } from './subject/ReplaySubject';
import { BehaviorSubject } from './subject/BehaviorSubject';
import { ConnectableObservable } from './observable/ConnectableObservable';
import { Notification } from './Notification';
import { EmptyError } from './util/EmptyError';
import { ArgumentOutOfRangeError } from './util/ArgumentOutOfRangeError';
import { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';
import { AsapScheduler } from './scheduler/AsapScheduler';
import { QueueScheduler } from './scheduler/QueueScheduler';
declare var Scheduler: {
asap: AsapScheduler;
queue: QueueScheduler;
};
declare var Symbol: {
rxSubscriber: any;
};
export { Subject, Scheduler, Observable, Subscriber, Subscription, Symbol, AsyncSubject, ReplaySubject, BehaviorSubject, ConnectableObservable, Notification, EmptyError, ArgumentOutOfRangeError, ObjectUnsubscribedError };

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -1,321 +0,0 @@
(function(t){"object"===typeof exports&&"undefined"!==typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).Rx=t()})(function(){return function a(b,e,h){function k(f,d){if(!e[f]){if(!b[f]){var c="function"==typeof require&&require;if(!d&&c)return c(f,!0);if(m)return m(f,!0);c=Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c;}c=e[f]={exports:{}};
b[f][0].call(c.exports,function(a){var c=b[f][1][a];return k(c?c:a)},c,c.exports,a,b,e,h)}return e[f].exports}for(var m="function"==typeof require&&require,l=0;l<h.length;l++)k(h[l]);return k}({1:[function(a,b,e){var h=this&&this.__extends||function(a,b){function l(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===b?Object.create(b):(l.prototype=b.prototype,new l)};a=function(a){function b(l,f,d){a.call(this);this.parent=l;this.outerValue=f;this.outerIndex=d;
this.index=0}h(b,a);b.prototype._next=function(a){var f=this.index++;this.parent.notifyNext(this.outerValue,a,this.outerIndex,f)};b.prototype._error=function(a){this.parent.notifyError(a,this)};b.prototype._complete=function(){this.parent.notifyComplete(this)};return b}(a("./Subscriber").Subscriber);e.InnerSubscriber=a},{"./Subscriber":7}],2:[function(a,b,e){var h=a("./Observable");a=function(){function a(b,l,f){this.kind=b;this.value=l;this.exception=f;this.hasValue="N"===b}a.prototype.observe=function(a){switch(this.kind){case "N":return a.next(this.value);
case "E":return a.error(this.exception);case "C":return a.complete()}};a.prototype.do=function(a,b,f){switch(this.kind){case "N":return a(this.value);case "E":return b(this.exception);case "C":return f()}};a.prototype.accept=function(a,b,f){return a&&"function"===typeof a.next?this.observe(a):this.do(a,b,f)};a.prototype.toObservable=function(){switch(this.kind){case "N":return h.Observable.of(this.value);case "E":return h.Observable.throw(this.exception);case "C":return h.Observable.empty()}};a.createNext=
function(b){return"undefined"!==typeof b?new a("N",b):this.undefinedValueNotification};a.createError=function(b){return new a("E",void 0,b)};a.createComplete=function(){return this.completeNotification};a.completeNotification=new a("C");a.undefinedValueNotification=new a("N",void 0);return a}();e.Notification=a},{"./Observable":3}],3:[function(a,b,e){var h=a("./Subscriber"),k=a("./util/root"),m=a("./util/SymbolShim"),l=a("./symbol/rxSubscriber");a=function(){function a(d){this._isScalar=!1;d&&(this._subscribe=
d)}a.prototype.lift=function(d){var c=new a;c.source=this;c.operator=d;return c};a.prototype[m.SymbolShim.observable]=function(){return this};a.prototype.subscribe=function(a,c,g){a=a&&"object"===typeof a?a instanceof h.Subscriber?a:a[l.rxSubscriber]?a[l.rxSubscriber]():new h.Subscriber(a):h.Subscriber.create(a,c,g);a.add(this._subscribe(a));return a};a.prototype.forEach=function(a,c,g){g||(k.root.Rx&&k.root.Rx.config&&k.root.Rx.config.Promise?g=k.root.Rx.config.Promise:k.root.Promise&&(g=k.root.Promise));
if(!g)throw Error("no Promise impl found");var n;c?(n=function q(a){return q.next.call(q.thisArg,a)},n.thisArg=c,n.next=a):n=a;a=function q(a,c){q.source.subscribe(q.nextHandler,c,a)};a.source=this;a.nextHandler=n;return new g(a)};a.prototype._subscribe=function(a){return this.source._subscribe(this.operator.call(a))};a.create=function(d){return new a(d)};return a}();e.Observable=a},{"./Subscriber":7,"./symbol/rxSubscriber":221,"./util/SymbolShim":229,"./util/root":238}],4:[function(a,b,e){var h=
this&&this.__extends||function(a,b){function l(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===b?Object.create(b):(l.prototype=b.prototype,new l)};a=function(a){function b(){a.apply(this,arguments)}h(b,a);b.prototype.notifyComplete=function(a){this.destination.complete()};b.prototype.notifyNext=function(a,f,d,c){this.destination.next(f)};b.prototype.notifyError=function(a,f){this.destination.error(a)};return b}(a("./Subscriber").Subscriber);e.OuterSubscriber=
a},{"./Subscriber":7}],5:[function(a,b,e){b=a("./Subject");e.Subject=b.Subject;b=a("./Observable");e.Observable=b.Observable;a("./add/operator/combineLatest-static");a("./add/operator/concat-static");a("./add/operator/merge-static");a("./add/observable/bindCallback");a("./add/observable/defer");a("./add/observable/empty");a("./add/observable/forkJoin");a("./add/observable/from");a("./add/observable/fromArray");a("./add/observable/fromEvent");a("./add/observable/fromEventPattern");a("./add/observable/fromPromise");
a("./add/observable/interval");a("./add/observable/never");a("./add/observable/range");a("./add/observable/throw");a("./add/observable/timer");a("./add/operator/zip-static");a("./add/operator/buffer");a("./add/operator/bufferCount");a("./add/operator/bufferTime");a("./add/operator/bufferToggle");a("./add/operator/bufferWhen");a("./add/operator/catch");a("./add/operator/combineAll");a("./add/operator/combineLatest");a("./add/operator/concat");a("./add/operator/concatAll");a("./add/operator/concatMap");
a("./add/operator/concatMapTo");a("./add/operator/count");a("./add/operator/dematerialize");a("./add/operator/debounce");a("./add/operator/debounceTime");a("./add/operator/defaultIfEmpty");a("./add/operator/delay");a("./add/operator/distinctUntilChanged");a("./add/operator/do");a("./add/operator/expand");a("./add/operator/filter");a("./add/operator/finally");a("./add/operator/first");a("./add/operator/groupBy");a("./add/operator/ignoreElements");a("./add/operator/every");a("./add/operator/last");
a("./add/operator/map");a("./add/operator/mapTo");a("./add/operator/materialize");a("./add/operator/merge");a("./add/operator/mergeAll");a("./add/operator/mergeMap");a("./add/operator/mergeMapTo");a("./add/operator/multicast");a("./add/operator/observeOn");a("./add/operator/partition");a("./add/operator/publish");a("./add/operator/publishBehavior");a("./add/operator/publishReplay");a("./add/operator/publishLast");a("./add/operator/reduce");a("./add/operator/repeat");a("./add/operator/retry");a("./add/operator/retryWhen");
a("./add/operator/sample");a("./add/operator/sampleTime");a("./add/operator/scan");a("./add/operator/share");a("./add/operator/single");a("./add/operator/skip");a("./add/operator/skipUntil");a("./add/operator/skipWhile");a("./add/operator/startWith");a("./add/operator/subscribeOn");a("./add/operator/switch");a("./add/operator/switchMap");a("./add/operator/switchMapTo");a("./add/operator/take");a("./add/operator/takeUntil");a("./add/operator/takeWhile");a("./add/operator/throttle");a("./add/operator/throttleTime");
a("./add/operator/timeout");a("./add/operator/timeoutWith");a("./add/operator/toArray");a("./add/operator/toPromise");a("./add/operator/window");a("./add/operator/windowCount");a("./add/operator/windowTime");a("./add/operator/windowToggle");a("./add/operator/windowWhen");a("./add/operator/withLatestFrom");a("./add/operator/zip");a("./add/operator/zipAll");b=a("./Subscription");e.Subscription=b.Subscription;b=a("./Subscriber");e.Subscriber=b.Subscriber;b=a("./subject/AsyncSubject");e.AsyncSubject=
b.AsyncSubject;b=a("./subject/ReplaySubject");e.ReplaySubject=b.ReplaySubject;b=a("./subject/BehaviorSubject");e.BehaviorSubject=b.BehaviorSubject;b=a("./observable/ConnectableObservable");e.ConnectableObservable=b.ConnectableObservable;b=a("./Notification");e.Notification=b.Notification;b=a("./util/EmptyError");e.EmptyError=b.EmptyError;b=a("./util/ArgumentOutOfRangeError");e.ArgumentOutOfRangeError=b.ArgumentOutOfRangeError;b=a("./util/ObjectUnsubscribedError");e.ObjectUnsubscribedError=b.ObjectUnsubscribedError;
b=a("./scheduler/asap");var h=a("./scheduler/queue");a=a("./symbol/rxSubscriber");e.Scheduler={asap:b.asap,queue:h.queue};e.Symbol={rxSubscriber:a.rxSubscriber}},{"./Notification":2,"./Observable":3,"./Subject":6,"./Subscriber":7,"./Subscription":8,"./add/observable/bindCallback":9,"./add/observable/defer":10,"./add/observable/empty":11,"./add/observable/forkJoin":12,"./add/observable/from":13,"./add/observable/fromArray":14,"./add/observable/fromEvent":15,"./add/observable/fromEventPattern":16,"./add/observable/fromPromise":17,
"./add/observable/interval":18,"./add/observable/never":19,"./add/observable/range":20,"./add/observable/throw":21,"./add/observable/timer":22,"./add/operator/buffer":23,"./add/operator/bufferCount":24,"./add/operator/bufferTime":25,"./add/operator/bufferToggle":26,"./add/operator/bufferWhen":27,"./add/operator/catch":28,"./add/operator/combineAll":29,"./add/operator/combineLatest":31,"./add/operator/combineLatest-static":30,"./add/operator/concat":33,"./add/operator/concat-static":32,"./add/operator/concatAll":34,
"./add/operator/concatMap":35,"./add/operator/concatMapTo":36,"./add/operator/count":37,"./add/operator/debounce":38,"./add/operator/debounceTime":39,"./add/operator/defaultIfEmpty":40,"./add/operator/delay":41,"./add/operator/dematerialize":42,"./add/operator/distinctUntilChanged":43,"./add/operator/do":44,"./add/operator/every":45,"./add/operator/expand":46,"./add/operator/filter":47,"./add/operator/finally":48,"./add/operator/first":49,"./add/operator/groupBy":50,"./add/operator/ignoreElements":51,
"./add/operator/last":52,"./add/operator/map":53,"./add/operator/mapTo":54,"./add/operator/materialize":55,"./add/operator/merge":57,"./add/operator/merge-static":56,"./add/operator/mergeAll":58,"./add/operator/mergeMap":59,"./add/operator/mergeMapTo":60,"./add/operator/multicast":61,"./add/operator/observeOn":62,"./add/operator/partition":63,"./add/operator/publish":64,"./add/operator/publishBehavior":65,"./add/operator/publishLast":66,"./add/operator/publishReplay":67,"./add/operator/reduce":68,
"./add/operator/repeat":69,"./add/operator/retry":70,"./add/operator/retryWhen":71,"./add/operator/sample":72,"./add/operator/sampleTime":73,"./add/operator/scan":74,"./add/operator/share":75,"./add/operator/single":76,"./add/operator/skip":77,"./add/operator/skipUntil":78,"./add/operator/skipWhile":79,"./add/operator/startWith":80,"./add/operator/subscribeOn":81,"./add/operator/switch":82,"./add/operator/switchMap":83,"./add/operator/switchMapTo":84,"./add/operator/take":85,"./add/operator/takeUntil":86,
"./add/operator/takeWhile":87,"./add/operator/throttle":88,"./add/operator/throttleTime":89,"./add/operator/timeout":90,"./add/operator/timeoutWith":91,"./add/operator/toArray":92,"./add/operator/toPromise":93,"./add/operator/window":94,"./add/operator/windowCount":95,"./add/operator/windowTime":96,"./add/operator/windowToggle":97,"./add/operator/windowWhen":98,"./add/operator/withLatestFrom":99,"./add/operator/zip":101,"./add/operator/zip-static":100,"./add/operator/zipAll":102,"./observable/ConnectableObservable":103,
"./scheduler/asap":215,"./scheduler/queue":216,"./subject/AsyncSubject":217,"./subject/BehaviorSubject":218,"./subject/ReplaySubject":219,"./symbol/rxSubscriber":221,"./util/ArgumentOutOfRangeError":222,"./util/EmptyError":223,"./util/ObjectUnsubscribedError":228}],6:[function(a,b,e){var h=this&&this.__extends||function(a,c){function g(){this.constructor=a}for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d]);a.prototype=null===c?Object.create(c):(g.prototype=c.prototype,new g)};b=a("./Observable");var k=
a("./Subscriber"),m=a("./Subscription"),l=a("./subject/SubjectSubscription"),f=a("./symbol/rxSubscriber"),d=m.Subscription.prototype.add,c=m.Subscription.prototype.remove,g=m.Subscription.prototype.unsubscribe,n=k.Subscriber.prototype.next,p=k.Subscriber.prototype.error,q=k.Subscriber.prototype.complete,w=k.Subscriber.prototype._next,x=k.Subscriber.prototype._error,r=k.Subscriber.prototype._complete;a=function(a){function n(){a.apply(this,arguments);this.observers=[];this.completeSignal=this.errorSignal=
this.dispatching=this.isUnsubscribed=!1}h(n,a);n.prototype[f.rxSubscriber]=function(){return this};n.create=function(a,c){return new v(a,c)};n.prototype.lift=function(a){var c=new v(this,this.destination||this);c.operator=a;return c};n.prototype._subscribe=function(a){if(!a.isUnsubscribed)if(this.errorSignal)a.error(this.errorInstance);else if(this.completeSignal)a.complete();else{if(this.isUnsubscribed)throw Error("Cannot subscribe to a disposed Subject.");this.observers.push(a);return new l.SubjectSubscription(this,
a)}};n.prototype.add=function(a){d.call(this,a)};n.prototype.remove=function(a){c.call(this,a)};n.prototype.unsubscribe=function(){this.observers=void 0;g.call(this)};n.prototype.next=function(a){this.isUnsubscribed||(this.dispatching=!0,this._next(a),this.dispatching=!1,this.errorSignal?this.error(this.errorInstance):this.completeSignal&&this.complete())};n.prototype.error=function(a){this.isUnsubscribed||this.completeSignal||(this.errorSignal=!0,this.errorInstance=a,this.dispatching||(this._error(a),
this.unsubscribe()))};n.prototype.complete=function(){this.isUnsubscribed||this.errorSignal||(this.completeSignal=!0,this.dispatching||(this._complete(),this.unsubscribe()))};n.prototype._next=function(a){for(var c=-1,g=this.observers.slice(0),n=g.length;++c<n;)g[c].next(a)};n.prototype._error=function(a){var c=-1,g=this.observers,n=g.length;this.observers=void 0;for(this.isUnsubscribed=!0;++c<n;)g[c].error(a);this.isUnsubscribed=!1};n.prototype._complete=function(){var a=-1,c=this.observers,g=c.length;
this.observers=void 0;for(this.isUnsubscribed=!0;++a<g;)c[a].complete();this.isUnsubscribed=!1};return n}(b.Observable);e.Subject=a;var v=function(a){function c(g,n){a.call(this);this.source=g;this.destination=n}h(c,a);c.prototype._subscribe=function(a){var c=this.operator;return this.source._subscribe.call(this.source,c?c.call(a):a)};c.prototype.next=function(a){n.call(this,a)};c.prototype.error=function(a){p.call(this,a)};c.prototype.complete=function(){q.call(this)};c.prototype._next=function(a){w.call(this,
a)};c.prototype._error=function(a){x.call(this,a)};c.prototype._complete=function(){r.call(this)};return c}(a)},{"./Observable":3,"./Subscriber":7,"./Subscription":8,"./subject/SubjectSubscription":220,"./symbol/rxSubscriber":221}],7:[function(a,b,e){var h=this&&this.__extends||function(a,c){function g(){this.constructor=a}for(var n in c)c.hasOwnProperty(n)&&(a[n]=c[n]);a.prototype=null===c?Object.create(c):(g.prototype=c.prototype,new g)},k=a("./util/noop"),m=a("./util/throwError"),l=a("./util/tryOrOnError");
b=a("./Subscription");var f=a("./symbol/rxSubscriber");a=function(a){function c(g){a.call(this);this.destination=g;this._isUnsubscribed=!1;if(this.destination){var n=g._subscription;n?this._subscription=n:g instanceof c&&(this._subscription=g)}}h(c,a);c.prototype[f.rxSubscriber]=function(){return this};Object.defineProperty(c.prototype,"isUnsubscribed",{get:function(){var a=this._subscription;return a?this._isUnsubscribed||a.isUnsubscribed:this._isUnsubscribed},set:function(a){var c=this._subscription;
c?c.isUnsubscribed=Boolean(a):this._isUnsubscribed=Boolean(a)},enumerable:!0,configurable:!0});c.create=function(a,n,d){var f=new c;f._next="function"===typeof a&&l.tryOrOnError(a)||k.noop;f._error="function"===typeof n&&n||m.throwError;f._complete="function"===typeof d&&d||k.noop;return f};c.prototype.add=function(c){var n=this._subscription;n?n.add(c):a.prototype.add.call(this,c)};c.prototype.remove=function(c){this._subscription?this._subscription.remove(c):a.prototype.remove.call(this,c)};c.prototype.unsubscribe=
function(){this._isUnsubscribed||(this._subscription?this._isUnsubscribed=!0:a.prototype.unsubscribe.call(this))};c.prototype._next=function(a){var c=this.destination;c.next&&c.next(a)};c.prototype._error=function(a){var c=this.destination;c.error&&c.error(a)};c.prototype._complete=function(){var a=this.destination;a.complete&&a.complete()};c.prototype.next=function(a){this.isUnsubscribed||this._next(a)};c.prototype.error=function(a){this.isUnsubscribed||(this._error(a),this.unsubscribe())};c.prototype.complete=
function(){this.isUnsubscribed||(this._complete(),this.unsubscribe())};return c}(b.Subscription);e.Subscriber=a},{"./Subscription":8,"./symbol/rxSubscriber":221,"./util/noop":236,"./util/throwError":240,"./util/tryOrOnError":242}],8:[function(a,b,e){var h=a("./util/noop");a=function(){function a(b){this.isUnsubscribed=!1;b&&(this._unsubscribe=b)}a.prototype._unsubscribe=function(){h.noop()};a.prototype.unsubscribe=function(){if(!this.isUnsubscribed){this.isUnsubscribed=!0;var a=this._unsubscribe,
b=this._subscriptions;this._subscriptions=void 0;a&&a.call(this);if(null!=b)for(var a=-1,f=b.length;++a<f;)b[a].unsubscribe()}};a.prototype.add=function(b){if(b&&b!==this&&b!==a.EMPTY){var l=b;switch(typeof b){case "function":l=new a(b);case "object":if(l.isUnsubscribed||"function"!==typeof l.unsubscribe)break;else this.isUnsubscribed?l.unsubscribe():(this._subscriptions||(this._subscriptions=[])).push(l);break;default:throw Error("Unrecognized subscription "+b+" added to Subscription.");}}};a.prototype.remove=
function(b){if(null!=b&&b!==this&&b!==a.EMPTY){var l=this._subscriptions;l&&(b=l.indexOf(b),-1!==b&&l.splice(b,1))}};a.EMPTY=function(a){a.isUnsubscribed=!0;return a}(new a);return a}();e.Subscription=a},{"./util/noop":236}],9:[function(a,b,e){b=a("../../Observable");a=a("../../observable/bindCallback");b.Observable.bindCallback=a.BoundCallbackObservable.create},{"../../Observable":3,"../../observable/bindCallback":107}],10:[function(a,b,e){b=a("../../Observable");a=a("../../observable/defer");b.Observable.defer=
a.DeferObservable.create},{"../../Observable":3,"../../observable/defer":108}],11:[function(a,b,e){b=a("../../Observable");a=a("../../observable/empty");b.Observable.empty=a.EmptyObservable.create},{"../../Observable":3,"../../observable/empty":109}],12:[function(a,b,e){b=a("../../Observable");a=a("../../observable/forkJoin");b.Observable.forkJoin=a.ForkJoinObservable.create},{"../../Observable":3,"../../observable/forkJoin":110}],13:[function(a,b,e){b=a("../../Observable");a=a("../../observable/from");
b.Observable.from=a.FromObservable.create},{"../../Observable":3,"../../observable/from":111}],14:[function(a,b,e){b=a("../../Observable");a=a("../../observable/fromArray");b.Observable.fromArray=a.ArrayObservable.create;b.Observable.of=a.ArrayObservable.of},{"../../Observable":3,"../../observable/fromArray":112}],15:[function(a,b,e){b=a("../../Observable");a=a("../../observable/fromEvent");b.Observable.fromEvent=a.FromEventObservable.create},{"../../Observable":3,"../../observable/fromEvent":113}],
16:[function(a,b,e){b=a("../../Observable");a=a("../../observable/fromEventPattern");b.Observable.fromEventPattern=a.FromEventPatternObservable.create},{"../../Observable":3,"../../observable/fromEventPattern":114}],17:[function(a,b,e){b=a("../../Observable");a=a("../../observable/fromPromise");b.Observable.fromPromise=a.PromiseObservable.create},{"../../Observable":3,"../../observable/fromPromise":115}],18:[function(a,b,e){b=a("../../Observable");a=a("../../observable/interval");b.Observable.interval=
a.IntervalObservable.create},{"../../Observable":3,"../../observable/interval":116}],19:[function(a,b,e){b=a("../../Observable");a=a("../../observable/never");b.Observable.never=a.InfiniteObservable.create},{"../../Observable":3,"../../observable/never":117}],20:[function(a,b,e){b=a("../../Observable");a=a("../../observable/range");b.Observable.range=a.RangeObservable.create},{"../../Observable":3,"../../observable/range":118}],21:[function(a,b,e){b=a("../../Observable");a=a("../../observable/throw");
b.Observable.throw=a.ErrorObservable.create},{"../../Observable":3,"../../observable/throw":119}],22:[function(a,b,e){b=a("../../Observable");a=a("../../observable/timer");b.Observable.timer=a.TimerObservable.create},{"../../Observable":3,"../../observable/timer":120}],23:[function(a,b,e){b=a("../../Observable");a=a("../../operator/buffer");b.Observable.prototype.buffer=a.buffer},{"../../Observable":3,"../../operator/buffer":121}],24:[function(a,b,e){b=a("../../Observable");a=a("../../operator/bufferCount");
b.Observable.prototype.bufferCount=a.bufferCount},{"../../Observable":3,"../../operator/bufferCount":122}],25:[function(a,b,e){b=a("../../Observable");a=a("../../operator/bufferTime");b.Observable.prototype.bufferTime=a.bufferTime},{"../../Observable":3,"../../operator/bufferTime":123}],26:[function(a,b,e){b=a("../../Observable");a=a("../../operator/bufferToggle");b.Observable.prototype.bufferToggle=a.bufferToggle},{"../../Observable":3,"../../operator/bufferToggle":124}],27:[function(a,b,e){b=a("../../Observable");
a=a("../../operator/bufferWhen");b.Observable.prototype.bufferWhen=a.bufferWhen},{"../../Observable":3,"../../operator/bufferWhen":125}],28:[function(a,b,e){b=a("../../Observable");a=a("../../operator/catch");b.Observable.prototype.catch=a._catch},{"../../Observable":3,"../../operator/catch":126}],29:[function(a,b,e){b=a("../../Observable");a=a("../../operator/combineAll");b.Observable.prototype.combineAll=a.combineAll},{"../../Observable":3,"../../operator/combineAll":127}],30:[function(a,b,e){b=
a("../../Observable");a=a("../../operator/combineLatest-static");b.Observable.combineLatest=a.combineLatest},{"../../Observable":3,"../../operator/combineLatest-static":128}],31:[function(a,b,e){b=a("../../Observable");a=a("../../operator/combineLatest");b.Observable.prototype.combineLatest=a.combineLatest},{"../../Observable":3,"../../operator/combineLatest":130}],32:[function(a,b,e){b=a("../../Observable");a=a("../../operator/concat-static");b.Observable.concat=a.concat},{"../../Observable":3,"../../operator/concat-static":131}],
33:[function(a,b,e){b=a("../../Observable");a=a("../../operator/concat");b.Observable.prototype.concat=a.concat},{"../../Observable":3,"../../operator/concat":132}],34:[function(a,b,e){b=a("../../Observable");a=a("../../operator/concatAll");b.Observable.prototype.concatAll=a.concatAll},{"../../Observable":3,"../../operator/concatAll":133}],35:[function(a,b,e){b=a("../../Observable");a=a("../../operator/concatMap");b.Observable.prototype.concatMap=a.concatMap},{"../../Observable":3,"../../operator/concatMap":134}],
36:[function(a,b,e){b=a("../../Observable");a=a("../../operator/concatMapTo");b.Observable.prototype.concatMapTo=a.concatMapTo},{"../../Observable":3,"../../operator/concatMapTo":135}],37:[function(a,b,e){b=a("../../Observable");a=a("../../operator/count");b.Observable.prototype.count=a.count},{"../../Observable":3,"../../operator/count":136}],38:[function(a,b,e){b=a("../../Observable");a=a("../../operator/debounce");b.Observable.prototype.debounce=a.debounce},{"../../Observable":3,"../../operator/debounce":137}],
39:[function(a,b,e){b=a("../../Observable");a=a("../../operator/debounceTime");b.Observable.prototype.debounceTime=a.debounceTime},{"../../Observable":3,"../../operator/debounceTime":138}],40:[function(a,b,e){b=a("../../Observable");a=a("../../operator/defaultIfEmpty");b.Observable.prototype.defaultIfEmpty=a.defaultIfEmpty},{"../../Observable":3,"../../operator/defaultIfEmpty":139}],41:[function(a,b,e){b=a("../../Observable");a=a("../../operator/delay");b.Observable.prototype.delay=a.delay},{"../../Observable":3,
"../../operator/delay":140}],42:[function(a,b,e){b=a("../../Observable");a=a("../../operator/dematerialize");b.Observable.prototype.dematerialize=a.dematerialize},{"../../Observable":3,"../../operator/dematerialize":141}],43:[function(a,b,e){b=a("../../Observable");a=a("../../operator/distinctUntilChanged");b.Observable.prototype.distinctUntilChanged=a.distinctUntilChanged},{"../../Observable":3,"../../operator/distinctUntilChanged":142}],44:[function(a,b,e){b=a("../../Observable");a=a("../../operator/do");
b.Observable.prototype.do=a._do},{"../../Observable":3,"../../operator/do":143}],45:[function(a,b,e){b=a("../../Observable");a=a("../../operator/every");b.Observable.prototype.every=a.every},{"../../Observable":3,"../../operator/every":144}],46:[function(a,b,e){b=a("../../Observable");a=a("../../operator/expand");b.Observable.prototype.expand=a.expand},{"../../Observable":3,"../../operator/expand":146}],47:[function(a,b,e){b=a("../../Observable");a=a("../../operator/filter");b.Observable.prototype.filter=
a.filter},{"../../Observable":3,"../../operator/filter":147}],48:[function(a,b,e){b=a("../../Observable");a=a("../../operator/finally");b.Observable.prototype.finally=a._finally},{"../../Observable":3,"../../operator/finally":148}],49:[function(a,b,e){b=a("../../Observable");a=a("../../operator/first");b.Observable.prototype.first=a.first},{"../../Observable":3,"../../operator/first":149}],50:[function(a,b,e){b=a("../../Observable");a=a("../../operator/groupBy");b.Observable.prototype.groupBy=a.groupBy},
{"../../Observable":3,"../../operator/groupBy":151}],51:[function(a,b,e){b=a("../../Observable");a=a("../../operator/ignoreElements");b.Observable.prototype.ignoreElements=a.ignoreElements},{"../../Observable":3,"../../operator/ignoreElements":152}],52:[function(a,b,e){b=a("../../Observable");a=a("../../operator/last");b.Observable.prototype.last=a.last},{"../../Observable":3,"../../operator/last":153}],53:[function(a,b,e){b=a("../../Observable");a=a("../../operator/map");b.Observable.prototype.map=
a.map},{"../../Observable":3,"../../operator/map":154}],54:[function(a,b,e){b=a("../../Observable");a=a("../../operator/mapTo");b.Observable.prototype.mapTo=a.mapTo},{"../../Observable":3,"../../operator/mapTo":155}],55:[function(a,b,e){b=a("../../Observable");a=a("../../operator/materialize");b.Observable.prototype.materialize=a.materialize},{"../../Observable":3,"../../operator/materialize":156}],56:[function(a,b,e){b=a("../../Observable");a=a("../../operator/merge-static");b.Observable.merge=a.merge},
{"../../Observable":3,"../../operator/merge-static":157}],57:[function(a,b,e){b=a("../../Observable");a=a("../../operator/merge");b.Observable.prototype.merge=a.merge},{"../../Observable":3,"../../operator/merge":158}],58:[function(a,b,e){b=a("../../Observable");a=a("../../operator/mergeAll");b.Observable.prototype.mergeAll=a.mergeAll},{"../../Observable":3,"../../operator/mergeAll":160}],59:[function(a,b,e){b=a("../../Observable");a=a("../../operator/mergeMap");b.Observable.prototype.mergeMap=a.mergeMap;
b.Observable.prototype.flatMap=a.mergeMap},{"../../Observable":3,"../../operator/mergeMap":162}],60:[function(a,b,e){b=a("../../Observable");a=a("../../operator/mergeMapTo");b.Observable.prototype.mergeMapTo=a.mergeMapTo},{"../../Observable":3,"../../operator/mergeMapTo":164}],61:[function(a,b,e){b=a("../../Observable");a=a("../../operator/multicast");b.Observable.prototype.multicast=a.multicast},{"../../Observable":3,"../../operator/multicast":165}],62:[function(a,b,e){b=a("../../Observable");a=
a("../../operator/observeOn");b.Observable.prototype.observeOn=a.observeOn},{"../../Observable":3,"../../operator/observeOn":167}],63:[function(a,b,e){b=a("../../Observable");a=a("../../operator/partition");b.Observable.prototype.partition=a.partition},{"../../Observable":3,"../../operator/partition":168}],64:[function(a,b,e){b=a("../../Observable");a=a("../../operator/publish");b.Observable.prototype.publish=a.publish},{"../../Observable":3,"../../operator/publish":169}],65:[function(a,b,e){b=a("../../Observable");
a=a("../../operator/publishBehavior");b.Observable.prototype.publishBehavior=a.publishBehavior},{"../../Observable":3,"../../operator/publishBehavior":170}],66:[function(a,b,e){b=a("../../Observable");a=a("../../operator/publishLast");b.Observable.prototype.publishLast=a.publishLast},{"../../Observable":3,"../../operator/publishLast":171}],67:[function(a,b,e){b=a("../../Observable");a=a("../../operator/publishReplay");b.Observable.prototype.publishReplay=a.publishReplay},{"../../Observable":3,"../../operator/publishReplay":172}],
68:[function(a,b,e){b=a("../../Observable");a=a("../../operator/reduce");b.Observable.prototype.reduce=a.reduce},{"../../Observable":3,"../../operator/reduce":174}],69:[function(a,b,e){b=a("../../Observable");a=a("../../operator/repeat");b.Observable.prototype.repeat=a.repeat},{"../../Observable":3,"../../operator/repeat":175}],70:[function(a,b,e){b=a("../../Observable");a=a("../../operator/retry");b.Observable.prototype.retry=a.retry},{"../../Observable":3,"../../operator/retry":176}],71:[function(a,
b,e){b=a("../../Observable");a=a("../../operator/retryWhen");b.Observable.prototype.retryWhen=a.retryWhen},{"../../Observable":3,"../../operator/retryWhen":177}],72:[function(a,b,e){b=a("../../Observable");a=a("../../operator/sample");b.Observable.prototype.sample=a.sample},{"../../Observable":3,"../../operator/sample":178}],73:[function(a,b,e){b=a("../../Observable");a=a("../../operator/sampleTime");b.Observable.prototype.sampleTime=a.sampleTime},{"../../Observable":3,"../../operator/sampleTime":179}],
74:[function(a,b,e){b=a("../../Observable");a=a("../../operator/scan");b.Observable.prototype.scan=a.scan},{"../../Observable":3,"../../operator/scan":180}],75:[function(a,b,e){b=a("../../Observable");a=a("../../operator/share");b.Observable.prototype.share=a.share},{"../../Observable":3,"../../operator/share":181}],76:[function(a,b,e){b=a("../../Observable");a=a("../../operator/single");b.Observable.prototype.single=a.single},{"../../Observable":3,"../../operator/single":182}],77:[function(a,b,e){b=
a("../../Observable");a=a("../../operator/skip");b.Observable.prototype.skip=a.skip},{"../../Observable":3,"../../operator/skip":183}],78:[function(a,b,e){b=a("../../Observable");a=a("../../operator/skipUntil");b.Observable.prototype.skipUntil=a.skipUntil},{"../../Observable":3,"../../operator/skipUntil":184}],79:[function(a,b,e){b=a("../../Observable");a=a("../../operator/skipWhile");b.Observable.prototype.skipWhile=a.skipWhile},{"../../Observable":3,"../../operator/skipWhile":185}],80:[function(a,
b,e){b=a("../../Observable");a=a("../../operator/startWith");b.Observable.prototype.startWith=a.startWith},{"../../Observable":3,"../../operator/startWith":186}],81:[function(a,b,e){b=a("../../Observable");a=a("../../operator/subscribeOn");b.Observable.prototype.subscribeOn=a.subscribeOn},{"../../Observable":3,"../../operator/subscribeOn":187}],82:[function(a,b,e){b=a("../../Observable");a=a("../../operator/switch");b.Observable.prototype.switch=a._switch},{"../../Observable":3,"../../operator/switch":188}],
83:[function(a,b,e){b=a("../../Observable");a=a("../../operator/switchMap");b.Observable.prototype.switchMap=a.switchMap},{"../../Observable":3,"../../operator/switchMap":189}],84:[function(a,b,e){b=a("../../Observable");a=a("../../operator/switchMapTo");b.Observable.prototype.switchMapTo=a.switchMapTo},{"../../Observable":3,"../../operator/switchMapTo":190}],85:[function(a,b,e){b=a("../../Observable");a=a("../../operator/take");b.Observable.prototype.take=a.take},{"../../Observable":3,"../../operator/take":191}],
86:[function(a,b,e){b=a("../../Observable");a=a("../../operator/takeUntil");b.Observable.prototype.takeUntil=a.takeUntil},{"../../Observable":3,"../../operator/takeUntil":192}],87:[function(a,b,e){b=a("../../Observable");a=a("../../operator/takeWhile");b.Observable.prototype.takeWhile=a.takeWhile},{"../../Observable":3,"../../operator/takeWhile":193}],88:[function(a,b,e){b=a("../../Observable");a=a("../../operator/throttle");b.Observable.prototype.throttle=a.throttle},{"../../Observable":3,"../../operator/throttle":194}],
89:[function(a,b,e){b=a("../../Observable");a=a("../../operator/throttleTime");b.Observable.prototype.throttleTime=a.throttleTime},{"../../Observable":3,"../../operator/throttleTime":195}],90:[function(a,b,e){b=a("../../Observable");a=a("../../operator/timeout");b.Observable.prototype.timeout=a.timeout},{"../../Observable":3,"../../operator/timeout":196}],91:[function(a,b,e){b=a("../../Observable");a=a("../../operator/timeoutWith");b.Observable.prototype.timeoutWith=a.timeoutWith},{"../../Observable":3,
"../../operator/timeoutWith":197}],92:[function(a,b,e){b=a("../../Observable");a=a("../../operator/toArray");b.Observable.prototype.toArray=a.toArray},{"../../Observable":3,"../../operator/toArray":198}],93:[function(a,b,e){b=a("../../Observable");a=a("../../operator/toPromise");b.Observable.prototype.toPromise=a.toPromise},{"../../Observable":3,"../../operator/toPromise":199}],94:[function(a,b,e){b=a("../../Observable");a=a("../../operator/window");b.Observable.prototype.window=a.window},{"../../Observable":3,
"../../operator/window":200}],95:[function(a,b,e){b=a("../../Observable");a=a("../../operator/windowCount");b.Observable.prototype.windowCount=a.windowCount},{"../../Observable":3,"../../operator/windowCount":201}],96:[function(a,b,e){b=a("../../Observable");a=a("../../operator/windowTime");b.Observable.prototype.windowTime=a.windowTime},{"../../Observable":3,"../../operator/windowTime":202}],97:[function(a,b,e){b=a("../../Observable");a=a("../../operator/windowToggle");b.Observable.prototype.windowToggle=
a.windowToggle},{"../../Observable":3,"../../operator/windowToggle":203}],98:[function(a,b,e){b=a("../../Observable");a=a("../../operator/windowWhen");b.Observable.prototype.windowWhen=a.windowWhen},{"../../Observable":3,"../../operator/windowWhen":204}],99:[function(a,b,e){b=a("../../Observable");a=a("../../operator/withLatestFrom");b.Observable.prototype.withLatestFrom=a.withLatestFrom},{"../../Observable":3,"../../operator/withLatestFrom":205}],100:[function(a,b,e){b=a("../../Observable");a=a("../../operator/zip-static");
b.Observable.zip=a.zip},{"../../Observable":3,"../../operator/zip-static":206}],101:[function(a,b,e){b=a("../../Observable");a=a("../../operator/zip");b.Observable.prototype.zip=a.zipProto},{"../../Observable":3,"../../operator/zip":208}],102:[function(a,b,e){b=a("../../Observable");a=a("../../operator/zipAll");b.Observable.prototype.zipAll=a.zipAll},{"../../Observable":3,"../../operator/zipAll":209}],103:[function(a,b,e){var h=this&&this.__extends||function(a,g){function n(){this.constructor=a}for(var d in g)g.hasOwnProperty(d)&&
(a[d]=g[d]);a.prototype=null===g?Object.create(g):(n.prototype=g.prototype,new n)};b=a("../Observable");var k=a("../Subscription");a=a("../Subscriber");var m=function(a){function g(n,g){a.call(this);this.source=n;this.subjectFactory=g}h(g,a);g.prototype._subscribe=function(a){return this._getSubject().subscribe(a)};g.prototype._getSubject=function(){var a=this.subject;return a&&!a.isUnsubscribed?a:this.subject=this.subjectFactory()};g.prototype.connect=function(){var a=this.subscription;if(a&&!a.isUnsubscribed)return a;
a=this.source.subscribe(this._getSubject());a.add(new l(this));return this.subscription=a};g.prototype.refCount=function(){return new f(this)};return g}(b.Observable);e.ConnectableObservable=m;var l=function(a){function g(g){a.call(this);this.connectable=g}h(g,a);g.prototype._unsubscribe=function(){var a=this.connectable;a.subject=void 0;this.connectable=a.subscription=void 0};return g}(k.Subscription),f=function(a){function g(g,d){void 0===d&&(d=0);a.call(this);this.connectable=g;this.refCount=d}
h(g,a);g.prototype._subscribe=function(a){var c=this.connectable;a=new d(a,this);var g=c.subscribe(a);g.isUnsubscribed||1!==++this.refCount||(a.connection=this.connection=c.connect());return g};return g}(b.Observable),d=function(a){function g(g,d){a.call(this,null);this.destination=g;this.refCountObservable=d;this.connection=d.connection;g.add(this)}h(g,a);g.prototype._next=function(a){this.destination.next(a)};g.prototype._error=function(a){this._resetConnectable();this.destination.error(a)};g.prototype._complete=
function(){this._resetConnectable();this.destination.complete()};g.prototype._resetConnectable=function(){var a=this.refCountObservable,c=a.connection,g=this.connection;g&&g===c&&(a.refCount=0,c.unsubscribe(),a.connection=void 0,this.unsubscribe())};g.prototype._unsubscribe=function(){var a=this.refCountObservable;if(0!==a.refCount&&0===--a.refCount){var c=a.connection,g=this.connection;g&&g===c&&(c.unsubscribe(),a.connection=void 0)}};return g}(a.Subscriber)},{"../Observable":3,"../Subscriber":7,
"../Subscription":8}],104:[function(a,b,e){var h=this&&this.__extends||function(a,c){function g(){this.constructor=a}for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d]);a.prototype=null===c?Object.create(c):(g.prototype=c.prototype,new g)};b=a("../Observable");var k=a("../util/root"),m=a("../util/SymbolShim"),l=a("../util/tryCatch"),f=a("../util/errorObject");a=function(a){function g(f,b,p,l){a.call(this);this.project=b;this.thisArg=p;this.scheduler=l;if(null==f)throw Error("iterator cannot be null.");
if(b&&"function"!==typeof b)throw Error("When provided, `project` must be a function.");if((b=f[m.SymbolShim.iterator])||"string"!==typeof f)if(b||void 0===f.length){if(!b)throw new TypeError("Object is not iterable");f=f[m.SymbolShim.iterator]()}else f=new c(f);else f=new d(f);this.iterator=f}h(g,a);g.create=function(a,c,d,n){return new g(a,c,d,n)};g.dispatch=function(a){var c=a.index,g=a.thisArg,d=a.project,n=a.iterator,b=a.subscriber;a.hasError?b.error(a.error):(n=n.next(),n.done?b.complete():
(d?(n=l.tryCatch(d).call(g,n.value,c),n===f.errorObject?(a.error=f.errorObject.e,a.hasError=!0):(b.next(n),a.index=c+1)):(b.next(n.value),a.index=c+1),b.isUnsubscribed||this.schedule(a)))};g.prototype._subscribe=function(a){var c=0,d=this.iterator,n=this.project,b=this.thisArg,m=this.scheduler;if(m)a.add(m.schedule(g.dispatch,0,{index:c,thisArg:b,project:n,iterator:d,subscriber:a}));else{do{m=d.next();if(m.done){a.complete();break}else if(n){m=l.tryCatch(n).call(b,m.value,c++);if(m===f.errorObject){a.error(f.errorObject.e);
break}a.next(m)}else a.next(m.value);if(a.isUnsubscribed)break}while(1)}};return g}(b.Observable);e.IteratorObservable=a;var d=function(){function a(c,g,d){void 0===g&&(g=0);void 0===d&&(d=c.length);this.str=c;this.idx=g;this.len=d}a.prototype[m.SymbolShim.iterator]=function(){return this};a.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}};return a}(),c=function(){function a(c,d,n){void 0===d&&(d=0);if(void 0===n)if(n=+c.length,
isNaN(n))n=0;else if(0!==n&&"number"===typeof n&&k.root.isFinite(n)){var f;f=+n;f=0===f?f:isNaN(f)?f:0>f?-1:1;n=f*Math.floor(Math.abs(n));n=0>=n?0:n>g?g:n}this.arr=c;this.idx=d;this.len=n}a.prototype[m.SymbolShim.iterator]=function(){return this};a.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}:{done:!0,value:void 0}};return a}(),g=Math.pow(2,53)-1},{"../Observable":3,"../util/SymbolShim":229,"../util/errorObject":230,"../util/root":238,"../util/tryCatch":241}],
105:[function(a,b,e){var h=this&&this.__extends||function(a,g){function d(){this.constructor=a}for(var f in g)g.hasOwnProperty(f)&&(a[f]=g[f]);a.prototype=null===g?Object.create(g):(d.prototype=g.prototype,new d)};b=a("../Observable");var k=a("../util/tryCatch"),m=a("../util/errorObject"),l=a("./throw"),f=a("./empty"),d=function(a){function g(g,d){a.call(this);this.value=g;this.scheduler=d;this._isScalar=!0}h(g,a);g.create=function(a,c){return new g(a,c)};g.dispatch=function(a){var c=a.value,g=a.subscriber;
a.done?g.complete():(g.next(c),g.isUnsubscribed||(a.done=!0,this.schedule(a)))};g.prototype._subscribe=function(a){var c=this.value,d=this.scheduler;d?a.add(d.schedule(g.dispatch,0,{done:!1,value:c,subscriber:a})):(a.next(c),a.isUnsubscribed||a.complete())};return g}(b.Observable);e.ScalarObservable=d;a=d.prototype;a.map=function(a,g){return k.tryCatch(a).call(g||this,this.value,0)===m.errorObject?new l.ErrorObservable(m.errorObject.e):new d(a.call(g||this,this.value,0))};a.filter=function(a,g){var d=
k.tryCatch(a).call(g||this,this.value,0);return d===m.errorObject?new l.ErrorObservable(m.errorObject.e):d?this:new f.EmptyObservable};a.reduce=function(a,g){if("undefined"===typeof g)return this;var n=k.tryCatch(a)(g,this.value);return n===m.errorObject?new l.ErrorObservable(m.errorObject.e):new d(n)};a.scan=function(a,g){return this.reduce(a,g)};a.count=function(a){return a?(a=k.tryCatch(a).call(this,this.value,0,this),a===m.errorObject?new l.ErrorObservable(m.errorObject.e):new d(a?1:0)):new d(1)};
a.skip=function(a){return 0<a?new f.EmptyObservable:this};a.take=function(a){return 0<a?this:new f.EmptyObservable}},{"../Observable":3,"../util/errorObject":230,"../util/tryCatch":241,"./empty":109,"./throw":119}],106:[function(a,b,e){var h=this&&this.__extends||function(a,f){function d(){this.constructor=a}for(var c in f)f.hasOwnProperty(c)&&(a[c]=f[c]);a.prototype=null===f?Object.create(f):(d.prototype=f.prototype,new d)};b=a("../Observable");var k=a("../scheduler/asap"),m=a("../util/isNumeric");
a=function(a){function f(d,c,g){void 0===c&&(c=0);void 0===g&&(g=k.asap);a.call(this);this.source=d;this.delayTime=c;this.scheduler=g;if(!m.isNumeric(c)||0>c)this.delayTime=0;g&&"function"===typeof g.schedule||(this.scheduler=k.asap)}h(f,a);f.create=function(a,c,g){void 0===c&&(c=0);void 0===g&&(g=k.asap);return new f(a,c,g)};f.dispatch=function(a){return a.source.subscribe(a.subscriber)};f.prototype._subscribe=function(a){a.add(this.scheduler.schedule(f.dispatch,this.delayTime,{source:this.source,
subscriber:a}))};return f}(b.Observable);e.SubscribeOnObservable=a},{"../Observable":3,"../scheduler/asap":215,"../util/isNumeric":233}],107:[function(a,b,e){function h(a){var n=a.source;a=a.subscriber;var b=n.callbackFunc,l=n.args,e=n.scheduler,h=n.subject;if(!h){var h=n.subject=new c.AsyncSubject,r=function u(){for(var a=[],c=0;c<arguments.length;c++)a[c-0]=arguments[c];var g=u.source,c=g.selector,g=g.subject;c?(a=f.tryCatch(c).apply(this,a),a===d.errorObject?g.add(e.schedule(m,0,{err:d.errorObject.e,
subject:g})):g.add(e.schedule(k,0,{value:a,subject:g}))):g.add(e.schedule(k,0,{value:1===a.length?a[0]:a,subject:g}))};r.source=n;f.tryCatch(b).apply(this,l.concat(r))===d.errorObject&&h.error(d.errorObject.e)}this.add(h.subscribe(a))}function k(a){var c=a.subject;c.next(a.value);c.complete()}function m(a){a.subject.error(a.err)}var l=this&&this.__extends||function(a,c){function d(){this.constructor=a}for(var f in c)c.hasOwnProperty(f)&&(a[f]=c[f]);a.prototype=null===c?Object.create(c):(d.prototype=
c.prototype,new d)};b=a("../Observable");var f=a("../util/tryCatch"),d=a("../util/errorObject"),c=a("../subject/AsyncSubject");a=function(a){function n(c,d,n,f){a.call(this);this.callbackFunc=c;this.selector=d;this.args=n;this.scheduler=f}l(n,a);n.create=function(a,c,g){void 0===c&&(c=void 0);return function(){for(var d=[],f=0;f<arguments.length;f++)d[f-0]=arguments[f];return new n(a,c,d,g)}};n.prototype._subscribe=function(a){var g=this.callbackFunc,n=this.args,b=this.scheduler,l=this.subject;if(b)return a.add(b.schedule(h,
0,{source:this,subscriber:a})),a;l||(l=this.subject=new c.AsyncSubject,b=function u(){for(var a=[],c=0;c<arguments.length;c++)a[c-0]=arguments[c];var g=u.source,c=g.selector,g=g.subject;c?(a=f.tryCatch(c).apply(this,a),a===d.errorObject?g.error(d.errorObject.e):(g.next(a),g.complete())):(g.next(1===a.length?a[0]:a),g.complete())},b.source=this,f.tryCatch(g).apply(this,n.concat(b))===d.errorObject&&l.error(d.errorObject.e));return l.subscribe(a)};return n}(b.Observable);e.BoundCallbackObservable=a},
{"../Observable":3,"../subject/AsyncSubject":217,"../util/errorObject":230,"../util/tryCatch":241}],108:[function(a,b,e){var h=this&&this.__extends||function(a,f){function d(){this.constructor=a}for(var c in f)f.hasOwnProperty(c)&&(a[c]=f[c]);a.prototype=null===f?Object.create(f):(d.prototype=f.prototype,new d)};b=a("../Observable");var k=a("../util/tryCatch"),m=a("../util/errorObject");a=function(a){function f(d){a.call(this);this.observableFactory=d}h(f,a);f.create=function(a){return new f(a)};
f.prototype._subscribe=function(a){var c=k.tryCatch(this.observableFactory)();c===m.errorObject?a.error(m.errorObject.e):c.subscribe(a)};return f}(b.Observable);e.DeferObservable=a},{"../Observable":3,"../util/errorObject":230,"../util/tryCatch":241}],109:[function(a,b,e){var h=this&&this.__extends||function(a,b){function l(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===b?Object.create(b):(l.prototype=b.prototype,new l)};a=function(a){function b(l){a.call(this);
this.scheduler=l}h(b,a);b.create=function(a){return new b(a)};b.dispatch=function(a){a.subscriber.complete()};b.prototype._subscribe=function(a){var f=this.scheduler;f?a.add(f.schedule(b.dispatch,0,{subscriber:a})):a.complete()};return b}(a("../Observable").Observable);e.EmptyObservable=a},{"../Observable":3}],110:[function(a,b,e){function h(a){return null!==a}var k=this&&this.__extends||function(a,c){function g(){this.constructor=a}for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d]);a.prototype=null===
c?Object.create(c):(g.prototype=c.prototype,new g)},m=a("../Observable");b=a("../Subscriber");var l=a("./fromPromise"),f=a("./empty"),d=a("../util/isPromise"),c=a("../util/isArray");a=function(a){function b(c,g){a.call(this);this.sources=c;this.resultSelector=g}k(b,a);b.create=function(){for(var a=[],g=0;g<arguments.length;g++)a[g-0]=arguments[g];if(null===a||0===arguments.length)return new f.EmptyObservable;g=null;"function"===typeof a[a.length-1]&&(g=a.pop());1===a.length&&c.isArray(a[0])&&(a=a[0]);
return new b(a,g)};b.prototype._subscribe=function(a){for(var c=this.sources,n=c.length,f=[],b=0;b<n;b++)f.push(null);f={completed:0,total:n,values:f,selector:this.resultSelector};for(b=0;b<n;b++){var p=c[b];d.isPromise(p)&&(p=new l.PromiseObservable(p));p.subscribe(new g(a,b,f))}};return b}(m.Observable);e.ForkJoinObservable=a;var g=function(a){function c(g,d,f){a.call(this,g);this.index=d;this.context=f;this._value=null}k(c,a);c.prototype._next=function(a){this._value=a};c.prototype._complete=function(){var a=
this.destination;null==this._value&&a.complete();var c=this.context;c.completed++;c.values[this.index]=this._value;var g=c.values;c.completed===g.length&&(g.every(h)&&(c=c.selector?c.selector.apply(this,g):g,a.next(c)),a.complete())};return c}(b.Subscriber)},{"../Observable":3,"../Subscriber":7,"../util/isArray":231,"../util/isPromise":234,"./empty":109,"./fromPromise":115}],111:[function(a,b,e){var h=this&&this.__extends||function(a,c){function g(){this.constructor=a}for(var d in c)c.hasOwnProperty(d)&&
(a[d]=c[d]);a.prototype=null===c?Object.create(c):(g.prototype=c.prototype,new g)},k=a("./fromPromise"),m=a("./IteratorObservable"),l=a("./fromArray"),f=a("../util/SymbolShim"),d=a("../Observable"),c=a("../operator/observeOn-support"),g=a("../scheduler/queue"),n=Array.isArray;a=function(a){function b(c,g){a.call(this,null);this.ish=c;this.scheduler=g}h(b,a);b.create=function(a,c){void 0===c&&(c=g.queue);if(a){if(n(a))return new l.ArrayObservable(a,c);if("function"===typeof a.then)return new k.PromiseObservable(a,
c);if("function"===typeof a[f.SymbolShim.observable])return a instanceof d.Observable?a:new b(a,c);if("function"===typeof a[f.SymbolShim.iterator])return new m.IteratorObservable(a,null,null,c)}throw new TypeError(typeof a+" is not observable");};b.prototype._subscribe=function(a){var d=this.ish,n=this.scheduler;return n===g.queue?d[f.SymbolShim.observable]().subscribe(a):d[f.SymbolShim.observable]().subscribe(new c.ObserveOnSubscriber(a,n,0))};return b}(d.Observable);e.FromObservable=a},{"../Observable":3,
"../operator/observeOn-support":166,"../scheduler/queue":216,"../util/SymbolShim":229,"./IteratorObservable":104,"./fromArray":112,"./fromPromise":115}],112:[function(a,b,e){var h=this&&this.__extends||function(a,d){function c(){this.constructor=a}for(var g in d)d.hasOwnProperty(g)&&(a[g]=d[g]);a.prototype=null===d?Object.create(d):(c.prototype=d.prototype,new c)};b=a("../Observable");var k=a("./ScalarObservable"),m=a("./empty"),l=a("../util/isScheduler");a=function(a){function d(c,g){a.call(this);
this.array=c;this.scheduler=g;g||1!==c.length||(this._isScalar=!0,this.value=c[0])}h(d,a);d.create=function(a,g){return new d(a,g)};d.of=function(){for(var a=[],g=0;g<arguments.length;g++)a[g-0]=arguments[g];g=a[a.length-1];l.isScheduler(g)?a.pop():g=void 0;var n=a.length;return 1<n?new d(a,g):1===n?new k.ScalarObservable(a[0],g):new m.EmptyObservable(g)};d.dispatch=function(a){var g=a.array,d=a.index,f=a.subscriber;d>=a.count?f.complete():(f.next(g[d]),f.isUnsubscribed||(a.index=d+1,this.schedule(a)))};
d.prototype._subscribe=function(a){var g=this.array,n=g.length,f=this.scheduler;if(f)a.add(f.schedule(d.dispatch,0,{array:g,index:0,count:n,subscriber:a}));else{for(f=0;f<n&&!a.isUnsubscribed;f++)a.next(g[f]);a.complete()}};return d}(b.Observable);e.ArrayObservable=a},{"../Observable":3,"../util/isScheduler":235,"./ScalarObservable":105,"./empty":109}],113:[function(a,b,e){var h=this&&this.__extends||function(a,d){function c(){this.constructor=a}for(var g in d)d.hasOwnProperty(g)&&(a[g]=d[g]);a.prototype=
null===d?Object.create(d):(c.prototype=d.prototype,new c)};b=a("../Observable");var k=a("../util/tryCatch"),m=a("../util/errorObject"),l=a("../Subscription");a=function(a){function d(c,g,d){a.call(this);this.sourceObj=c;this.eventName=g;this.selector=d}h(d,a);d.create=function(a,g,n){return new d(a,g,n)};d.setupSubscription=function(a,g,n,f){var b,e=a.toString();if("[object NodeList]"===e||"[object HTMLCollection]"===e)for(var e=0,m=a.length;e<m;e++)d.setupSubscription(a[e],g,n,f);else"function"===
typeof a.addEventListener&&"function"===typeof a.removeEventListener?(a.addEventListener(g,n),b=function(){return a.removeEventListener(g,n)}):"function"===typeof a.on&&"function"===typeof a.off?(a.on(g,n),b=function(){return a.off(g,n)}):"function"===typeof a.addListener&&"function"===typeof a.removeListener&&(a.addListener(g,n),b=function(){return a.removeListener(g,n)});f.add(new l.Subscription(b))};d.prototype._subscribe=function(a){var g=this.selector;d.setupSubscription(this.sourceObj,this.eventName,
g?function(d){d=k.tryCatch(g)(d);d===m.errorObject?a.error(d.e):a.next(d)}:function(g){return a.next(g)},a)};return d}(b.Observable);e.FromEventObservable=a},{"../Observable":3,"../Subscription":8,"../util/errorObject":230,"../util/tryCatch":241}],114:[function(a,b,e){var h=this&&this.__extends||function(a,d){function c(){this.constructor=a}for(var g in d)d.hasOwnProperty(g)&&(a[g]=d[g]);a.prototype=null===d?Object.create(d):(c.prototype=d.prototype,new c)};b=a("../Observable");var k=a("../Subscription"),
m=a("../util/tryCatch"),l=a("../util/errorObject");a=function(a){function d(c,g,d){a.call(this);this.addHandler=c;this.removeHandler=g;this.selector=d}h(d,a);d.create=function(a,g,n){return new d(a,g,n)};d.prototype._subscribe=function(a){var g=this.removeHandler,d=this.selector,f=d?function(g){var f=m.tryCatch(d).apply(null,arguments);f===l.errorObject?a.error(f.e):a.next(f)}:function(g){a.next(g)},b=m.tryCatch(this.addHandler)(f);b===l.errorObject&&a.error(b.e);a.add(new k.Subscription(function(){g(f)}))};
return d}(b.Observable);e.FromEventPatternObservable=a},{"../Observable":3,"../Subscription":8,"../util/errorObject":230,"../util/tryCatch":241}],115:[function(a,b,e){function h(a){var c=a.subscriber;c.next(a.value);c.complete()}function k(a){a.subscriber.error(a.err)}var m=this&&this.__extends||function(a,c){function g(){this.constructor=a}for(var n in c)c.hasOwnProperty(n)&&(a[n]=c[n]);a.prototype=null===c?Object.create(c):(g.prototype=c.prototype,new g)};b=a("../Observable");var l=a("../Subscription"),
f=a("../scheduler/queue");a=function(a){function c(c,n){void 0===n&&(n=f.queue);a.call(this);this.promise=c;this.scheduler=n;this._isScalar=!1}m(c,a);c.create=function(a,d){void 0===d&&(d=f.queue);return new c(a,d)};c.prototype._subscribe=function(a){var c=this,d=this.scheduler,b=this.promise;if(d===f.queue)this._isScalar?(a.next(this.value),a.complete()):b.then(function(d){c._isScalar=!0;c.value=d;a.next(d);a.complete()},function(c){return a.error(c)}).then(null,function(a){setTimeout(function(){throw a;
})});else{var e=new l.Subscription;this._isScalar?e.add(d.schedule(h,0,{value:this.value,subscriber:a})):b.then(function(f){c._isScalar=!0;c.value=f;e.add(d.schedule(h,0,{value:f,subscriber:a}))},function(c){return e.add(d.schedule(k,0,{err:c,subscriber:a}))}).then(null,function(a){d.schedule(function(){throw a;})});return e}};return c}(b.Observable);e.PromiseObservable=a},{"../Observable":3,"../Subscription":8,"../scheduler/queue":216}],116:[function(a,b,e){var h=this&&this.__extends||function(a,
f){function d(){this.constructor=a}for(var c in f)f.hasOwnProperty(c)&&(a[c]=f[c]);a.prototype=null===f?Object.create(f):(d.prototype=f.prototype,new d)},k=a("../util/isNumeric");b=a("../Observable");var m=a("../scheduler/asap");a=function(a){function f(d,c){void 0===d&&(d=0);void 0===c&&(c=m.asap);a.call(this);this.period=d;this.scheduler=c;if(!k.isNumeric(d)||0>d)this.period=0;c&&"function"===typeof c.schedule||(this.scheduler=m.asap)}h(f,a);f.create=function(a,c){void 0===a&&(a=0);void 0===c&&
(c=m.asap);return new f(a,c)};f.dispatch=function(a){var c=a.subscriber,g=a.period;c.next(a.index);c.isUnsubscribed||(a.index+=1,this.schedule(a,g))};f.prototype._subscribe=function(a){var c=this.period;a.add(this.scheduler.schedule(f.dispatch,c,{index:0,subscriber:a,period:c}))};return f}(b.Observable);e.IntervalObservable=a},{"../Observable":3,"../scheduler/asap":215,"../util/isNumeric":233}],117:[function(a,b,e){var h=this&&this.__extends||function(a,b){function f(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&
(a[d]=b[d]);a.prototype=null===b?Object.create(b):(f.prototype=b.prototype,new f)};b=a("../Observable");var k=a("../util/noop");a=function(a){function b(){a.call(this)}h(b,a);b.create=function(){return new b};b.prototype._subscribe=function(a){k.noop()};return b}(b.Observable);e.InfiniteObservable=a},{"../Observable":3,"../util/noop":236}],118:[function(a,b,e){var h=this&&this.__extends||function(a,b){function l(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===
b?Object.create(b):(l.prototype=b.prototype,new l)};a=function(a){function b(l,f,d){a.call(this);this.start=l;this.end=f;this.scheduler=d}h(b,a);b.create=function(a,f,d){void 0===a&&(a=0);void 0===f&&(f=0);return new b(a,f,d)};b.dispatch=function(a){var b=a.start,d=a.index,c=a.subscriber;d>=a.end?c.complete():(c.next(b),c.isUnsubscribed||(a.index=d+1,a.start=b+1,this.schedule(a)))};b.prototype._subscribe=function(a){var f=0,d=this.start,c=this.end,g=this.scheduler;if(g)a.add(g.schedule(b.dispatch,
0,{index:f,end:c,start:d,subscriber:a}));else{do{if(f++>=c){a.complete();break}a.next(d++);if(a.isUnsubscribed)break}while(1)}};return b}(a("../Observable").Observable);e.RangeObservable=a},{"../Observable":3}],119:[function(a,b,e){var h=this&&this.__extends||function(a,b){function l(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===b?Object.create(b):(l.prototype=b.prototype,new l)};a=function(a){function b(l,f){a.call(this);this.error=l;this.scheduler=f}h(b,
a);b.create=function(a,f){return new b(a,f)};b.dispatch=function(a){a.subscriber.error(a.error)};b.prototype._subscribe=function(a){var f=this.error,d=this.scheduler;d?a.add(d.schedule(b.dispatch,0,{error:f,subscriber:a})):a.error(f)};return b}(a("../Observable").Observable);e.ErrorObservable=a},{"../Observable":3}],120:[function(a,b,e){var h=this&&this.__extends||function(a,c){function g(){this.constructor=a}for(var n in c)c.hasOwnProperty(n)&&(a[n]=c[n]);a.prototype=null===c?Object.create(c):(g.prototype=
c.prototype,new g)},k=a("../util/isNumeric");b=a("../Observable");var m=a("../scheduler/asap"),l=a("../util/isScheduler"),f=a("../util/isDate");a=function(a){function c(c,n,b){void 0===c&&(c=0);a.call(this);this.period=n;this.scheduler=b;this.dueTime=0;k.isNumeric(n)?this._period=1>Number(n)&&1||Number(n):l.isScheduler(n)&&(b=n);l.isScheduler(b)||(b=m.asap);this.scheduler=b;this.dueTime=f.isDate(c)?+c-this.scheduler.now():c}h(c,a);c.create=function(a,d,b){void 0===a&&(a=0);return new c(a,d,b)};c.dispatch=
function(a){var d=a.index,b=a.period,f=a.subscriber;f.next(d);"undefined"===typeof b?f.complete():f.isUnsubscribed||("undefined"===typeof this.delay?this.add(this.scheduler.schedule(c.dispatch,b,{index:d+1,period:b,subscriber:f})):(a.index=d+1,this.schedule(a,b)))};c.prototype._subscribe=function(a){a.add(this.scheduler.schedule(c.dispatch,this.dueTime,{index:0,period:this._period,subscriber:a}))};return c}(b.Observable);e.TimerObservable=a},{"../Observable":3,"../scheduler/asap":215,"../util/isDate":232,
"../util/isNumeric":233,"../util/isScheduler":235}],121:[function(a,b,e){var h=this&&this.__extends||function(a,d){function c(){this.constructor=a}for(var g in d)d.hasOwnProperty(g)&&(a[g]=d[g]);a.prototype=null===d?Object.create(d):(c.prototype=d.prototype,new c)};a=a("../Subscriber");e.buffer=function(a){return this.lift(new k(a))};var k=function(){function a(d){this.closingNotifier=d}a.prototype.call=function(a){return new m(a,this.closingNotifier)};return a}(),m=function(a){function d(c,g){a.call(this,
c);this.buffer=[];this.notifierSubscriber=null;this.notifierSubscriber=new l(this);this.add(g._subscribe(this.notifierSubscriber))}h(d,a);d.prototype._next=function(a){this.buffer.push(a)};d.prototype._error=function(a){this.destination.error(a)};d.prototype._complete=function(){this.destination.complete()};d.prototype.flushBuffer=function(){var a=this.buffer;this.buffer=[];this.destination.next(a);this.isUnsubscribed&&this.notifierSubscriber.unsubscribe()};return d}(a.Subscriber),l=function(a){function d(c){a.call(this,
null);this.parent=c}h(d,a);d.prototype._next=function(a){this.parent.flushBuffer()};d.prototype._error=function(a){this.parent.error(a)};d.prototype._complete=function(){this.parent.complete()};return d}(a.Subscriber)},{"../Subscriber":7}],122:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)};a=a("../Subscriber");e.bufferCount=function(a,b){void 0===
b&&(b=null);return this.lift(new k(a,b))};var k=function(){function a(b,d){this.bufferSize=b;this.startBufferEvery=d}a.prototype.call=function(a){return new m(a,this.bufferSize,this.startBufferEvery)};return a}(),m=function(a){function b(d,c,g){a.call(this,d);this.bufferSize=c;this.startBufferEvery=g;this.buffers=[[]];this.count=0}h(b,a);b.prototype._next=function(a){var c=this.count+=1,g=this.destination,n=this.bufferSize,b=this.buffers,f=b.length,l=-1;0===c%(null==this.startBufferEvery?n:this.startBufferEvery)&&
b.push([]);for(c=0;c<f;c++){var e=b[c];e.push(a);e.length===n&&(l=c,g.next(e))}-1!==l&&b.splice(l,1)};b.prototype._error=function(a){this.destination.error(a)};b.prototype._complete=function(){for(var a=this.destination,c=this.buffers;0<c.length;){var g=c.shift();0<g.length&&a.next(g)}a.complete()};return b}(a.Subscriber)},{"../Subscriber":7}],123:[function(a,b,e){function h(a){var c=a.subscriber,d=a.buffer;d&&c.closeBuffer(d);a.buffer=c.openBuffer();c.isUnsubscribed||this.schedule(a,a.bufferTimeSpan)}
function k(a){var c=a.bufferCreationInterval,d=a.bufferTimeSpan,b=a.subscriber,f=a.scheduler,l=b.openBuffer();b.isUnsubscribed||(this.add(f.schedule(m,d,{subscriber:b,buffer:l})),this.schedule(a,c))}function m(a){a.subscriber.closeBuffer(a.buffer)}var l=this&&this.__extends||function(a,c){function d(){this.constructor=a}for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b]);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)};b=a("../Subscriber");var f=a("../scheduler/asap");e.bufferTime=
function(a,c,b){void 0===c&&(c=null);void 0===b&&(b=f.asap);return this.lift(new d(a,c,b))};var d=function(){function a(c,d,g){this.bufferTimeSpan=c;this.bufferCreationInterval=d;this.scheduler=g}a.prototype.call=function(a){return new c(a,this.bufferTimeSpan,this.bufferCreationInterval,this.scheduler)};return a}(),c=function(a){function c(d,b,n,f){a.call(this,d);this.bufferTimeSpan=b;this.bufferCreationInterval=n;this.scheduler=f;this.buffers=[];d=this.openBuffer();if(null!==n&&0<=n){var l={bufferTimeSpan:b,
bufferCreationInterval:n,subscriber:this,scheduler:f};this.add(f.schedule(m,b,{subscriber:this,buffer:d}));this.add(f.schedule(k,n,l))}else this.add(f.schedule(h,b,{subscriber:this,buffer:d,bufferTimeSpan:b}))}l(c,a);c.prototype._next=function(a){for(var c=this.buffers,d=c.length,g=0;g<d;g++)c[g].push(a)};c.prototype._error=function(a){this.buffers.length=0;this.destination.error(a)};c.prototype._complete=function(){for(var a=this.buffers;0<a.length;)this.destination.next(a.shift());this.destination.complete()};
c.prototype.openBuffer=function(){var a=[];this.buffers.push(a);return a};c.prototype.closeBuffer=function(a){this.destination.next(a);var c=this.buffers;c.splice(c.indexOf(a),1)};return c}(b.Subscriber)},{"../Subscriber":7,"../scheduler/asap":215}],124:[function(a,b,e){var h=this&&this.__extends||function(a,c){function d(){this.constructor=a}for(var g in c)c.hasOwnProperty(g)&&(a[g]=c[g]);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)};b=a("../Subscriber");var k=a("../Subscription"),
m=a("../util/tryCatch"),l=a("../util/errorObject");e.bufferToggle=function(a,c){return this.lift(new f(a,c))};var f=function(){function a(c,d){this.openings=c;this.closingSelector=d}a.prototype.call=function(a){return new d(a,this.openings,this.closingSelector)};return a}(),d=function(a){function d(g,b,f){a.call(this,g);this.openings=b;this.closingSelector=f;this.contexts=[];this.add(this.openings._subscribe(new c(this)))}h(d,a);d.prototype._next=function(a){for(var c=this.contexts,d=c.length,g=0;g<
d;g++)c[g].buffer.push(a)};d.prototype._error=function(a){for(var c=this.contexts;0<c.length;){var d=c.shift();d.subscription.unsubscribe();d.buffer=null;d.subscription=null}this.contexts=null;this.destination.error(a)};d.prototype._complete=function(){for(var a=this.contexts;0<a.length;){var c=a.shift();this.destination.next(c.buffer);c.subscription.unsubscribe();c.buffer=null;c.subscription=null}this.contexts=null;this.destination.complete()};d.prototype.openBuffer=function(a){var c=this.contexts,
d=m.tryCatch(this.closingSelector)(a);d===l.errorObject?this._error(d.e):(a={buffer:[],subscription:new k.Subscription},c.push(a),c=new g(this,a),c=d._subscribe(c),a.subscription.add(c),this.add(c))};d.prototype.closeBuffer=function(a){var c=this.contexts;if(null!==c){var d=a.subscription;this.destination.next(a.buffer);c.splice(c.indexOf(a),1);this.remove(d);d.unsubscribe()}};return d}(b.Subscriber),c=function(a){function c(d){a.call(this,null);this.parent=d}h(c,a);c.prototype._next=function(a){this.parent.openBuffer(a)};
c.prototype._error=function(a){this.parent.error(a)};c.prototype._complete=function(){};return c}(b.Subscriber),g=function(a){function c(d,g){a.call(this,null);this.parent=d;this.context=g}h(c,a);c.prototype._next=function(){this.parent.closeBuffer(this.context)};c.prototype._error=function(a){this.parent.error(a)};c.prototype._complete=function(){this.parent.closeBuffer(this.context)};return c}(b.Subscriber)},{"../Subscriber":7,"../Subscription":8,"../util/errorObject":230,"../util/tryCatch":241}],
125:[function(a,b,e){var h=this&&this.__extends||function(a,d){function b(){this.constructor=a}for(var f in d)d.hasOwnProperty(f)&&(a[f]=d[f]);a.prototype=null===d?Object.create(d):(b.prototype=d.prototype,new b)};b=a("../Subscriber");var k=a("../util/tryCatch"),m=a("../util/errorObject");e.bufferWhen=function(a){return this.lift(new l(a))};var l=function(){function a(c){this.closingSelector=c}a.prototype.call=function(a){return new f(a,this.closingSelector)};return a}(),f=function(a){function g(d,
g){a.call(this,d);this.closingSelector=g;this.openBuffer()}h(g,a);g.prototype._next=function(a){this.buffer.push(a)};g.prototype._error=function(a){this.buffer=null;this.destination.error(a)};g.prototype._complete=function(){this.destination.next(this.buffer);this.buffer=null;this.destination.complete()};g.prototype.openBuffer=function(){var a=this.closingNotification;a&&(this.remove(a),a.unsubscribe());(a=this.buffer)&&this.destination.next(a);this.buffer=[];a=k.tryCatch(this.closingSelector)();
a===m.errorObject?(a=a.e,this.buffer=null,this.destination.error(a)):this.add(this.closingNotification=a._subscribe(new d(this)))};return g}(b.Subscriber),d=function(a){function d(g){a.call(this,null);this.parent=g}h(d,a);d.prototype._next=function(){this.parent.openBuffer()};d.prototype._error=function(a){this.parent.error(a)};d.prototype._complete=function(){this.parent.openBuffer()};return d}(b.Subscriber)},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],126:[function(a,b,
e){var h=this&&this.__extends||function(a,c){function g(){this.constructor=a}for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b]);a.prototype=null===c?Object.create(c):(g.prototype=c.prototype,new g)};b=a("../Subscriber");var k=a("../util/tryCatch"),m=a("../util/errorObject");e._catch=function(a){a=new l(a);var c=this.lift(a);return a.caught=c};var l=function(){function a(c){this.selector=c}a.prototype.call=function(a){return new f(a,this.selector,this.caught)};return a}(),f=function(a){function c(c,b,
f){a.call(this,null);this.destination=c;this.selector=b;this.caught=f;this.lastSubscription=this;this.destination.add(this)}h(c,a);c.prototype._next=function(a){this.destination.next(a)};c.prototype._error=function(a){a=k.tryCatch(this.selector)(a,this.caught);a===m.errorObject?this.destination.error(m.errorObject.e):(this.lastSubscription.unsubscribe(),this.lastSubscription=a.subscribe(this.destination))};c.prototype._complete=function(){this.lastSubscription.unsubscribe();this.destination.complete()};
c.prototype._unsubscribe=function(){this.lastSubscription.unsubscribe()};return c}(b.Subscriber)},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],127:[function(a,b,e){var h=a("./combineLatest-support");e.combineAll=function(a){return this.lift(new h.CombineLatestOperator(a))}},{"./combineLatest-support":129}],128:[function(a,b,e){var h=a("../observable/fromArray"),k=a("./combineLatest-support"),m=a("../util/isScheduler"),l=a("../util/isArray");e.combineLatest=function(){for(var a=
[],d=0;d<arguments.length;d++)a[d-0]=arguments[d];var c=d=null;m.isScheduler(a[a.length-1])&&(c=a.pop());"function"===typeof a[a.length-1]&&(d=a.pop());1===a.length&&l.isArray(a[0])&&(a=a[0]);return(new h.ArrayObservable(a,c)).lift(new k.CombineLatestOperator(d))}},{"../observable/fromArray":112,"../util/isArray":231,"../util/isScheduler":235,"./combineLatest-support":129}],129:[function(a,b,e){var h=this&&this.__extends||function(a,c){function g(){this.constructor=a}for(var b in c)c.hasOwnProperty(b)&&
(a[b]=c[b]);a.prototype=null===c?Object.create(c):(g.prototype=c.prototype,new g)},k=a("../util/tryCatch"),m=a("../util/errorObject");b=a("../OuterSubscriber");var l=a("../util/subscribeToResult");a=function(){function a(c){this.project=c}a.prototype.call=function(a){return new f(a,this.project)};return a}();e.CombineLatestOperator=a;var f=function(a){function c(c,b){a.call(this,c);this.project=b;this.active=0;this.values=[];this.observables=[];this.toRespond=[]}h(c,a);c.prototype._next=function(a){var c=
this.toRespond;c.push(c.length);this.observables.push(a)};c.prototype._complete=function(){var a=this.observables,c=a.length;if(0===c)this.destination.complete();else{this.active=c;for(var d=0;d<c;d++){var b=a[d];this.add(l.subscribeToResult(this,b,b,d))}}};c.prototype.notifyComplete=function(a){0===--this.active&&this.destination.complete()};c.prototype.notifyNext=function(a,c,d,b){a=this.values;a[d]=c;c=this.toRespond;0<c.length&&(d=c.indexOf(d),-1!==d&&c.splice(d,1));0===c.length&&(c=this.project,
d=this.destination,c?(a=k.tryCatch(c).apply(this,a),a===m.errorObject?d.error(m.errorObject.e):d.next(a)):d.next(a))};return c}(b.OuterSubscriber);e.CombineLatestSubscriber=f},{"../OuterSubscriber":4,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],130:[function(a,b,e){var h=a("../observable/fromArray"),k=a("./combineLatest-support"),m=a("../util/isArray");e.combineLatest=function(){for(var a=[],b=0;b<arguments.length;b++)a[b-0]=arguments[b];b=null;"function"===typeof a[a.length-
1]&&(b=a.pop());1===a.length&&m.isArray(a[0])&&(a=a[0]);a.unshift(this);return(new h.ArrayObservable(a)).lift(new k.CombineLatestOperator(b))}},{"../observable/fromArray":112,"../util/isArray":231,"./combineLatest-support":129}],131:[function(a,b,e){var h=a("../scheduler/queue"),k=a("./mergeAll-support"),m=a("../observable/fromArray"),l=a("../util/isScheduler");e.concat=function(){for(var a=[],d=0;d<arguments.length;d++)a[d-0]=arguments[d];d=h.queue;l.isScheduler(a[a.length-1])&&(d=a.pop());return(new m.ArrayObservable(a,
d)).lift(new k.MergeAllOperator(1))}},{"../observable/fromArray":112,"../scheduler/queue":216,"../util/isScheduler":235,"./mergeAll-support":159}],132:[function(a,b,e){var h=a("../util/isScheduler"),k=a("../observable/fromArray"),m=a("./mergeAll-support");e.concat=function(){for(var a=[],b=0;b<arguments.length;b++)a[b-0]=arguments[b];a.unshift(this);b=null;h.isScheduler(a[a.length-1])&&(b=a.pop());return(new k.ArrayObservable(a,b)).lift(new m.MergeAllOperator(1))}},{"../observable/fromArray":112,
"../util/isScheduler":235,"./mergeAll-support":159}],133:[function(a,b,e){var h=a("./mergeAll-support");e.concatAll=function(){return this.lift(new h.MergeAllOperator(1))}},{"./mergeAll-support":159}],134:[function(a,b,e){var h=a("./mergeMap-support");e.concatMap=function(a,b){return this.lift(new h.MergeMapOperator(a,b,1))}},{"./mergeMap-support":161}],135:[function(a,b,e){var h=a("./mergeMapTo-support");e.concatMapTo=function(a,b){return this.lift(new h.MergeMapToOperator(a,b,1))}},{"./mergeMapTo-support":163}],
136:[function(a,b,e){var h=this&&this.__extends||function(a,c){function g(){this.constructor=a}for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b]);a.prototype=null===c?Object.create(c):(g.prototype=c.prototype,new g)};b=a("../Subscriber");var k=a("../util/tryCatch"),m=a("../util/errorObject");e.count=function(a){return this.lift(new l(a,this))};var l=function(){function a(c,d){this.predicate=c;this.source=d}a.prototype.call=function(a){return new f(a,this.predicate,this.source)};return a}(),f=function(a){function c(c,
b,f){a.call(this,c);this.predicate=b;this.source=f;this.index=this.count=0}h(c,a);c.prototype._next=function(a){var c=this.predicate,d=!0;if(c&&(d=k.tryCatch(c)(a,this.index++,this.source),d===m.errorObject)){this.destination.error(d.e);return}d&&(this.count+=1)};c.prototype._complete=function(){this.destination.next(this.count);this.destination.complete()};return c}(b.Subscriber)},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],137:[function(a,b,e){var h=this&&this.__extends||
function(a,c){function d(){this.constructor=a}for(var g in c)c.hasOwnProperty(g)&&(a[g]=c[g]);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)},k=a("../observable/fromPromise");b=a("../Subscriber");var m=a("../util/tryCatch"),l=a("../util/isPromise"),f=a("../util/errorObject");e.debounce=function(a){return this.lift(new d(a))};var d=function(){function a(c){this.durationSelector=c}a.prototype.call=function(a){return new c(a,this.durationSelector)};return a}(),c=function(a){function c(d,
g){a.call(this,d);this.durationSelector=g;this.lastValue=this.debouncedSubscription=null;this._index=0}h(c,a);Object.defineProperty(c.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0});c.prototype._next=function(a){var c=this.destination,d=++this._index,b=m.tryCatch(this.durationSelector)(a);b===f.errorObject?c.error(f.errorObject.e):(l.isPromise(b)&&(b=k.PromiseObservable.create(b)),this.lastValue=a,this.clearDebounce(),this.add(this.debouncedSubscription=b._subscribe(new g(this,
d))))};c.prototype._complete=function(){this.debouncedNext();this.destination.complete()};c.prototype.debouncedNext=function(){this.clearDebounce();null!=this.lastValue&&(this.destination.next(this.lastValue),this.lastValue=null)};c.prototype.clearDebounce=function(){var a=this.debouncedSubscription;a&&(a.unsubscribe(),this.remove(a),this.debouncedSubscription=null)};return c}(b.Subscriber),g=function(a){function c(d,g){a.call(this,null);this.parent=d;this.currentIndex=g}h(c,a);c.prototype.debounceNext=
function(){var a=this.parent;this.currentIndex===a.index&&(a.debouncedNext(),this.isUnsubscribed||this.unsubscribe())};c.prototype._next=function(a){this.debounceNext()};c.prototype._error=function(a){this.parent.error(a)};c.prototype._complete=function(){this.debounceNext()};return c}(b.Subscriber)},{"../Subscriber":7,"../observable/fromPromise":115,"../util/errorObject":230,"../util/isPromise":234,"../util/tryCatch":241}],138:[function(a,b,e){function h(a){a.debouncedNext()}var k=this&&this.__extends||
function(a,c){function g(){this.constructor=a}for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b]);a.prototype=null===c?Object.create(c):(g.prototype=c.prototype,new g)};b=a("../Subscriber");var m=a("../scheduler/asap");e.debounceTime=function(a,c){void 0===c&&(c=m.asap);return this.lift(new l(a,c))};var l=function(){function a(c,d){this.dueTime=c;this.scheduler=d}a.prototype.call=function(a){return new f(a,this.dueTime,this.scheduler)};return a}(),f=function(a){function c(c,b,f){a.call(this,c);this.dueTime=
b;this.scheduler=f;this.lastValue=this.debouncedSubscription=null}k(c,a);c.prototype._next=function(a){this.clearDebounce();this.lastValue=a;this.add(this.debouncedSubscription=this.scheduler.schedule(h,this.dueTime,this))};c.prototype._complete=function(){this.debouncedNext();this.destination.complete()};c.prototype.debouncedNext=function(){this.clearDebounce();null!=this.lastValue&&(this.destination.next(this.lastValue),this.lastValue=null)};c.prototype.clearDebounce=function(){var a=this.debouncedSubscription;
null!==a&&(this.remove(a),a.unsubscribe(),this.debouncedSubscription=null)};return c}(b.Subscriber)},{"../Subscriber":7,"../scheduler/asap":215}],139:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)};a=a("../Subscriber");e.defaultIfEmpty=function(a){void 0===a&&(a=null);return this.lift(new k(a))};var k=function(){function a(b){this.defaultValue=
b}a.prototype.call=function(a){return new m(a,this.defaultValue)};return a}(),m=function(a){function b(d,c){a.call(this,d);this.defaultValue=c;this.isEmpty=!0}h(b,a);b.prototype._next=function(a){this.isEmpty=!1;this.destination.next(a)};b.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue);this.destination.complete()};return b}(a.Subscriber)},{"../Subscriber":7}],140:[function(a,b,e){var h=this&&this.__extends||function(a,c){function d(){this.constructor=a}for(var b in c)c.hasOwnProperty(b)&&
(a[b]=c[b]);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)};b=a("../Subscriber");var k=a("../Notification"),m=a("../scheduler/queue"),l=a("../util/isDate");e.delay=function(a,c){void 0===c&&(c=m.queue);var d=l.isDate(a)?+a-c.now():a;return this.lift(new f(d,c))};var f=function(){function a(c,d){this.delay=c;this.scheduler=d}a.prototype.call=function(a){return new d(a,this.delay,this.scheduler)};return a}(),d=function(a){function d(c,b,f){a.call(this,c);this.delay=b;this.scheduler=
f;this.queue=[];this.errored=this.active=!1}h(d,a);d.dispatch=function(a){for(var c=a.source,d=c.queue,b=a.scheduler,g=a.destination;0<d.length&&0>=d[0].time-b.now();)d.shift().notification.observe(g);0<d.length?(c=Math.max(0,d[0].time-b.now()),this.schedule(a,c)):c.active=!1};d.prototype._schedule=function(a){this.active=!0;this.add(a.schedule(d.dispatch,this.delay,{source:this,destination:this.destination,scheduler:a}))};d.prototype.scheduleNotification=function(a){if(!0!==this.errored){var d=this.scheduler;
a=new c(d.now()+this.delay,a);this.queue.push(a);!1===this.active&&this._schedule(d)}};d.prototype._next=function(a){this.scheduleNotification(k.Notification.createNext(a))};d.prototype._error=function(a){this.errored=!0;this.queue=[];this.destination.error(a)};d.prototype._complete=function(){this.scheduleNotification(k.Notification.createComplete())};return d}(b.Subscriber),c=function(){return function(a,c){this.time=a;this.notification=c}}()},{"../Notification":2,"../Subscriber":7,"../scheduler/queue":216,
"../util/isDate":232}],141:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)};a=a("../Subscriber");e.dematerialize=function(){return this.lift(new k)};var k=function(){function a(){}a.prototype.call=function(a){return new m(a)};return a}(),m=function(a){function b(d){a.call(this,d)}h(b,a);b.prototype._next=function(a){a.observe(this.destination)};
return b}(a.Subscriber)},{"../Subscriber":7}],142:[function(a,b,e){var h=this&&this.__extends||function(a,c){function b(){this.constructor=a}for(var f in c)c.hasOwnProperty(f)&&(a[f]=c[f]);a.prototype=null===c?Object.create(c):(b.prototype=c.prototype,new b)};b=a("../Subscriber");var k=a("../util/tryCatch"),m=a("../util/errorObject");e.distinctUntilChanged=function(a){return this.lift(new l(a))};var l=function(){function a(c){this.compare=c}a.prototype.call=function(a){return new f(a,this.compare)};
return a}(),f=function(a){function c(c,b){a.call(this,c);this.hasValue=!1;"function"===typeof b&&(this.compare=b)}h(c,a);c.prototype.compare=function(a,c){return a===c};c.prototype._next=function(a){var c=!1;if(this.hasValue){if(c=k.tryCatch(this.compare)(this.value,a),c===m.errorObject){this.destination.error(m.errorObject.e);return}}else this.hasValue=!0;!1===Boolean(c)&&(this.value=a,this.destination.next(a))};return c}(b.Subscriber)},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],
143:[function(a,b,e){var h=this&&this.__extends||function(a,d){function b(){this.constructor=a}for(var f in d)d.hasOwnProperty(f)&&(a[f]=d[f]);a.prototype=null===d?Object.create(d):(b.prototype=d.prototype,new b)};b=a("../Subscriber");var k=a("../util/noop"),m=a("../util/tryCatch"),l=a("../util/errorObject");e._do=function(a,d,b){var l;a&&"object"===typeof a?(l=a.next,d=a.error,b=a.complete):l=a;return this.lift(new f(l||k.noop,d||k.noop,b||k.noop))};var f=function(){function a(c,d,b){this.next=c;
this.error=d;this.complete=b}a.prototype.call=function(a){return new d(a,this.next,this.error,this.complete)};return a}(),d=function(a){function d(b,g,f,l){a.call(this,b);this.__next=g;this.__error=f;this.__complete=l}h(d,a);d.prototype._next=function(a){m.tryCatch(this.__next)(a)===l.errorObject?this.destination.error(l.errorObject.e):this.destination.next(a)};d.prototype._error=function(a){m.tryCatch(this.__error)(a)===l.errorObject?this.destination.error(l.errorObject.e):this.destination.error(a)};
d.prototype._complete=function(){m.tryCatch(this.__complete)()===l.errorObject?this.destination.error(l.errorObject.e):this.destination.complete()};return d}(b.Subscriber)},{"../Subscriber":7,"../util/errorObject":230,"../util/noop":236,"../util/tryCatch":241}],144:[function(a,b,e){var h=this&&this.__extends||function(a,c){function d(){this.constructor=a}for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b]);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)},k=a("../observable/ScalarObservable"),
m=a("../observable/fromArray"),l=a("../observable/throw");b=a("../Subscriber");var f=a("../util/tryCatch"),d=a("../util/errorObject");e.every=function(a,b){var g;return this._isScalar?(g=f.tryCatch(a).call(b||this,this.value,0,this),g===d.errorObject?new l.ErrorObservable(d.errorObject.e,this.scheduler):new k.ScalarObservable(g,this.scheduler)):this instanceof m.ArrayObservable?(g=this.array,g=f.tryCatch(function(a,c,d){return a.every(c,d)})(g,a,b),g===d.errorObject?new l.ErrorObservable(d.errorObject.e,
this.scheduler):new k.ScalarObservable(g,this.scheduler)):this.lift(new c(a,b,this))};var c=function(){function a(c,d,b){this.predicate=c;this.thisArg=d;this.source=b}a.prototype.call=function(a){return new g(a,this.predicate,this.thisArg,this.source)};return a}(),g=function(a){function c(d,b,g,f){a.call(this,d);this.predicate=b;this.thisArg=g;this.source=f;this.index=0}h(c,a);c.prototype.notifyComplete=function(a){this.destination.next(a);this.destination.complete()};c.prototype._next=function(a){a=
f.tryCatch(this.predicate).call(this.thisArg||this,a,this.index++,this.source);a===d.errorObject?this.destination.error(a.e):a||this.notifyComplete(!1)};c.prototype._complete=function(){this.notifyComplete(!0)};return c}(b.Subscriber)},{"../Subscriber":7,"../observable/ScalarObservable":105,"../observable/fromArray":112,"../observable/throw":119,"../util/errorObject":230,"../util/tryCatch":241}],145:[function(a,b,e){var h=this&&this.__extends||function(a,c){function b(){this.constructor=a}for(var f in c)c.hasOwnProperty(f)&&
(a[f]=c[f]);a.prototype=null===c?Object.create(c):(b.prototype=c.prototype,new b)},k=a("../util/tryCatch"),m=a("../util/errorObject");b=a("../OuterSubscriber");var l=a("../util/subscribeToResult");a=function(){function a(c,d,b){this.project=c;this.concurrent=d;this.scheduler=b}a.prototype.call=function(a){return new f(a,this.project,this.concurrent,this.scheduler)};return a}();e.ExpandOperator=a;var f=function(a){function c(c,b,f,l){a.call(this,c);this.project=b;this.concurrent=f;this.scheduler=l;
this.active=this.index=0;this.hasCompleted=!1;f<Number.POSITIVE_INFINITY&&(this.buffer=[])}h(c,a);c.dispatch=function(a){a.subscriber.subscribeToProjection(a.result,a.value,a.index)};c.prototype._next=function(a){var d=this.destination;if(d.isUnsubscribed)this._complete();else{var b=this.index++;if(this.active<this.concurrent){d.next(a);var f=k.tryCatch(this.project)(a,b);f===m.errorObject?d.error(f.e):this.scheduler?this.add(this.scheduler.schedule(c.dispatch,0,{subscriber:this,result:f,value:a,
index:b})):this.subscribeToProjection(f,a,b)}else this.buffer.push(a)}};c.prototype.subscribeToProjection=function(a,c,d){a._isScalar?this._next(a.value):(this.active++,this.add(l.subscribeToResult(this,a,c,d)))};c.prototype._complete=function(){(this.hasCompleted=!0,0===this.active)&&this.destination.complete()};c.prototype.notifyComplete=function(a){var c=this.buffer;this.remove(a);this.active--;c&&0<c.length&&this._next(c.shift());this.hasCompleted&&0===this.active&&this.destination.complete()};
c.prototype.notifyNext=function(a,c,d,b){this._next(c)};return c}(b.OuterSubscriber);e.ExpandSubscriber=f},{"../OuterSubscriber":4,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],146:[function(a,b,e){var h=a("./expand-support");e.expand=function(a,b,l){void 0===b&&(b=Number.POSITIVE_INFINITY);void 0===l&&(l=void 0);b=1>(b||0)?Number.POSITIVE_INFINITY:b;return this.lift(new h.ExpandOperator(a,b,l))}},{"./expand-support":145}],147:[function(a,b,e){var h=this&&this.__extends||
function(a,c){function b(){this.constructor=a}for(var f in c)c.hasOwnProperty(f)&&(a[f]=c[f]);a.prototype=null===c?Object.create(c):(b.prototype=c.prototype,new b)};b=a("../Subscriber");var k=a("../util/tryCatch"),m=a("../util/errorObject");e.filter=function(a,c){return this.lift(new l(a,c))};var l=function(){function a(c,d){this.select=c;this.thisArg=d}a.prototype.call=function(a){return new f(a,this.select,this.thisArg)};return a}(),f=function(a){function c(c,b,f){a.call(this,c);this.thisArg=f;
this.count=0;this.select=b}h(c,a);c.prototype._next=function(a){var c=k.tryCatch(this.select).call(this.thisArg||this,a,this.count++);c===m.errorObject?this.destination.error(m.errorObject.e):Boolean(c)&&this.destination.next(a)};return c}(b.Subscriber)},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],148:[function(a,b,e){var h=this&&this.__extends||function(a,d){function c(){this.constructor=a}for(var b in d)d.hasOwnProperty(b)&&(a[b]=d[b]);a.prototype=null===d?Object.create(d):
(c.prototype=d.prototype,new c)};b=a("../Subscriber");var k=a("../Subscription");e._finally=function(a){return this.lift(new m(a))};var m=function(){function a(d){this.finallySelector=d}a.prototype.call=function(a){return new l(a,this.finallySelector)};return a}(),l=function(a){function d(c,d){a.call(this,c);this.add(new k.Subscription(d))}h(d,a);return d}(b.Subscriber)},{"../Subscriber":7,"../Subscription":8}],149:[function(a,b,e){var h=this&&this.__extends||function(a,d){function b(){this.constructor=
a}for(var f in d)d.hasOwnProperty(f)&&(a[f]=d[f]);a.prototype=null===d?Object.create(d):(b.prototype=d.prototype,new b)};b=a("../Subscriber");var k=a("../util/tryCatch"),m=a("../util/errorObject"),l=a("../util/EmptyError");e.first=function(a,d,b){return this.lift(new f(a,d,b,this))};var f=function(){function a(c,d,b,f){this.predicate=c;this.resultSelector=d;this.defaultValue=b;this.source=f}a.prototype.call=function(a){return new d(a,this.predicate,this.resultSelector,this.defaultValue,this.source)};
return a}(),d=function(a){function d(b,g,f,l,e){a.call(this,b);this.predicate=g;this.resultSelector=f;this.defaultValue=l;this.source=e;this.index=0;this.hasCompleted=!1}h(d,a);d.prototype._next=function(a){var c=this.destination,d=this.predicate,b=this.resultSelector,g=this.index++,f=!0;if(d&&(f=k.tryCatch(d)(a,g,this.source),f===m.errorObject)){c.error(m.errorObject.e);return}if(f){if(b&&(a=k.tryCatch(b)(a,g),a===m.errorObject)){c.error(m.errorObject.e);return}c.next(a);c.complete();this.hasCompleted=
!0}};d.prototype._complete=function(){var a=this.destination;this.hasCompleted||"undefined"===typeof this.defaultValue?this.hasCompleted||a.error(new l.EmptyError):(a.next(this.defaultValue),a.complete())};return d}(b.Subscriber)},{"../Subscriber":7,"../util/EmptyError":223,"../util/errorObject":230,"../util/tryCatch":241}],150:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);a.prototype=null===b?Object.create(b):
(d.prototype=b.prototype,new d)},k=a("../Subscription");a=a("../Observable");b=function(a){function b(){a.call(this);this.attemptedToUnsubscribePrimary=!1;this.count=0}h(b,a);b.prototype.setPrimary=function(a){this.primary=a};b.prototype.unsubscribe=function(){this.isUnsubscribed||this.attemptedToUnsubscribePrimary||(this.attemptedToUnsubscribePrimary=!0,0===this.count&&(a.prototype.unsubscribe.call(this),this.primary.unsubscribe()))};return b}(k.Subscription);e.RefCountSubscription=b;a=function(a){function b(d,
c,g){a.call(this);this.key=d;this.groupSubject=c;this.refCountSubscription=g}h(b,a);b.prototype._subscribe=function(a){var c=new k.Subscription;this.refCountSubscription&&!this.refCountSubscription.isUnsubscribed&&c.add(new m(this.refCountSubscription));c.add(this.groupSubject.subscribe(a));return c};return b}(a.Observable);e.GroupedObservable=a;var m=function(a){function b(d){a.call(this);this.parent=d;d.count++}h(b,a);b.prototype.unsubscribe=function(){this.parent.isUnsubscribed||this.isUnsubscribed||
(a.prototype.unsubscribe.call(this),this.parent.count--,0===this.parent.count&&this.parent.attemptedToUnsubscribePrimary&&(this.parent.unsubscribe(),this.parent.primary.unsubscribe()))};return b}(k.Subscription);e.InnerRefCountSubscription=m},{"../Observable":3,"../Subscription":8}],151:[function(a,b,e){var h=this&&this.__extends||function(a,c){function d(){this.constructor=a}for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b]);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)};b=a("../Subscriber");
var k=a("../Observable"),m=a("../Subject"),l=a("../util/Map"),f=a("../util/FastMap"),d=a("./groupBy-support"),c=a("../util/tryCatch"),g=a("../util/errorObject");e.groupBy=function(a,c,d){return new n(this,a,c,d)};var n=function(a){function c(d,b,g,f){a.call(this);this.source=d;this.keySelector=b;this.elementSelector=g;this.durationSelector=f}h(c,a);c.prototype._subscribe=function(a){var c=new d.RefCountSubscription;a=new p(a,c,this.keySelector,this.elementSelector,this.durationSelector);c.setPrimary(this.source.subscribe(a));
return c};return c}(k.Observable);e.GroupByObservable=n;var p=function(a){function b(c,d,g,f,n){a.call(this);this.refCountSubscription=d;this.keySelector=g;this.elementSelector=f;this.durationSelector=n;this.groups=null;this.destination=c;this.add(c)}h(b,a);b.prototype._next=function(a){var b=c.tryCatch(this.keySelector)(a);if(b===g.errorObject)this.error(b.e);else{var n=this.groups,e=this.elementSelector,k=this.durationSelector;n||(n=this.groups="string"===typeof b?new f.FastMap:new l.Map);var h=
n.get(b);h||(n.set(b,h=new m.Subject),n=new d.GroupedObservable(b,h,this.refCountSubscription),k&&(k=c.tryCatch(k)(new d.GroupedObservable(b,h)),k===g.errorObject?this.error(k.e):this.add(k._subscribe(new q(b,h,this)))),this.destination.next(n));e?(a=c.tryCatch(e)(a),a===g.errorObject?this.error(a.e):h.next(a)):h.next(a)}};b.prototype._error=function(a){var c=this,b=this.groups;b&&b.forEach(function(b,d){b.error(a);c.removeGroup(d)});this.destination.error(a)};b.prototype._complete=function(){var a=
this,c=this.groups;c&&c.forEach(function(c,b){c.complete();a.removeGroup(c)});this.destination.complete()};b.prototype.removeGroup=function(a){this.groups.delete(a)};return b}(b.Subscriber),q=function(a){function c(b,d,g){a.call(this,null);this.key=b;this.group=d;this.parent=g}h(c,a);c.prototype._next=function(a){this.group.complete();this.parent.removeGroup(this.key)};c.prototype._error=function(a){this.group.error(a);this.parent.removeGroup(this.key)};c.prototype._complete=function(){this.group.complete();
this.parent.removeGroup(this.key)};return c}(b.Subscriber)},{"../Observable":3,"../Subject":6,"../Subscriber":7,"../util/FastMap":224,"../util/Map":226,"../util/errorObject":230,"../util/tryCatch":241,"./groupBy-support":150}],152:[function(a,b,e){var h=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var g in b)b.hasOwnProperty(g)&&(a[g]=b[g]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)};b=a("../Subscriber");var k=a("../util/noop");e.ignoreElements=
function(){return this.lift(new m)};var m=function(){function a(){}a.prototype.call=function(a){return new l(a)};return a}(),l=function(a){function b(){a.apply(this,arguments)}h(b,a);b.prototype._next=function(a){k.noop()};return b}(b.Subscriber)},{"../Subscriber":7,"../util/noop":236}],153:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)};
b=a("../Subscriber");var k=a("../util/tryCatch"),m=a("../util/errorObject"),l=a("../util/EmptyError");e.last=function(a,b,d){return this.lift(new f(a,b,d,this))};var f=function(){function a(c,b,d,f){this.predicate=c;this.resultSelector=b;this.defaultValue=d;this.source=f}a.prototype.call=function(a){return new d(a,this.predicate,this.resultSelector,this.defaultValue,this.source)};return a}(),d=function(a){function b(d,g,f,e,l){a.call(this,d);this.predicate=g;this.resultSelector=f;this.defaultValue=
e;this.source=l;this.hasValue=!1;this.index=0;"undefined"!==typeof e&&(this.lastValue=e,this.hasValue=!0)}h(b,a);b.prototype._next=function(a){var c=this.predicate,b=this.resultSelector,d=this.destination,g=this.index++;if(c)if(c=k.tryCatch(c)(a,g,this.source),c===m.errorObject)d.error(m.errorObject.e);else{if(c){if(b&&(a=k.tryCatch(b)(a,g),a===m.errorObject)){d.error(m.errorObject.e);return}this.lastValue=a;this.hasValue=!0}}else this.lastValue=a,this.hasValue=!0};b.prototype._complete=function(){var a=
this.destination;this.hasValue?(a.next(this.lastValue),a.complete()):a.error(new l.EmptyError)};return b}(b.Subscriber)},{"../Subscriber":7,"../util/EmptyError":223,"../util/errorObject":230,"../util/tryCatch":241}],154:[function(a,b,e){var h=this&&this.__extends||function(a,c){function b(){this.constructor=a}for(var f in c)c.hasOwnProperty(f)&&(a[f]=c[f]);a.prototype=null===c?Object.create(c):(b.prototype=c.prototype,new b)};b=a("../Subscriber");var k=a("../util/tryCatch"),m=a("../util/errorObject");
e.map=function(a,c){if("function"!==typeof a)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return this.lift(new l(a,c))};var l=function(){function a(c,b){this.project=c;this.thisArg=b}a.prototype.call=function(a){return new f(a,this.project,this.thisArg)};return a}(),f=function(a){function c(c,b,f){a.call(this,c);this.project=b;this.thisArg=f;this.count=0}h(c,a);c.prototype._next=function(a){a=k.tryCatch(this.project).call(this.thisArg||this,a,this.count++);a===
m.errorObject?this.error(m.errorObject.e):this.destination.next(a)};return c}(b.Subscriber)},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],155:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)};a=a("../Subscriber");e.mapTo=function(a){return this.lift(new k(a))};var k=function(){function a(b){this.value=b}a.prototype.call=
function(a){return new m(a,this.value)};return a}(),m=function(a){function b(d,c){a.call(this,d);this.value=c}h(b,a);b.prototype._next=function(a){this.destination.next(this.value)};return b}(a.Subscriber)},{"../Subscriber":7}],156:[function(a,b,e){var h=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var g in b)b.hasOwnProperty(g)&&(a[g]=b[g]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)};b=a("../Subscriber");var k=a("../Notification");e.materialize=
function(){return this.lift(new m)};var m=function(){function a(){}a.prototype.call=function(a){return new l(a)};return a}(),l=function(a){function b(c){a.call(this,c)}h(b,a);b.prototype._next=function(a){this.destination.next(k.Notification.createNext(a))};b.prototype._error=function(a){var b=this.destination;b.next(k.Notification.createError(a));b.complete()};b.prototype._complete=function(){var a=this.destination;a.next(k.Notification.createComplete());a.complete()};return b}(b.Subscriber)},{"../Notification":2,
"../Subscriber":7}],157:[function(a,b,e){var h=a("../observable/fromArray"),k=a("./mergeAll-support"),m=a("../scheduler/queue"),l=a("../util/isScheduler");e.merge=function(){for(var a=[],b=0;b<arguments.length;b++)a[b-0]=arguments[b];var b=Number.POSITIVE_INFINITY,c=m.queue,g=a[a.length-1];l.isScheduler(g)?(c=a.pop(),1<a.length&&"number"===typeof a[a.length-1]&&(b=a.pop())):"number"===typeof g&&(b=a.pop());return 1===a.length?a[0]:(new h.ArrayObservable(a,c)).lift(new k.MergeAllOperator(b))}},{"../observable/fromArray":112,
"../scheduler/queue":216,"../util/isScheduler":235,"./mergeAll-support":159}],158:[function(a,b,e){var h=a("./merge-static");e.merge=function(){for(var a=[],b=0;b<arguments.length;b++)a[b-0]=arguments[b];a.unshift(this);return h.merge.apply(this,a)}},{"./merge-static":157}],159:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)};b=a("../OuterSubscriber");
var k=a("../util/subscribeToResult");a=function(){function a(b){this.concurrent=b}a.prototype.call=function(a){return new m(a,this.concurrent)};return a}();e.MergeAllOperator=a;var m=function(a){function b(d,c){a.call(this,d);this.concurrent=c;this.hasCompleted=!1;this.buffer=[];this.active=0}h(b,a);b.prototype._next=function(a){this.active<this.concurrent?a._isScalar?this.destination.next(a.value):(this.active++,this.add(k.subscribeToResult(this,a))):this.buffer.push(a)};b.prototype._complete=function(){this.hasCompleted=
!0;0===this.active&&0===this.buffer.length&&this.destination.complete()};b.prototype.notifyComplete=function(a){var c=this.buffer;this.remove(a);this.active--;0<c.length?this._next(c.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return b}(b.OuterSubscriber);e.MergeAllSubscriber=m},{"../OuterSubscriber":4,"../util/subscribeToResult":239}],160:[function(a,b,e){var h=a("./mergeAll-support");e.mergeAll=function(a){void 0===a&&(a=Number.POSITIVE_INFINITY);return this.lift(new h.MergeAllOperator(a))}},
{"./mergeAll-support":159}],161:[function(a,b,e){var h=this&&this.__extends||function(a,c){function b(){this.constructor=a}for(var f in c)c.hasOwnProperty(f)&&(a[f]=c[f]);a.prototype=null===c?Object.create(c):(b.prototype=c.prototype,new b)},k=a("../util/tryCatch"),m=a("../util/errorObject"),l=a("../util/subscribeToResult");a=a("../OuterSubscriber");b=function(){function a(c,b,d){void 0===d&&(d=Number.POSITIVE_INFINITY);this.project=c;this.resultSelector=b;this.concurrent=d}a.prototype.call=function(a){return new f(a,
this.project,this.resultSelector,this.concurrent)};return a}();e.MergeMapOperator=b;var f=function(a){function c(c,b,f,e){void 0===e&&(e=Number.POSITIVE_INFINITY);a.call(this,c);this.project=b;this.resultSelector=f;this.concurrent=e;this.hasCompleted=!1;this.buffer=[];this.index=this.active=0}h(c,a);c.prototype._next=function(a){if(this.active<this.concurrent){var c=this.index++,b=k.tryCatch(this.project)(a,c),d=this.destination;b===m.errorObject?d.error(b.e):(this.active++,this._innerSub(b,a,c))}else this.buffer.push(a)};
c.prototype._innerSub=function(a,c,b){this.add(l.subscribeToResult(this,a,c,b))};c.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&this.destination.complete()};c.prototype.notifyNext=function(a,c,b,d){var f=this.destination,e=this.resultSelector;e?(a=k.tryCatch(e)(a,c,b,d),a===m.errorObject?f.error(m.errorObject.e):f.next(a)):f.next(c)};c.prototype.notifyComplete=function(a){var c=this.buffer;this.remove(a);this.active--;0<c.length?this._next(c.shift()):
0===this.active&&this.hasCompleted&&this.destination.complete()};return c}(a.OuterSubscriber);e.MergeMapSubscriber=f},{"../OuterSubscriber":4,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],162:[function(a,b,e){var h=a("./mergeMap-support");e.mergeMap=function(a,b,e){void 0===e&&(e=Number.POSITIVE_INFINITY);return this.lift(new h.MergeMapOperator(a,b,e))}},{"./mergeMap-support":161}],163:[function(a,b,e){var h=this&&this.__extends||function(a,c){function b(){this.constructor=
a}for(var f in c)c.hasOwnProperty(f)&&(a[f]=c[f]);a.prototype=null===c?Object.create(c):(b.prototype=c.prototype,new b)},k=a("../util/tryCatch"),m=a("../util/errorObject");b=a("../OuterSubscriber");var l=a("../util/subscribeToResult");a=function(){function a(c,b,d){void 0===d&&(d=Number.POSITIVE_INFINITY);this.ish=c;this.resultSelector=b;this.concurrent=d}a.prototype.call=function(a){return new f(a,this.ish,this.resultSelector,this.concurrent)};return a}();e.MergeMapToOperator=a;var f=function(a){function c(c,
b,f,e){void 0===e&&(e=Number.POSITIVE_INFINITY);a.call(this,c);this.ish=b;this.resultSelector=f;this.concurrent=e;this.hasCompleted=!1;this.buffer=[];this.index=this.active=0}h(c,a);c.prototype._next=function(a){if(this.active<this.concurrent){var c=this.resultSelector,b=this.index++,d=this.ish,f=this.destination;this.active++;this._innerSub(d,f,c,a,b)}else this.buffer.push(a)};c.prototype._innerSub=function(a,c,b,d,f){this.add(l.subscribeToResult(this,a,d,f))};c.prototype._complete=function(){this.hasCompleted=
!0;0===this.active&&0===this.buffer.length&&this.destination.complete()};c.prototype.notifyNext=function(a,c,b,d){var f=this.resultSelector,e=this.destination;f?(a=k.tryCatch(f)(a,c,b,d),a===m.errorObject?e.error(m.errorObject.e):e.next(a)):e.next(c)};c.prototype.notifyError=function(a){this.destination.error(a)};c.prototype.notifyComplete=function(a){var c=this.buffer;this.remove(a);this.active--;0<c.length?this._next(c.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return c}(b.OuterSubscriber);
e.MergeMapToSubscriber=f},{"../OuterSubscriber":4,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],164:[function(a,b,e){var h=a("./mergeMapTo-support");e.mergeMapTo=function(a,b,e){void 0===e&&(e=Number.POSITIVE_INFINITY);return this.lift(new h.MergeMapToOperator(a,b,e))}},{"./mergeMapTo-support":163}],165:[function(a,b,e){var h=a("../observable/ConnectableObservable");e.multicast=function(a){return new h.ConnectableObservable(this,"function"===typeof a?a:function(){return a})}},
{"../observable/ConnectableObservable":103}],166:[function(a,b,e){var h=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var g in b)b.hasOwnProperty(g)&&(a[g]=b[g]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)};b=a("../Subscriber");var k=a("../Notification");a=function(){function a(b,c){void 0===c&&(c=0);this.scheduler=b;this.delay=c}a.prototype.call=function(a){return new m(a,this.scheduler,this.delay)};return a}();e.ObserveOnOperator=a;var m=function(a){function b(c,
d,n){void 0===n&&(n=0);a.call(this,c);this.scheduler=d;this.delay=n}h(b,a);b.dispatch=function(a){a.notification.observe(a.destination)};b.prototype.scheduleMessage=function(a){this.add(this.scheduler.schedule(b.dispatch,this.delay,new l(a,this.destination)))};b.prototype._next=function(a){this.scheduleMessage(k.Notification.createNext(a))};b.prototype._error=function(a){this.scheduleMessage(k.Notification.createError(a))};b.prototype._complete=function(){this.scheduleMessage(k.Notification.createComplete())};
return b}(b.Subscriber);e.ObserveOnSubscriber=m;var l=function(){return function(a,b){this.notification=a;this.destination=b}}()},{"../Notification":2,"../Subscriber":7}],167:[function(a,b,e){var h=a("./observeOn-support");e.observeOn=function(a,b){void 0===b&&(b=0);return this.lift(new h.ObserveOnOperator(a,b))}},{"./observeOn-support":166}],168:[function(a,b,e){var h=a("../util/not"),k=a("./filter");e.partition=function(a,b){return[k.filter.call(this,a),k.filter.call(this,h.not(a,b))]}},{"../util/not":237,
"./filter":147}],169:[function(a,b,e){var h=a("../Subject"),k=a("./multicast");e.publish=function(){return k.multicast.call(this,new h.Subject)}},{"../Subject":6,"./multicast":165}],170:[function(a,b,e){var h=a("../subject/BehaviorSubject"),k=a("./multicast");e.publishBehavior=function(a){return k.multicast.call(this,new h.BehaviorSubject(a))}},{"../subject/BehaviorSubject":218,"./multicast":165}],171:[function(a,b,e){var h=a("../subject/AsyncSubject"),k=a("./multicast");e.publishLast=function(){return k.multicast.call(this,
new h.AsyncSubject)}},{"../subject/AsyncSubject":217,"./multicast":165}],172:[function(a,b,e){var h=a("../subject/ReplaySubject"),k=a("./multicast");e.publishReplay=function(a,b,f){void 0===a&&(a=Number.POSITIVE_INFINITY);void 0===b&&(b=Number.POSITIVE_INFINITY);return k.multicast.call(this,new h.ReplaySubject(a,b,f))}},{"../subject/ReplaySubject":219,"./multicast":165}],173:[function(a,b,e){var h=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var g in b)b.hasOwnProperty(g)&&
(a[g]=b[g]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)};b=a("../Subscriber");var k=a("../util/tryCatch"),m=a("../util/errorObject");a=function(){function a(b,c){this.project=b;this.seed=c}a.prototype.call=function(a){return new l(a,this.project,this.seed)};return a}();e.ReduceOperator=a;var l=function(a){function b(c,d,n){a.call(this,c);this.hasValue=!1;this.acc=n;this.project=d;this.hasSeed="undefined"!==typeof n}h(b,a);b.prototype._next=function(a){this.hasValue||(this.hasValue=
this.hasSeed)?(a=k.tryCatch(this.project).call(this,this.acc,a),a===m.errorObject?this.destination.error(m.errorObject.e):this.acc=a):(this.acc=a,this.hasValue=!0)};b.prototype._complete=function(){(this.hasValue||this.hasSeed)&&this.destination.next(this.acc);this.destination.complete()};return b}(b.Subscriber);e.ReduceSubscriber=l},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],174:[function(a,b,e){var h=a("./reduce-support");e.reduce=function(a,b){return this.lift(new h.ReduceOperator(a,
b))}},{"./reduce-support":173}],175:[function(a,b,e){var h=this&&this.__extends||function(a,c){function b(){this.constructor=a}for(var f in c)c.hasOwnProperty(f)&&(a[f]=c[f]);a.prototype=null===c?Object.create(c):(b.prototype=c.prototype,new b)};b=a("../Subscriber");var k=a("../observable/empty");e.repeat=function(a){void 0===a&&(a=-1);return 0===a?new k.EmptyObservable:this.lift(new m(a,this))};var m=function(){function a(c,b){this.count=c;this.source=b}a.prototype.call=function(a){return new l(a,
this.count,this.source)};return a}(),l=function(a){function c(c,b,f){a.call(this);this.destination=c;this.count=b;this.source=f;c.add(this);this.lastSubscription=this}h(c,a);c.prototype._next=function(a){this.destination.next(a)};c.prototype._error=function(a){this.destination.error(a)};c.prototype.complete=function(){this.isUnsubscribed||this.resubscribe(this.count)};c.prototype.unsubscribe=function(){var c=this.lastSubscription;c===this?a.prototype.unsubscribe.call(this):c.unsubscribe()};c.prototype.resubscribe=
function(a){var c=this.destination,b=this.lastSubscription;c.remove(b);b.unsubscribe();0===a-1?c.complete():(a=new f(this,a-1),this.lastSubscription=this.source.subscribe(a),c.add(this.lastSubscription))};return c}(b.Subscriber),f=function(a){function c(c,b){a.call(this);this.parent=c;this.count=b}h(c,a);c.prototype._next=function(a){this.parent.destination.next(a)};c.prototype._error=function(a){this.parent.destination.error(a)};c.prototype._complete=function(){var a=this.count;this.parent.resubscribe(0>
a?-1:a)};return c}(b.Subscriber)},{"../Subscriber":7,"../observable/empty":109}],176:[function(a,b,e){var h=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var g in b)b.hasOwnProperty(g)&&(a[g]=b[g]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)};a=a("../Subscriber");e.retry=function(a){void 0===a&&(a=0);return this.lift(new k(a,this))};var k=function(){function a(b,c){this.count=b;this.source=c}a.prototype.call=function(a){return new m(a,this.count,
this.source)};return a}(),m=function(a){function b(c,d,n){a.call(this);this.destination=c;this.count=d;this.source=n;c.add(this);this.lastSubscription=this}h(b,a);b.prototype._next=function(a){this.destination.next(a)};b.prototype.error=function(a){this.isUnsubscribed||(this.unsubscribe(),this.resubscribe())};b.prototype._complete=function(){this.unsubscribe();this.destination.complete()};b.prototype.resubscribe=function(a){void 0===a&&(a=0);var b=this.lastSubscription,d=this.destination;d.remove(b);
b.unsubscribe();a=new l(this,this.count,a+1);this.lastSubscription=this.source.subscribe(a);d.add(this.lastSubscription)};return b}(a.Subscriber),l=function(a){function b(c,d,n){void 0===n&&(n=0);a.call(this,null);this.parent=c;this.count=d;this.retried=n}h(b,a);b.prototype._next=function(a){this.parent.destination.next(a)};b.prototype._error=function(a){var b=this.parent,d=this.retried,f=this.count;f&&d===f?b.destination.error(a):b.resubscribe(d)};b.prototype._complete=function(){this.parent.destination.complete()};
return b}(a.Subscriber)},{"../Subscriber":7}],177:[function(a,b,e){var h=this&&this.__extends||function(a,c){function b(){this.constructor=a}for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d]);a.prototype=null===c?Object.create(c):(b.prototype=c.prototype,new b)};b=a("../Subscriber");var k=a("../Subject"),m=a("../util/tryCatch"),l=a("../util/errorObject");e.retryWhen=function(a){return this.lift(new f(a,this))};var f=function(){function a(c,b){this.notifier=c;this.source=b}a.prototype.call=function(a){return new d(a,
this.notifier,this.source)};return a}(),d=function(a){function b(c,d,g){a.call(this);this.destination=c;this.notifier=d;this.source=g;c.add(this);this.lastSubscription=this}h(b,a);b.prototype._next=function(a){this.destination.next(a)};b.prototype.error=function(c){var b=this.destination;if(!this.isUnsubscribed){a.prototype.unsubscribe.call(this);if(!this.retryNotifications){this.errors=new k.Subject;var d=m.tryCatch(this.notifier).call(this,this.errors);if(d===l.errorObject)b.error(l.errorObject.e);
else{this.retryNotifications=d;var f=new g(this);this.notificationSubscription=d.subscribe(f);b.add(this.notificationSubscription)}}this.errors.next(c)}};b.prototype.destinationError=function(a){this.tearDown();this.destination.error(a)};b.prototype._complete=function(){this.destinationComplete()};b.prototype.destinationComplete=function(){this.tearDown();this.destination.complete()};b.prototype.unsubscribe=function(){this.lastSubscription===this?a.prototype.unsubscribe.call(this):this.tearDown()};
b.prototype.tearDown=function(){a.prototype.unsubscribe.call(this);this.lastSubscription.unsubscribe();var c=this.notificationSubscription;c&&c.unsubscribe()};b.prototype.resubscribe=function(){var a=this.destination,b=this.lastSubscription;a.remove(b);b.unsubscribe();b=new c(this);this.lastSubscription=this.source.subscribe(b);a.add(this.lastSubscription)};return b}(b.Subscriber),c=function(a){function c(b){a.call(this,null);this.parent=b}h(c,a);c.prototype._next=function(a){this.parent.destination.next(a)};
c.prototype._error=function(a){this.parent.errors.next(a)};c.prototype._complete=function(){this.parent.destinationComplete()};return c}(b.Subscriber),g=function(a){function c(b){a.call(this,null);this.parent=b}h(c,a);c.prototype._next=function(a){this.parent.resubscribe()};c.prototype._error=function(a){this.parent.destinationError(a)};c.prototype._complete=function(){this.parent.destinationComplete()};return c}(b.Subscriber)},{"../Subject":6,"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],
178:[function(a,b,e){var h=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var g in b)b.hasOwnProperty(g)&&(a[g]=b[g]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)};a=a("../Subscriber");e.sample=function(a){return this.lift(new k(a))};var k=function(){function a(b){this.notifier=b}a.prototype.call=function(a){return new m(a,this.notifier)};return a}(),m=function(a){function b(c,d){a.call(this,c);this.notifier=d;this.hasValue=!1;this.add(d._subscribe(new l(this)))}
h(b,a);b.prototype._next=function(a){this.lastValue=a;this.hasValue=!0};b.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))};return b}(a.Subscriber),l=function(a){function b(c){a.call(this,null);this.parent=c}h(b,a);b.prototype._next=function(){this.parent.notifyNext()};b.prototype._error=function(a){this.parent.error(a)};b.prototype._complete=function(){this.parent.notifyNext()};return b}(a.Subscriber)},{"../Subscriber":7}],179:[function(a,b,
e){function h(a){var c=a.delay;a.subscriber.notifyNext();this.schedule(a,c)}var k=this&&this.__extends||function(a,c){function b(){this.constructor=a}for(var f in c)c.hasOwnProperty(f)&&(a[f]=c[f]);a.prototype=null===c?Object.create(c):(b.prototype=c.prototype,new b)};b=a("../Subscriber");var m=a("../scheduler/asap");e.sampleTime=function(a,c){void 0===c&&(c=m.asap);return this.lift(new l(a,c))};var l=function(){function a(c,b){this.delay=c;this.scheduler=b}a.prototype.call=function(a){return new f(a,
this.delay,this.scheduler)};return a}(),f=function(a){function c(c,b,f){a.call(this,c);this.delay=b;this.scheduler=f;this.hasValue=!1;this.add(f.schedule(h,b,{subscriber:this,delay:b}))}k(c,a);c.prototype._next=function(a){this.lastValue=a;this.hasValue=!0};c.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))};return c}(b.Subscriber)},{"../Subscriber":7,"../scheduler/asap":215}],180:[function(a,b,e){var h=this&&this.__extends||function(a,c){function b(){this.constructor=
a}for(var f in c)c.hasOwnProperty(f)&&(a[f]=c[f]);a.prototype=null===c?Object.create(c):(b.prototype=c.prototype,new b)};b=a("../Subscriber");var k=a("../util/tryCatch"),m=a("../util/errorObject");e.scan=function(a,c){return this.lift(new l(a,c))};var l=function(){function a(c,b){this.accumulator=c;this.seed=b}a.prototype.call=function(a){return new f(a,this.accumulator,this.seed)};return a}(),f=function(a){function c(c,b,f){a.call(this,c);this.accumulator=b;this.accumulatorSet=!1;this.seed=f;this.accumulator=
b;this.accumulatorSet="undefined"!==typeof f}h(c,a);Object.defineProperty(c.prototype,"seed",{get:function(){return this._seed},set:function(a){this.accumulatorSet=!0;this._seed=a},enumerable:!0,configurable:!0});c.prototype._next=function(a){this.accumulatorSet?(a=k.tryCatch(this.accumulator).call(this,this.seed,a),a===m.errorObject?this.destination.error(m.errorObject.e):(this.seed=a,this.destination.next(this.seed))):(this.seed=a,this.destination.next(a))};return c}(b.Subscriber)},{"../Subscriber":7,
"../util/errorObject":230,"../util/tryCatch":241}],181:[function(a,b,e){function h(){return new m.Subject}var k=a("./multicast"),m=a("../Subject");e.share=function(){return k.multicast.call(this,h).refCount()}},{"../Subject":6,"./multicast":165}],182:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)};b=a("../Subscriber");var k=a("../util/tryCatch"),
m=a("../util/errorObject"),l=a("../util/EmptyError");e.single=function(a){return this.lift(new f(a,this))};var f=function(){function a(b,c){this.predicate=b;this.source=c}a.prototype.call=function(a){return new d(a,this.predicate,this.source)};return a}(),d=function(a){function b(d,g,f){a.call(this,d);this.predicate=g;this.source=f;this.seenValue=!1;this.index=0}h(b,a);b.prototype.applySingleValue=function(a){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=
!0,this.singleValue=a)};b.prototype._next=function(a){var b=this.predicate,c=this.index++;b?(b=k.tryCatch(b)(a,c,this.source),b===m.errorObject?this.destination.error(b.e):b&&this.applySingleValue(a)):this.applySingleValue(a)};b.prototype._complete=function(){var a=this.destination;0<this.index?(a.next(this.seenValue?this.singleValue:void 0),a.complete()):a.error(new l.EmptyError)};return b}(b.Subscriber)},{"../Subscriber":7,"../util/EmptyError":223,"../util/errorObject":230,"../util/tryCatch":241}],
183:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)};a=a("../Subscriber");e.skip=function(a){return this.lift(new k(a))};var k=function(){function a(b){this.total=b}a.prototype.call=function(a){return new m(a,this.total)};return a}(),m=function(a){function b(d,c){a.call(this,d);this.total=c;this.count=0}h(b,a);b.prototype._next=function(a){++this.count>
this.total&&this.destination.next(a)};return b}(a.Subscriber)},{"../Subscriber":7}],184:[function(a,b,e){var h=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var g in b)b.hasOwnProperty(g)&&(a[g]=b[g]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)};a=a("../Subscriber");e.skipUntil=function(a){return this.lift(new k(a))};var k=function(){function a(b){this.notifier=b}a.prototype.call=function(a){return new m(a,this.notifier)};return a}(),m=function(a){function b(c,
d){a.call(this,c);this.notifier=d;this.notificationSubscriber=null;this.notificationSubscriber=new l(this);this.add(this.notifier.subscribe(this.notificationSubscriber))}h(b,a);b.prototype._next=function(a){this.notificationSubscriber.hasValue&&this.destination.next(a)};b.prototype._error=function(a){this.destination.error(a)};b.prototype._complete=function(){this.notificationSubscriber.hasCompleted&&this.destination.complete();this.notificationSubscriber.unsubscribe()};b.prototype.unsubscribe=function(){this._isUnsubscribed||
(this._subscription?(this._subscription.unsubscribe(),this._isUnsubscribed=!0):a.prototype.unsubscribe.call(this))};return b}(a.Subscriber),l=function(a){function b(c){a.call(this,null);this.parent=c;this.hasCompleted=this.hasValue=!1}h(b,a);b.prototype._next=function(a){this.hasValue=!0};b.prototype._error=function(a){this.parent.error(a);this.hasValue=!0};b.prototype._complete=function(){this.hasCompleted=!0};return b}(a.Subscriber)},{"../Subscriber":7}],185:[function(a,b,e){var h=this&&this.__extends||
function(a,b){function g(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===b?Object.create(b):(g.prototype=b.prototype,new g)};b=a("../Subscriber");var k=a("../util/tryCatch"),m=a("../util/errorObject");e.skipWhile=function(a){return this.lift(new l(a))};var l=function(){function a(b){this.predicate=b}a.prototype.call=function(a){return new f(a,this.predicate)};return a}(),f=function(a){function b(c,f){a.call(this,c);this.predicate=f;this.skipping=!0;this.index=
0}h(b,a);b.prototype._next=function(a){var b=this.destination;if(!0===this.skipping){var c=this.index++,c=k.tryCatch(this.predicate)(a,c);c===m.errorObject?b.error(c.e):this.skipping=Boolean(c)}!1===this.skipping&&b.next(a)};return b}(b.Subscriber)},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],186:[function(a,b,e){var h=a("../observable/fromArray"),k=a("../observable/ScalarObservable"),m=a("../observable/empty"),l=a("./concat-static"),f=a("../util/isScheduler");e.startWith=
function(){for(var a=[],b=0;b<arguments.length;b++)a[b-0]=arguments[b];b=a[a.length-1];f.isScheduler(b)?a.pop():b=void 0;var g=a.length;return 1===g?l.concat(new k.ScalarObservable(a[0],b),this):1<g?l.concat(new h.ArrayObservable(a,b),this):l.concat(new m.EmptyObservable(b),this)}},{"../observable/ScalarObservable":105,"../observable/empty":109,"../observable/fromArray":112,"../util/isScheduler":235,"./concat-static":131}],187:[function(a,b,e){var h=a("../observable/SubscribeOnObservable");e.subscribeOn=
function(a,b){void 0===b&&(b=0);return new h.SubscribeOnObservable(this,b,a)}},{"../observable/SubscribeOnObservable":106}],188:[function(a,b,e){var h=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var g in b)b.hasOwnProperty(g)&&(a[g]=b[g]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)};b=a("../OuterSubscriber");var k=a("../util/subscribeToResult");e._switch=function(){return this.lift(new m)};var m=function(){function a(){}a.prototype.call=function(a){return new l(a)};
return a}(),l=function(a){function b(c){a.call(this,c);this.active=0;this.hasCompleted=!1}h(b,a);b.prototype._next=function(a){this.unsubscribeInner();this.active++;this.add(this.innerSubscription=k.subscribeToResult(this,a))};b.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&this.destination.complete()};b.prototype.unsubscribeInner=function(){this.active=0<this.active?this.active-1:0;var a=this.innerSubscription;a&&(a.unsubscribe(),this.remove(a))};b.prototype.notifyNext=function(a,
b){this.destination.next(b)};b.prototype.notifyError=function(a){this.destination.error(a)};b.prototype.notifyComplete=function(){this.unsubscribeInner();this.hasCompleted&&0===this.active&&this.destination.complete()};return b}(b.OuterSubscriber)},{"../OuterSubscriber":4,"../util/subscribeToResult":239}],189:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===b?Object.create(b):(d.prototype=
b.prototype,new d)},k=a("../util/tryCatch"),m=a("../util/errorObject");b=a("../OuterSubscriber");var l=a("../util/subscribeToResult");e.switchMap=function(a,b){return this.lift(new f(a,b))};var f=function(){function a(b,c){this.project=b;this.resultSelector=c}a.prototype.call=function(a){return new d(a,this.project,this.resultSelector)};return a}(),d=function(a){function b(d,g,f){a.call(this,d);this.project=g;this.resultSelector=f;this.hasCompleted=!1;this.index=0}h(b,a);b.prototype._next=function(a){var b=
this.index++,c=this.destination,d=k.tryCatch(this.project)(a,b);d===m.errorObject?c.error(d.e):((c=this.innerSubscription)&&c.unsubscribe(),this.add(this.innerSubscription=l.subscribeToResult(this,d,a,b)))};b.prototype._complete=function(){var a=this.innerSubscription;this.hasCompleted=!0;a&&!a.isUnsubscribed||this.destination.complete()};b.prototype.notifyComplete=function(a){this.remove(a);(a=this.innerSubscription)&&a.unsubscribe();this.innerSubscription=null;this.hasCompleted&&this.destination.complete()};
b.prototype.notifyError=function(a){this.destination.error(a)};b.prototype.notifyNext=function(a,b,c,d){var g=this.resultSelector,f=this.destination;g?(a=k.tryCatch(g)(a,b,c,d),a===m.errorObject?f.error(m.errorObject.e):f.next(a)):f.next(b)};return b}(b.OuterSubscriber)},{"../OuterSubscriber":4,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],190:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&
(a[f]=b[f]);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)},k=a("../util/tryCatch"),m=a("../util/errorObject");b=a("../OuterSubscriber");var l=a("../util/subscribeToResult");e.switchMapTo=function(a,b){return this.lift(new f(a,b))};var f=function(){function a(b,c){this.observable=b;this.resultSelector=c}a.prototype.call=function(a){return new d(a,this.observable,this.resultSelector)};return a}(),d=function(a){function b(d,f,g){a.call(this,d);this.inner=f;this.resultSelector=
g;this.hasCompleted=!1;this.index=0}h(b,a);b.prototype._next=function(a){var b=this.index++,c=this.innerSubscription;c&&c.unsubscribe();this.add(this.innerSubscription=l.subscribeToResult(this,this.inner,a,b))};b.prototype._complete=function(){var a=this.innerSubscription;this.hasCompleted=!0;a&&!a.isUnsubscribed||this.destination.complete()};b.prototype.notifyComplete=function(a){this.remove(a);(a=this.innerSubscription)&&a.unsubscribe();this.innerSubscription=null;this.hasCompleted&&this.destination.complete()};
b.prototype.notifyError=function(a){this.destination.error(a)};b.prototype.notifyNext=function(a,b,c,d){var f=this.resultSelector,g=this.destination;f?(a=k.tryCatch(f)(a,b,c,d),a===m.errorObject?g.error(m.errorObject.e):g.next(a)):g.next(b)};return b}(b.OuterSubscriber)},{"../OuterSubscriber":4,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],191:[function(a,b,e){var h=this&&this.__extends||function(a,b){function f(){this.constructor=a}for(var e in b)b.hasOwnProperty(e)&&
(a[e]=b[e]);a.prototype=null===b?Object.create(b):(f.prototype=b.prototype,new f)};b=a("../Subscriber");var k=a("../util/ArgumentOutOfRangeError"),m=a("../observable/empty");e.take=function(a){return 0===a?new m.EmptyObservable:this.lift(new l(a))};var l=function(){function a(b){this.total=b;if(0>this.total)throw new k.ArgumentOutOfRangeError;}a.prototype.call=function(a){return new f(a,this.total)};return a}(),f=function(a){function b(c,f){a.call(this,c);this.total=f;this.count=0}h(b,a);b.prototype._next=
function(a){var b=this.total;++this.count<=b&&(this.destination.next(a),this.count===b&&this.destination.complete())};return b}(b.Subscriber)},{"../Subscriber":7,"../observable/empty":109,"../util/ArgumentOutOfRangeError":222}],192:[function(a,b,e){var h=this&&this.__extends||function(a,b){function f(){this.constructor=a}for(var e in b)b.hasOwnProperty(e)&&(a[e]=b[e]);a.prototype=null===b?Object.create(b):(f.prototype=b.prototype,new f)};b=a("../Subscriber");var k=a("../util/noop");e.takeUntil=function(a){return this.lift(new m(a))};
var m=function(){function a(b){this.notifier=b}a.prototype.call=function(a){return new l(a,this.notifier)};return a}(),l=function(a){function b(c,e){a.call(this,c);this.notifier=e;this.notificationSubscriber=null;this.notificationSubscriber=new f(c);this.add(e.subscribe(this.notificationSubscriber))}h(b,a);b.prototype._complete=function(){this.destination.complete();this.notificationSubscriber.unsubscribe()};return b}(b.Subscriber),f=function(a){function b(c){a.call(this,null);this.destination=c}
h(b,a);b.prototype._next=function(a){this.destination.complete()};b.prototype._error=function(a){this.destination.error(a)};b.prototype._complete=function(){k.noop()};return b}(b.Subscriber)},{"../Subscriber":7,"../util/noop":236}],193:[function(a,b,e){var h=this&&this.__extends||function(a,b){function f(){this.constructor=a}for(var e in b)b.hasOwnProperty(e)&&(a[e]=b[e]);a.prototype=null===b?Object.create(b):(f.prototype=b.prototype,new f)};b=a("../Subscriber");var k=a("../util/tryCatch"),m=a("../util/errorObject");
e.takeWhile=function(a){return this.lift(new l(a))};var l=function(){function a(b){this.predicate=b}a.prototype.call=function(a){return new f(a,this.predicate)};return a}(),f=function(a){function b(c,f){a.call(this,c);this.predicate=f;this.index=0}h(b,a);b.prototype._next=function(a){var b=this.destination,c=k.tryCatch(this.predicate)(a,this.index++);c==m.errorObject?b.error(c.e):Boolean(c)?b.next(a):b.complete()};return b}(b.Subscriber)},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],
194:[function(a,b,e){var h=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},k=a("../observable/fromPromise");b=a("../Subscriber");var m=a("../util/tryCatch"),l=a("../util/isPromise"),f=a("../util/errorObject");e.throttle=function(a){return this.lift(new d(a))};var d=function(){function a(b){this.durationSelector=b}a.prototype.call=function(a){return new c(a,this.durationSelector)};
return a}(),c=function(a){function b(c,d){a.call(this,c);this.durationSelector=d}h(b,a);b.prototype._next=function(a){if(!this.throttled){var b=this.destination,c=m.tryCatch(this.durationSelector)(a);c===f.errorObject?b.error(f.errorObject.e):(l.isPromise(c)&&(c=k.PromiseObservable.create(c)),this.add(this.throttled=c._subscribe(new g(this))),b.next(a))}};b.prototype._error=function(b){this.clearThrottle();a.prototype._error.call(this,b)};b.prototype._complete=function(){this.clearThrottle();a.prototype._complete.call(this)};
b.prototype.clearThrottle=function(){var a=this.throttled;a&&(a.unsubscribe(),this.remove(a),this.throttled=null)};return b}(b.Subscriber),g=function(a){function b(c){a.call(this,null);this.parent=c}h(b,a);b.prototype._next=function(a){this.parent.clearThrottle()};b.prototype._error=function(a){this.parent.error(a)};b.prototype._complete=function(){this.parent.clearThrottle()};return b}(b.Subscriber)},{"../Subscriber":7,"../observable/fromPromise":115,"../util/errorObject":230,"../util/isPromise":234,
"../util/tryCatch":241}],195:[function(a,b,e){function h(a){a.subscriber.clearThrottle()}var k=this&&this.__extends||function(a,b){function f(){this.constructor=a}for(var e in b)b.hasOwnProperty(e)&&(a[e]=b[e]);a.prototype=null===b?Object.create(b):(f.prototype=b.prototype,new f)};b=a("../Subscriber");var m=a("../scheduler/asap");e.throttleTime=function(a,b){void 0===b&&(b=m.asap);return this.lift(new l(a,b))};var l=function(){function a(b,d){this.delay=b;this.scheduler=d}a.prototype.call=function(a){return new f(a,
this.delay,this.scheduler)};return a}(),f=function(a){function b(c,f,e){a.call(this,c);this.delay=f;this.scheduler=e}k(b,a);b.prototype._next=function(a){this.throttled||(this.add(this.throttled=this.scheduler.schedule(h,this.delay,{subscriber:this})),this.destination.next(a))};b.prototype.clearThrottle=function(){var a=this.throttled;a&&(a.unsubscribe(),this.remove(a),this.throttled=null)};return b}(b.Subscriber)},{"../Subscriber":7,"../scheduler/asap":215}],196:[function(a,b,e){var h=this&&this.__extends||
function(a,b){function f(){this.constructor=a}for(var e in b)b.hasOwnProperty(e)&&(a[e]=b[e]);a.prototype=null===b?Object.create(b):(f.prototype=b.prototype,new f)};b=a("../Subscriber");var k=a("../scheduler/queue"),m=a("../util/isDate");e.timeout=function(a,b,f){void 0===b&&(b=null);void 0===f&&(f=k.queue);var e=m.isDate(a);a=e?+a-f.now():a;return this.lift(new l(a,e,b,f))};var l=function(){function a(b,d,f,e){this.waitFor=b;this.absoluteTimeout=d;this.errorToSend=f;this.scheduler=e}a.prototype.call=
function(a){return new f(a,this.absoluteTimeout,this.waitFor,this.errorToSend,this.scheduler)};return a}(),f=function(a){function b(c,f,e,l,k){a.call(this,c);this.absoluteTimeout=f;this.waitFor=e;this.errorToSend=l;this.scheduler=k;this._previousIndex=this.index=0;this._hasCompleted=!1;this.scheduleTimeout()}h(b,a);Object.defineProperty(b.prototype,"previousIndex",{get:function(){return this._previousIndex},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"hasCompleted",{get:function(){return this._hasCompleted},
enumerable:!0,configurable:!0});b.dispatchTimeout=function(a){var b=a.subscriber;a=a.index;b.hasCompleted||b.previousIndex!==a||b.notifyTimeout()};b.prototype.scheduleTimeout=function(){var a=this.index;this.scheduler.schedule(b.dispatchTimeout,this.waitFor,{subscriber:this,index:a});this.index++;this._previousIndex=a};b.prototype._next=function(a){this.destination.next(a);this.absoluteTimeout||this.scheduleTimeout()};b.prototype._error=function(a){this.destination.error(a);this._hasCompleted=!0};
b.prototype._complete=function(){this.destination.complete();this._hasCompleted=!0};b.prototype.notifyTimeout=function(){this.error(this.errorToSend||Error("timeout"))};return b}(b.Subscriber)},{"../Subscriber":7,"../scheduler/queue":216,"../util/isDate":232}],197:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)},k=a("../scheduler/queue"),
m=a("../util/isDate");b=a("../OuterSubscriber");var l=a("../util/subscribeToResult");e.timeoutWith=function(a,b,d){void 0===d&&(d=k.queue);var e=m.isDate(a);a=e?+a-d.now():a;return this.lift(new f(a,e,b,d))};var f=function(){function a(b,c,d,f){this.waitFor=b;this.absoluteTimeout=c;this.withObservable=d;this.scheduler=f}a.prototype.call=function(a){return new d(a,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler)};return a}(),d=function(a){function b(d,f,g,e,l){a.call(this,null);
this.destination=d;this.absoluteTimeout=f;this.waitFor=g;this.withObservable=e;this.scheduler=l;this.timeoutSubscription=void 0;this._previousIndex=this.index=0;this._hasCompleted=!1;d.add(this);this.scheduleTimeout()}h(b,a);Object.defineProperty(b.prototype,"previousIndex",{get:function(){return this._previousIndex},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"hasCompleted",{get:function(){return this._hasCompleted},enumerable:!0,configurable:!0});b.dispatchTimeout=function(a){var b=
a.subscriber;a=a.index;b.hasCompleted||b.previousIndex!==a||b.handleTimeout()};b.prototype.scheduleTimeout=function(){var a=this.index;this.scheduler.schedule(b.dispatchTimeout,this.waitFor,{subscriber:this,index:a});this.index++;this._previousIndex=a};b.prototype._next=function(a){this.destination.next(a);this.absoluteTimeout||this.scheduleTimeout()};b.prototype._error=function(a){this.destination.error(a);this._hasCompleted=!0};b.prototype._complete=function(){this.destination.complete();this._hasCompleted=
!0};b.prototype.handleTimeout=function(){if(!this.isUnsubscribed){var a=this.withObservable;this.unsubscribe();this.destination.add(this.timeoutSubscription=l.subscribeToResult(this,a))}};return b}(b.OuterSubscriber)},{"../OuterSubscriber":4,"../scheduler/queue":216,"../util/isDate":232,"../util/subscribeToResult":239}],198:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);a.prototype=null===b?Object.create(b):
(d.prototype=b.prototype,new d)};a=a("../Subscriber");e.toArray=function(){return this.lift(new k)};var k=function(){function a(){}a.prototype.call=function(a){return new m(a)};return a}(),m=function(a){function b(d){a.call(this,d);this.array=[]}h(b,a);b.prototype._next=function(a){this.array.push(a)};b.prototype._complete=function(){this.destination.next(this.array);this.destination.complete()};return b}(a.Subscriber)},{"../Subscriber":7}],199:[function(a,b,e){var h=a("../util/root");e.toPromise=
function(a){var b=this;a||(h.root.Rx&&h.root.Rx.config&&h.root.Rx.config.Promise?a=h.root.Rx.config.Promise:h.root.Promise&&(a=h.root.Promise));if(!a)throw Error("no Promise impl found");return new a(function(a,f){var d;b.subscribe(function(a){return d=a},function(a){return f(a)},function(){return a(d)})})}},{"../util/root":238}],200:[function(a,b,e){var h=this&&this.__extends||function(a,b){function f(){this.constructor=a}for(var e in b)b.hasOwnProperty(e)&&(a[e]=b[e]);a.prototype=null===b?Object.create(b):
(f.prototype=b.prototype,new f)};b=a("../Subscriber");var k=a("../Subject");e.window=function(a){return this.lift(new m(a))};var m=function(){function a(b){this.closingNotifier=b}a.prototype.call=function(a){return new l(a,this.closingNotifier)};return a}(),l=function(a){function b(c,e){a.call(this,c);this.destination=c;this.closingNotifier=e;this.add(e._subscribe(new f(this)));this.openWindow()}h(b,a);b.prototype._next=function(a){this.window.next(a)};b.prototype._error=function(a){this.window.error(a);
this.destination.error(a)};b.prototype._complete=function(){this.window.complete();this.destination.complete()};b.prototype.openWindow=function(){var a=this.window;a&&a.complete();var a=this.destination,b=this.window=new k.Subject;a.add(b);a.next(b)};return b}(b.Subscriber),f=function(a){function b(c){a.call(this,null);this.parent=c}h(b,a);b.prototype._next=function(){this.parent.openWindow()};b.prototype._error=function(a){this.parent._error(a)};b.prototype._complete=function(){this.parent._complete()};
return b}(b.Subscriber)},{"../Subject":6,"../Subscriber":7}],201:[function(a,b,e){var h=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var g in b)b.hasOwnProperty(g)&&(a[g]=b[g]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)};b=a("../Subscriber");var k=a("../Subject");e.windowCount=function(a,b){void 0===b&&(b=0);return this.lift(new m(a,b))};var m=function(){function a(b,c){this.windowSize=b;this.startWindowEvery=c}a.prototype.call=function(a){return new l(a,
this.windowSize,this.startWindowEvery)};return a}(),l=function(a){function b(c,d,e){a.call(this,c);this.destination=c;this.windowSize=d;this.startWindowEvery=e;this.windows=[new k.Subject];this.count=0;d=this.windows[0];c.add(d);c.next(d)}h(b,a);b.prototype._next=function(a){for(var b=0<this.startWindowEvery?this.startWindowEvery:this.windowSize,d=this.destination,f=this.windowSize,e=this.windows,l=e.length,h=0;h<l;h++)e[h].next(a);a=this.count-f+1;0<=a&&0===a%b&&e.shift().complete();0===++this.count%
b&&(b=new k.Subject,e.push(b),d.add(b),d.next(b))};b.prototype._error=function(a){for(var b=this.windows;0<b.length;)b.shift().error(a);this.destination.error(a)};b.prototype._complete=function(){for(var a=this.windows;0<a.length;)a.shift().complete();this.destination.complete()};return b}(b.Subscriber)},{"../Subject":6,"../Subscriber":7}],202:[function(a,b,e){function h(a){var b=a.subscriber,c=a.windowTimeSpan,d=a.window;d&&d.complete();a.window=b.openWindow();this.schedule(a,c)}function k(a){var b=
a.windowTimeSpan,c=a.subscriber,d=a.scheduler,f=a.windowCreationInterval,e=c.openWindow(),g={action:this,subscription:null};g.subscription=d.schedule(m,b,{subscriber:c,window:e,context:g});this.add(g.subscription);this.schedule(a,f)}function m(a){var b=a.subscriber,c=a.window;(a=a.context)&&a.action&&a.subscription&&a.action.remove(a.subscription);b.closeWindow(c)}var l=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=
null===b?Object.create(b):(c.prototype=b.prototype,new c)};b=a("../Subscriber");var f=a("../Subject"),d=a("../scheduler/asap");e.windowTime=function(a,b,f){void 0===b&&(b=null);void 0===f&&(f=d.asap);return this.lift(new c(a,b,f))};var c=function(){function a(b,c,d){this.windowTimeSpan=b;this.windowCreationInterval=c;this.scheduler=d}a.prototype.call=function(a){return new g(a,this.windowTimeSpan,this.windowCreationInterval,this.scheduler)};return a}(),g=function(a){function b(c,d,f,e){a.call(this,
c);this.destination=c;this.windowTimeSpan=d;this.windowCreationInterval=f;this.scheduler=e;this.windows=[];if(null!==f&&0<=f){c={subscriber:this,window:this.openWindow(),context:null};var g={windowTimeSpan:d,windowCreationInterval:f,subscriber:this,scheduler:e};this.add(e.schedule(m,d,c));this.add(e.schedule(k,f,g))}else f={subscriber:this,window:this.openWindow(),windowTimeSpan:d},this.add(e.schedule(h,d,f))}l(b,a);b.prototype._next=function(a){for(var b=this.windows,c=b.length,d=0;d<c;d++)b[d].next(a)};
b.prototype._error=function(a){for(var b=this.windows;0<b.length;)b.shift().error(a);this.destination.error(a)};b.prototype._complete=function(){for(var a=this.windows;0<a.length;)a.shift().complete();this.destination.complete()};b.prototype.openWindow=function(){var a=new f.Subject;this.windows.push(a);var b=this.destination;b.add(a);b.next(a);return a};b.prototype.closeWindow=function(a){a.complete();var b=this.windows;b.splice(b.indexOf(a),1)};return b}(b.Subscriber)},{"../Subject":6,"../Subscriber":7,
"../scheduler/asap":215}],203:[function(a,b,e){var h=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)};b=a("../Subscriber");var k=a("../Subject"),m=a("../Subscription"),l=a("../util/tryCatch"),f=a("../util/errorObject");e.windowToggle=function(a,b){return this.lift(new d(a,b))};var d=function(){function a(b,c){this.openings=b;this.closingSelector=c}a.prototype.call=
function(a){return new c(a,this.openings,this.closingSelector)};return a}(),c=function(a){function b(c,d,f){a.call(this,c);this.destination=c;this.openings=d;this.closingSelector=f;this.contexts=[];this.add(this.openings._subscribe(new n(this)))}h(b,a);b.prototype._next=function(a){for(var b=this.contexts,c=b.length,d=0;d<c;d++)b[d].window.next(a)};b.prototype._error=function(a){for(var b=this.contexts;0<b.length;)b.shift().window.error(a);this.destination.error(a)};b.prototype._complete=function(){for(var a=
this.contexts;0<a.length;){var b=a.shift();b.window.complete();b.subscription.unsubscribe()}this.destination.complete()};b.prototype.openWindow=function(a){var b=l.tryCatch(this.closingSelector)(a);if(b===f.errorObject)this.error(b.e);else{a=this.destination;var c=new k.Subject,d=new m.Subscription,e={window:c,subscription:d};this.contexts.push(e);e=new g(this,e);b=b._subscribe(e);d.add(b);a.add(d);a.add(c);a.next(c)}};b.prototype.closeWindow=function(a){var b=a.window,c=a.subscription,d=this.contexts,
f=this.destination;d.splice(d.indexOf(a),1);b.complete();f.remove(c);f.remove(b);c.unsubscribe()};return b}(b.Subscriber),g=function(a){function b(c,d){a.call(this,null);this.parent=c;this.windowContext=d}h(b,a);b.prototype._next=function(){this.parent.closeWindow(this.windowContext)};b.prototype._error=function(a){this.parent.error(a)};b.prototype._complete=function(){this.parent.closeWindow(this.windowContext)};return b}(b.Subscriber),n=function(a){function b(c){a.call(this);this.parent=c}h(b,a);
b.prototype._next=function(a){this.parent.openWindow(a)};b.prototype._error=function(a){this.parent.error(a)};b.prototype._complete=function(){};return b}(b.Subscriber)},{"../Subject":6,"../Subscriber":7,"../Subscription":8,"../util/errorObject":230,"../util/tryCatch":241}],204:[function(a,b,e){var h=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)};b=a("../Subscriber");
var k=a("../Subject"),m=a("../Subscription"),l=a("../util/tryCatch"),f=a("../util/errorObject");e.windowWhen=function(a){return this.lift(new d(a))};var d=function(){function a(b){this.closingSelector=b}a.prototype.call=function(a){return new c(a,this.closingSelector)};return a}(),c=function(a){function b(c,d){a.call(this,c);this.destination=c;this.closingSelector=d;this.openWindow()}h(b,a);b.prototype._next=function(a){this.window.next(a)};b.prototype._error=function(a){this.window.error(a);this.destination.error(a);
this._unsubscribeClosingNotification()};b.prototype._complete=function(){this.window.complete();this.destination.complete();this._unsubscribeClosingNotification()};b.prototype.unsubscribe=function(){a.prototype.unsubscribe.call(this);this._unsubscribeClosingNotification()};b.prototype._unsubscribeClosingNotification=function(){var a=this.closingNotification;a&&a.unsubscribe()};b.prototype.openWindow=function(){var a=this.closingNotification;a&&(this.remove(a),a.unsubscribe());(a=this.window)&&a.complete();
a=this.window=new k.Subject;this.destination.next(a);var b=l.tryCatch(this.closingSelector)();if(b===f.errorObject)a=b.e,this.destination.error(a),this.window.error(a);else{var c=this.closingNotification=new m.Subscription;c.add(b._subscribe(new g(this)));this.add(c);this.add(a)}};return b}(b.Subscriber),g=function(a){function b(c){a.call(this,null);this.parent=c}h(b,a);b.prototype._next=function(){this.parent.openWindow()};b.prototype._error=function(a){this.parent.error(a)};b.prototype._complete=
function(){this.parent.openWindow()};return b}(b.Subscriber)},{"../Subject":6,"../Subscriber":7,"../Subscription":8,"../util/errorObject":230,"../util/tryCatch":241}],205:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)},k=a("../util/tryCatch"),m=a("../util/errorObject");b=a("../OuterSubscriber");var l=a("../util/subscribeToResult");e.withLatestFrom=
function(){for(var a=[],b=0;b<arguments.length;b++)a[b-0]=arguments[b];var d;"function"===typeof a[a.length-1]&&(d=a.pop());return this.lift(new f(a,d))};var f=function(){function a(b,c){this.observables=b;this.project=c}a.prototype.call=function(a){return new d(a,this.observables,this.project)};return a}(),d=function(a){function b(d,f,e){a.call(this,d);this.observables=f;this.project=e;this.toRespond=[];d=f.length;this.values=Array(d);for(e=0;e<d;e++)this.toRespond.push(e);for(e=0;e<d;e++){var g=
f[e];this.add(l.subscribeToResult(this,g,g,e))}}h(b,a);b.prototype.notifyNext=function(a,b,c,d){this.values[c]=b;a=this.toRespond;0<a.length&&(c=a.indexOf(c),-1!==c&&a.splice(c,1))};b.prototype.notifyComplete=function(){};b.prototype._next=function(a){if(0===this.toRespond.length){var b=this.destination,c=this.project;a=[a].concat(this.values);c?(c=k.tryCatch(this.project).apply(this,a),c===m.errorObject?b.error(c.e):b.next(c)):b.next(a)}};return b}(b.OuterSubscriber)},{"../OuterSubscriber":4,"../util/errorObject":230,
"../util/subscribeToResult":239,"../util/tryCatch":241}],206:[function(a,b,e){var h=a("../observable/fromArray"),k=a("./zip-support");e.zip=function(){for(var a=[],b=0;b<arguments.length;b++)a[b-0]=arguments[b];b=a[a.length-1];"function"===typeof b&&a.pop();return(new h.ArrayObservable(a)).lift(new k.ZipOperator(b))}},{"../observable/fromArray":112,"./zip-support":207}],207:[function(a,b,e){var h=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&
(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)};b=a("../Subscriber");var k=a("../util/tryCatch"),m=a("../util/errorObject"),l=a("../OuterSubscriber"),f=a("../util/subscribeToResult"),d=a("../util/SymbolShim"),c=Array.isArray;a=function(){function a(b){this.project=b}a.prototype.call=function(a){return new g(a,this.project)};return a}();e.ZipOperator=a;var g=function(a){function b(c,d,f){void 0===f&&(f=Object.create(null));a.call(this,c);this.index=0;this.iterators=
[];this.active=0;this.project="function"===typeof d?d:null;this.values=f}h(b,a);b.prototype._next=function(a){var b=this.iterators,f=this.index++;c(a)?b.push(new p(a)):"function"===typeof a[d.SymbolShim.iterator]?b.push(new n(a[d.SymbolShim.iterator]())):b.push(new q(this.destination,this,a,f))};b.prototype._complete=function(){var a=this.iterators,b=a.length;this.active=b;for(var c=0;c<b;c++){var d=a[c];d.stillUnsubscribed?d.subscribe(d,c):this.active--}};b.prototype.notifyInactive=function(){this.active--;
0===this.active&&this.destination.complete()};b.prototype.checkIterators=function(){for(var a=this.iterators,b=a.length,c=this.destination,d=0;d<b;d++){var f=a[d];if("function"===typeof f.hasValue&&!f.hasValue())return}for(var e=!1,g=[],d=0;d<b;d++){var f=a[d],l=f.next();f.hasCompleted()&&(e=!0);if(l.done){c.complete();return}g.push(l.value)}(a=this.project)?(l=k.tryCatch(a).apply(this,g),l===m.errorObject?c.error(m.errorObject.e):c.next(l)):c.next(g);e&&c.complete()};return b}(b.Subscriber);e.ZipSubscriber=
g;var n=function(){function a(b){this.iterator=b;this.nextResult=b.next()}a.prototype.hasValue=function(){return!0};a.prototype.next=function(){var a=this.nextResult;this.nextResult=this.iterator.next();return a};a.prototype.hasCompleted=function(){var a=this.nextResult;return a&&a.done};return a}(),p=function(){function a(b){this.array=b;this.length=this.index=0;this.length=b.length}a.prototype[d.SymbolShim.iterator]=function(){return this};a.prototype.next=function(a){a=this.index++;var b=this.array;
return a<this.length?{value:b[a],done:!1}:{done:!0}};a.prototype.hasValue=function(){return this.array.length>this.index};a.prototype.hasCompleted=function(){return this.array.length===this.index};return a}(),q=function(a){function b(c,d,f,e){a.call(this,c);this.parent=d;this.observable=f;this.index=e;this.stillUnsubscribed=!0;this.buffer=[];this.isComplete=!1}h(b,a);b.prototype[d.SymbolShim.iterator]=function(){return this};b.prototype.next=function(){var a=this.buffer;return 0===a.length&&this.isComplete?
{done:!0}:{value:a.shift(),done:!1}};b.prototype.hasValue=function(){return 0<this.buffer.length};b.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete};b.prototype.notifyComplete=function(){0<this.buffer.length?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()};b.prototype.notifyNext=function(a,b,c,d){this.buffer.push(b);this.parent.checkIterators()};b.prototype.subscribe=function(a,b){this.add(f.subscribeToResult(this,this.observable,this,
b))};return b}(l.OuterSubscriber)},{"../OuterSubscriber":4,"../Subscriber":7,"../util/SymbolShim":229,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],208:[function(a,b,e){var h=a("./zip-static");e.zipProto=function(){for(var a=[],b=0;b<arguments.length;b++)a[b-0]=arguments[b];a.unshift(this);return h.zip.apply(this,a)}},{"./zip-static":206}],209:[function(a,b,e){var h=a("./zip-support");e.zipAll=function(a){return this.lift(new h.ZipOperator(a))}},{"./zip-support":207}],
210:[function(a,b,e){var h=this&&this.__extends||function(a,b){function f(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(f.prototype=b.prototype,new f)},k=a("../util/Immediate");a=function(a){function b(){a.apply(this,arguments)}h(b,a);b.prototype.schedule=function(a){var b=this;if(this.isUnsubscribed)return this;this.state=a;a=this.scheduler;a.actions.push(this);a.scheduled||(a.scheduled=!0,this.id=k.Immediate.setImmediate(function(){b.id=
null;b.scheduler.scheduled=!1;b.scheduler.flush()}));return this};b.prototype.unsubscribe=function(){var b=this.id,d=this.scheduler;a.prototype.unsubscribe.call(this);0===d.actions.length&&(d.active=!1,d.scheduled=!1);b&&(this.id=null,k.Immediate.clearImmediate(b))};return b}(a("./QueueAction").QueueAction);e.AsapAction=a},{"../util/Immediate":225,"./QueueAction":213}],211:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var c in b)b.hasOwnProperty(c)&&
(a[c]=b[c]);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)};b=a("./QueueScheduler");var k=a("./AsapAction"),m=a("./QueueAction");a=function(a){function b(){a.apply(this,arguments)}h(b,a);b.prototype.scheduleNow=function(a,b){return(this.scheduled?new m.QueueAction(this,a):new k.AsapAction(this,a)).schedule(b)};return b}(b.QueueScheduler);e.AsapScheduler=a},{"./AsapAction":210,"./QueueAction":213,"./QueueScheduler":214}],212:[function(a,b,e){var h=this&&this.__extends||function(a,
b){function e(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===b?Object.create(b):(e.prototype=b.prototype,new e)};a=function(a){function b(e,f){a.call(this,e,f);this.scheduler=e;this.work=f}h(b,a);b.prototype.schedule=function(a,b){var d=this;void 0===b&&(b=0);if(this.isUnsubscribed)return this;this.delay=b;this.state=a;var c=this.id;null!=c&&(this.id=void 0,clearTimeout(c));var e=this.scheduler;this.id=setTimeout(function(){d.id=void 0;e.actions.push(d);e.flush()},
this.delay);return this};b.prototype.unsubscribe=function(){var b=this.id;null!=b&&(this.id=void 0,clearTimeout(b));a.prototype.unsubscribe.call(this)};return b}(a("./QueueAction").QueueAction);e.FutureAction=a},{"./QueueAction":213}],213:[function(a,b,e){var h=this&&this.__extends||function(a,b){function e(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===b?Object.create(b):(e.prototype=b.prototype,new e)};a=function(a){function b(e,f){a.call(this);this.scheduler=
e;this.work=f}h(b,a);b.prototype.schedule=function(a){if(this.isUnsubscribed)return this;this.state=a;a=this.scheduler;a.actions.push(this);a.flush();return this};b.prototype.execute=function(){if(this.isUnsubscribed)throw Error("How did did we execute a canceled Action?");this.work(this.state)};b.prototype.unsubscribe=function(){var b=this.scheduler.actions,f=b.indexOf(this);this.scheduler=this.state=this.work=void 0;-1!==f&&b.splice(f,1);a.prototype.unsubscribe.call(this)};return b}(a("../Subscription").Subscription);
e.QueueAction=a},{"../Subscription":8}],214:[function(a,b,e){var h=a("./QueueAction"),k=a("./FutureAction");a=function(){function a(){this.actions=[];this.scheduled=this.active=!1}a.prototype.now=function(){return Date.now()};a.prototype.flush=function(){if(!this.active&&!this.scheduled){this.active=!0;for(var a=this.actions,b=void 0;b=a.shift();)b.execute();this.active=!1}};a.prototype.schedule=function(a,b,d){void 0===b&&(b=0);return 0>=b?this.scheduleNow(a,d):this.scheduleLater(a,b,d)};a.prototype.scheduleNow=
function(a,b){return(new h.QueueAction(this,a)).schedule(b)};a.prototype.scheduleLater=function(a,b,d){return(new k.FutureAction(this,a)).schedule(d,b)};return a}();e.QueueScheduler=a},{"./FutureAction":212,"./QueueAction":213}],215:[function(a,b,e){a=a("./AsapScheduler");e.asap=new a.AsapScheduler},{"./AsapScheduler":211}],216:[function(a,b,e){a=a("./QueueScheduler");e.queue=new a.QueueScheduler},{"./QueueScheduler":214}],217:[function(a,b,e){var h=this&&this.__extends||function(a,b){function e(){this.constructor=
a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===b?Object.create(b):(e.prototype=b.prototype,new e)};a=function(a){function b(){a.call(this);this._value=void 0;this._isScalar=this._hasNext=!1}h(b,a);b.prototype._subscribe=function(b){this.completeSignal&&this._hasNext&&b.next(this._value);return a.prototype._subscribe.call(this,b)};b.prototype._next=function(a){this._value=a;this._hasNext=!0};b.prototype._complete=function(){var a=-1,b=this.observers,d=b.length;this.observers=
void 0;this.isUnsubscribed=!0;if(this._hasNext)for(;++a<d;){var c=b[a];c.next(this._value);c.complete()}else for(;++a<d;)b[a].complete();this.isUnsubscribed=!1};return b}(a("../Subject").Subject);e.AsyncSubject=a},{"../Subject":6}],218:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)};b=a("../Subject");var k=a("../util/throwError"),m=a("../util/ObjectUnsubscribedError");
a=function(a){function b(d){a.call(this);this._value=d;this._hasError=!1}h(b,a);b.prototype.getValue=function(){if(this._hasError)k.throwError(this._err);else if(this.isUnsubscribed)k.throwError(new m.ObjectUnsubscribedError);else return this._value};Object.defineProperty(b.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0});b.prototype._subscribe=function(b){var c=a.prototype._subscribe.call(this,b);if(c)return c.isUnsubscribed||b.next(this._value),c};b.prototype._next=
function(b){a.prototype._next.call(this,this._value=b)};b.prototype._error=function(b){this._hasError=!0;a.prototype._error.call(this,this._err=b)};return b}(b.Subject);e.BehaviorSubject=a},{"../Subject":6,"../util/ObjectUnsubscribedError":228,"../util/throwError":240}],219:[function(a,b,e){var h=this&&this.__extends||function(a,b){function d(){this.constructor=a}for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)};b=a("../Subject");
var k=a("../scheduler/queue");a=function(a){function b(d,c,f){void 0===d&&(d=Number.POSITIVE_INFINITY);void 0===c&&(c=Number.POSITIVE_INFINITY);a.call(this);this.events=[];this.bufferSize=1>d?1:d;this._windowTime=1>c?1:c;this.scheduler=f}h(b,a);b.prototype._next=function(b){var c=this._getNow();this.events.push(new m(c,b));this._trimBufferThenGetEvents(c);a.prototype._next.call(this,b)};b.prototype._subscribe=function(b){for(var c=this._trimBufferThenGetEvents(this._getNow()),f=-1,e=c.length;!b.isUnsubscribed&&
++f<e;)b.next(c[f].value);return a.prototype._subscribe.call(this,b)};b.prototype._getNow=function(){return(this.scheduler||k.queue).now()};b.prototype._trimBufferThenGetEvents=function(a){for(var b=this.bufferSize,f=this._windowTime,e=this.events,h=e.length,k=0;k<h&&!(a-e[k].time<f);)k+=1;h>b&&(k=Math.max(k,h-b));0<k&&e.splice(0,k);return e};return b}(b.Subject);e.ReplaySubject=a;var m=function(){return function(a,b){this.time=a;this.value=b}}()},{"../Subject":6,"../scheduler/queue":216}],220:[function(a,
b,e){var h=this&&this.__extends||function(a,b){function f(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(f.prototype=b.prototype,new f)};b=a("../Subscription");var k=a("../Subscriber");a=function(a){function b(f,d){a.call(this);this.subject=f;this.observer=d;this.isUnsubscribed=!1}h(b,a);b.prototype.unsubscribe=function(){if(!this.isUnsubscribed){this.isUnsubscribed=!0;var a=this.subject,b=a.observers;this.subject=void 0;b&&0!==b.length&&
!a.isUnsubscribed&&(this.observer instanceof k.Subscriber&&this.observer.unsubscribe(),a=b.indexOf(this.observer),-1!==a&&b.splice(a,1))}};return b}(b.Subscription);e.SubjectSubscription=a},{"../Subscriber":7,"../Subscription":8}],221:[function(a,b,e){a=a("../util/SymbolShim");e.rxSubscriber=a.SymbolShim.for("rxSubscriber")},{"../util/SymbolShim":229}],222:[function(a,b,e){a=function(){return function(){this.name="ArgumentOutOfRangeError";this.message="argument out of range"}}();e.ArgumentOutOfRangeError=
a},{}],223:[function(a,b,e){a=function(){return function(){this.name="EmptyError";this.message="no elements in sequence"}}();e.EmptyError=a},{}],224:[function(a,b,e){a=function(){function a(){this.values={}}a.prototype.delete=function(a){this.values[a]=null;return!0};a.prototype.set=function(a,b){this.values[a]=b;return this};a.prototype.get=function(a){return this.values[a]};a.prototype.forEach=function(a,b){var e=this.values,f;for(f in e)e.hasOwnProperty(f)&&null!==e[f]&&a.call(b,e[f],f)};a.prototype.clear=
function(){this.values={}};return a}();e.FastMap=a},{}],225:[function(a,b,e){a=a("./root");b=function(){function a(b){this.root=b;b.setImmediate?(this.setImmediate=b.setImmediate,this.clearImmediate=b.clearImmediate):(this.nextHandle=1,this.tasksByHandle={},this.currentlyRunningATask=!1,this.canUseProcessNextTick()?this.setImmediate=this.createProcessNextTickSetImmediate():this.canUsePostMessage()?this.setImmediate=this.createPostMessageSetImmediate():this.canUseMessageChannel()?this.setImmediate=
this.createMessageChannelSetImmediate():this.canUseReadyStateChange()?this.setImmediate=this.createReadyStateChangeSetImmediate():this.setImmediate=this.createSetTimeoutSetImmediate(),b=function l(a){delete l.instance.tasksByHandle[a]},b.instance=this,this.clearImmediate=b)}a.prototype.identify=function(a){return this.root.Object.prototype.toString.call(a)};a.prototype.canUseProcessNextTick=function(){return"[object process]"===this.identify(this.root.process)};a.prototype.canUseMessageChannel=function(){return Boolean(this.root.MessageChannel)};
a.prototype.canUseReadyStateChange=function(){var a=this.root.document;return Boolean(a&&"onreadystatechange"in a.createElement("script"))};a.prototype.canUsePostMessage=function(){var a=this.root;if(a.postMessage&&!a.importScripts){var b=!0,e=a.onmessage;a.onmessage=function(){b=!1};a.postMessage("","*");a.onmessage=e;return b}return!1};a.prototype.partiallyApplied=function(a){for(var b=[],e=1;e<arguments.length;e++)b[e-1]=arguments[e];e=function d(){var a=d.handler,b=d.args;"function"===typeof a?
a.apply(void 0,b):(new Function(""+a))()};e.handler=a;e.args=b;return e};a.prototype.addFromSetImmediateArguments=function(a){this.tasksByHandle[this.nextHandle]=this.partiallyApplied.apply(void 0,a);return this.nextHandle++};a.prototype.createProcessNextTickSetImmediate=function(){var a=function l(){var a=l.instance,b=a.addFromSetImmediateArguments(arguments);a.root.process.nextTick(a.partiallyApplied(a.runIfPresent,b));return b};a.instance=this;return a};a.prototype.createPostMessageSetImmediate=
function(){var a=this.root,b="setImmediate$"+a.Math.random()+"$",e=function d(c){var e=d.instance;c.source===a&&"string"===typeof c.data&&0===c.data.indexOf(b)&&e.runIfPresent(+c.data.slice(b.length))};e.instance=this;a.addEventListener("message",e,!1);e=function c(){var a=c,b=a.messagePrefix,a=a.instance,e=a.addFromSetImmediateArguments(arguments);a.root.postMessage(b+e,"*");return e};e.instance=this;e.messagePrefix=b;return e};a.prototype.runIfPresent=function(a){if(this.currentlyRunningATask)this.root.setTimeout(this.partiallyApplied(this.runIfPresent,
a),0);else{var b=this.tasksByHandle[a];if(b){this.currentlyRunningATask=!0;try{b()}finally{this.clearImmediate(a),this.currentlyRunningATask=!1}}}};a.prototype.createMessageChannelSetImmediate=function(){var a=this,b=new this.root.MessageChannel;b.port1.onmessage=function(b){a.runIfPresent(b.data)};var e=function d(){var a=d,b=a.channel,a=a.instance.addFromSetImmediateArguments(arguments);b.port2.postMessage(a);return a};e.channel=b;e.instance=this;return e};a.prototype.createReadyStateChangeSetImmediate=
function(){var a=function l(){var a=l.instance,b=a.root.document,c=b.documentElement,e=a.addFromSetImmediateArguments(arguments),h=b.createElement("script");h.onreadystatechange=function(){a.runIfPresent(e);h.onreadystatechange=null;c.removeChild(h);h=null};c.appendChild(h);return e};a.instance=this;return a};a.prototype.createSetTimeoutSetImmediate=function(){var a=function l(){var a=l.instance,b=a.addFromSetImmediateArguments(arguments);a.root.setTimeout(a.partiallyApplied(a.runIfPresent,b),0);
return b};a.instance=this;return a};return a}();e.ImmediateDefinition=b;e.Immediate=new b(a.root)},{"./root":238}],226:[function(a,b,e){b=a("./root");a=a("./MapPolyfill");e.Map=b.root.Map||a.MapPolyfill},{"./MapPolyfill":227,"./root":238}],227:[function(a,b,e){a=function(){function a(){this.size=0;this._values=[];this._keys=[]}a.prototype.get=function(a){a=this._keys.indexOf(a);return-1===a?void 0:this._values[a]};a.prototype.set=function(a,b){var e=this._keys.indexOf(a);-1===e?(this._keys.push(a),
this._values.push(b),this.size++):this._values[e]=b;return this};a.prototype.delete=function(a){a=this._keys.indexOf(a);if(-1===a)return!1;this._values.splice(a,1);this._keys.splice(a,1);this.size--;return!0};a.prototype.forEach=function(a,b){for(var e=0;e<this.size;e++)a.call(b,this._values[e],this._keys[e])};return a}();e.MapPolyfill=a},{}],228:[function(a,b,e){var h=this&&this.__extends||function(a,b){function e(){this.constructor=a}for(var f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);a.prototype=null===
b?Object.create(b):(e.prototype=b.prototype,new e)};a=function(a){function b(){a.call(this,"object unsubscribed");this.name="ObjectUnsubscribedError"}h(b,a);return b}(Error);e.ObjectUnsubscribedError=a},{}],229:[function(a,b,e){function h(a){var b=m(a);f(b,a);d(b);k(b);return b}function k(a){a.for||(a.for=l)}function m(a){a.Symbol||(a.Symbol=function(a){return"@@Symbol("+a+"):"+c++});return a.Symbol}function l(a){return"@@"+a}function f(a,b){if(!a.iterator)if("function"===typeof a.for)a.iterator=
a.for("iterator");else if(b.Set&&"function"===typeof(new b.Set)["@@iterator"])a.iterator="@@iterator";else if(b.Map)for(var c=Object.getOwnPropertyNames(b.Map.prototype),d=0;d<c.length;++d){var e=c[d];if("entries"!==e&&"size"!==e&&b.Map.prototype[e]===b.Map.prototype.entries){a.iterator=e;break}}else a.iterator="@@iterator"}function d(a){a.observable||(a.observable="function"===typeof a.for?a.for("observable"):"@@observable")}a=a("./root");e.polyfillSymbol=h;e.ensureFor=k;var c=0;e.ensureSymbol=m;
e.symbolForPolyfill=l;e.ensureIterator=f;e.ensureObservable=d;e.SymbolShim=h(a.root)},{"./root":238}],230:[function(a,b,e){e.errorObject={e:{}}},{}],231:[function(a,b,e){e.isArray=Array.isArray||function(a){return a&&"number"===typeof a.length}},{}],232:[function(a,b,e){e.isDate=function(a){return a instanceof Date&&!isNaN(+a)}},{}],233:[function(a,b,e){var h=Array.isArray;e.isNumeric=function(a){return!h(a)&&0<=a-parseFloat(a)+1}},{}],234:[function(a,b,e){e.isPromise=function(a){return a&&"function"!==
typeof a.subscribe&&"function"===typeof a.then}},{}],235:[function(a,b,e){e.isScheduler=function(a){return a&&"function"===typeof a.schedule}},{}],236:[function(a,b,e){e.noop=function(){}},{}],237:[function(a,b,e){e.not=function(a,b){function e(){return!e.pred.apply(e.thisArg,arguments)}e.pred=a;e.thisArg=b;return e}},{}],238:[function(a,b,e){a="undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{};b={"boolean":!1,"function":!0,object:!0,number:!1,
string:!1,undefined:!1};e.root=b[typeof self]&&self||b[typeof window]&&window;!(a=b[typeof a]&&a)||a.global!==a&&a.window!==a||(e.root=a)},{}],239:[function(a,b,e){var h=a("../Observable"),k=a("../util/SymbolShim"),m=a("../InnerSubscriber"),l=Array.isArray;e.subscribeToResult=function(a,b,c,e){var n=new m.InnerSubscriber(a,c,e);if(!n.isUnsubscribed){if(b instanceof h.Observable){if(b._isScalar){n.next(b.value);n.complete();return}return b.subscribe(n)}if(l(b)){a=0;for(c=b.length;a<c&&!n.isUnsubscribed;a++)n.next(b[a]);
n.isUnsubscribed||n.complete()}else{if("function"===typeof b.then)return b.then(function(a){n.isUnsubscribed||(n.next(a),n.complete())},function(a){return n.error(a)}).then(null,function(a){setTimeout(function(){throw a;})}),n;if("function"===typeof b[k.SymbolShim.iterator]){for(a=0;a<b.length&&(n.next(b[a]),!n.isUnsubscribed);a++);n.isUnsubscribed||n.complete()}else if("function"===typeof b[k.SymbolShim.observable])if(b=b[k.SymbolShim.observable](),"function"!==typeof b.subscribe)n.error("invalid observable");
else return b.subscribe(new m.InnerSubscriber(a,c,e));else n.error(new TypeError("unknown type returned"))}}}},{"../InnerSubscriber":1,"../Observable":3,"../util/SymbolShim":229}],240:[function(a,b,e){e.throwError=function(a){throw a;}},{}],241:[function(a,b,e){function h(){try{return m.apply(this,arguments)}catch(a){return k.errorObject.e=a,k.errorObject}}var k=a("./errorObject"),m;e.tryCatch=function(a){m=a;return h}},{"./errorObject":230}],242:[function(a,b,e){e.tryOrOnError=function(a){function b(){try{b.target.apply(this,
arguments)}catch(a){this.error(a)}}b.target=a;return b}},{}]},{},[5])(5)});

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -30,8 +30,7 @@ module.exports = function(config) {
'reflect-metadata/*.js',
'reflect-metadata/*.ts',
'reflect-metadata/*.d.ts',
'rxjs/bundles/*.js',
'rxjs/Rx.d.ts',
'rxjs/**/*',
],
dest: '<%= srcDir %>/vendor/npm'
}