UNPKG

angular2

Version:

Angular 2 - a web framework for modern web apps

1,649 lines (1,630 loc) 1.09 MB
"format register"; System.register("angular2/src/facade/lang", [], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; var __extends = (this && this.__extends) || function(d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var globalScope; if (typeof window === 'undefined') { if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) { globalScope = self; } else { globalScope = global; } } else { globalScope = window; } function scheduleMicroTask(fn) { Zone.current.scheduleMicroTask('scheduleMicrotask', fn); } exports.scheduleMicroTask = scheduleMicroTask; exports.IS_DART = false; var _global = globalScope; exports.global = _global; exports.Type = Function; function getTypeNameForDebugging(type) { if (type['name']) { return type['name']; } return typeof type; } exports.getTypeNameForDebugging = getTypeNameForDebugging; exports.Math = _global.Math; exports.Date = _global.Date; var _devMode = true; var _modeLocked = false; function lockMode() { _modeLocked = true; } exports.lockMode = lockMode; function enableProdMode() { if (_modeLocked) { throw 'Cannot enable prod mode after platform setup.'; } _devMode = false; } exports.enableProdMode = enableProdMode; function assertionsEnabled() { return _devMode; } exports.assertionsEnabled = assertionsEnabled; _global.assert = function assert(condition) {}; function CONST_EXPR(expr) { return expr; } exports.CONST_EXPR = CONST_EXPR; function CONST() { return function(target) { return target; }; } exports.CONST = CONST; function isPresent(obj) { return obj !== undefined && obj !== null; } exports.isPresent = isPresent; function isBlank(obj) { return obj === undefined || obj === null; } exports.isBlank = isBlank; function isBoolean(obj) { return typeof obj === "boolean"; } exports.isBoolean = isBoolean; function isNumber(obj) { return typeof obj === "number"; } exports.isNumber = isNumber; function isString(obj) { return typeof obj === "string"; } exports.isString = isString; function isFunction(obj) { return typeof obj === "function"; } exports.isFunction = isFunction; function isType(obj) { return isFunction(obj); } exports.isType = isType; function isStringMap(obj) { return typeof obj === 'object' && obj !== null; } exports.isStringMap = isStringMap; function isPromise(obj) { return obj instanceof _global.Promise; } exports.isPromise = isPromise; function isArray(obj) { return Array.isArray(obj); } exports.isArray = isArray; function isDate(obj) { return obj instanceof exports.Date && !isNaN(obj.valueOf()); } exports.isDate = isDate; function noop() {} exports.noop = noop; function stringify(token) { if (typeof token === 'string') { return token; } if (token === undefined || token === null) { return '' + token; } if (token.name) { return token.name; } if (token.overriddenName) { return token.overriddenName; } var res = token.toString(); var newLineIndex = res.indexOf("\n"); return (newLineIndex === -1) ? res : res.substring(0, newLineIndex); } exports.stringify = stringify; function serializeEnum(val) { return val; } exports.serializeEnum = serializeEnum; function deserializeEnum(val, values) { return val; } exports.deserializeEnum = deserializeEnum; function resolveEnumToken(enumValue, val) { return enumValue[val]; } exports.resolveEnumToken = resolveEnumToken; var StringWrapper = (function() { function StringWrapper() {} StringWrapper.fromCharCode = function(code) { return String.fromCharCode(code); }; StringWrapper.charCodeAt = function(s, index) { return s.charCodeAt(index); }; StringWrapper.split = function(s, regExp) { return s.split(regExp); }; StringWrapper.equals = function(s, s2) { return s === s2; }; StringWrapper.stripLeft = function(s, charVal) { if (s && s.length) { var pos = 0; for (var i = 0; i < s.length; i++) { if (s[i] != charVal) break; pos++; } s = s.substring(pos); } return s; }; StringWrapper.stripRight = function(s, charVal) { if (s && s.length) { var pos = s.length; for (var i = s.length - 1; i >= 0; i--) { if (s[i] != charVal) break; pos--; } s = s.substring(0, pos); } return s; }; StringWrapper.replace = function(s, from, replace) { return s.replace(from, replace); }; StringWrapper.replaceAll = function(s, from, replace) { return s.replace(from, replace); }; StringWrapper.slice = function(s, from, to) { if (from === void 0) { from = 0; } if (to === void 0) { to = null; } return s.slice(from, to === null ? undefined : to); }; StringWrapper.replaceAllMapped = function(s, from, cb) { return s.replace(from, function() { var matches = []; for (var _i = 0; _i < arguments.length; _i++) { matches[_i - 0] = arguments[_i]; } matches.splice(-2, 2); return cb(matches); }); }; StringWrapper.contains = function(s, substr) { return s.indexOf(substr) != -1; }; StringWrapper.compare = function(a, b) { if (a < b) { return -1; } else if (a > b) { return 1; } else { return 0; } }; return StringWrapper; }()); exports.StringWrapper = StringWrapper; var StringJoiner = (function() { function StringJoiner(parts) { if (parts === void 0) { parts = []; } this.parts = parts; } StringJoiner.prototype.add = function(part) { this.parts.push(part); }; StringJoiner.prototype.toString = function() { return this.parts.join(""); }; return StringJoiner; }()); exports.StringJoiner = StringJoiner; var NumberParseError = (function(_super) { __extends(NumberParseError, _super); function NumberParseError(message) { _super.call(this); this.message = message; } NumberParseError.prototype.toString = function() { return this.message; }; return NumberParseError; }(Error)); exports.NumberParseError = NumberParseError; var NumberWrapper = (function() { function NumberWrapper() {} NumberWrapper.toFixed = function(n, fractionDigits) { return n.toFixed(fractionDigits); }; NumberWrapper.equal = function(a, b) { return a === b; }; NumberWrapper.parseIntAutoRadix = function(text) { var result = parseInt(text); if (isNaN(result)) { throw new NumberParseError("Invalid integer literal when parsing " + text); } return result; }; NumberWrapper.parseInt = function(text, radix) { if (radix == 10) { if (/^(\-|\+)?[0-9]+$/.test(text)) { return parseInt(text, radix); } } else if (radix == 16) { if (/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(text)) { return parseInt(text, radix); } } else { var result = parseInt(text, radix); if (!isNaN(result)) { return result; } } throw new NumberParseError("Invalid integer literal when parsing " + text + " in base " + radix); }; NumberWrapper.parseFloat = function(text) { return parseFloat(text); }; Object.defineProperty(NumberWrapper, "NaN", { get: function() { return NaN; }, enumerable: true, configurable: true }); NumberWrapper.isNaN = function(value) { return isNaN(value); }; NumberWrapper.isInteger = function(value) { return Number.isInteger(value); }; return NumberWrapper; }()); exports.NumberWrapper = NumberWrapper; exports.RegExp = _global.RegExp; var RegExpWrapper = (function() { function RegExpWrapper() {} RegExpWrapper.create = function(regExpStr, flags) { if (flags === void 0) { flags = ''; } flags = flags.replace(/g/g, ''); return new _global.RegExp(regExpStr, flags + 'g'); }; RegExpWrapper.firstMatch = function(regExp, input) { regExp.lastIndex = 0; return regExp.exec(input); }; RegExpWrapper.test = function(regExp, input) { regExp.lastIndex = 0; return regExp.test(input); }; RegExpWrapper.matcher = function(regExp, input) { regExp.lastIndex = 0; return { re: regExp, input: input }; }; RegExpWrapper.replaceAll = function(regExp, input, replace) { var c = regExp.exec(input); var res = ''; regExp.lastIndex = 0; var prev = 0; while (c) { res += input.substring(prev, c.index); res += replace(c); prev = c.index + c[0].length; regExp.lastIndex = prev; c = regExp.exec(input); } res += input.substring(prev); return res; }; return RegExpWrapper; }()); exports.RegExpWrapper = RegExpWrapper; var RegExpMatcherWrapper = (function() { function RegExpMatcherWrapper() {} RegExpMatcherWrapper.next = function(matcher) { return matcher.re.exec(matcher.input); }; return RegExpMatcherWrapper; }()); exports.RegExpMatcherWrapper = RegExpMatcherWrapper; var FunctionWrapper = (function() { function FunctionWrapper() {} FunctionWrapper.apply = function(fn, posArgs) { return fn.apply(null, posArgs); }; return FunctionWrapper; }()); exports.FunctionWrapper = FunctionWrapper; function looseIdentical(a, b) { return a === b || typeof a === "number" && typeof b === "number" && isNaN(a) && isNaN(b); } exports.looseIdentical = looseIdentical; function getMapKey(value) { return value; } exports.getMapKey = getMapKey; function normalizeBlank(obj) { return isBlank(obj) ? null : obj; } exports.normalizeBlank = normalizeBlank; function normalizeBool(obj) { return isBlank(obj) ? false : obj; } exports.normalizeBool = normalizeBool; function isJsObject(o) { return o !== null && (typeof o === "function" || typeof o === "object"); } exports.isJsObject = isJsObject; function print(obj) { console.log(obj); } exports.print = print; function warn(obj) { console.warn(obj); } exports.warn = warn; var Json = (function() { function Json() {} Json.parse = function(s) { return _global.JSON.parse(s); }; Json.stringify = function(data) { return _global.JSON.stringify(data, null, 2); }; return Json; }()); exports.Json = Json; var DateWrapper = (function() { function DateWrapper() {} DateWrapper.create = function(year, month, day, hour, minutes, seconds, milliseconds) { if (month === void 0) { month = 1; } if (day === void 0) { day = 1; } if (hour === void 0) { hour = 0; } if (minutes === void 0) { minutes = 0; } if (seconds === void 0) { seconds = 0; } if (milliseconds === void 0) { milliseconds = 0; } return new exports.Date(year, month - 1, day, hour, minutes, seconds, milliseconds); }; DateWrapper.fromISOString = function(str) { return new exports.Date(str); }; DateWrapper.fromMillis = function(ms) { return new exports.Date(ms); }; DateWrapper.toMillis = function(date) { return date.getTime(); }; DateWrapper.now = function() { return new exports.Date(); }; DateWrapper.toJson = function(date) { return date.toJSON(); }; return DateWrapper; }()); exports.DateWrapper = DateWrapper; function setValueOnPath(global, path, value) { var parts = path.split('.'); var obj = global; while (parts.length > 1) { var name = parts.shift(); if (obj.hasOwnProperty(name) && isPresent(obj[name])) { obj = obj[name]; } else { obj = obj[name] = {}; } } if (obj === undefined || obj === null) { obj = {}; } obj[parts.shift()] = value; } exports.setValueOnPath = setValueOnPath; var _symbolIterator = null; function getSymbolIterator() { if (isBlank(_symbolIterator)) { if (isPresent(globalScope.Symbol) && isPresent(Symbol.iterator)) { _symbolIterator = Symbol.iterator; } else { var keys = Object.getOwnPropertyNames(Map.prototype); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (key !== 'entries' && key !== 'size' && Map.prototype[key] === Map.prototype['entries']) { _symbolIterator = key; } } } } return _symbolIterator; } exports.getSymbolIterator = getSymbolIterator; function evalExpression(sourceUrl, expr, declarations, vars) { var fnBody = declarations + "\nreturn " + expr + "\n//# sourceURL=" + sourceUrl; var fnArgNames = []; var fnArgValues = []; for (var argName in vars) { fnArgNames.push(argName); fnArgValues.push(vars[argName]); } return new (Function.bind.apply(Function, [void 0].concat(fnArgNames.concat(fnBody))))().apply(void 0, fnArgValues); } exports.evalExpression = evalExpression; function isPrimitive(obj) { return !isJsObject(obj); } exports.isPrimitive = isPrimitive; function hasConstructor(value, type) { return value.constructor === type; } exports.hasConstructor = hasConstructor; function bitWiseOr(values) { return values.reduce(function(a, b) { return a | b; }); } exports.bitWiseOr = bitWiseOr; function bitWiseAnd(values) { return values.reduce(function(a, b) { return a & b; }); } exports.bitWiseAnd = bitWiseAnd; function escape(s) { return _global.encodeURI(s); } exports.escape = escape; global.define = __define; return module.exports; }); System.register("angular2/src/facade/promise", [], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; var PromiseCompleter = (function() { function PromiseCompleter() { var _this = this; this.promise = new Promise(function(res, rej) { _this.resolve = res; _this.reject = rej; }); } return PromiseCompleter; }()); exports.PromiseCompleter = PromiseCompleter; var PromiseWrapper = (function() { function PromiseWrapper() {} PromiseWrapper.resolve = function(obj) { return Promise.resolve(obj); }; PromiseWrapper.reject = function(obj, _) { return Promise.reject(obj); }; PromiseWrapper.catchError = function(promise, onError) { return promise.catch(onError); }; PromiseWrapper.all = function(promises) { if (promises.length == 0) return Promise.resolve([]); return Promise.all(promises); }; PromiseWrapper.then = function(promise, success, rejection) { return promise.then(success, rejection); }; PromiseWrapper.wrap = function(computation) { return new Promise(function(res, rej) { try { res(computation()); } catch (e) { rej(e); } }); }; PromiseWrapper.scheduleMicrotask = function(computation) { PromiseWrapper.then(PromiseWrapper.resolve(null), computation, function(_) {}); }; PromiseWrapper.isPromise = function(obj) { return obj instanceof Promise; }; PromiseWrapper.completer = function() { return new PromiseCompleter(); }; return PromiseWrapper; }()); exports.PromiseWrapper = PromiseWrapper; global.define = __define; return module.exports; }); System.register("rxjs/util/root", [], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; var objectTypes = { 'boolean': false, 'function': true, 'object': true, 'number': false, 'string': false, 'undefined': false }; exports.root = (objectTypes[typeof self] && self) || (objectTypes[typeof window] && window); var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; var freeGlobal = objectTypes[typeof global] && global; if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { exports.root = freeGlobal; } global.define = __define; return module.exports; }); System.register("rxjs/symbol/observable", ["rxjs/util/root"], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; var root_1 = require("rxjs/util/root"); var Symbol = root_1.root.Symbol; if (typeof Symbol === 'function') { if (Symbol.observable) { exports.$$observable = Symbol.observable; } else { if (typeof Symbol.for === 'function') { exports.$$observable = Symbol.for('observable'); } else { exports.$$observable = Symbol('observable'); } Symbol.observable = exports.$$observable; } } else { exports.$$observable = '@@observable'; } global.define = __define; return module.exports; }); System.register("rxjs/util/isFunction", [], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; function isFunction(x) { return typeof x === 'function'; } exports.isFunction = isFunction; global.define = __define; return module.exports; }); System.register("rxjs/util/isArray", [], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; exports.isArray = Array.isArray || (function(x) { return x && typeof x.length === 'number'; }); global.define = __define; return module.exports; }); System.register("rxjs/util/isObject", [], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; function isObject(x) { return x != null && typeof x === 'object'; } exports.isObject = isObject; global.define = __define; return module.exports; }); System.register("rxjs/util/errorObject", [], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; exports.errorObject = {e: {}}; global.define = __define; return module.exports; }); System.register("rxjs/util/UnsubscriptionError", [], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; var __extends = (this && this.__extends) || function(d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var UnsubscriptionError = (function(_super) { __extends(UnsubscriptionError, _super); function UnsubscriptionError(errors) { _super.call(this); this.errors = errors; this.name = 'UnsubscriptionError'; this.message = errors ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function(err, i) { return ((i + 1) + ") " + err.toString()); }).join('\n') : ''; } return UnsubscriptionError; }(Error)); exports.UnsubscriptionError = UnsubscriptionError; global.define = __define; return module.exports; }); System.register("rxjs/symbol/rxSubscriber", ["rxjs/util/root"], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; var root_1 = require("rxjs/util/root"); var Symbol = root_1.root.Symbol; exports.$$rxSubscriber = (typeof Symbol === 'function' && typeof Symbol.for === 'function') ? Symbol.for('rxSubscriber') : '@@rxSubscriber'; global.define = __define; return module.exports; }); System.register("rxjs/Observer", [], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; exports.empty = { isUnsubscribed: true, next: function(value) {}, error: function(err) { throw err; }, complete: function() {} }; global.define = __define; return module.exports; }); System.register("rxjs/SubjectSubscription", ["rxjs/Subscription"], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; var __extends = (this && this.__extends) || function(d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Subscription_1 = require("rxjs/Subscription"); var SubjectSubscription = (function(_super) { __extends(SubjectSubscription, _super); function SubjectSubscription(subject, observer) { _super.call(this); this.subject = subject; this.observer = observer; this.isUnsubscribed = false; } SubjectSubscription.prototype.unsubscribe = function() { if (this.isUnsubscribed) { return ; } this.isUnsubscribed = true; var subject = this.subject; var observers = subject.observers; this.subject = null; if (!observers || observers.length === 0 || subject.isUnsubscribed) { return ; } var subscriberIndex = observers.indexOf(this.observer); if (subscriberIndex !== -1) { observers.splice(subscriberIndex, 1); } }; return SubjectSubscription; }(Subscription_1.Subscription)); exports.SubjectSubscription = SubjectSubscription; global.define = __define; return module.exports; }); System.register("rxjs/util/throwError", [], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; function throwError(e) { throw e; } exports.throwError = throwError; global.define = __define; return module.exports; }); System.register("rxjs/util/ObjectUnsubscribedError", [], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; var __extends = (this && this.__extends) || function(d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var ObjectUnsubscribedError = (function(_super) { __extends(ObjectUnsubscribedError, _super); function ObjectUnsubscribedError() { _super.call(this, 'object unsubscribed'); this.name = 'ObjectUnsubscribedError'; } return ObjectUnsubscribedError; }(Error)); exports.ObjectUnsubscribedError = ObjectUnsubscribedError; global.define = __define; return module.exports; }); System.register("rxjs/observable/PromiseObservable", ["rxjs/util/root", "rxjs/Observable"], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; var __extends = (this && this.__extends) || function(d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var root_1 = require("rxjs/util/root"); var Observable_1 = require("rxjs/Observable"); var PromiseObservable = (function(_super) { __extends(PromiseObservable, _super); function PromiseObservable(promise, scheduler) { if (scheduler === void 0) { scheduler = null; } _super.call(this); this.promise = promise; this.scheduler = scheduler; } PromiseObservable.create = function(promise, scheduler) { if (scheduler === void 0) { scheduler = null; } return new PromiseObservable(promise, scheduler); }; PromiseObservable.prototype._subscribe = function(subscriber) { var _this = this; var promise = this.promise; var scheduler = this.scheduler; if (scheduler == null) { if (this._isScalar) { if (!subscriber.isUnsubscribed) { subscriber.next(this.value); subscriber.complete(); } } else { promise.then(function(value) { _this.value = value; _this._isScalar = true; if (!subscriber.isUnsubscribed) { subscriber.next(value); subscriber.complete(); } }, function(err) { if (!subscriber.isUnsubscribed) { subscriber.error(err); } }).then(null, function(err) { root_1.root.setTimeout(function() { throw err; }); }); } } else { if (this._isScalar) { if (!subscriber.isUnsubscribed) { return scheduler.schedule(dispatchNext, 0, { value: this.value, subscriber: subscriber }); } } else { promise.then(function(value) { _this.value = value; _this._isScalar = true; if (!subscriber.isUnsubscribed) { subscriber.add(scheduler.schedule(dispatchNext, 0, { value: value, subscriber: subscriber })); } }, function(err) { if (!subscriber.isUnsubscribed) { subscriber.add(scheduler.schedule(dispatchError, 0, { err: err, subscriber: subscriber })); } }).then(null, function(err) { root_1.root.setTimeout(function() { throw err; }); }); } } }; return PromiseObservable; }(Observable_1.Observable)); exports.PromiseObservable = PromiseObservable; function dispatchNext(arg) { var value = arg.value, subscriber = arg.subscriber; if (!subscriber.isUnsubscribed) { subscriber.next(value); subscriber.complete(); } } function dispatchError(arg) { var err = arg.err, subscriber = arg.subscriber; if (!subscriber.isUnsubscribed) { subscriber.error(err); } } global.define = __define; return module.exports; }); System.register("rxjs/operator/toPromise", ["rxjs/util/root"], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; var root_1 = require("rxjs/util/root"); function toPromise(PromiseCtor) { var _this = this; if (!PromiseCtor) { if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) { PromiseCtor = root_1.root.Rx.config.Promise; } else if (root_1.root.Promise) { PromiseCtor = root_1.root.Promise; } } if (!PromiseCtor) { throw new Error('no Promise impl found'); } return new PromiseCtor(function(resolve, reject) { var value; _this.subscribe(function(x) { return value = x; }, function(err) { return reject(err); }, function() { return resolve(value); }); }); } exports.toPromise = toPromise; global.define = __define; return module.exports; }); System.register("angular2/src/facade/base_wrapped_exception", [], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; var __extends = (this && this.__extends) || function(d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var BaseWrappedException = (function(_super) { __extends(BaseWrappedException, _super); function BaseWrappedException(message) { _super.call(this, message); } Object.defineProperty(BaseWrappedException.prototype, "wrapperMessage", { get: function() { return ''; }, enumerable: true, configurable: true }); Object.defineProperty(BaseWrappedException.prototype, "wrapperStack", { get: function() { return null; }, enumerable: true, configurable: true }); Object.defineProperty(BaseWrappedException.prototype, "originalException", { get: function() { return null; }, enumerable: true, configurable: true }); Object.defineProperty(BaseWrappedException.prototype, "originalStack", { get: function() { return null; }, enumerable: true, configurable: true }); Object.defineProperty(BaseWrappedException.prototype, "context", { get: function() { return null; }, enumerable: true, configurable: true }); Object.defineProperty(BaseWrappedException.prototype, "message", { get: function() { return ''; }, enumerable: true, configurable: true }); return BaseWrappedException; }(Error)); exports.BaseWrappedException = BaseWrappedException; global.define = __define; return module.exports; }); System.register("angular2/src/facade/collection", ["angular2/src/facade/lang"], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; var lang_1 = require("angular2/src/facade/lang"); exports.Map = lang_1.global.Map; exports.Set = lang_1.global.Set; var createMapFromPairs = (function() { try { if (new exports.Map([[1, 2]]).size === 1) { return function createMapFromPairs(pairs) { return new exports.Map(pairs); }; } } catch (e) {} return function createMapAndPopulateFromPairs(pairs) { var map = new exports.Map(); for (var i = 0; i < pairs.length; i++) { var pair = pairs[i]; map.set(pair[0], pair[1]); } return map; }; })(); var createMapFromMap = (function() { try { if (new exports.Map(new exports.Map())) { return function createMapFromMap(m) { return new exports.Map(m); }; } } catch (e) {} return function createMapAndPopulateFromMap(m) { var map = new exports.Map(); m.forEach(function(v, k) { map.set(k, v); }); return map; }; })(); var _clearValues = (function() { if ((new exports.Map()).keys().next) { return function _clearValues(m) { var keyIterator = m.keys(); var k; while (!((k = keyIterator.next()).done)) { m.set(k.value, null); } }; } else { return function _clearValuesWithForeEach(m) { m.forEach(function(v, k) { m.set(k, null); }); }; } })(); var _arrayFromMap = (function() { try { if ((new exports.Map()).values().next) { return function createArrayFromMap(m, getValues) { return getValues ? Array.from(m.values()) : Array.from(m.keys()); }; } } catch (e) {} return function createArrayFromMapWithForeach(m, getValues) { var res = ListWrapper.createFixedSize(m.size), i = 0; m.forEach(function(v, k) { res[i] = getValues ? v : k; i++; }); return res; }; })(); var MapWrapper = (function() { function MapWrapper() {} MapWrapper.clone = function(m) { return createMapFromMap(m); }; MapWrapper.createFromStringMap = function(stringMap) { var result = new exports.Map(); for (var prop in stringMap) { result.set(prop, stringMap[prop]); } return result; }; MapWrapper.toStringMap = function(m) { var r = {}; m.forEach(function(v, k) { return r[k] = v; }); return r; }; MapWrapper.createFromPairs = function(pairs) { return createMapFromPairs(pairs); }; MapWrapper.clearValues = function(m) { _clearValues(m); }; MapWrapper.iterable = function(m) { return m; }; MapWrapper.keys = function(m) { return _arrayFromMap(m, false); }; MapWrapper.values = function(m) { return _arrayFromMap(m, true); }; return MapWrapper; }()); exports.MapWrapper = MapWrapper; var StringMapWrapper = (function() { function StringMapWrapper() {} StringMapWrapper.create = function() { return {}; }; StringMapWrapper.contains = function(map, key) { return map.hasOwnProperty(key); }; StringMapWrapper.get = function(map, key) { return map.hasOwnProperty(key) ? map[key] : undefined; }; StringMapWrapper.set = function(map, key, value) { map[key] = value; }; StringMapWrapper.keys = function(map) { return Object.keys(map); }; StringMapWrapper.values = function(map) { return Object.keys(map).reduce(function(r, a) { r.push(map[a]); return r; }, []); }; StringMapWrapper.isEmpty = function(map) { for (var prop in map) { return false; } return true; }; StringMapWrapper.delete = function(map, key) { delete map[key]; }; StringMapWrapper.forEach = function(map, callback) { for (var prop in map) { if (map.hasOwnProperty(prop)) { callback(map[prop], prop); } } }; StringMapWrapper.merge = function(m1, m2) { var m = {}; for (var attr in m1) { if (m1.hasOwnProperty(attr)) { m[attr] = m1[attr]; } } for (var attr in m2) { if (m2.hasOwnProperty(attr)) { m[attr] = m2[attr]; } } return m; }; StringMapWrapper.equals = function(m1, m2) { var k1 = Object.keys(m1); var k2 = Object.keys(m2); if (k1.length != k2.length) { return false; } var key; for (var i = 0; i < k1.length; i++) { key = k1[i]; if (m1[key] !== m2[key]) { return false; } } return true; }; return StringMapWrapper; }()); exports.StringMapWrapper = StringMapWrapper; var ListWrapper = (function() { function ListWrapper() {} ListWrapper.createFixedSize = function(size) { return new Array(size); }; ListWrapper.createGrowableSize = function(size) { return new Array(size); }; ListWrapper.clone = function(array) { return array.slice(0); }; ListWrapper.forEachWithIndex = function(array, fn) { for (var i = 0; i < array.length; i++) { fn(array[i], i); } }; ListWrapper.first = function(array) { if (!array) return null; return array[0]; }; ListWrapper.last = function(array) { if (!array || array.length == 0) return null; return array[array.length - 1]; }; ListWrapper.indexOf = function(array, value, startIndex) { if (startIndex === void 0) { startIndex = 0; } return array.indexOf(value, startIndex); }; ListWrapper.contains = function(list, el) { return list.indexOf(el) !== -1; }; ListWrapper.reversed = function(array) { var a = ListWrapper.clone(array); return a.reverse(); }; ListWrapper.concat = function(a, b) { return a.concat(b); }; ListWrapper.insert = function(list, index, value) { list.splice(index, 0, value); }; ListWrapper.removeAt = function(list, index) { var res = list[index]; list.splice(index, 1); return res; }; ListWrapper.removeAll = function(list, items) { for (var i = 0; i < items.length; ++i) { var index = list.indexOf(items[i]); list.splice(index, 1); } }; ListWrapper.remove = function(list, el) { var index = list.indexOf(el); if (index > -1) { list.splice(index, 1); return true; } return false; }; ListWrapper.clear = function(list) { list.length = 0; }; ListWrapper.isEmpty = function(list) { return list.length == 0; }; ListWrapper.fill = function(list, value, start, end) { if (start === void 0) { start = 0; } if (end === void 0) { end = null; } list.fill(value, start, end === null ? list.length : end); }; ListWrapper.equals = function(a, b) { if (a.length != b.length) return false; for (var i = 0; i < a.length; ++i) { if (a[i] !== b[i]) return false; } return true; }; ListWrapper.slice = function(l, from, to) { if (from === void 0) { from = 0; } if (to === void 0) { to = null; } return l.slice(from, to === null ? undefined : to); }; ListWrapper.splice = function(l, from, length) { return l.splice(from, length); }; ListWrapper.sort = function(l, compareFn) { if (lang_1.isPresent(compareFn)) { l.sort(compareFn); } else { l.sort(); } }; ListWrapper.toString = function(l) { return l.toString(); }; ListWrapper.toJSON = function(l) { return JSON.stringify(l); }; ListWrapper.maximum = function(list, predicate) { if (list.length == 0) { return null; } var solution = null; var maxValue = -Infinity; for (var index = 0; index < list.length; index++) { var candidate = list[index]; if (lang_1.isBlank(candidate)) { continue; } var candidateValue = predicate(candidate); if (candidateValue > maxValue) { solution = candidate; maxValue = candidateValue; } } return solution; }; ListWrapper.flatten = function(list) { var target = []; _flattenArray(list, target); return target; }; ListWrapper.addAll = function(list, source) { for (var i = 0; i < source.length; i++) { list.push(source[i]); } }; return ListWrapper; }()); exports.ListWrapper = ListWrapper; function _flattenArray(source, target) { if (lang_1.isPresent(source)) { for (var i = 0; i < source.length; i++) { var item = source[i]; if (lang_1.isArray(item)) { _flattenArray(item, target); } else { target.push(item); } } } return target; } function isListLikeIterable(obj) { if (!lang_1.isJsObject(obj)) return false; return lang_1.isArray(obj) || (!(obj instanceof exports.Map) && lang_1.getSymbolIterator() in obj); } exports.isListLikeIterable = isListLikeIterable; function areIterablesEqual(a, b, comparator) { var iterator1 = a[lang_1.getSymbolIterator()](); var iterator2 = b[lang_1.getSymbolIterator()](); while (true) { var item1 = iterator1.next(); var item2 = iterator2.next(); if (item1.done && item2.done) return true; if (item1.done || item2.done) return false; if (!comparator(item1.value, item2.value)) return false; } } exports.areIterablesEqual = areIterablesEqual; function iterateListLike(obj, fn) { if (lang_1.isArray(obj)) { for (var i = 0; i < obj.length; i++) { fn(obj[i]); } } else { var iterator = obj[lang_1.getSymbolIterator()](); var item; while (!((item = iterator.next()).done)) { fn(item.value); } } } exports.iterateListLike = iterateListLike; var createSetFromList = (function() { var test = new exports.Set([1, 2, 3]); if (test.size === 3) { return function createSetFromList(lst) { return new exports.Set(lst); }; } else { return function createSetAndPopulateFromList(lst) { var res = new exports.Set(lst); if (res.size !== lst.length) { for (var i = 0; i < lst.length; i++) { res.add(lst[i]); } } return res; }; } })(); var SetWrapper = (function() { function SetWrapper() {} SetWrapper.createFromList = function(lst) { return createSetFromList(lst); }; SetWrapper.has = function(s, key) { return s.has(key); }; SetWrapper.delete = function(m, k) { m.delete(k); }; return SetWrapper; }()); exports.SetWrapper = SetWrapper; global.define = __define; return module.exports; }); System.register("angular2/src/core/di/metadata", ["angular2/src/facade/lang"], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var lang_1 = require("angular2/src/facade/lang"); var InjectMetadata = (function() { function InjectMetadata(token) { this.token = token; } InjectMetadata.prototype.toString = function() { return "@Inject(" + lang_1.stringify(this.token) + ")"; }; InjectMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], InjectMetadata); return InjectMetadata; }()); exports.InjectMetadata = InjectMetadata; var OptionalMetadata = (function() { function OptionalMetadata() {} OptionalMetadata.prototype.toString = function() { return "@Optional()"; }; OptionalMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], OptionalMetadata); return OptionalMetadata; }()); exports.OptionalMetadata = OptionalMetadata; var DependencyMetadata = (function() { function DependencyMetadata() {} Object.defineProperty(DependencyMetadata.prototype, "token", { get: function() { return null; }, enumerable: true, configurable: true }); DependencyMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DependencyMetadata); return DependencyMetadata; }()); exports.DependencyMetadata = DependencyMetadata; var InjectableMetadata = (function() { function InjectableMetadata() {} InjectableMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], InjectableMetadata); return InjectableMetadata; }()); exports.InjectableMetadata = InjectableMetadata; var SelfMetadata = (function() { function SelfMetadata() {} SelfMetadata.prototype.toString = function() { return "@Self()"; }; SelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SelfMetadata); return SelfMetadata; }()); exports.SelfMetadata = SelfMetadata; var SkipSelfMetadata = (function() { function SkipSelfMetadata() {} SkipSelfMetadata.prototype.toString = function() { return "@SkipSelf()"; }; SkipSelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SkipSelfMetadata); return SkipSelfMetadata; }()); exports.SkipSelfMetadata = SkipSelfMetadata; var HostMetadata = (function() { function HostMetadata() {} HostMetadata.prototype.toString = function() { return "@Host()"; }; HostMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], HostMetadata); return HostMetadata; }()); exports.HostMetadata = HostMetadata; global.define = __define; return module.exports; }); System.register("angular2/src/core/util/decorators", ["angular2/src/facade/lang"], true, function(require, exports, module) { var global = System.global, __define = global.define; global.define = undefined; "use strict"; var lang_1 = require("angular2/src/facade/lang"); var _nextClassId = 0; function extractAnnotation(annotation) { if (lang_1.isFunction(annotation) && annotation.hasOwnProperty('annotation')) { annotation = annotation.annotation; } return annotation; } function applyParams(fnOrArray, key) { if (fnOrArray === Object || fnOrArray === String || fnOrArray === Function || fnOrArray === Number || fnOrArray === Array) { throw new Error("Can not use native " + lang_1.stringify(fnOrArray) + " as constructor"); } if (lang_1.isFunction(fnOrArray)) { return fnOrArray; } else if (fnOrArray instanceof Array) { var annotations = fnOrArray; var fn = fnOrArray[fnOrArray.length - 1]; if (!lang_1.isFunction(fn)) { throw new Error("Last position of Class method array must be Function in key " + key + " was '" + lang_1.stringify(fn) + "'"); } var annoLength = annotations.length - 1; if (annoLength != fn.length) { throw new Error("Number of annotations (" + annoLength + ") does not match number of arguments (" + fn.length + ") in the function: " + lang_1.stringify(fn)); } var paramsAnnotations = []; for (var i = 0, ii = annotations.length - 1; i < ii; i++) { var paramAnnotations = []; paramsAnnotations.push(paramAnnotations); var annotation = annotations[i]; if (annotation instanceof Array) { for (var j = 0; j < annotation.length; j++) { paramAnnotations.push(extractAnnotation(annotation[j])); } } else if (lang_1.isFunction(annotation)) { paramAnnotations.push(extractAnnotation(annotation)); } else { paramAnnotations.push(annotation); } } Reflect.defineMetadata('parameters', paramsAnnotations, fn); return fn; } else { throw new Error("Only Function or Array is supported in Class definition for key '" + key + "' is '" + lang_1.stringify(fnOrArray) + "'"); } } function Class(clsDef) { var constructor = applyParams(clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor'); var proto = constructor.prototype; if (clsDef.hasOwnProperty('extends')) { if (lang_1.isFunction(clsDef.extends)) { constructor.prototype = proto = Object.create(clsDef.extends.prototype); } else { throw new Error("Class definition 'extends' property must be a constructor function was: " + lang_1.stringify(clsDef.extends)); } } for (var key in clsDef) { if (key != 'extends' && key != 'prototype' && clsDef.hasOwnProperty(key)) { proto[key] = applyParams(clsDef[key], key); } } if (this && this.annotations instanceof Array) { Reflect.defineMetadata('annotations', this.annotations, constructor); } if (!constructor['name']) { constructor['overriddenName'] = "class" + _nextClassId++; } return constructor; } exports.Class = Class; var Reflect = lang_1.global.Reflect; (function checkReflect() { if (!(Reflect && Reflect.getMetadata)) { throw 'reflect-metadata shim is required when using class decorators'; } })(); function makeDecorator(annotationCls, chainFn) { if (chainFn === void 0) { chainFn = null; } function DecoratorFactory(objOrType) { var annotationInstance = new annotationCls(objOrType); if (this instanceof annotationCls) { return annotationInstance; } else { var chainAnnotation = lang_1.isFunction(this) && this.annotations instanceof Array ? this.annotations : []; chainAnnotation.push(annotationInstance); var TypeDecorator = function TypeDecorator(cls) { var annotations = Reflect.getOwnMetadata('annotations', cls); annotations = annotations || []; annotations.push(annotationInstance); Reflect.defineMetadata('annotations', annotations, cls); return cls; }; TypeDecorator.annotations = chainAnnotation; TypeDecorator.Class = Class; if (chainFn) chainFn(TypeDecorator); return TypeDecorator; } } DecoratorFactory.prototype = Object.create(annotationCls.prototype); return DecoratorFactory;