.
- * For example, matching the above expression to
- *
- * http://www.ics.uci.edu/pub/ietf/uri/#Related
- *
- * results in the following subexpression matches:
- *
- * $1 = http:
- * $2 = http
- * $3 = //www.ics.uci.edu
- * $4 = www.ics.uci.edu
- * $5 = /pub/ietf/uri/
- * $6 =
- * $7 =
- * $8 = #Related
- * $9 = Related
- *
- * where indicates that the component is not present, as is the
- * case for the query component in the above example. Therefore, we can
- * determine the value of the five components as
- *
- * scheme = $2
- * authority = $4
- * path = $5
- * query = $7
- * fragment = $9
- *
- *
- * The regular expression has been modified slightly to expose the
- * userInfo, domain, and port separately from the authority.
- * The modified version yields
- *
- * $1 = http scheme
- * $2 = userInfo -\
- * $3 = www.ics.uci.edu domain | authority
- * $4 = port -/
- * $5 = /pub/ietf/uri/ path
- * $6 = query without ?
- * $7 = Related fragment without #
- *
- * @type {!RegExp}
- * @internal
- */
-var /** @type {?} */ _splitRe = new RegExp('^' +
- '(?:' +
- '([^:/?#.]+)' +
- // used by other URL parts such as :,
- // ?, /, #, and .
- ':)?' +
- '(?://' +
- '(?:([^/?#]*)@)?' +
- '([\\w\\d\\-\\u0100-\\uffff.%]*)' +
- // digits, dashes, dots, percent
- // escapes, and unicode characters.
- '(?::([0-9]+))?' +
- ')?' +
- '([^?#]+)?' +
- '(?:\\?([^#]*))?' +
- '(?:#(.*))?' +
- '$');
-var _ComponentIndex = {};
-_ComponentIndex.Scheme = 1;
-_ComponentIndex.UserInfo = 2;
-_ComponentIndex.Domain = 3;
-_ComponentIndex.Port = 4;
-_ComponentIndex.Path = 5;
-_ComponentIndex.QueryData = 6;
-_ComponentIndex.Fragment = 7;
-_ComponentIndex[_ComponentIndex.Scheme] = "Scheme";
-_ComponentIndex[_ComponentIndex.UserInfo] = "UserInfo";
-_ComponentIndex[_ComponentIndex.Domain] = "Domain";
-_ComponentIndex[_ComponentIndex.Port] = "Port";
-_ComponentIndex[_ComponentIndex.Path] = "Path";
-_ComponentIndex[_ComponentIndex.QueryData] = "QueryData";
-_ComponentIndex[_ComponentIndex.Fragment] = "Fragment";
-/**
- * Splits a URI into its component parts.
- *
- * Each component can be accessed via the component indices; for example:
- *
- * goog.uri.utils.split(someStr)[goog.uri.utils.CompontentIndex.QUERY_DATA];
- *
- *
- * @param {?} uri The URI string to examine.
- * @return {?} Each component still URI-encoded.
- * Each component that is present will contain the encoded value, whereas
- * components that are not present will be undefined or empty, depending
- * on the browser's regular expression implementation. Never null, since
- * arbitrary strings may still look like path names.
- */
-function _split(uri) {
- return uri.match(_splitRe);
-}
-/**
- * Removes dot segments in given path component, as described in
- * RFC 3986, section 5.2.4.
- *
- * @param {?} path A non-empty path component.
- * @return {?} Path component with removed dot segments.
- */
-function _removeDotSegments(path) {
- if (path == '/')
- return '/';
- var /** @type {?} */ leadingSlash = path[0] == '/' ? '/' : '';
- var /** @type {?} */ trailingSlash = path[path.length - 1] === '/' ? '/' : '';
- var /** @type {?} */ segments = path.split('/');
- var /** @type {?} */ out = [];
- var /** @type {?} */ up = 0;
- for (var /** @type {?} */ pos = 0; pos < segments.length; pos++) {
- var /** @type {?} */ segment = segments[pos];
- switch (segment) {
- case '':
- case '.':
- break;
- case '..':
- if (out.length > 0) {
- out.pop();
- }
- else {
- up++;
- }
- break;
- default:
- out.push(segment);
- }
- }
- if (leadingSlash == '') {
- while (up-- > 0) {
- out.unshift('..');
- }
- if (out.length === 0)
- out.push('.');
- }
- return leadingSlash + out.join('/') + trailingSlash;
-}
-/**
- * Takes an array of the parts from split and canonicalizes the path part
- * and then joins all the parts.
- * @param {?} parts
- * @return {?}
- */
-function _joinAndCanonicalizePath(parts) {
- var /** @type {?} */ path = parts[_ComponentIndex.Path];
- path = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["isBlank"])(path) ? '' : _removeDotSegments(path);
- parts[_ComponentIndex.Path] = path;
- return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);
-}
-/**
- * Resolves a URL.
- * @param {?} base The URL acting as the base URL.
- * @param {?} url
- * @return {?}
- */
-function _resolveUrl(base, url) {
- var /** @type {?} */ parts = _split(encodeURI(url));
- var /** @type {?} */ baseParts = _split(base);
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["isPresent"])(parts[_ComponentIndex.Scheme])) {
- return _joinAndCanonicalizePath(parts);
- }
- else {
- parts[_ComponentIndex.Scheme] = baseParts[_ComponentIndex.Scheme];
- }
- for (var /** @type {?} */ i = _ComponentIndex.Scheme; i <= _ComponentIndex.Port; i++) {
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["isBlank"])(parts[i])) {
- parts[i] = baseParts[i];
- }
- }
- if (parts[_ComponentIndex.Path][0] == '/') {
- return _joinAndCanonicalizePath(parts);
- }
- var /** @type {?} */ path = baseParts[_ComponentIndex.Path];
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["isBlank"])(path))
- path = '/';
- var /** @type {?} */ index = path.lastIndexOf('/');
- path = path.substring(0, index + 1) + parts[_ComponentIndex.Path];
- parts[_ComponentIndex.Path] = path;
- return _joinAndCanonicalizePath(parts);
-}
-//# sourceMappingURL=url_resolver.js.map
-
-/***/ }),
-/* 82 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compile_metadata__ = __webpack_require__(15);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__compiler_util_identifier_util__ = __webpack_require__(46);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__output_output_ast__ = __webpack_require__(12);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__private_import_core__ = __webpack_require__(18);
-/* harmony export (immutable) */ __webpack_exports__["getPropertyInView"] = getPropertyInView;
-/* harmony export (immutable) */ __webpack_exports__["injectFromViewParentInjector"] = injectFromViewParentInjector;
-/* harmony export (immutable) */ __webpack_exports__["getViewClassName"] = getViewClassName;
-/* harmony export (immutable) */ __webpack_exports__["getHandleEventMethodName"] = getHandleEventMethodName;
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-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 __());
-};
-
-
-
-
-/**
- * @param {?} property
- * @param {?} callingView
- * @param {?} definedView
- * @return {?}
- */
-function getPropertyInView(property, callingView, definedView) {
- if (callingView === definedView) {
- return property;
- }
- else {
- var /** @type {?} */ viewProp = __WEBPACK_IMPORTED_MODULE_2__output_output_ast__["THIS_EXPR"];
- var /** @type {?} */ currView = callingView;
- while (currView !== definedView && currView.declarationElement.view) {
- currView = currView.declarationElement.view;
- viewProp = viewProp.prop('parentView');
- }
- if (currView !== definedView) {
- throw new Error("Internal error: Could not calculate a property in a parent view: " + property);
- }
- return property.visitExpression(new _ReplaceViewTransformer(viewProp, definedView), null);
- }
-}
-var _ReplaceViewTransformer = (function (_super) {
- __extends(_ReplaceViewTransformer, _super);
- /**
- * @param {?} _viewExpr
- * @param {?} _view
- */
- function _ReplaceViewTransformer(_viewExpr, _view) {
- _super.call(this);
- this._viewExpr = _viewExpr;
- this._view = _view;
- }
- /**
- * @param {?} expr
- * @return {?}
- */
- _ReplaceViewTransformer.prototype._isThis = function (expr) {
- return expr instanceof __WEBPACK_IMPORTED_MODULE_2__output_output_ast__["ReadVarExpr"] && expr.builtin === __WEBPACK_IMPORTED_MODULE_2__output_output_ast__["BuiltinVar"].This;
- };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- _ReplaceViewTransformer.prototype.visitReadVarExpr = function (ast, context) {
- return this._isThis(ast) ? this._viewExpr : ast;
- };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- _ReplaceViewTransformer.prototype.visitReadPropExpr = function (ast, context) {
- if (this._isThis(ast.receiver)) {
- // Note: Don't cast for members of the AppView base class...
- if (this._view.fields.some(function (field) { return field.name == ast.name; }) ||
- this._view.getters.some(function (field) { return field.name == ast.name; })) {
- return this._viewExpr.cast(this._view.classType).prop(ast.name);
- }
- }
- return _super.prototype.visitReadPropExpr.call(this, ast, context);
- };
- return _ReplaceViewTransformer;
-}(__WEBPACK_IMPORTED_MODULE_2__output_output_ast__["ExpressionTransformer"]));
-function _ReplaceViewTransformer_tsickle_Closure_declarations() {
- /** @type {?} */
- _ReplaceViewTransformer.prototype._viewExpr;
- /** @type {?} */
- _ReplaceViewTransformer.prototype._view;
-}
-/**
- * @param {?} view
- * @param {?} token
- * @param {?} optional
- * @return {?}
- */
-function injectFromViewParentInjector(view, token, optional) {
- var /** @type {?} */ viewExpr;
- if (view.viewType === __WEBPACK_IMPORTED_MODULE_3__private_import_core__["ViewType"].HOST) {
- viewExpr = __WEBPACK_IMPORTED_MODULE_2__output_output_ast__["THIS_EXPR"];
- }
- else {
- viewExpr = __WEBPACK_IMPORTED_MODULE_2__output_output_ast__["THIS_EXPR"].prop('parentView');
- }
- var /** @type {?} */ args = [__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__compiler_util_identifier_util__["createDiTokenExpression"])(token), __WEBPACK_IMPORTED_MODULE_2__output_output_ast__["THIS_EXPR"].prop('parentIndex')];
- if (optional) {
- args.push(__WEBPACK_IMPORTED_MODULE_2__output_output_ast__["NULL_EXPR"]);
- }
- return viewExpr.callMethod('injectorGet', args);
-}
-/**
- * @param {?} component
- * @param {?} embeddedTemplateIndex
- * @return {?}
- */
-function getViewClassName(component, embeddedTemplateIndex) {
- return "View_" + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__compile_metadata__["identifierName"])(component.type) + embeddedTemplateIndex;
-}
-/**
- * @param {?} elementIndex
- * @return {?}
- */
-function getHandleEventMethodName(elementIndex) {
- return "handleEvent_" + elementIndex;
-}
-//# sourceMappingURL=util.js.map
-
-/***/ }),
-/* 83 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__abstract_control_directive__ = __webpack_require__(236);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgControl", function() { return NgControl; });
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-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 __());
-};
-
-/**
- * @return {?}
- */
-function unimplemented() {
- throw new Error('unimplemented');
-}
-/**
- * A base class that all control directive extend.
- * It binds a {\@link FormControl} object to a DOM element.
- *
- * Used internally by Angular forms.
- *
- * \@stable
- * @abstract
- */
-var NgControl = (function (_super) {
- __extends(NgControl, _super);
- function NgControl() {
- _super.apply(this, arguments);
- /** @internal */
- this._parent = null;
- this.name = null;
- this.valueAccessor = null;
- /** @internal */
- this._rawValidators = [];
- /** @internal */
- this._rawAsyncValidators = [];
- }
- Object.defineProperty(NgControl.prototype, "validator", {
- /**
- * @return {?}
- */
- get: function () { return (unimplemented()); },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(NgControl.prototype, "asyncValidator", {
- /**
- * @return {?}
- */
- get: function () { return (unimplemented()); },
- enumerable: true,
- configurable: true
- });
- /**
- * @abstract
- * @param {?} newValue
- * @return {?}
- */
- NgControl.prototype.viewToModelUpdate = function (newValue) { };
- return NgControl;
-}(__WEBPACK_IMPORTED_MODULE_0__abstract_control_directive__["AbstractControlDirective"]));
-function NgControl_tsickle_Closure_declarations() {
- /**
- * \@internal
- * @type {?}
- */
- NgControl.prototype._parent;
- /** @type {?} */
- NgControl.prototype.name;
- /** @type {?} */
- NgControl.prototype.valueAccessor;
- /**
- * \@internal
- * @type {?}
- */
- NgControl.prototype._rawValidators;
- /**
- * \@internal
- * @type {?}
- */
- NgControl.prototype._rawAsyncValidators;
-}
-//# sourceMappingURL=ng_control.js.map
-
-/***/ }),
-/* 84 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shared__ = __webpack_require__(51);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_collection__ = __webpack_require__(59);
-/* harmony export (immutable) */ __webpack_exports__["createEmptyUrlTree"] = createEmptyUrlTree;
-/* harmony export (immutable) */ __webpack_exports__["containsTree"] = containsTree;
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlTree", function() { return UrlTree; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlSegmentGroup", function() { return UrlSegmentGroup; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlSegment", function() { return UrlSegment; });
-/* harmony export (immutable) */ __webpack_exports__["equalSegments"] = equalSegments;
-/* harmony export (immutable) */ __webpack_exports__["equalPath"] = equalPath;
-/* harmony export (immutable) */ __webpack_exports__["mapChildrenIntoArray"] = mapChildrenIntoArray;
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlSerializer", function() { return UrlSerializer; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultUrlSerializer", function() { return DefaultUrlSerializer; });
-/* harmony export (immutable) */ __webpack_exports__["serializePaths"] = serializePaths;
-/* harmony export (immutable) */ __webpack_exports__["encode"] = encode;
-/* harmony export (immutable) */ __webpack_exports__["decode"] = decode;
-/* harmony export (immutable) */ __webpack_exports__["serializePath"] = serializePath;
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-
-
-/**
- * @return {?}
- */
-function createEmptyUrlTree() {
- return new UrlTree(new UrlSegmentGroup([], {}), {}, null);
-}
-/**
- * @param {?} container
- * @param {?} containee
- * @param {?} exact
- * @return {?}
- */
-function containsTree(container, containee, exact) {
- if (exact) {
- return equalQueryParams(container.queryParams, containee.queryParams) &&
- equalSegmentGroups(container.root, containee.root);
- }
- return containsQueryParams(container.queryParams, containee.queryParams) &&
- containsSegmentGroup(container.root, containee.root);
-}
-/**
- * @param {?} container
- * @param {?} containee
- * @return {?}
- */
-function equalQueryParams(container, containee) {
- return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_collection__["shallowEqual"])(container, containee);
-}
-/**
- * @param {?} container
- * @param {?} containee
- * @return {?}
- */
-function equalSegmentGroups(container, containee) {
- if (!equalPath(container.segments, containee.segments))
- return false;
- if (container.numberOfChildren !== containee.numberOfChildren)
- return false;
- for (var c in containee.children) {
- if (!container.children[c])
- return false;
- if (!equalSegmentGroups(container.children[c], containee.children[c]))
- return false;
- }
- return true;
-}
-/**
- * @param {?} container
- * @param {?} containee
- * @return {?}
- */
-function containsQueryParams(container, containee) {
- return Object.keys(containee).length <= Object.keys(container).length &&
- Object.keys(containee).every(function (key) { return containee[key] === container[key]; });
-}
-/**
- * @param {?} container
- * @param {?} containee
- * @return {?}
- */
-function containsSegmentGroup(container, containee) {
- return containsSegmentGroupHelper(container, containee, containee.segments);
-}
-/**
- * @param {?} container
- * @param {?} containee
- * @param {?} containeePaths
- * @return {?}
- */
-function containsSegmentGroupHelper(container, containee, containeePaths) {
- if (container.segments.length > containeePaths.length) {
- var /** @type {?} */ current = container.segments.slice(0, containeePaths.length);
- if (!equalPath(current, containeePaths))
- return false;
- if (containee.hasChildren())
- return false;
- return true;
- }
- else if (container.segments.length === containeePaths.length) {
- if (!equalPath(container.segments, containeePaths))
- return false;
- for (var c in containee.children) {
- if (!container.children[c])
- return false;
- if (!containsSegmentGroup(container.children[c], containee.children[c]))
- return false;
- }
- return true;
- }
- else {
- var /** @type {?} */ current = containeePaths.slice(0, container.segments.length);
- var /** @type {?} */ next = containeePaths.slice(container.segments.length);
- if (!equalPath(container.segments, current))
- return false;
- if (!container.children[__WEBPACK_IMPORTED_MODULE_0__shared__["PRIMARY_OUTLET"]])
- return false;
- return containsSegmentGroupHelper(container.children[__WEBPACK_IMPORTED_MODULE_0__shared__["PRIMARY_OUTLET"]], containee, next);
- }
-}
-/**
- * \@whatItDoes Represents the parsed URL.
- *
- * \@howToUse
- *
- * ```
- * \@Component({templateUrl:'template.html'})
- * class MyComponent {
- * constructor(router: Router) {
- * const tree: UrlTree =
- * router.parseUrl('/team/33/(user/victor//support:help)?debug=true#fragment');
- * const f = tree.fragment; // return 'fragment'
- * const q = tree.queryParams; // returns {debug: 'true'}
- * const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];
- * const s: UrlSegment[] = g.segments; // returns 2 segments 'team' and '33'
- * g.children[PRIMARY_OUTLET].segments; // returns 2 segments 'user' and 'victor'
- * g.children['support'].segments; // return 1 segment 'help'
- * }
- * }
- * ```
- *
- * \@description
- *
- * Since a router state is a tree, and the URL is nothing but a serialized state, the URL is a
- * serialized tree.
- * UrlTree is a data structure that provides a lot of affordances in dealing with URLs
- *
- * \@stable
- */
-var UrlTree = (function () {
- /**
- * \@internal
- * @param {?} root
- * @param {?} queryParams
- * @param {?} fragment
- */
- function UrlTree(root, queryParams, fragment) {
- this.root = root;
- this.queryParams = queryParams;
- this.fragment = fragment;
- }
- /**
- * \@docsNotRequired
- * @return {?}
- */
- UrlTree.prototype.toString = function () { return new DefaultUrlSerializer().serialize(this); };
- return UrlTree;
-}());
-function UrlTree_tsickle_Closure_declarations() {
- /**
- * The root segment group of the URL tree
- * @type {?}
- */
- UrlTree.prototype.root;
- /**
- * The query params of the URL
- * @type {?}
- */
- UrlTree.prototype.queryParams;
- /**
- * The fragment of the URL
- * @type {?}
- */
- UrlTree.prototype.fragment;
-}
-/**
- * \@whatItDoes Represents the parsed URL segment group.
- *
- * See {\@link UrlTree} for more information.
- *
- * \@stable
- */
-var UrlSegmentGroup = (function () {
- /**
- * @param {?} segments
- * @param {?} children
- */
- function UrlSegmentGroup(segments, children) {
- var _this = this;
- this.segments = segments;
- this.children = children;
- /** The parent node in the url tree */
- this.parent = null;
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_collection__["forEach"])(children, function (v, k) { return v.parent = _this; });
- }
- /**
- * Wether the segment has child segments
- * @return {?}
- */
- UrlSegmentGroup.prototype.hasChildren = function () { return this.numberOfChildren > 0; };
- Object.defineProperty(UrlSegmentGroup.prototype, "numberOfChildren", {
- /**
- * Number of child segments
- * @return {?}
- */
- get: function () { return Object.keys(this.children).length; },
- enumerable: true,
- configurable: true
- });
- /**
- * \@docsNotRequired
- * @return {?}
- */
- UrlSegmentGroup.prototype.toString = function () { return serializePaths(this); };
- return UrlSegmentGroup;
-}());
-function UrlSegmentGroup_tsickle_Closure_declarations() {
- /**
- * \@internal
- * @type {?}
- */
- UrlSegmentGroup.prototype._sourceSegment;
- /**
- * \@internal
- * @type {?}
- */
- UrlSegmentGroup.prototype._segmentIndexShift;
- /**
- * The parent node in the url tree
- * @type {?}
- */
- UrlSegmentGroup.prototype.parent;
- /**
- * The URL segments of this group. See {\@link UrlSegment} for more information
- * @type {?}
- */
- UrlSegmentGroup.prototype.segments;
- /**
- * The list of children of this group
- * @type {?}
- */
- UrlSegmentGroup.prototype.children;
-}
-/**
- * \@whatItDoes Represents a single URL segment.
- *
- * \@howToUse
- *
- * ```
- * \@Component({templateUrl:'template.html'})
- * class MyComponent {
- * constructor(router: Router) {
- * const tree: UrlTree = router.parseUrl('/team;id=33');
- * const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];
- * const s: UrlSegment[] = g.segments;
- * s[0].path; // returns 'team'
- * s[0].parameters; // returns {id: 33}
- * }
- * }
- * ```
- *
- * \@description
- *
- * A UrlSegment is a part of a URL between the two slashes. It contains a path and the matrix
- * parameters associated with the segment.
- *
- * \@stable
- */
-var UrlSegment = (function () {
- /**
- * @param {?} path
- * @param {?} parameters
- */
- function UrlSegment(path, parameters) {
- this.path = path;
- this.parameters = parameters;
- }
- /**
- * \@docsNotRequired
- * @return {?}
- */
- UrlSegment.prototype.toString = function () { return serializePath(this); };
- return UrlSegment;
-}());
-function UrlSegment_tsickle_Closure_declarations() {
- /**
- * The path part of a URL segment
- * @type {?}
- */
- UrlSegment.prototype.path;
- /**
- * The matrix parameters associated with a segment
- * @type {?}
- */
- UrlSegment.prototype.parameters;
-}
-/**
- * @param {?} a
- * @param {?} b
- * @return {?}
- */
-function equalSegments(a, b) {
- if (a.length !== b.length)
- return false;
- for (var /** @type {?} */ i = 0; i < a.length; ++i) {
- if (a[i].path !== b[i].path)
- return false;
- if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_collection__["shallowEqual"])(a[i].parameters, b[i].parameters))
- return false;
- }
- return true;
-}
-/**
- * @param {?} a
- * @param {?} b
- * @return {?}
- */
-function equalPath(a, b) {
- if (a.length !== b.length)
- return false;
- for (var /** @type {?} */ i = 0; i < a.length; ++i) {
- if (a[i].path !== b[i].path)
- return false;
- }
- return true;
-}
-/**
- * @param {?} segment
- * @param {?} fn
- * @return {?}
- */
-function mapChildrenIntoArray(segment, fn) {
- var /** @type {?} */ res = [];
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_collection__["forEach"])(segment.children, function (child, childOutlet) {
- if (childOutlet === __WEBPACK_IMPORTED_MODULE_0__shared__["PRIMARY_OUTLET"]) {
- res = res.concat(fn(child, childOutlet));
- }
- });
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_collection__["forEach"])(segment.children, function (child, childOutlet) {
- if (childOutlet !== __WEBPACK_IMPORTED_MODULE_0__shared__["PRIMARY_OUTLET"]) {
- res = res.concat(fn(child, childOutlet));
- }
- });
- return res;
-}
-/**
- * \@whatItDoes Serializes and deserializes a URL string into a URL tree.
- *
- * \@description The url serialization strategy is customizable. You can
- * make all URLs case insensitive by providing a custom UrlSerializer.
- *
- * See {\@link DefaultUrlSerializer} for an example of a URL serializer.
- *
- * \@stable
- * @abstract
- */
-var UrlSerializer = (function () {
- function UrlSerializer() {
- }
- /**
- * Parse a url into a {\@link UrlTree}
- * @abstract
- * @param {?} url
- * @return {?}
- */
- UrlSerializer.prototype.parse = function (url) { };
- /**
- * Converts a {\@link UrlTree} into a url
- * @abstract
- * @param {?} tree
- * @return {?}
- */
- UrlSerializer.prototype.serialize = function (tree) { };
- return UrlSerializer;
-}());
-/**
- * \@whatItDoes A default implementation of the {\@link UrlSerializer}.
- *
- * \@description
- *
- * Example URLs:
- *
- * ```
- * /inbox/33(popup:compose)
- * /inbox/33;open=true/messages/44
- * ```
- *
- * DefaultUrlSerializer uses parentheses to serialize secondary segments (e.g., popup:compose), the
- * colon syntax to specify the outlet, and the ';parameter=value' syntax (e.g., open=true) to
- * specify route specific parameters.
- *
- * \@stable
- */
-var DefaultUrlSerializer = (function () {
- function DefaultUrlSerializer() {
- }
- /**
- * Parses a url into a {\@link UrlTree}
- * @param {?} url
- * @return {?}
- */
- DefaultUrlSerializer.prototype.parse = function (url) {
- var /** @type {?} */ p = new UrlParser(url);
- return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());
- };
- /**
- * Converts a {\@link UrlTree} into a url
- * @param {?} tree
- * @return {?}
- */
- DefaultUrlSerializer.prototype.serialize = function (tree) {
- var /** @type {?} */ segment = "/" + serializeSegment(tree.root, true);
- var /** @type {?} */ query = serializeQueryParams(tree.queryParams);
- var /** @type {?} */ fragment = tree.fragment !== null && tree.fragment !== undefined ? "#" + encodeURI(tree.fragment) : '';
- return "" + segment + query + fragment;
- };
- return DefaultUrlSerializer;
-}());
-/**
- * @param {?} segment
- * @return {?}
- */
-function serializePaths(segment) {
- return segment.segments.map(function (p) { return serializePath(p); }).join('/');
-}
-/**
- * @param {?} segment
- * @param {?} root
- * @return {?}
- */
-function serializeSegment(segment, root) {
- if (segment.hasChildren() && root) {
- var /** @type {?} */ primary = segment.children[__WEBPACK_IMPORTED_MODULE_0__shared__["PRIMARY_OUTLET"]] ?
- serializeSegment(segment.children[__WEBPACK_IMPORTED_MODULE_0__shared__["PRIMARY_OUTLET"]], false) :
- '';
- var /** @type {?} */ children_1 = [];
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_collection__["forEach"])(segment.children, function (v, k) {
- if (k !== __WEBPACK_IMPORTED_MODULE_0__shared__["PRIMARY_OUTLET"]) {
- children_1.push(k + ":" + serializeSegment(v, false));
- }
- });
- if (children_1.length > 0) {
- return primary + "(" + children_1.join('//') + ")";
- }
- else {
- return "" + primary;
- }
- }
- else if (segment.hasChildren() && !root) {
- var /** @type {?} */ children = mapChildrenIntoArray(segment, function (v, k) {
- if (k === __WEBPACK_IMPORTED_MODULE_0__shared__["PRIMARY_OUTLET"]) {
- return [serializeSegment(segment.children[__WEBPACK_IMPORTED_MODULE_0__shared__["PRIMARY_OUTLET"]], false)];
- }
- else {
- return [(k + ":" + serializeSegment(v, false))];
- }
- });
- return serializePaths(segment) + "/(" + children.join('//') + ")";
- }
- else {
- return serializePaths(segment);
- }
-}
-/**
- * @param {?} s
- * @return {?}
- */
-function encode(s) {
- return encodeURIComponent(s);
-}
-/**
- * @param {?} s
- * @return {?}
- */
-function decode(s) {
- return decodeURIComponent(s);
-}
-/**
- * @param {?} path
- * @return {?}
- */
-function serializePath(path) {
- return "" + encode(path.path) + serializeParams(path.parameters);
-}
-/**
- * @param {?} params
- * @return {?}
- */
-function serializeParams(params) {
- return pairs(params).map(function (p) { return (";" + encode(p.first) + "=" + encode(p.second)); }).join('');
-}
-/**
- * @param {?} params
- * @return {?}
- */
-function serializeQueryParams(params) {
- var /** @type {?} */ strParams = Object.keys(params).map(function (name) {
- var /** @type {?} */ value = params[name];
- return Array.isArray(value) ? value.map(function (v) { return (encode(name) + "=" + encode(v)); }).join('&') :
- encode(name) + "=" + encode(value);
- });
- return strParams.length ? "?" + strParams.join("&") : '';
-}
-var Pair = (function () {
- /**
- * @param {?} first
- * @param {?} second
- */
- function Pair(first, second) {
- this.first = first;
- this.second = second;
- }
- return Pair;
-}());
-function Pair_tsickle_Closure_declarations() {
- /** @type {?} */
- Pair.prototype.first;
- /** @type {?} */
- Pair.prototype.second;
-}
-/**
- * @param {?} obj
- * @return {?}
- */
-function pairs(obj) {
- var /** @type {?} */ res = [];
- for (var prop in obj) {
- if (obj.hasOwnProperty(prop)) {
- res.push(new Pair(prop, obj[prop]));
- }
- }
- return res;
-}
-var /** @type {?} */ SEGMENT_RE = /^[^\/()?;=]+/;
-/**
- * @param {?} str
- * @return {?}
- */
-function matchSegments(str) {
- SEGMENT_RE.lastIndex = 0;
- var /** @type {?} */ match = str.match(SEGMENT_RE);
- return match ? match[0] : '';
-}
-var /** @type {?} */ QUERY_PARAM_RE = /^[^=?]+/;
-/**
- * @param {?} str
- * @return {?}
- */
-function matchQueryParams(str) {
- QUERY_PARAM_RE.lastIndex = 0;
- var /** @type {?} */ match = str.match(SEGMENT_RE);
- return match ? match[0] : '';
-}
-var /** @type {?} */ QUERY_PARAM_VALUE_RE = /^[^?]+/;
-/**
- * @param {?} str
- * @return {?}
- */
-function matchUrlQueryParamValue(str) {
- QUERY_PARAM_VALUE_RE.lastIndex = 0;
- var /** @type {?} */ match = str.match(QUERY_PARAM_VALUE_RE);
- return match ? match[0] : '';
-}
-var UrlParser = (function () {
- /**
- * @param {?} url
- */
- function UrlParser(url) {
- this.url = url;
- this.remaining = url;
- }
- /**
- * @param {?} str
- * @return {?}
- */
- UrlParser.prototype.peekStartsWith = function (str) { return this.remaining.startsWith(str); };
- /**
- * @param {?} str
- * @return {?}
- */
- UrlParser.prototype.capture = function (str) {
- if (!this.remaining.startsWith(str)) {
- throw new Error("Expected \"" + str + "\".");
- }
- this.remaining = this.remaining.substring(str.length);
- };
- /**
- * @return {?}
- */
- UrlParser.prototype.parseRootSegment = function () {
- if (this.remaining.startsWith('/')) {
- this.capture('/');
- }
- if (this.remaining === '' || this.remaining.startsWith('?') || this.remaining.startsWith('#')) {
- return new UrlSegmentGroup([], {});
- }
- return new UrlSegmentGroup([], this.parseChildren());
- };
- /**
- * @return {?}
- */
- UrlParser.prototype.parseChildren = function () {
- if (this.remaining.length == 0) {
- return {};
- }
- if (this.peekStartsWith('/')) {
- this.capture('/');
- }
- var /** @type {?} */ paths = [];
- if (!this.peekStartsWith('(')) {
- paths.push(this.parseSegments());
- }
- while (this.peekStartsWith('/') && !this.peekStartsWith('//') && !this.peekStartsWith('/(')) {
- this.capture('/');
- paths.push(this.parseSegments());
- }
- var /** @type {?} */ children = {};
- if (this.peekStartsWith('/(')) {
- this.capture('/');
- children = this.parseParens(true);
- }
- var /** @type {?} */ res = {};
- if (this.peekStartsWith('(')) {
- res = this.parseParens(false);
- }
- if (paths.length > 0 || Object.keys(children).length > 0) {
- res[__WEBPACK_IMPORTED_MODULE_0__shared__["PRIMARY_OUTLET"]] = new UrlSegmentGroup(paths, children);
- }
- return res;
- };
- /**
- * @return {?}
- */
- UrlParser.prototype.parseSegments = function () {
- var /** @type {?} */ path = matchSegments(this.remaining);
- if (path === '' && this.peekStartsWith(';')) {
- throw new Error("Empty path url segment cannot have parameters: '" + this.remaining + "'.");
- }
- this.capture(path);
- var /** @type {?} */ matrixParams = {};
- if (this.peekStartsWith(';')) {
- matrixParams = this.parseMatrixParams();
- }
- return new UrlSegment(decode(path), matrixParams);
- };
- /**
- * @return {?}
- */
- UrlParser.prototype.parseQueryParams = function () {
- var /** @type {?} */ params = {};
- if (this.peekStartsWith('?')) {
- this.capture('?');
- this.parseQueryParam(params);
- while (this.remaining.length > 0 && this.peekStartsWith('&')) {
- this.capture('&');
- this.parseQueryParam(params);
- }
- }
- return params;
- };
- /**
- * @return {?}
- */
- UrlParser.prototype.parseFragment = function () {
- if (this.peekStartsWith('#')) {
- return decodeURI(this.remaining.substring(1));
- }
- return null;
- };
- /**
- * @return {?}
- */
- UrlParser.prototype.parseMatrixParams = function () {
- var /** @type {?} */ params = {};
- while (this.remaining.length > 0 && this.peekStartsWith(';')) {
- this.capture(';');
- this.parseParam(params);
- }
- return params;
- };
- /**
- * @param {?} params
- * @return {?}
- */
- UrlParser.prototype.parseParam = function (params) {
- var /** @type {?} */ key = matchSegments(this.remaining);
- if (!key) {
- return;
- }
- this.capture(key);
- var /** @type {?} */ value = '';
- if (this.peekStartsWith('=')) {
- this.capture('=');
- var /** @type {?} */ valueMatch = matchSegments(this.remaining);
- if (valueMatch) {
- value = valueMatch;
- this.capture(value);
- }
- }
- params[decode(key)] = decode(value);
- };
- /**
- * @param {?} params
- * @return {?}
- */
- UrlParser.prototype.parseQueryParam = function (params) {
- var /** @type {?} */ key = matchQueryParams(this.remaining);
- if (!key) {
- return;
- }
- this.capture(key);
- var /** @type {?} */ value = '';
- if (this.peekStartsWith('=')) {
- this.capture('=');
- var /** @type {?} */ valueMatch = matchUrlQueryParamValue(this.remaining);
- if (valueMatch) {
- value = valueMatch;
- this.capture(value);
- }
- }
- var /** @type {?} */ decodedKey = decode(key);
- var /** @type {?} */ decodedVal = decode(value);
- if (params.hasOwnProperty(decodedKey)) {
- // Append to existing values
- var /** @type {?} */ currentVal = params[decodedKey];
- if (!Array.isArray(currentVal)) {
- currentVal = [currentVal];
- params[decodedKey] = currentVal;
- }
- currentVal.push(decodedVal);
- }
- else {
- // Create a new value
- params[decodedKey] = decodedVal;
- }
- };
- /**
- * @param {?} allowPrimary
- * @return {?}
- */
- UrlParser.prototype.parseParens = function (allowPrimary) {
- var /** @type {?} */ segments = {};
- this.capture('(');
- while (!this.peekStartsWith(')') && this.remaining.length > 0) {
- var /** @type {?} */ path = matchSegments(this.remaining);
- var /** @type {?} */ next = this.remaining[path.length];
- // if is is not one of these characters, then the segment was unescaped
- // or the group was not closed
- if (next !== '/' && next !== ')' && next !== ';') {
- throw new Error("Cannot parse url '" + this.url + "'");
- }
- var /** @type {?} */ outletName = void 0;
- if (path.indexOf(':') > -1) {
- outletName = path.substr(0, path.indexOf(':'));
- this.capture(outletName);
- this.capture(':');
- }
- else if (allowPrimary) {
- outletName = __WEBPACK_IMPORTED_MODULE_0__shared__["PRIMARY_OUTLET"];
- }
- var /** @type {?} */ children = this.parseChildren();
- segments[outletName] = Object.keys(children).length === 1 ? children[__WEBPACK_IMPORTED_MODULE_0__shared__["PRIMARY_OUTLET"]] :
- new UrlSegmentGroup([], children);
- if (this.peekStartsWith('//')) {
- this.capture('//');
- }
- }
- this.capture(')');
- return segments;
- };
- return UrlParser;
-}());
-function UrlParser_tsickle_Closure_declarations() {
- /** @type {?} */
- UrlParser.prototype.remaining;
- /** @type {?} */
- UrlParser.prototype.url;
-}
-//# sourceMappingURL=url_tree.js.map
-
-/***/ }),
-/* 85 */,
-/* 86 */,
-/* 87 */,
-/* 88 */,
-/* 89 */,
-/* 90 */,
-/* 91 */,
-/* 92 */,
-/* 93 */,
-/* 94 */,
-/* 95 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-var ArrayObservable_1 = __webpack_require__(64);
-exports.of = ArrayObservable_1.ArrayObservable.of;
-//# sourceMappingURL=of.js.map
-
-/***/ }),
-/* 96 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"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 Subscriber_1 = __webpack_require__(3);
-/**
- * Applies a given `project` function to each value emitted by the source
- * Observable, and emits the resulting values as an Observable.
- *
- * Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),
- * it passes each source value through a transformation function to get
- * corresponding output values.
- *
- *
- *
- * Similar to the well known `Array.prototype.map` function, this operator
- * applies a projection to each value and emits that projection in the output
- * Observable.
- *
- * @example Map every every click to the clientX position of that click
- * var clicks = Rx.Observable.fromEvent(document, 'click');
- * var positions = clicks.map(ev => ev.clientX);
- * positions.subscribe(x => console.log(x));
- *
- * @see {@link mapTo}
- * @see {@link pluck}
- *
- * @param {function(value: T, index: number): R} project The function to apply
- * to each `value` emitted by the source Observable. The `index` parameter is
- * the number `i` for the i-th emission that has happened since the
- * subscription, starting from the number `0`.
- * @param {any} [thisArg] An optional argument to define what `this` is in the
- * `project` function.
- * @return {Observable} An Observable that emits the values from the source
- * Observable transformed by the given `project` function.
- * @method map
- * @owner Observable
- */
-function map(project, thisArg) {
- if (typeof project !== 'function') {
- throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');
- }
- return this.lift(new MapOperator(project, thisArg));
-}
-exports.map = map;
-var MapOperator = (function () {
- function MapOperator(project, thisArg) {
- this.project = project;
- this.thisArg = thisArg;
- }
- MapOperator.prototype.call = function (subscriber, source) {
- return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));
- };
- return MapOperator;
-}());
-exports.MapOperator = MapOperator;
-/**
- * We need this JSDoc comment for affecting ESDoc.
- * @ignore
- * @extends {Ignored}
- */
-var MapSubscriber = (function (_super) {
- __extends(MapSubscriber, _super);
- function MapSubscriber(destination, project, thisArg) {
- _super.call(this, destination);
- this.project = project;
- this.count = 0;
- this.thisArg = thisArg || this;
- }
- // NOTE: This looks unoptimized, but it's actually purposefully NOT
- // using try/catch optimizations.
- MapSubscriber.prototype._next = function (value) {
- var result;
- try {
- result = this.project.call(this.thisArg, value, this.count++);
- }
- catch (err) {
- this.destination.error(err);
- return;
- }
- this.destination.next(result);
- };
- return MapSubscriber;
-}(Subscriber_1.Subscriber));
-//# sourceMappingURL=map.js.map
-
-/***/ }),
-/* 97 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__chars__ = __webpack_require__(148);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__facade_lang__ = __webpack_require__(7);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__injectable__ = __webpack_require__(20);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ml_parser_interpolation_config__ = __webpack_require__(47);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ast__ = __webpack_require__(209);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__lexer__ = __webpack_require__(115);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SplitInterpolation", function() { return SplitInterpolation; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateBindingParseResult", function() { return TemplateBindingParseResult; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Parser", function() { return Parser; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_ParseAST", function() { return _ParseAST; });
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-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 SplitInterpolation = (function () {
- /**
- * @param {?} strings
- * @param {?} expressions
- * @param {?} offsets
- */
- function SplitInterpolation(strings, expressions, offsets) {
- this.strings = strings;
- this.expressions = expressions;
- this.offsets = offsets;
- }
- return SplitInterpolation;
-}());
-function SplitInterpolation_tsickle_Closure_declarations() {
- /** @type {?} */
- SplitInterpolation.prototype.strings;
- /** @type {?} */
- SplitInterpolation.prototype.expressions;
- /** @type {?} */
- SplitInterpolation.prototype.offsets;
-}
-var TemplateBindingParseResult = (function () {
- /**
- * @param {?} templateBindings
- * @param {?} warnings
- * @param {?} errors
- */
- function TemplateBindingParseResult(templateBindings, warnings, errors) {
- this.templateBindings = templateBindings;
- this.warnings = warnings;
- this.errors = errors;
- }
- return TemplateBindingParseResult;
-}());
-function TemplateBindingParseResult_tsickle_Closure_declarations() {
- /** @type {?} */
- TemplateBindingParseResult.prototype.templateBindings;
- /** @type {?} */
- TemplateBindingParseResult.prototype.warnings;
- /** @type {?} */
- TemplateBindingParseResult.prototype.errors;
-}
-/**
- * @param {?} config
- * @return {?}
- */
-function _createInterpolateRegExp(config) {
- var /** @type {?} */ pattern = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["escapeRegExp"])(config.start) + '([\\s\\S]*?)' + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["escapeRegExp"])(config.end);
- return new RegExp(pattern, 'g');
-}
-var Parser = (function () {
- /**
- * @param {?} _lexer
- */
- function Parser(_lexer) {
- this._lexer = _lexer;
- this.errors = [];
- }
- /**
- * @param {?} input
- * @param {?} location
- * @param {?=} interpolationConfig
- * @return {?}
- */
- Parser.prototype.parseAction = function (input, location, interpolationConfig) {
- if (interpolationConfig === void 0) { interpolationConfig = __WEBPACK_IMPORTED_MODULE_3__ml_parser_interpolation_config__["DEFAULT_INTERPOLATION_CONFIG"]; }
- this._checkNoInterpolation(input, location, interpolationConfig);
- var /** @type {?} */ sourceToLex = this._stripComments(input);
- var /** @type {?} */ tokens = this._lexer.tokenize(this._stripComments(input));
- var /** @type {?} */ ast = new _ParseAST(input, location, tokens, sourceToLex.length, true, this.errors, input.length - sourceToLex.length)
- .parseChain();
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["ASTWithSource"](ast, input, location, this.errors);
- };
- /**
- * @param {?} input
- * @param {?} location
- * @param {?=} interpolationConfig
- * @return {?}
- */
- Parser.prototype.parseBinding = function (input, location, interpolationConfig) {
- if (interpolationConfig === void 0) { interpolationConfig = __WEBPACK_IMPORTED_MODULE_3__ml_parser_interpolation_config__["DEFAULT_INTERPOLATION_CONFIG"]; }
- var /** @type {?} */ ast = this._parseBindingAst(input, location, interpolationConfig);
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["ASTWithSource"](ast, input, location, this.errors);
- };
- /**
- * @param {?} input
- * @param {?} location
- * @param {?=} interpolationConfig
- * @return {?}
- */
- Parser.prototype.parseSimpleBinding = function (input, location, interpolationConfig) {
- if (interpolationConfig === void 0) { interpolationConfig = __WEBPACK_IMPORTED_MODULE_3__ml_parser_interpolation_config__["DEFAULT_INTERPOLATION_CONFIG"]; }
- var /** @type {?} */ ast = this._parseBindingAst(input, location, interpolationConfig);
- var /** @type {?} */ errors = SimpleExpressionChecker.check(ast);
- if (errors.length > 0) {
- this._reportError("Host binding expression cannot contain " + errors.join(' '), input, location);
- }
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["ASTWithSource"](ast, input, location, this.errors);
- };
- /**
- * @param {?} message
- * @param {?} input
- * @param {?} errLocation
- * @param {?=} ctxLocation
- * @return {?}
- */
- Parser.prototype._reportError = function (message, input, errLocation, ctxLocation) {
- this.errors.push(new __WEBPACK_IMPORTED_MODULE_4__ast__["ParserError"](message, input, errLocation, ctxLocation));
- };
- /**
- * @param {?} input
- * @param {?} location
- * @param {?} interpolationConfig
- * @return {?}
- */
- Parser.prototype._parseBindingAst = function (input, location, interpolationConfig) {
- // Quotes expressions use 3rd-party expression language. We don't want to use
- // our lexer or parser for that, so we check for that ahead of time.
- var /** @type {?} */ quote = this._parseQuote(input, location);
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["isPresent"])(quote)) {
- return quote;
- }
- this._checkNoInterpolation(input, location, interpolationConfig);
- var /** @type {?} */ sourceToLex = this._stripComments(input);
- var /** @type {?} */ tokens = this._lexer.tokenize(sourceToLex);
- return new _ParseAST(input, location, tokens, sourceToLex.length, false, this.errors, input.length - sourceToLex.length)
- .parseChain();
- };
- /**
- * @param {?} input
- * @param {?} location
- * @return {?}
- */
- Parser.prototype._parseQuote = function (input, location) {
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["isBlank"])(input))
- return null;
- var /** @type {?} */ prefixSeparatorIndex = input.indexOf(':');
- if (prefixSeparatorIndex == -1)
- return null;
- var /** @type {?} */ prefix = input.substring(0, prefixSeparatorIndex).trim();
- if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lexer__["isIdentifier"])(prefix))
- return null;
- var /** @type {?} */ uninterpretedExpression = input.substring(prefixSeparatorIndex + 1);
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["Quote"](new __WEBPACK_IMPORTED_MODULE_4__ast__["ParseSpan"](0, input.length), prefix, uninterpretedExpression, location);
- };
- /**
- * @param {?} prefixToken
- * @param {?} input
- * @param {?} location
- * @return {?}
- */
- Parser.prototype.parseTemplateBindings = function (prefixToken, input, location) {
- var /** @type {?} */ tokens = this._lexer.tokenize(input);
- if (prefixToken) {
- // Prefix the tokens with the tokens from prefixToken but have them take no space (0 index).
- var /** @type {?} */ prefixTokens = this._lexer.tokenize(prefixToken).map(function (t) {
- t.index = 0;
- return t;
- });
- tokens.unshift.apply(tokens, prefixTokens);
- }
- return new _ParseAST(input, location, tokens, input.length, false, this.errors, 0)
- .parseTemplateBindings();
- };
- /**
- * @param {?} input
- * @param {?} location
- * @param {?=} interpolationConfig
- * @return {?}
- */
- Parser.prototype.parseInterpolation = function (input, location, interpolationConfig) {
- if (interpolationConfig === void 0) { interpolationConfig = __WEBPACK_IMPORTED_MODULE_3__ml_parser_interpolation_config__["DEFAULT_INTERPOLATION_CONFIG"]; }
- var /** @type {?} */ split = this.splitInterpolation(input, location, interpolationConfig);
- if (split == null)
- return null;
- var /** @type {?} */ expressions = [];
- for (var /** @type {?} */ i = 0; i < split.expressions.length; ++i) {
- var /** @type {?} */ expressionText = split.expressions[i];
- var /** @type {?} */ sourceToLex = this._stripComments(expressionText);
- var /** @type {?} */ tokens = this._lexer.tokenize(this._stripComments(split.expressions[i]));
- var /** @type {?} */ ast = new _ParseAST(input, location, tokens, sourceToLex.length, false, this.errors, split.offsets[i] + (expressionText.length - sourceToLex.length))
- .parseChain();
- expressions.push(ast);
- }
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["ASTWithSource"](new __WEBPACK_IMPORTED_MODULE_4__ast__["Interpolation"](new __WEBPACK_IMPORTED_MODULE_4__ast__["ParseSpan"](0, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["isBlank"])(input) ? 0 : input.length), split.strings, expressions), input, location, this.errors);
- };
- /**
- * @param {?} input
- * @param {?} location
- * @param {?=} interpolationConfig
- * @return {?}
- */
- Parser.prototype.splitInterpolation = function (input, location, interpolationConfig) {
- if (interpolationConfig === void 0) { interpolationConfig = __WEBPACK_IMPORTED_MODULE_3__ml_parser_interpolation_config__["DEFAULT_INTERPOLATION_CONFIG"]; }
- var /** @type {?} */ regexp = _createInterpolateRegExp(interpolationConfig);
- var /** @type {?} */ parts = input.split(regexp);
- if (parts.length <= 1) {
- return null;
- }
- var /** @type {?} */ strings = [];
- var /** @type {?} */ expressions = [];
- var /** @type {?} */ offsets = [];
- var /** @type {?} */ offset = 0;
- for (var /** @type {?} */ i = 0; i < parts.length; i++) {
- var /** @type {?} */ part = parts[i];
- if (i % 2 === 0) {
- // fixed string
- strings.push(part);
- offset += part.length;
- }
- else if (part.trim().length > 0) {
- offset += interpolationConfig.start.length;
- expressions.push(part);
- offsets.push(offset);
- offset += part.length + interpolationConfig.end.length;
- }
- else {
- this._reportError('Blank expressions are not allowed in interpolated strings', input, "at column " + this._findInterpolationErrorColumn(parts, i, interpolationConfig) + " in", location);
- expressions.push('$implict');
- offsets.push(offset);
- }
- }
- return new SplitInterpolation(strings, expressions, offsets);
- };
- /**
- * @param {?} input
- * @param {?} location
- * @return {?}
- */
- Parser.prototype.wrapLiteralPrimitive = function (input, location) {
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["ASTWithSource"](new __WEBPACK_IMPORTED_MODULE_4__ast__["LiteralPrimitive"](new __WEBPACK_IMPORTED_MODULE_4__ast__["ParseSpan"](0, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["isBlank"])(input) ? 0 : input.length), input), input, location, this.errors);
- };
- /**
- * @param {?} input
- * @return {?}
- */
- Parser.prototype._stripComments = function (input) {
- var /** @type {?} */ i = this._commentStart(input);
- return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["isPresent"])(i) ? input.substring(0, i).trim() : input;
- };
- /**
- * @param {?} input
- * @return {?}
- */
- Parser.prototype._commentStart = function (input) {
- var /** @type {?} */ outerQuote = null;
- for (var /** @type {?} */ i = 0; i < input.length - 1; i++) {
- var /** @type {?} */ char = input.charCodeAt(i);
- var /** @type {?} */ nextChar = input.charCodeAt(i + 1);
- if (char === __WEBPACK_IMPORTED_MODULE_0__chars__["$SLASH"] && nextChar == __WEBPACK_IMPORTED_MODULE_0__chars__["$SLASH"] && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["isBlank"])(outerQuote))
- return i;
- if (outerQuote === char) {
- outerQuote = null;
- }
- else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["isBlank"])(outerQuote) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lexer__["isQuote"])(char)) {
- outerQuote = char;
- }
- }
- return null;
- };
- /**
- * @param {?} input
- * @param {?} location
- * @param {?} interpolationConfig
- * @return {?}
- */
- Parser.prototype._checkNoInterpolation = function (input, location, interpolationConfig) {
- var /** @type {?} */ regexp = _createInterpolateRegExp(interpolationConfig);
- var /** @type {?} */ parts = input.split(regexp);
- if (parts.length > 1) {
- this._reportError("Got interpolation (" + interpolationConfig.start + interpolationConfig.end + ") where expression was expected", input, "at column " + this._findInterpolationErrorColumn(parts, 1, interpolationConfig) + " in", location);
- }
- };
- /**
- * @param {?} parts
- * @param {?} partInErrIdx
- * @param {?} interpolationConfig
- * @return {?}
- */
- Parser.prototype._findInterpolationErrorColumn = function (parts, partInErrIdx, interpolationConfig) {
- var /** @type {?} */ errLocation = '';
- for (var /** @type {?} */ j = 0; j < partInErrIdx; j++) {
- errLocation += j % 2 === 0 ?
- parts[j] :
- "" + interpolationConfig.start + parts[j] + interpolationConfig.end;
- }
- return errLocation.length;
- };
- Parser = __decorate([
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__injectable__["CompilerInjectable"])(),
- __metadata('design:paramtypes', [__WEBPACK_IMPORTED_MODULE_5__lexer__["Lexer"]])
- ], Parser);
- return Parser;
-}());
-function Parser_tsickle_Closure_declarations() {
- /** @type {?} */
- Parser.prototype.errors;
- /** @type {?} */
- Parser.prototype._lexer;
-}
-var _ParseAST = (function () {
- /**
- * @param {?} input
- * @param {?} location
- * @param {?} tokens
- * @param {?} inputLength
- * @param {?} parseAction
- * @param {?} errors
- * @param {?} offset
- */
- function _ParseAST(input, location, tokens, inputLength, parseAction, errors, offset) {
- this.input = input;
- this.location = location;
- this.tokens = tokens;
- this.inputLength = inputLength;
- this.parseAction = parseAction;
- this.errors = errors;
- this.offset = offset;
- this.rparensExpected = 0;
- this.rbracketsExpected = 0;
- this.rbracesExpected = 0;
- this.index = 0;
- }
- /**
- * @param {?} offset
- * @return {?}
- */
- _ParseAST.prototype.peek = function (offset) {
- var /** @type {?} */ i = this.index + offset;
- return i < this.tokens.length ? this.tokens[i] : __WEBPACK_IMPORTED_MODULE_5__lexer__["EOF"];
- };
- Object.defineProperty(_ParseAST.prototype, "next", {
- /**
- * @return {?}
- */
- get: function () { return this.peek(0); },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(_ParseAST.prototype, "inputIndex", {
- /**
- * @return {?}
- */
- get: function () {
- return (this.index < this.tokens.length) ? this.next.index + this.offset :
- this.inputLength + this.offset;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * @param {?} start
- * @return {?}
- */
- _ParseAST.prototype.span = function (start) { return new __WEBPACK_IMPORTED_MODULE_4__ast__["ParseSpan"](start, this.inputIndex); };
- /**
- * @return {?}
- */
- _ParseAST.prototype.advance = function () { this.index++; };
- /**
- * @param {?} code
- * @return {?}
- */
- _ParseAST.prototype.optionalCharacter = function (code) {
- if (this.next.isCharacter(code)) {
- this.advance();
- return true;
- }
- else {
- return false;
- }
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.peekKeywordLet = function () { return this.next.isKeywordLet(); };
- /**
- * @param {?} code
- * @return {?}
- */
- _ParseAST.prototype.expectCharacter = function (code) {
- if (this.optionalCharacter(code))
- return;
- this.error("Missing expected " + String.fromCharCode(code));
- };
- /**
- * @param {?} op
- * @return {?}
- */
- _ParseAST.prototype.optionalOperator = function (op) {
- if (this.next.isOperator(op)) {
- this.advance();
- return true;
- }
- else {
- return false;
- }
- };
- /**
- * @param {?} operator
- * @return {?}
- */
- _ParseAST.prototype.expectOperator = function (operator) {
- if (this.optionalOperator(operator))
- return;
- this.error("Missing expected operator " + operator);
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.expectIdentifierOrKeyword = function () {
- var /** @type {?} */ n = this.next;
- if (!n.isIdentifier() && !n.isKeyword()) {
- this.error("Unexpected token " + n + ", expected identifier or keyword");
- return '';
- }
- this.advance();
- return n.toString();
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.expectIdentifierOrKeywordOrString = function () {
- var /** @type {?} */ n = this.next;
- if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) {
- this.error("Unexpected token " + n + ", expected identifier, keyword, or string");
- return '';
- }
- this.advance();
- return n.toString();
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parseChain = function () {
- var /** @type {?} */ exprs = [];
- var /** @type {?} */ start = this.inputIndex;
- while (this.index < this.tokens.length) {
- var /** @type {?} */ expr = this.parsePipe();
- exprs.push(expr);
- if (this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$SEMICOLON"])) {
- if (!this.parseAction) {
- this.error('Binding expression cannot contain chained expression');
- }
- while (this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$SEMICOLON"])) {
- } // read all semicolons
- }
- else if (this.index < this.tokens.length) {
- this.error("Unexpected token '" + this.next + "'");
- }
- }
- if (exprs.length == 0)
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["EmptyExpr"](this.span(start));
- if (exprs.length == 1)
- return exprs[0];
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["Chain"](this.span(start), exprs);
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parsePipe = function () {
- var /** @type {?} */ result = this.parseExpression();
- if (this.optionalOperator('|')) {
- if (this.parseAction) {
- this.error('Cannot have a pipe in an action expression');
- }
- do {
- var /** @type {?} */ name_1 = this.expectIdentifierOrKeyword();
- var /** @type {?} */ args = [];
- while (this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$COLON"])) {
- args.push(this.parseExpression());
- }
- result = new __WEBPACK_IMPORTED_MODULE_4__ast__["BindingPipe"](this.span(result.span.start), result, name_1, args);
- } while (this.optionalOperator('|'));
- }
- return result;
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parseExpression = function () { return this.parseConditional(); };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parseConditional = function () {
- var /** @type {?} */ start = this.inputIndex;
- var /** @type {?} */ result = this.parseLogicalOr();
- if (this.optionalOperator('?')) {
- var /** @type {?} */ yes = this.parsePipe();
- var /** @type {?} */ no = void 0;
- if (!this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$COLON"])) {
- var /** @type {?} */ end = this.inputIndex;
- var /** @type {?} */ expression = this.input.substring(start, end);
- this.error("Conditional expression " + expression + " requires all 3 expressions");
- no = new __WEBPACK_IMPORTED_MODULE_4__ast__["EmptyExpr"](this.span(start));
- }
- else {
- no = this.parsePipe();
- }
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["Conditional"](this.span(start), result, yes, no);
- }
- else {
- return result;
- }
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parseLogicalOr = function () {
- // '||'
- var /** @type {?} */ result = this.parseLogicalAnd();
- while (this.optionalOperator('||')) {
- var /** @type {?} */ right = this.parseLogicalAnd();
- result = new __WEBPACK_IMPORTED_MODULE_4__ast__["Binary"](this.span(result.span.start), '||', result, right);
- }
- return result;
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parseLogicalAnd = function () {
- // '&&'
- var /** @type {?} */ result = this.parseEquality();
- while (this.optionalOperator('&&')) {
- var /** @type {?} */ right = this.parseEquality();
- result = new __WEBPACK_IMPORTED_MODULE_4__ast__["Binary"](this.span(result.span.start), '&&', result, right);
- }
- return result;
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parseEquality = function () {
- // '==','!=','===','!=='
- var /** @type {?} */ result = this.parseRelational();
- while (this.next.type == __WEBPACK_IMPORTED_MODULE_5__lexer__["TokenType"].Operator) {
- var /** @type {?} */ operator = this.next.strValue;
- switch (operator) {
- case '==':
- case '===':
- case '!=':
- case '!==':
- this.advance();
- var /** @type {?} */ right = this.parseRelational();
- result = new __WEBPACK_IMPORTED_MODULE_4__ast__["Binary"](this.span(result.span.start), operator, result, right);
- continue;
- }
- break;
- }
- return result;
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parseRelational = function () {
- // '<', '>', '<=', '>='
- var /** @type {?} */ result = this.parseAdditive();
- while (this.next.type == __WEBPACK_IMPORTED_MODULE_5__lexer__["TokenType"].Operator) {
- var /** @type {?} */ operator = this.next.strValue;
- switch (operator) {
- case '<':
- case '>':
- case '<=':
- case '>=':
- this.advance();
- var /** @type {?} */ right = this.parseAdditive();
- result = new __WEBPACK_IMPORTED_MODULE_4__ast__["Binary"](this.span(result.span.start), operator, result, right);
- continue;
- }
- break;
- }
- return result;
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parseAdditive = function () {
- // '+', '-'
- var /** @type {?} */ result = this.parseMultiplicative();
- while (this.next.type == __WEBPACK_IMPORTED_MODULE_5__lexer__["TokenType"].Operator) {
- var /** @type {?} */ operator = this.next.strValue;
- switch (operator) {
- case '+':
- case '-':
- this.advance();
- var /** @type {?} */ right = this.parseMultiplicative();
- result = new __WEBPACK_IMPORTED_MODULE_4__ast__["Binary"](this.span(result.span.start), operator, result, right);
- continue;
- }
- break;
- }
- return result;
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parseMultiplicative = function () {
- // '*', '%', '/'
- var /** @type {?} */ result = this.parsePrefix();
- while (this.next.type == __WEBPACK_IMPORTED_MODULE_5__lexer__["TokenType"].Operator) {
- var /** @type {?} */ operator = this.next.strValue;
- switch (operator) {
- case '*':
- case '%':
- case '/':
- this.advance();
- var /** @type {?} */ right = this.parsePrefix();
- result = new __WEBPACK_IMPORTED_MODULE_4__ast__["Binary"](this.span(result.span.start), operator, result, right);
- continue;
- }
- break;
- }
- return result;
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parsePrefix = function () {
- if (this.next.type == __WEBPACK_IMPORTED_MODULE_5__lexer__["TokenType"].Operator) {
- var /** @type {?} */ start = this.inputIndex;
- var /** @type {?} */ operator = this.next.strValue;
- var /** @type {?} */ result = void 0;
- switch (operator) {
- case '+':
- this.advance();
- return this.parsePrefix();
- case '-':
- this.advance();
- result = this.parsePrefix();
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["Binary"](this.span(start), operator, new __WEBPACK_IMPORTED_MODULE_4__ast__["LiteralPrimitive"](new __WEBPACK_IMPORTED_MODULE_4__ast__["ParseSpan"](start, start), 0), result);
- case '!':
- this.advance();
- result = this.parsePrefix();
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["PrefixNot"](this.span(start), result);
- }
- }
- return this.parseCallChain();
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parseCallChain = function () {
- var /** @type {?} */ result = this.parsePrimary();
- while (true) {
- if (this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$PERIOD"])) {
- result = this.parseAccessMemberOrMethodCall(result, false);
- }
- else if (this.optionalOperator('?.')) {
- result = this.parseAccessMemberOrMethodCall(result, true);
- }
- else if (this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$LBRACKET"])) {
- this.rbracketsExpected++;
- var /** @type {?} */ key = this.parsePipe();
- this.rbracketsExpected--;
- this.expectCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$RBRACKET"]);
- if (this.optionalOperator('=')) {
- var /** @type {?} */ value = this.parseConditional();
- result = new __WEBPACK_IMPORTED_MODULE_4__ast__["KeyedWrite"](this.span(result.span.start), result, key, value);
- }
- else {
- result = new __WEBPACK_IMPORTED_MODULE_4__ast__["KeyedRead"](this.span(result.span.start), result, key);
- }
- }
- else if (this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$LPAREN"])) {
- this.rparensExpected++;
- var /** @type {?} */ args = this.parseCallArguments();
- this.rparensExpected--;
- this.expectCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$RPAREN"]);
- result = new __WEBPACK_IMPORTED_MODULE_4__ast__["FunctionCall"](this.span(result.span.start), result, args);
- }
- else {
- return result;
- }
- }
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parsePrimary = function () {
- var /** @type {?} */ start = this.inputIndex;
- if (this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$LPAREN"])) {
- this.rparensExpected++;
- var /** @type {?} */ result = this.parsePipe();
- this.rparensExpected--;
- this.expectCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$RPAREN"]);
- return result;
- }
- else if (this.next.isKeywordNull()) {
- this.advance();
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["LiteralPrimitive"](this.span(start), null);
- }
- else if (this.next.isKeywordUndefined()) {
- this.advance();
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["LiteralPrimitive"](this.span(start), void 0);
- }
- else if (this.next.isKeywordTrue()) {
- this.advance();
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["LiteralPrimitive"](this.span(start), true);
- }
- else if (this.next.isKeywordFalse()) {
- this.advance();
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["LiteralPrimitive"](this.span(start), false);
- }
- else if (this.next.isKeywordThis()) {
- this.advance();
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["ImplicitReceiver"](this.span(start));
- }
- else if (this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$LBRACKET"])) {
- this.rbracketsExpected++;
- var /** @type {?} */ elements = this.parseExpressionList(__WEBPACK_IMPORTED_MODULE_0__chars__["$RBRACKET"]);
- this.rbracketsExpected--;
- this.expectCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$RBRACKET"]);
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["LiteralArray"](this.span(start), elements);
- }
- else if (this.next.isCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$LBRACE"])) {
- return this.parseLiteralMap();
- }
- else if (this.next.isIdentifier()) {
- return this.parseAccessMemberOrMethodCall(new __WEBPACK_IMPORTED_MODULE_4__ast__["ImplicitReceiver"](this.span(start)), false);
- }
- else if (this.next.isNumber()) {
- var /** @type {?} */ value = this.next.toNumber();
- this.advance();
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["LiteralPrimitive"](this.span(start), value);
- }
- else if (this.next.isString()) {
- var /** @type {?} */ literalValue = this.next.toString();
- this.advance();
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["LiteralPrimitive"](this.span(start), literalValue);
- }
- else if (this.index >= this.tokens.length) {
- this.error("Unexpected end of expression: " + this.input);
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["EmptyExpr"](this.span(start));
- }
- else {
- this.error("Unexpected token " + this.next);
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["EmptyExpr"](this.span(start));
- }
- };
- /**
- * @param {?} terminator
- * @return {?}
- */
- _ParseAST.prototype.parseExpressionList = function (terminator) {
- var /** @type {?} */ result = [];
- if (!this.next.isCharacter(terminator)) {
- do {
- result.push(this.parsePipe());
- } while (this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$COMMA"]));
- }
- return result;
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parseLiteralMap = function () {
- var /** @type {?} */ keys = [];
- var /** @type {?} */ values = [];
- var /** @type {?} */ start = this.inputIndex;
- this.expectCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$LBRACE"]);
- if (!this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$RBRACE"])) {
- this.rbracesExpected++;
- do {
- var /** @type {?} */ key = this.expectIdentifierOrKeywordOrString();
- keys.push(key);
- this.expectCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$COLON"]);
- values.push(this.parsePipe());
- } while (this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$COMMA"]));
- this.rbracesExpected--;
- this.expectCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$RBRACE"]);
- }
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["LiteralMap"](this.span(start), keys, values);
- };
- /**
- * @param {?} receiver
- * @param {?=} isSafe
- * @return {?}
- */
- _ParseAST.prototype.parseAccessMemberOrMethodCall = function (receiver, isSafe) {
- if (isSafe === void 0) { isSafe = false; }
- var /** @type {?} */ start = receiver.span.start;
- var /** @type {?} */ id = this.expectIdentifierOrKeyword();
- if (this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$LPAREN"])) {
- this.rparensExpected++;
- var /** @type {?} */ args = this.parseCallArguments();
- this.expectCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$RPAREN"]);
- this.rparensExpected--;
- var /** @type {?} */ span = this.span(start);
- return isSafe ? new __WEBPACK_IMPORTED_MODULE_4__ast__["SafeMethodCall"](span, receiver, id, args) :
- new __WEBPACK_IMPORTED_MODULE_4__ast__["MethodCall"](span, receiver, id, args);
- }
- else {
- if (isSafe) {
- if (this.optionalOperator('=')) {
- this.error('The \'?.\' operator cannot be used in the assignment');
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["EmptyExpr"](this.span(start));
- }
- else {
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["SafePropertyRead"](this.span(start), receiver, id);
- }
- }
- else {
- if (this.optionalOperator('=')) {
- if (!this.parseAction) {
- this.error('Bindings cannot contain assignments');
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["EmptyExpr"](this.span(start));
- }
- var /** @type {?} */ value = this.parseConditional();
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["PropertyWrite"](this.span(start), receiver, id, value);
- }
- else {
- return new __WEBPACK_IMPORTED_MODULE_4__ast__["PropertyRead"](this.span(start), receiver, id);
- }
- }
- }
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parseCallArguments = function () {
- if (this.next.isCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$RPAREN"]))
- return [];
- var /** @type {?} */ positionals = [];
- do {
- positionals.push(this.parsePipe());
- } while (this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$COMMA"]));
- return (positionals);
- };
- /**
- * An identifier, a keyword, a string with an optional `-` inbetween.
- * @return {?}
- */
- _ParseAST.prototype.expectTemplateBindingKey = function () {
- var /** @type {?} */ result = '';
- var /** @type {?} */ operatorFound = false;
- do {
- result += this.expectIdentifierOrKeywordOrString();
- operatorFound = this.optionalOperator('-');
- if (operatorFound) {
- result += '-';
- }
- } while (operatorFound);
- return result.toString();
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.parseTemplateBindings = function () {
- var /** @type {?} */ bindings = [];
- var /** @type {?} */ prefix = null;
- var /** @type {?} */ warnings = [];
- while (this.index < this.tokens.length) {
- var /** @type {?} */ start = this.inputIndex;
- var /** @type {?} */ keyIsVar = this.peekKeywordLet();
- if (keyIsVar) {
- this.advance();
- }
- var /** @type {?} */ key = this.expectTemplateBindingKey();
- if (!keyIsVar) {
- if (prefix == null) {
- prefix = key;
- }
- else {
- key = prefix + key[0].toUpperCase() + key.substring(1);
- }
- }
- this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$COLON"]);
- var /** @type {?} */ name_2 = null;
- var /** @type {?} */ expression = null;
- if (keyIsVar) {
- if (this.optionalOperator('=')) {
- name_2 = this.expectTemplateBindingKey();
- }
- else {
- name_2 = '\$implicit';
- }
- }
- else if (this.next !== __WEBPACK_IMPORTED_MODULE_5__lexer__["EOF"] && !this.peekKeywordLet()) {
- var /** @type {?} */ start_1 = this.inputIndex;
- var /** @type {?} */ ast = this.parsePipe();
- var /** @type {?} */ source = this.input.substring(start_1 - this.offset, this.inputIndex - this.offset);
- expression = new __WEBPACK_IMPORTED_MODULE_4__ast__["ASTWithSource"](ast, source, this.location, this.errors);
- }
- bindings.push(new __WEBPACK_IMPORTED_MODULE_4__ast__["TemplateBinding"](this.span(start), key, keyIsVar, name_2, expression));
- if (!this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$SEMICOLON"])) {
- this.optionalCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$COMMA"]);
- }
- }
- return new TemplateBindingParseResult(bindings, warnings, this.errors);
- };
- /**
- * @param {?} message
- * @param {?=} index
- * @return {?}
- */
- _ParseAST.prototype.error = function (message, index) {
- if (index === void 0) { index = null; }
- this.errors.push(new __WEBPACK_IMPORTED_MODULE_4__ast__["ParserError"](message, this.input, this.locationText(index), this.location));
- this.skip();
- };
- /**
- * @param {?=} index
- * @return {?}
- */
- _ParseAST.prototype.locationText = function (index) {
- if (index === void 0) { index = null; }
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["isBlank"])(index))
- index = this.index;
- return (index < this.tokens.length) ? "at column " + (this.tokens[index].index + 1) + " in" :
- "at the end of the expression";
- };
- /**
- * @return {?}
- */
- _ParseAST.prototype.skip = function () {
- var /** @type {?} */ n = this.next;
- while (this.index < this.tokens.length && !n.isCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$SEMICOLON"]) &&
- (this.rparensExpected <= 0 || !n.isCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$RPAREN"])) &&
- (this.rbracesExpected <= 0 || !n.isCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$RBRACE"])) &&
- (this.rbracketsExpected <= 0 || !n.isCharacter(__WEBPACK_IMPORTED_MODULE_0__chars__["$RBRACKET"]))) {
- if (this.next.isError()) {
- this.errors.push(new __WEBPACK_IMPORTED_MODULE_4__ast__["ParserError"](this.next.toString(), this.input, this.locationText(), this.location));
- }
- this.advance();
- n = this.next;
- }
- };
- return _ParseAST;
-}());
-function _ParseAST_tsickle_Closure_declarations() {
- /** @type {?} */
- _ParseAST.prototype.rparensExpected;
- /** @type {?} */
- _ParseAST.prototype.rbracketsExpected;
- /** @type {?} */
- _ParseAST.prototype.rbracesExpected;
- /** @type {?} */
- _ParseAST.prototype.index;
- /** @type {?} */
- _ParseAST.prototype.input;
- /** @type {?} */
- _ParseAST.prototype.location;
- /** @type {?} */
- _ParseAST.prototype.tokens;
- /** @type {?} */
- _ParseAST.prototype.inputLength;
- /** @type {?} */
- _ParseAST.prototype.parseAction;
- /** @type {?} */
- _ParseAST.prototype.errors;
- /** @type {?} */
- _ParseAST.prototype.offset;
-}
-var SimpleExpressionChecker = (function () {
- function SimpleExpressionChecker() {
- this.errors = [];
- }
- /**
- * @param {?} ast
- * @return {?}
- */
- SimpleExpressionChecker.check = function (ast) {
- var /** @type {?} */ s = new SimpleExpressionChecker();
- ast.visit(s);
- return s.errors;
- };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitImplicitReceiver = function (ast, context) { };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitInterpolation = function (ast, context) { };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitLiteralPrimitive = function (ast, context) { };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitPropertyRead = function (ast, context) { };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitPropertyWrite = function (ast, context) { };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitSafePropertyRead = function (ast, context) { };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitMethodCall = function (ast, context) { };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitSafeMethodCall = function (ast, context) { };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitFunctionCall = function (ast, context) { };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitLiteralArray = function (ast, context) { this.visitAll(ast.expressions); };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitLiteralMap = function (ast, context) { this.visitAll(ast.values); };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitBinary = function (ast, context) { };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitPrefixNot = function (ast, context) { };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitConditional = function (ast, context) { };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitPipe = function (ast, context) { this.errors.push('pipes'); };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitKeyedRead = function (ast, context) { };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitKeyedWrite = function (ast, context) { };
- /**
- * @param {?} asts
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitAll = function (asts) {
- var _this = this;
- return asts.map(function (node) { return node.visit(_this); });
- };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitChain = function (ast, context) { };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- SimpleExpressionChecker.prototype.visitQuote = function (ast, context) { };
- return SimpleExpressionChecker;
-}());
-function SimpleExpressionChecker_tsickle_Closure_declarations() {
- /** @type {?} */
- SimpleExpressionChecker.prototype.errors;
-}
-//# sourceMappingURL=parser.js.map
-
-/***/ }),
-/* 98 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__facade_lang__ = __webpack_require__(7);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__parse_util__ = __webpack_require__(39);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ast__ = __webpack_require__(69);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__interpolation_config__ = __webpack_require__(47);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__lexer__ = __webpack_require__(485);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__tags__ = __webpack_require__(80);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TreeError", function() { return TreeError; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParseTreeResult", function() { return ParseTreeResult; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Parser", function() { return Parser; });
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-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 TreeError = (function (_super) {
- __extends(TreeError, _super);
- /**
- * @param {?} elementName
- * @param {?} span
- * @param {?} msg
- */
- function TreeError(elementName, span, msg) {
- _super.call(this, span, msg);
- this.elementName = elementName;
- }
- /**
- * @param {?} elementName
- * @param {?} span
- * @param {?} msg
- * @return {?}
- */
- TreeError.create = function (elementName, span, msg) {
- return new TreeError(elementName, span, msg);
- };
- return TreeError;
-}(__WEBPACK_IMPORTED_MODULE_1__parse_util__["ParseError"]));
-function TreeError_tsickle_Closure_declarations() {
- /** @type {?} */
- TreeError.prototype.elementName;
-}
-var ParseTreeResult = (function () {
- /**
- * @param {?} rootNodes
- * @param {?} errors
- */
- function ParseTreeResult(rootNodes, errors) {
- this.rootNodes = rootNodes;
- this.errors = errors;
- }
- return ParseTreeResult;
-}());
-function ParseTreeResult_tsickle_Closure_declarations() {
- /** @type {?} */
- ParseTreeResult.prototype.rootNodes;
- /** @type {?} */
- ParseTreeResult.prototype.errors;
-}
-var Parser = (function () {
- /**
- * @param {?} getTagDefinition
- */
- function Parser(getTagDefinition) {
- this.getTagDefinition = getTagDefinition;
- }
- /**
- * @param {?} source
- * @param {?} url
- * @param {?=} parseExpansionForms
- * @param {?=} interpolationConfig
- * @return {?}
- */
- Parser.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {
- if (parseExpansionForms === void 0) { parseExpansionForms = false; }
- if (interpolationConfig === void 0) { interpolationConfig = __WEBPACK_IMPORTED_MODULE_3__interpolation_config__["DEFAULT_INTERPOLATION_CONFIG"]; }
- var /** @type {?} */ tokensAndErrors = __WEBPACK_IMPORTED_MODULE_4__lexer__["tokenize"](source, url, this.getTagDefinition, parseExpansionForms, interpolationConfig);
- var /** @type {?} */ treeAndErrors = new _TreeBuilder(tokensAndErrors.tokens, this.getTagDefinition).build();
- return new ParseTreeResult(treeAndErrors.rootNodes, ((tokensAndErrors.errors)).concat(treeAndErrors.errors));
- };
- return Parser;
-}());
-function Parser_tsickle_Closure_declarations() {
- /** @type {?} */
- Parser.prototype.getTagDefinition;
-}
-var _TreeBuilder = (function () {
- /**
- * @param {?} tokens
- * @param {?} getTagDefinition
- */
- function _TreeBuilder(tokens, getTagDefinition) {
- this.tokens = tokens;
- this.getTagDefinition = getTagDefinition;
- this._index = -1;
- this._rootNodes = [];
- this._errors = [];
- this._elementStack = [];
- this._advance();
- }
- /**
- * @return {?}
- */
- _TreeBuilder.prototype.build = function () {
- while (this._peek.type !== __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].EOF) {
- if (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].TAG_OPEN_START) {
- this._consumeStartTag(this._advance());
- }
- else if (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].TAG_CLOSE) {
- this._consumeEndTag(this._advance());
- }
- else if (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].CDATA_START) {
- this._closeVoidElement();
- this._consumeCdata(this._advance());
- }
- else if (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].COMMENT_START) {
- this._closeVoidElement();
- this._consumeComment(this._advance());
- }
- else if (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].TEXT || this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].RAW_TEXT ||
- this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].ESCAPABLE_RAW_TEXT) {
- this._closeVoidElement();
- this._consumeText(this._advance());
- }
- else if (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].EXPANSION_FORM_START) {
- this._consumeExpansion(this._advance());
- }
- else {
- // Skip all other tokens...
- this._advance();
- }
- }
- return new ParseTreeResult(this._rootNodes, this._errors);
- };
- /**
- * @return {?}
- */
- _TreeBuilder.prototype._advance = function () {
- var /** @type {?} */ prev = this._peek;
- if (this._index < this.tokens.length - 1) {
- // Note: there is always an EOF token at the end
- this._index++;
- }
- this._peek = this.tokens[this._index];
- return prev;
- };
- /**
- * @param {?} type
- * @return {?}
- */
- _TreeBuilder.prototype._advanceIf = function (type) {
- if (this._peek.type === type) {
- return this._advance();
- }
- return null;
- };
- /**
- * @param {?} startToken
- * @return {?}
- */
- _TreeBuilder.prototype._consumeCdata = function (startToken) {
- this._consumeText(this._advance());
- this._advanceIf(__WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].CDATA_END);
- };
- /**
- * @param {?} token
- * @return {?}
- */
- _TreeBuilder.prototype._consumeComment = function (token) {
- var /** @type {?} */ text = this._advanceIf(__WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].RAW_TEXT);
- this._advanceIf(__WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].COMMENT_END);
- var /** @type {?} */ value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__facade_lang__["isPresent"])(text) ? text.parts[0].trim() : null;
- this._addToParent(new __WEBPACK_IMPORTED_MODULE_2__ast__["Comment"](value, token.sourceSpan));
- };
- /**
- * @param {?} token
- * @return {?}
- */
- _TreeBuilder.prototype._consumeExpansion = function (token) {
- var /** @type {?} */ switchValue = this._advance();
- var /** @type {?} */ type = this._advance();
- var /** @type {?} */ cases = [];
- // read =
- while (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].EXPANSION_CASE_VALUE) {
- var /** @type {?} */ expCase = this._parseExpansionCase();
- if (!expCase)
- return; // error
- cases.push(expCase);
- }
- // read the final }
- if (this._peek.type !== __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].EXPANSION_FORM_END) {
- this._errors.push(TreeError.create(null, this._peek.sourceSpan, "Invalid ICU message. Missing '}'."));
- return;
- }
- var /** @type {?} */ sourceSpan = new __WEBPACK_IMPORTED_MODULE_1__parse_util__["ParseSourceSpan"](token.sourceSpan.start, this._peek.sourceSpan.end);
- this._addToParent(new __WEBPACK_IMPORTED_MODULE_2__ast__["Expansion"](switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan));
- this._advance();
- };
- /**
- * @return {?}
- */
- _TreeBuilder.prototype._parseExpansionCase = function () {
- var /** @type {?} */ value = this._advance();
- // read {
- if (this._peek.type !== __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].EXPANSION_CASE_EXP_START) {
- this._errors.push(TreeError.create(null, this._peek.sourceSpan, "Invalid ICU message. Missing '{'."));
- return null;
- }
- // read until }
- var /** @type {?} */ start = this._advance();
- var /** @type {?} */ exp = this._collectExpansionExpTokens(start);
- if (!exp)
- return null;
- var /** @type {?} */ end = this._advance();
- exp.push(new __WEBPACK_IMPORTED_MODULE_4__lexer__["Token"](__WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].EOF, [], end.sourceSpan));
- // parse everything in between { and }
- var /** @type {?} */ parsedExp = new _TreeBuilder(exp, this.getTagDefinition).build();
- if (parsedExp.errors.length > 0) {
- this._errors = this._errors.concat(/** @type {?} */ (parsedExp.errors));
- return null;
- }
- var /** @type {?} */ sourceSpan = new __WEBPACK_IMPORTED_MODULE_1__parse_util__["ParseSourceSpan"](value.sourceSpan.start, end.sourceSpan.end);
- var /** @type {?} */ expSourceSpan = new __WEBPACK_IMPORTED_MODULE_1__parse_util__["ParseSourceSpan"](start.sourceSpan.start, end.sourceSpan.end);
- return new __WEBPACK_IMPORTED_MODULE_2__ast__["ExpansionCase"](value.parts[0], parsedExp.rootNodes, sourceSpan, value.sourceSpan, expSourceSpan);
- };
- /**
- * @param {?} start
- * @return {?}
- */
- _TreeBuilder.prototype._collectExpansionExpTokens = function (start) {
- var /** @type {?} */ exp = [];
- var /** @type {?} */ expansionFormStack = [__WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].EXPANSION_CASE_EXP_START];
- while (true) {
- if (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].EXPANSION_FORM_START ||
- this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].EXPANSION_CASE_EXP_START) {
- expansionFormStack.push(this._peek.type);
- }
- if (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].EXPANSION_CASE_EXP_END) {
- if (lastOnStack(expansionFormStack, __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].EXPANSION_CASE_EXP_START)) {
- expansionFormStack.pop();
- if (expansionFormStack.length == 0)
- return exp;
- }
- else {
- this._errors.push(TreeError.create(null, start.sourceSpan, "Invalid ICU message. Missing '}'."));
- return null;
- }
- }
- if (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].EXPANSION_FORM_END) {
- if (lastOnStack(expansionFormStack, __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].EXPANSION_FORM_START)) {
- expansionFormStack.pop();
- }
- else {
- this._errors.push(TreeError.create(null, start.sourceSpan, "Invalid ICU message. Missing '}'."));
- return null;
- }
- }
- if (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].EOF) {
- this._errors.push(TreeError.create(null, start.sourceSpan, "Invalid ICU message. Missing '}'."));
- return null;
- }
- exp.push(this._advance());
- }
- };
- /**
- * @param {?} token
- * @return {?}
- */
- _TreeBuilder.prototype._consumeText = function (token) {
- var /** @type {?} */ text = token.parts[0];
- if (text.length > 0 && text[0] == '\n') {
- var /** @type {?} */ parent_1 = this._getParentElement();
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__facade_lang__["isPresent"])(parent_1) && parent_1.children.length == 0 &&
- this.getTagDefinition(parent_1.name).ignoreFirstLf) {
- text = text.substring(1);
- }
- }
- if (text.length > 0) {
- this._addToParent(new __WEBPACK_IMPORTED_MODULE_2__ast__["Text"](text, token.sourceSpan));
- }
- };
- /**
- * @return {?}
- */
- _TreeBuilder.prototype._closeVoidElement = function () {
- if (this._elementStack.length > 0) {
- var /** @type {?} */ el = this._elementStack[this._elementStack.length - 1];
- if (this.getTagDefinition(el.name).isVoid) {
- this._elementStack.pop();
- }
- }
- };
- /**
- * @param {?} startTagToken
- * @return {?}
- */
- _TreeBuilder.prototype._consumeStartTag = function (startTagToken) {
- var /** @type {?} */ prefix = startTagToken.parts[0];
- var /** @type {?} */ name = startTagToken.parts[1];
- var /** @type {?} */ attrs = [];
- while (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].ATTR_NAME) {
- attrs.push(this._consumeAttr(this._advance()));
- }
- var /** @type {?} */ fullName = this._getElementFullName(prefix, name, this._getParentElement());
- var /** @type {?} */ selfClosing = false;
- // Note: There could have been a tokenizer error
- // so that we don't get a token for the end tag...
- if (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].TAG_OPEN_END_VOID) {
- this._advance();
- selfClosing = true;
- var /** @type {?} */ tagDef = this.getTagDefinition(fullName);
- if (!(tagDef.canSelfClose || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__tags__["getNsPrefix"])(fullName) !== null || tagDef.isVoid)) {
- this._errors.push(TreeError.create(fullName, startTagToken.sourceSpan, "Only void and foreign elements can be self closed \"" + startTagToken.parts[1] + "\""));
- }
- }
- else if (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].TAG_OPEN_END) {
- this._advance();
- selfClosing = false;
- }
- var /** @type {?} */ end = this._peek.sourceSpan.start;
- var /** @type {?} */ span = new __WEBPACK_IMPORTED_MODULE_1__parse_util__["ParseSourceSpan"](startTagToken.sourceSpan.start, end);
- var /** @type {?} */ el = new __WEBPACK_IMPORTED_MODULE_2__ast__["Element"](fullName, attrs, [], span, span, null);
- this._pushElement(el);
- if (selfClosing) {
- this._popElement(fullName);
- el.endSourceSpan = span;
- }
- };
- /**
- * @param {?} el
- * @return {?}
- */
- _TreeBuilder.prototype._pushElement = function (el) {
- if (this._elementStack.length > 0) {
- var /** @type {?} */ parentEl = this._elementStack[this._elementStack.length - 1];
- if (this.getTagDefinition(parentEl.name).isClosedByChild(el.name)) {
- this._elementStack.pop();
- }
- }
- var /** @type {?} */ tagDef = this.getTagDefinition(el.name);
- var _a = this._getParentElementSkippingContainers(), parent = _a.parent, container = _a.container;
- if (parent && tagDef.requireExtraParent(parent.name)) {
- var /** @type {?} */ newParent = new __WEBPACK_IMPORTED_MODULE_2__ast__["Element"](tagDef.parentToAdd, [], [], el.sourceSpan, el.startSourceSpan, el.endSourceSpan);
- this._insertBeforeContainer(parent, container, newParent);
- }
- this._addToParent(el);
- this._elementStack.push(el);
- };
- /**
- * @param {?} endTagToken
- * @return {?}
- */
- _TreeBuilder.prototype._consumeEndTag = function (endTagToken) {
- var /** @type {?} */ fullName = this._getElementFullName(endTagToken.parts[0], endTagToken.parts[1], this._getParentElement());
- if (this._getParentElement()) {
- this._getParentElement().endSourceSpan = endTagToken.sourceSpan;
- }
- if (this.getTagDefinition(fullName).isVoid) {
- this._errors.push(TreeError.create(fullName, endTagToken.sourceSpan, "Void elements do not have end tags \"" + endTagToken.parts[1] + "\""));
- }
- else if (!this._popElement(fullName)) {
- this._errors.push(TreeError.create(fullName, endTagToken.sourceSpan, "Unexpected closing tag \"" + endTagToken.parts[1] + "\""));
- }
- };
- /**
- * @param {?} fullName
- * @return {?}
- */
- _TreeBuilder.prototype._popElement = function (fullName) {
- for (var /** @type {?} */ stackIndex = this._elementStack.length - 1; stackIndex >= 0; stackIndex--) {
- var /** @type {?} */ el = this._elementStack[stackIndex];
- if (el.name == fullName) {
- this._elementStack.splice(stackIndex, this._elementStack.length - stackIndex);
- return true;
- }
- if (!this.getTagDefinition(el.name).closedByParent) {
- return false;
- }
- }
- return false;
- };
- /**
- * @param {?} attrName
- * @return {?}
- */
- _TreeBuilder.prototype._consumeAttr = function (attrName) {
- var /** @type {?} */ fullName = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__tags__["mergeNsAndName"])(attrName.parts[0], attrName.parts[1]);
- var /** @type {?} */ end = attrName.sourceSpan.end;
- var /** @type {?} */ value = '';
- var /** @type {?} */ valueSpan;
- if (this._peek.type === __WEBPACK_IMPORTED_MODULE_4__lexer__["TokenType"].ATTR_VALUE) {
- var /** @type {?} */ valueToken = this._advance();
- value = valueToken.parts[0];
- end = valueToken.sourceSpan.end;
- valueSpan = valueToken.sourceSpan;
- }
- return new __WEBPACK_IMPORTED_MODULE_2__ast__["Attribute"](fullName, value, new __WEBPACK_IMPORTED_MODULE_1__parse_util__["ParseSourceSpan"](attrName.sourceSpan.start, end), valueSpan);
- };
- /**
- * @return {?}
- */
- _TreeBuilder.prototype._getParentElement = function () {
- return this._elementStack.length > 0 ? this._elementStack[this._elementStack.length - 1] : null;
- };
- /**
- * Returns the parent in the DOM and the container.
- *
- * `` elements are skipped as they are not rendered as DOM element.
- * @return {?}
- */
- _TreeBuilder.prototype._getParentElementSkippingContainers = function () {
- var /** @type {?} */ container = null;
- for (var /** @type {?} */ i = this._elementStack.length - 1; i >= 0; i--) {
- if (this._elementStack[i].name !== 'ng-container') {
- return { parent: this._elementStack[i], container: container };
- }
- container = this._elementStack[i];
- }
- return { parent: this._elementStack[this._elementStack.length - 1], container: container };
- };
- /**
- * @param {?} node
- * @return {?}
- */
- _TreeBuilder.prototype._addToParent = function (node) {
- var /** @type {?} */ parent = this._getParentElement();
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__facade_lang__["isPresent"])(parent)) {
- parent.children.push(node);
- }
- else {
- this._rootNodes.push(node);
- }
- };
- /**
- * Insert a node between the parent and the container.
- * When no container is given, the node is appended as a child of the parent.
- * Also updates the element stack accordingly.
- *
- * \@internal
- * @param {?} parent
- * @param {?} container
- * @param {?} node
- * @return {?}
- */
- _TreeBuilder.prototype._insertBeforeContainer = function (parent, container, node) {
- if (!container) {
- this._addToParent(node);
- this._elementStack.push(node);
- }
- else {
- if (parent) {
- // replace the container with the new node in the children
- var /** @type {?} */ index = parent.children.indexOf(container);
- parent.children[index] = node;
- }
- else {
- this._rootNodes.push(node);
- }
- node.children.push(container);
- this._elementStack.splice(this._elementStack.indexOf(container), 0, node);
- }
- };
- /**
- * @param {?} prefix
- * @param {?} localName
- * @param {?} parentElement
- * @return {?}
- */
- _TreeBuilder.prototype._getElementFullName = function (prefix, localName, parentElement) {
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__facade_lang__["isBlank"])(prefix)) {
- prefix = this.getTagDefinition(localName).implicitNamespacePrefix;
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__facade_lang__["isBlank"])(prefix) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__facade_lang__["isPresent"])(parentElement)) {
- prefix = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__tags__["getNsPrefix"])(parentElement.name);
- }
- }
- return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__tags__["mergeNsAndName"])(prefix, localName);
- };
- return _TreeBuilder;
-}());
-function _TreeBuilder_tsickle_Closure_declarations() {
- /** @type {?} */
- _TreeBuilder.prototype._index;
- /** @type {?} */
- _TreeBuilder.prototype._peek;
- /** @type {?} */
- _TreeBuilder.prototype._rootNodes;
- /** @type {?} */
- _TreeBuilder.prototype._errors;
- /** @type {?} */
- _TreeBuilder.prototype._elementStack;
- /** @type {?} */
- _TreeBuilder.prototype.tokens;
- /** @type {?} */
- _TreeBuilder.prototype.getTagDefinition;
-}
-/**
- * @param {?} stack
- * @param {?} element
- * @return {?}
- */
-function lastOnStack(stack, element) {
- return stack.length > 0 && stack[stack.length - 1] === element;
-}
-//# sourceMappingURL=parser.js.map
-
-/***/ }),
-/* 99 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_decorators__ = __webpack_require__(100);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Inject", function() { return Inject; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Optional", function() { return Optional; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Injectable", function() { return Injectable; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Self", function() { return Self; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkipSelf", function() { return SkipSelf; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Host", function() { return Host; });
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-
-/**
- * Inject decorator and metadata.
- *
- * @stable
- * @Annotation
- */
-var /** @type {?} */ Inject = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_decorators__["makeParamDecorator"])('Inject', [['token', undefined]]);
-/**
- * Optional decorator and metadata.
- *
- * @stable
- * @Annotation
- */
-var /** @type {?} */ Optional = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_decorators__["makeParamDecorator"])('Optional', []);
-/**
- * Injectable decorator and metadata.
- *
- * @stable
- * @Annotation
- */
-var /** @type {?} */ Injectable = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_decorators__["makeDecorator"])('Injectable', []));
-/**
- * Self decorator and metadata.
- *
- * @stable
- * @Annotation
- */
-var /** @type {?} */ Self = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_decorators__["makeParamDecorator"])('Self', []);
-/**
- * SkipSelf decorator and metadata.
- *
- * @stable
- * @Annotation
- */
-var /** @type {?} */ SkipSelf = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_decorators__["makeParamDecorator"])('SkipSelf', []);
-/**
- * Host decorator and metadata.
- *
- * @stable
- * @Annotation
- */
-var /** @type {?} */ Host = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_decorators__["makeParamDecorator"])('Host', []);
-//# sourceMappingURL=metadata.js.map
-
-/***/ }),
-/* 100 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__facade_lang__ = __webpack_require__(8);
-/* harmony export (immutable) */ __webpack_exports__["Class"] = Class;
-/* harmony export (immutable) */ __webpack_exports__["makeDecorator"] = makeDecorator;
-/* harmony export (immutable) */ __webpack_exports__["makeParamDecorator"] = makeParamDecorator;
-/* harmony export (immutable) */ __webpack_exports__["makePropDecorator"] = makePropDecorator;
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-
-var /** @type {?} */ _nextClassId = 0;
-var /** @type {?} */ Reflect = __WEBPACK_IMPORTED_MODULE_0__facade_lang__["global"].Reflect;
-/**
- * @param {?} annotation
- * @return {?}
- */
-function extractAnnotation(annotation) {
- if (typeof annotation === 'function' && annotation.hasOwnProperty('annotation')) {
- // it is a decorator, extract annotation
- annotation = annotation.annotation;
- }
- return annotation;
-}
-/**
- * @param {?} fnOrArray
- * @param {?} key
- * @return {?}
- */
-function applyParams(fnOrArray, key) {
- if (fnOrArray === Object || fnOrArray === String || fnOrArray === Function ||
- fnOrArray === Number || fnOrArray === Array) {
- throw new Error("Can not use native " + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__facade_lang__["stringify"])(fnOrArray) + " as constructor");
- }
- if (typeof fnOrArray === 'function') {
- return fnOrArray;
- }
- if (Array.isArray(fnOrArray)) {
- var /** @type {?} */ annotations = fnOrArray;
- var /** @type {?} */ annoLength = annotations.length - 1;
- var /** @type {?} */ fn = fnOrArray[annoLength];
- if (typeof fn !== 'function') {
- throw new Error("Last position of Class method array must be Function in key " + key + " was '" + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__facade_lang__["stringify"])(fn) + "'");
- }
- if (annoLength != fn.length) {
- throw new Error("Number of annotations (" + annoLength + ") does not match number of arguments (" + fn.length + ") in the function: " + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__facade_lang__["stringify"])(fn));
- }
- var /** @type {?} */ paramsAnnotations = [];
- for (var /** @type {?} */ i = 0, /** @type {?} */ ii = annotations.length - 1; i < ii; i++) {
- var /** @type {?} */ paramAnnotations = [];
- paramsAnnotations.push(paramAnnotations);
- var /** @type {?} */ annotation = annotations[i];
- if (Array.isArray(annotation)) {
- for (var /** @type {?} */ j = 0; j < annotation.length; j++) {
- paramAnnotations.push(extractAnnotation(annotation[j]));
- }
- }
- else if (typeof annotation === 'function') {
- paramAnnotations.push(extractAnnotation(annotation));
- }
- else {
- paramAnnotations.push(annotation);
- }
- }
- Reflect.defineMetadata('parameters', paramsAnnotations, fn);
- return fn;
- }
- throw new Error("Only Function or Array is supported in Class definition for key '" + key + "' is '" + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__facade_lang__["stringify"])(fnOrArray) + "'");
-}
-/**
- * Provides a way for expressing ES6 classes with parameter annotations in ES5.
- *
- * ## Basic Example
- *
- * ```
- * var Greeter = ng.Class({
- * constructor: function(name) {
- * this.name = name;
- * },
- *
- * greet: function() {
- * alert('Hello ' + this.name + '!');
- * }
- * });
- * ```
- *
- * is equivalent to ES6:
- *
- * ```
- * class Greeter {
- * constructor(name) {
- * this.name = name;
- * }
- *
- * greet() {
- * alert('Hello ' + this.name + '!');
- * }
- * }
- * ```
- *
- * or equivalent to ES5:
- *
- * ```
- * var Greeter = function (name) {
- * this.name = name;
- * }
- *
- * Greeter.prototype.greet = function () {
- * alert('Hello ' + this.name + '!');
- * }
- * ```
- *
- * ### Example with parameter annotations
- *
- * ```
- * var MyService = ng.Class({
- * constructor: [String, [new Optional(), Service], function(name, myService) {
- * ...
- * }]
- * });
- * ```
- *
- * is equivalent to ES6:
- *
- * ```
- * class MyService {
- * constructor(name: string, \@Optional() myService: Service) {
- * ...
- * }
- * }
- * ```
- *
- * ### Example with inheritance
- *
- * ```
- * var Shape = ng.Class({
- * constructor: (color) {
- * this.color = color;
- * }
- * });
- *
- * var Square = ng.Class({
- * extends: Shape,
- * constructor: function(color, size) {
- * Shape.call(this, color);
- * this.size = size;
- * }
- * });
- * ```
- * \@stable
- * @param {?} clsDef
- * @return {?}
- */
-function Class(clsDef) {
- var /** @type {?} */ constructor = applyParams(clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor');
- var /** @type {?} */ proto = constructor.prototype;
- if (clsDef.hasOwnProperty('extends')) {
- if (typeof clsDef.extends === 'function') {
- ((constructor)).prototype = proto =
- Object.create(((clsDef.extends)).prototype);
- }
- else {
- throw new Error("Class definition 'extends' property must be a constructor function was: " + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__facade_lang__["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);
- }
- var /** @type {?} */ constructorName = constructor['name'];
- if (!constructorName || constructorName === 'constructor') {
- ((constructor))['overriddenName'] = "class" + _nextClassId++;
- }
- return (constructor);
-}
-/**
- * @param {?} name
- * @param {?} props
- * @param {?=} parentClass
- * @param {?=} chainFn
- * @return {?}
- */
-function makeDecorator(name, props, parentClass, chainFn) {
- if (chainFn === void 0) { chainFn = null; }
- var /** @type {?} */ metaCtor = makeMetadataCtor([props]);
- /**
- * @param {?} objOrType
- * @return {?}
- */
- function DecoratorFactory(objOrType) {
- if (!(Reflect && Reflect.getOwnMetadata)) {
- throw 'reflect-metadata shim is required when using class decorators';
- }
- if (this instanceof DecoratorFactory) {
- metaCtor.call(this, objOrType);
- return this;
- }
- var /** @type {?} */ annotationInstance = new ((DecoratorFactory))(objOrType);
- var /** @type {?} */ chainAnnotation = typeof this === 'function' && Array.isArray(this.annotations) ? this.annotations : [];
- chainAnnotation.push(annotationInstance);
- var /** @type {?} */ TypeDecorator = (function TypeDecorator(cls) {
- var /** @type {?} */ annotations = Reflect.getOwnMetadata('annotations', cls) || [];
- annotations.push(annotationInstance);
- Reflect.defineMetadata('annotations', annotations, cls);
- return cls;
- });
- TypeDecorator.annotations = chainAnnotation;
- TypeDecorator.Class = Class;
- if (chainFn)
- chainFn(TypeDecorator);
- return TypeDecorator;
- }
- if (parentClass) {
- DecoratorFactory.prototype = Object.create(parentClass.prototype);
- }
- DecoratorFactory.prototype.toString = function () { return ("@" + name); };
- ((DecoratorFactory)).annotationCls = DecoratorFactory;
- return DecoratorFactory;
-}
-/**
- * @param {?} props
- * @return {?}
- */
-function makeMetadataCtor(props) {
- return function ctor() {
- var _this = this;
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i - 0] = arguments[_i];
- }
- props.forEach(function (prop, i) {
- var /** @type {?} */ argVal = args[i];
- if (Array.isArray(prop)) {
- // plain parameter
- _this[prop[0]] = argVal === undefined ? prop[1] : argVal;
- }
- else {
- for (var propName in prop) {
- _this[propName] =
- argVal && argVal.hasOwnProperty(propName) ? argVal[propName] : prop[propName];
- }
- }
- });
- };
-}
-/**
- * @param {?} name
- * @param {?} props
- * @param {?=} parentClass
- * @return {?}
- */
-function makeParamDecorator(name, props, parentClass) {
- var /** @type {?} */ metaCtor = makeMetadataCtor(props);
- /**
- * @param {...?} args
- * @return {?}
- */
- function ParamDecoratorFactory() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i - 0] = arguments[_i];
- }
- if (this instanceof ParamDecoratorFactory) {
- metaCtor.apply(this, args);
- return this;
- }
- var /** @type {?} */ annotationInstance = new ((_a = ((ParamDecoratorFactory))).bind.apply(_a, [void 0].concat(args)))();
- ((ParamDecorator)).annotation = annotationInstance;
- return ParamDecorator;
- /**
- * @param {?} cls
- * @param {?} unusedKey
- * @param {?} index
- * @return {?}
- */
- function ParamDecorator(cls, unusedKey, index) {
- var /** @type {?} */ parameters = Reflect.getOwnMetadata('parameters', cls) || [];
- // there might be gaps if some in between parameters do not have annotations.
- // we pad with nulls.
- while (parameters.length <= index) {
- parameters.push(null);
- }
- parameters[index] = parameters[index] || [];
- parameters[index].push(annotationInstance);
- Reflect.defineMetadata('parameters', parameters, cls);
- return cls;
- }
- var _a;
- }
- if (parentClass) {
- ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);
- }
- ParamDecoratorFactory.prototype.toString = function () { return ("@" + name); };
- ((ParamDecoratorFactory)).annotationCls = ParamDecoratorFactory;
- return ParamDecoratorFactory;
-}
-/**
- * @param {?} name
- * @param {?} props
- * @param {?=} parentClass
- * @return {?}
- */
-function makePropDecorator(name, props, parentClass) {
- var /** @type {?} */ metaCtor = makeMetadataCtor(props);
- /**
- * @param {...?} args
- * @return {?}
- */
- function PropDecoratorFactory() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i - 0] = arguments[_i];
- }
- if (this instanceof PropDecoratorFactory) {
- metaCtor.apply(this, args);
- return this;
- }
- var /** @type {?} */ decoratorInstance = new ((_a = ((PropDecoratorFactory))).bind.apply(_a, [void 0].concat(args)))();
- return function PropDecorator(target, name) {
- var /** @type {?} */ meta = Reflect.getOwnMetadata('propMetadata', target.constructor) || {};
- meta[name] = meta.hasOwnProperty(name) && meta[name] || [];
- meta[name].unshift(decoratorInstance);
- Reflect.defineMetadata('propMetadata', meta, target.constructor);
- };
- var _a;
- }
- if (parentClass) {
- PropDecoratorFactory.prototype = Object.create(parentClass.prototype);
- }
- PropDecoratorFactory.prototype.toString = function () { return ("@" + name); };
- ((PropDecoratorFactory)).annotationCls = PropDecoratorFactory;
- return PropDecoratorFactory;
-}
-//# sourceMappingURL=decorators.js.map
-
-/***/ }),
-/* 101 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__ = __webpack_require__(17);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__ = __webpack_require__(0);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__);
-/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__, "Observable")) __webpack_require__.d(__webpack_exports__, "Observable", function() { return __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"]; });
-/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__, "Subject")) __webpack_require__.d(__webpack_exports__, "Subject", function() { return __WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__["Subject"]; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventEmitter", function() { return EventEmitter; });
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-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 __());
-};
-
-
-
-/**
- * Use by directives and components to emit custom Events.
- *
- * ### Examples
- *
- * In the following example, `Zippy` alternatively emits `open` and `close` events when its
- * title gets clicked:
- *
- * ```
- * \@Component({
- * selector: 'zippy',
- * template: `
- *
- *
Toggle
- *
- *
- *
- *
`})
- * export class Zippy {
- * visible: boolean = true;
- * \@Output() open: EventEmitter = new EventEmitter();
- * \@Output() close: EventEmitter = new EventEmitter();
- *
- * toggle() {
- * this.visible = !this.visible;
- * if (this.visible) {
- * this.open.emit(null);
- * } else {
- * this.close.emit(null);
- * }
- * }
- * }
- * ```
- *
- * The events payload can be accessed by the parameter `$event` on the components output event
- * handler:
- *
- * ```
- *
- * ```
- *
- * Uses Rx.Observable but provides an adapter to make it work as specified here:
- * https://github.com/jhusain/observable-spec
- *
- * Once a reference implementation of the spec is available, switch to it.
- * \@stable
- */
-var EventEmitter = (function (_super) {
- __extends(EventEmitter, _super);
- /**
- * Creates an instance of [EventEmitter], which depending on [isAsync],
- * delivers events synchronously or asynchronously.
- * @param {?=} isAsync
- */
- function EventEmitter(isAsync) {
- if (isAsync === void 0) { isAsync = false; }
- _super.call(this);
- this.__isAsync = isAsync;
- }
- /**
- * @param {?=} value
- * @return {?}
- */
- EventEmitter.prototype.emit = function (value) { _super.prototype.next.call(this, value); };
- /**
- * @param {?=} generatorOrNext
- * @param {?=} error
- * @param {?=} complete
- * @return {?}
- */
- EventEmitter.prototype.subscribe = function (generatorOrNext, error, complete) {
- var /** @type {?} */ schedulerFn;
- var /** @type {?} */ errorFn = function (err) { return null; };
- var /** @type {?} */ completeFn = function () { return null; };
- if (generatorOrNext && typeof generatorOrNext === 'object') {
- schedulerFn = this.__isAsync ? function (value) {
- setTimeout(function () { return generatorOrNext.next(value); });
- } : function (value) { generatorOrNext.next(value); };
- if (generatorOrNext.error) {
- errorFn = this.__isAsync ? function (err) { setTimeout(function () { return generatorOrNext.error(err); }); } :
- function (err) { generatorOrNext.error(err); };
- }
- if (generatorOrNext.complete) {
- completeFn = this.__isAsync ? function () { setTimeout(function () { return generatorOrNext.complete(); }); } :
- function () { generatorOrNext.complete(); };
- }
- }
- else {
- schedulerFn = this.__isAsync ? function (value) { setTimeout(function () { return generatorOrNext(value); }); } :
- function (value) { generatorOrNext(value); };
- if (error) {
- errorFn =
- this.__isAsync ? function (err) { setTimeout(function () { return error(err); }); } : function (err) { error(err); };
- }
- if (complete) {
- completeFn =
- this.__isAsync ? function () { setTimeout(function () { return complete(); }); } : function () { complete(); };
- }
- }
- return _super.prototype.subscribe.call(this, schedulerFn, errorFn, completeFn);
- };
- return EventEmitter;
-}(__WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__["Subject"]));
-function EventEmitter_tsickle_Closure_declarations() {
- /** @type {?} */
- EventEmitter.prototype.__isAsync;
-}
-//# sourceMappingURL=async.js.map
-
-/***/ }),
-/* 102 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony export (immutable) */ __webpack_exports__["scheduleMicroTask"] = scheduleMicroTask;
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "global", function() { return _global; });
-/* harmony export (immutable) */ __webpack_exports__["getTypeNameForDebugging"] = getTypeNameForDebugging;
-/* harmony export (immutable) */ __webpack_exports__["isPresent"] = isPresent;
-/* harmony export (immutable) */ __webpack_exports__["isBlank"] = isBlank;
-/* harmony export (immutable) */ __webpack_exports__["isStrictStringMap"] = isStrictStringMap;
-/* harmony export (immutable) */ __webpack_exports__["stringify"] = stringify;
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberWrapper", function() { return NumberWrapper; });
-/* harmony export (immutable) */ __webpack_exports__["looseIdentical"] = looseIdentical;
-/* harmony export (immutable) */ __webpack_exports__["isJsObject"] = isJsObject;
-/* harmony export (immutable) */ __webpack_exports__["print"] = print;
-/* harmony export (immutable) */ __webpack_exports__["warn"] = warn;
-/* harmony export (immutable) */ __webpack_exports__["setValueOnPath"] = setValueOnPath;
-/* harmony export (immutable) */ __webpack_exports__["getSymbolIterator"] = getSymbolIterator;
-/* harmony export (immutable) */ __webpack_exports__["isPrimitive"] = isPrimitive;
-/* harmony export (immutable) */ __webpack_exports__["escapeRegExp"] = escapeRegExp;
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-var /** @type {?} */ globalScope;
-if (typeof window === 'undefined') {
- if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
- // TODO: Replace any with WorkerGlobalScope from lib.webworker.d.ts #3492
- globalScope = (self);
- }
- else {
- globalScope = (global);
- }
-}
-else {
- globalScope = (window);
-}
-/**
- * @param {?} fn
- * @return {?}
- */
-function scheduleMicroTask(fn) {
- Zone.current.scheduleMicroTask('scheduleMicrotask', fn);
-}
-// Need to declare a new variable for global here since TypeScript
-// exports the original value of the symbol.
-var /** @type {?} */ _global = globalScope;
-
-/**
- * @param {?} type
- * @return {?}
- */
-function getTypeNameForDebugging(type) {
- return type['name'] || typeof type;
-}
-// TODO: remove calls to assert in production environment
-// Note: Can't just export this and import in in other files
-// as `assert` is a reserved keyword in Dart
-_global.assert = function assert(condition) {
- // TODO: to be fixed properly via #2830, noop for now
-};
-/**
- * @param {?} obj
- * @return {?}
- */
-function isPresent(obj) {
- return obj != null;
-}
-/**
- * @param {?} obj
- * @return {?}
- */
-function isBlank(obj) {
- return obj == null;
-}
-var /** @type {?} */ STRING_MAP_PROTO = Object.getPrototypeOf({});
-/**
- * @param {?} obj
- * @return {?}
- */
-function isStrictStringMap(obj) {
- return typeof obj === 'object' && obj !== null && Object.getPrototypeOf(obj) === STRING_MAP_PROTO;
-}
-/**
- * @param {?} token
- * @return {?}
- */
-function stringify(token) {
- if (typeof token === 'string') {
- return token;
- }
- if (token == null) {
- return '' + token;
- }
- if (token.overriddenName) {
- return "" + token.overriddenName;
- }
- if (token.name) {
- return "" + token.name;
- }
- var /** @type {?} */ res = token.toString();
- var /** @type {?} */ newLineIndex = res.indexOf('\n');
- return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
-}
-var NumberWrapper = (function () {
- function NumberWrapper() {
- }
- /**
- * @param {?} text
- * @return {?}
- */
- NumberWrapper.parseIntAutoRadix = function (text) {
- var /** @type {?} */ result = parseInt(text);
- if (isNaN(result)) {
- throw new Error('Invalid integer literal when parsing ' + text);
- }
- return result;
- };
- /**
- * @param {?} value
- * @return {?}
- */
- NumberWrapper.isNumeric = function (value) { return !isNaN(value - parseFloat(value)); };
- return NumberWrapper;
-}());
-/**
- * @param {?} a
- * @param {?} b
- * @return {?}
- */
-function looseIdentical(a, b) {
- return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);
-}
-/**
- * @param {?} o
- * @return {?}
- */
-function isJsObject(o) {
- return o !== null && (typeof o === 'function' || typeof o === 'object');
-}
-/**
- * @param {?} obj
- * @return {?}
- */
-function print(obj) {
- // tslint:disable-next-line:no-console
- console.log(obj);
-}
-/**
- * @param {?} obj
- * @return {?}
- */
-function warn(obj) {
- console.warn(obj);
-}
-/**
- * @param {?} global
- * @param {?} path
- * @param {?} value
- * @return {?}
- */
-function setValueOnPath(global, path, value) {
- var /** @type {?} */ parts = path.split('.');
- var /** @type {?} */ obj = global;
- while (parts.length > 1) {
- var /** @type {?} */ name_1 = parts.shift();
- if (obj.hasOwnProperty(name_1) && obj[name_1] != null) {
- obj = obj[name_1];
- }
- else {
- obj = obj[name_1] = {};
- }
- }
- if (obj === undefined || obj === null) {
- obj = {};
- }
- obj[parts.shift()] = value;
-}
-var /** @type {?} */ _symbolIterator = null;
-/**
- * @return {?}
- */
-function getSymbolIterator() {
- if (!_symbolIterator) {
- if (((globalScope)).Symbol && Symbol.iterator) {
- _symbolIterator = Symbol.iterator;
- }
- else {
- // es6-shim specific logic
- var /** @type {?} */ keys = Object.getOwnPropertyNames(Map.prototype);
- for (var /** @type {?} */ i = 0; i < keys.length; ++i) {
- var /** @type {?} */ key = keys[i];
- if (key !== 'entries' && key !== 'size' &&
- ((Map)).prototype[key] === Map.prototype['entries']) {
- _symbolIterator = key;
- }
- }
- }
- }
- return _symbolIterator;
-}
-/**
- * @param {?} obj
- * @return {?}
- */
-function isPrimitive(obj) {
- return !isJsObject(obj);
-}
-/**
- * @param {?} s
- * @return {?}
- */
-function escapeRegExp(s) {
- return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
-}
-//# sourceMappingURL=lang.js.map
-/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(57)))
-
-/***/ }),
-/* 103 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dom_adapter__ = __webpack_require__(22);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_MANAGER_PLUGINS", function() { return EVENT_MANAGER_PLUGINS; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventManager", function() { return EventManager; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventManagerPlugin", function() { return EventManagerPlugin; });
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-
-
-/**
- * @stable
- */
-var /** @type {?} */ EVENT_MANAGER_PLUGINS = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["OpaqueToken"]('EventManagerPlugins');
-/**
- * \@stable
- */
-var EventManager = (function () {
- /**
- * @param {?} plugins
- * @param {?} _zone
- */
- function EventManager(plugins, _zone) {
- var _this = this;
- this._zone = _zone;
- this._eventNameToPlugin = new Map();
- plugins.forEach(function (p) { return p.manager = _this; });
- this._plugins = plugins.slice().reverse();
- }
- /**
- * @param {?} element
- * @param {?} eventName
- * @param {?} handler
- * @return {?}
- */
- EventManager.prototype.addEventListener = function (element, eventName, handler) {
- var /** @type {?} */ plugin = this._findPluginFor(eventName);
- return plugin.addEventListener(element, eventName, handler);
- };
- /**
- * @param {?} target
- * @param {?} eventName
- * @param {?} handler
- * @return {?}
- */
- EventManager.prototype.addGlobalEventListener = function (target, eventName, handler) {
- var /** @type {?} */ plugin = this._findPluginFor(eventName);
- return plugin.addGlobalEventListener(target, eventName, handler);
- };
- /**
- * @return {?}
- */
- EventManager.prototype.getZone = function () { return this._zone; };
- /**
- * \@internal
- * @param {?} eventName
- * @return {?}
- */
- EventManager.prototype._findPluginFor = function (eventName) {
- var /** @type {?} */ plugin = this._eventNameToPlugin.get(eventName);
- if (plugin) {
- return plugin;
- }
- var /** @type {?} */ plugins = this._plugins;
- for (var /** @type {?} */ i = 0; i < plugins.length; i++) {
- var /** @type {?} */ plugin_1 = plugins[i];
- if (plugin_1.supports(eventName)) {
- this._eventNameToPlugin.set(eventName, plugin_1);
- return plugin_1;
- }
- }
- throw new Error("No event manager plugin found for event " + eventName);
- };
- EventManager.decorators = [
- { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
- ];
- /** @nocollapse */
- EventManager.ctorParameters = function () { return [
- { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [EVENT_MANAGER_PLUGINS,] },] },
- { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
- ]; };
- return EventManager;
-}());
-function EventManager_tsickle_Closure_declarations() {
- /** @type {?} */
- EventManager.decorators;
- /**
- * @nocollapse
- * @type {?}
- */
- EventManager.ctorParameters;
- /** @type {?} */
- EventManager.prototype._plugins;
- /** @type {?} */
- EventManager.prototype._eventNameToPlugin;
- /** @type {?} */
- EventManager.prototype._zone;
-}
-/**
- * @abstract
- */
-var EventManagerPlugin = (function () {
- function EventManagerPlugin() {
- }
- /**
- * @abstract
- * @param {?} eventName
- * @return {?}
- */
- EventManagerPlugin.prototype.supports = function (eventName) { };
- /**
- * @abstract
- * @param {?} element
- * @param {?} eventName
- * @param {?} handler
- * @return {?}
- */
- EventManagerPlugin.prototype.addEventListener = function (element, eventName, handler) { };
- /**
- * @param {?} element
- * @param {?} eventName
- * @param {?} handler
- * @return {?}
- */
- EventManagerPlugin.prototype.addGlobalEventListener = function (element, eventName, handler) {
- var /** @type {?} */ target = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__dom_adapter__["getDOM"])().getGlobalEventTarget(element);
- if (!target) {
- throw new Error("Unsupported event target " + target + " for event " + eventName);
- }
- return this.addEventListener(target, eventName, handler);
- };
- ;
- return EventManagerPlugin;
-}());
-function EventManagerPlugin_tsickle_Closure_declarations() {
- /** @type {?} */
- EventManagerPlugin.prototype.manager;
-}
-//# sourceMappingURL=event_manager.js.map
-
-/***/ }),
-/* 104 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_BehaviorSubject__ = __webpack_require__(136);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_BehaviorSubject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_rxjs_BehaviorSubject__);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__shared__ = __webpack_require__(51);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__url_tree__ = __webpack_require__(84);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_collection__ = __webpack_require__(59);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_tree__ = __webpack_require__(255);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterState", function() { return RouterState; });
-/* harmony export (immutable) */ __webpack_exports__["createEmptyState"] = createEmptyState;
-/* harmony export (immutable) */ __webpack_exports__["createEmptyStateSnapshot"] = createEmptyStateSnapshot;
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActivatedRoute", function() { return ActivatedRoute; });
-/* harmony export (immutable) */ __webpack_exports__["inheritedParamsDataResolve"] = inheritedParamsDataResolve;
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActivatedRouteSnapshot", function() { return ActivatedRouteSnapshot; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterStateSnapshot", function() { return RouterStateSnapshot; });
-/* harmony export (immutable) */ __webpack_exports__["advanceActivatedRoute"] = advanceActivatedRoute;
-/* harmony export (immutable) */ __webpack_exports__["equalParamsAndUrlSegments"] = equalParamsAndUrlSegments;
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-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 __());
-};
-
-
-
-
-
-/**
- * \@whatItDoes Represents the state of the router.
- *
- * \@howToUse
- *
- * ```
- * \@Component({templateUrl:'template.html'})
- * class MyComponent {
- * constructor(router: Router) {
- * const state: RouterState = router.routerState;
- * const root: ActivatedRoute = state.root;
- * const child = root.firstChild;
- * const id: Observable = child.params.map(p => p.id);
- * //...
- * }
- * }
- * ```
- *
- * \@description
- * RouterState is a tree of activated routes. Every node in this tree knows about the "consumed" URL
- * segments,
- * the extracted parameters, and the resolved data.
- *
- * See {\@link ActivatedRoute} for more information.
- *
- * \@stable
- */
-var RouterState = (function (_super) {
- __extends(RouterState, _super);
- /**
- * \@internal
- * @param {?} root
- * @param {?} snapshot
- */
- function RouterState(root, snapshot) {
- _super.call(this, root);
- this.snapshot = snapshot;
- setRouterStateSnapshot(this, root);
- }
- /**
- * @return {?}
- */
- RouterState.prototype.toString = function () { return this.snapshot.toString(); };
- return RouterState;
-}(__WEBPACK_IMPORTED_MODULE_4__utils_tree__["Tree"]));
-function RouterState_tsickle_Closure_declarations() {
- /**
- * The current snapshot of the router state
- * @type {?}
- */
- RouterState.prototype.snapshot;
-}
-/**
- * @param {?} urlTree
- * @param {?} rootComponent
- * @return {?}
- */
-function createEmptyState(urlTree, rootComponent) {
- var /** @type {?} */ snapshot = createEmptyStateSnapshot(urlTree, rootComponent);
- var /** @type {?} */ emptyUrl = new __WEBPACK_IMPORTED_MODULE_0_rxjs_BehaviorSubject__["BehaviorSubject"]([new __WEBPACK_IMPORTED_MODULE_2__url_tree__["UrlSegment"]('', {})]);
- var /** @type {?} */ emptyParams = new __WEBPACK_IMPORTED_MODULE_0_rxjs_BehaviorSubject__["BehaviorSubject"]({});
- var /** @type {?} */ emptyData = new __WEBPACK_IMPORTED_MODULE_0_rxjs_BehaviorSubject__["BehaviorSubject"]({});
- var /** @type {?} */ emptyQueryParams = new __WEBPACK_IMPORTED_MODULE_0_rxjs_BehaviorSubject__["BehaviorSubject"]({});
- var /** @type {?} */ fragment = new __WEBPACK_IMPORTED_MODULE_0_rxjs_BehaviorSubject__["BehaviorSubject"]('');
- var /** @type {?} */ activated = new ActivatedRoute(emptyUrl, emptyParams, emptyQueryParams, fragment, emptyData, __WEBPACK_IMPORTED_MODULE_1__shared__["PRIMARY_OUTLET"], rootComponent, snapshot.root);
- activated.snapshot = snapshot.root;
- return new RouterState(new __WEBPACK_IMPORTED_MODULE_4__utils_tree__["TreeNode"](activated, []), snapshot);
-}
-/**
- * @param {?} urlTree
- * @param {?} rootComponent
- * @return {?}
- */
-function createEmptyStateSnapshot(urlTree, rootComponent) {
- var /** @type {?} */ emptyParams = {};
- var /** @type {?} */ emptyData = {};
- var /** @type {?} */ emptyQueryParams = {};
- var /** @type {?} */ fragment = '';
- var /** @type {?} */ activated = new ActivatedRouteSnapshot([], emptyParams, emptyQueryParams, fragment, emptyData, __WEBPACK_IMPORTED_MODULE_1__shared__["PRIMARY_OUTLET"], rootComponent, null, urlTree.root, -1, {});
- return new RouterStateSnapshot('', new __WEBPACK_IMPORTED_MODULE_4__utils_tree__["TreeNode"](activated, []));
-}
-/**
- * \@whatItDoes Contains the information about a route associated with a component loaded in an
- * outlet.
- * An `ActivatedRoute` can also be used to traverse the router state tree.
- *
- * \@howToUse
- *
- * ```
- * \@Component({...})
- * class MyComponent {
- * constructor(route: ActivatedRoute) {
- * const id: Observable = route.params.map(p => p.id);
- * const url: Observable = route.url.map(segments => segments.join(''));
- * // route.data includes both `data` and `resolve`
- * const user = route.data.map(d => d.user);
- * }
- * }
- * ```
- *
- * \@stable
- */
-var ActivatedRoute = (function () {
- /**
- * \@internal
- * @param {?} url
- * @param {?} params
- * @param {?} queryParams
- * @param {?} fragment
- * @param {?} data
- * @param {?} outlet
- * @param {?} component
- * @param {?} futureSnapshot
- */
- function ActivatedRoute(url, params, queryParams, fragment, data, outlet, component, futureSnapshot) {
- this.url = url;
- this.params = params;
- this.queryParams = queryParams;
- this.fragment = fragment;
- this.data = data;
- this.outlet = outlet;
- this.component = component;
- this._futureSnapshot = futureSnapshot;
- }
- Object.defineProperty(ActivatedRoute.prototype, "routeConfig", {
- /**
- * The configuration used to match this route
- * @return {?}
- */
- get: function () { return this._futureSnapshot.routeConfig; },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(ActivatedRoute.prototype, "root", {
- /**
- * The root of the router state
- * @return {?}
- */
- get: function () { return this._routerState.root; },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(ActivatedRoute.prototype, "parent", {
- /**
- * The parent of this route in the router state tree
- * @return {?}
- */
- get: function () { return this._routerState.parent(this); },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(ActivatedRoute.prototype, "firstChild", {
- /**
- * The first child of this route in the router state tree
- * @return {?}
- */
- get: function () { return this._routerState.firstChild(this); },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(ActivatedRoute.prototype, "children", {
- /**
- * The children of this route in the router state tree
- * @return {?}
- */
- get: function () { return this._routerState.children(this); },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(ActivatedRoute.prototype, "pathFromRoot", {
- /**
- * The path from the root of the router state tree to this route
- * @return {?}
- */
- get: function () { return this._routerState.pathFromRoot(this); },
- enumerable: true,
- configurable: true
- });
- /**
- * @return {?}
- */
- ActivatedRoute.prototype.toString = function () {
- return this.snapshot ? this.snapshot.toString() : "Future(" + this._futureSnapshot + ")";
- };
- return ActivatedRoute;
-}());
-function ActivatedRoute_tsickle_Closure_declarations() {
- /**
- * The current snapshot of this route
- * @type {?}
- */
- ActivatedRoute.prototype.snapshot;
- /**
- * \@internal
- * @type {?}
- */
- ActivatedRoute.prototype._futureSnapshot;
- /**
- * \@internal
- * @type {?}
- */
- ActivatedRoute.prototype._routerState;
- /**
- * An observable of the URL segments matched by this route
- * @type {?}
- */
- ActivatedRoute.prototype.url;
- /**
- * An observable of the matrix parameters scoped to this route
- * @type {?}
- */
- ActivatedRoute.prototype.params;
- /**
- * An observable of the query parameters shared by all the routes
- * @type {?}
- */
- ActivatedRoute.prototype.queryParams;
- /**
- * An observable of the URL fragment shared by all the routes
- * @type {?}
- */
- ActivatedRoute.prototype.fragment;
- /**
- * An observable of the static and resolved data of this route.
- * @type {?}
- */
- ActivatedRoute.prototype.data;
- /**
- * The outlet name of the route. It's a constant
- * @type {?}
- */
- ActivatedRoute.prototype.outlet;
- /** @type {?} */
- ActivatedRoute.prototype.component;
-}
-/**
- * \@internal
- * @param {?} route
- * @return {?}
- */
-function inheritedParamsDataResolve(route) {
- var /** @type {?} */ pathToRoot = route.pathFromRoot;
- var /** @type {?} */ inhertingStartingFrom = pathToRoot.length - 1;
- while (inhertingStartingFrom >= 1) {
- var /** @type {?} */ current = pathToRoot[inhertingStartingFrom];
- var /** @type {?} */ parent_1 = pathToRoot[inhertingStartingFrom - 1];
- // current route is an empty path => inherits its parent's params and data
- if (current.routeConfig && current.routeConfig.path === '') {
- inhertingStartingFrom--;
- }
- else if (!parent_1.component) {
- inhertingStartingFrom--;
- }
- else {
- break;
- }
- }
- return pathToRoot.slice(inhertingStartingFrom).reduce(function (res, curr) {
- var /** @type {?} */ params = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils_collection__["merge"])(res.params, curr.params);
- var /** @type {?} */ data = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils_collection__["merge"])(res.data, curr.data);
- var /** @type {?} */ resolve = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils_collection__["merge"])(res.resolve, curr._resolvedData);
- return { params: params, data: data, resolve: resolve };
- }, /** @type {?} */ ({ params: {}, data: {}, resolve: {} }));
-}
-/**
- * \@whatItDoes Contains the information about a route associated with a component loaded in an
- * outlet
- * at a particular moment in time. ActivatedRouteSnapshot can also be used to traverse the router
- * state tree.
- *
- * \@howToUse
- *
- * ```
- * \@Component({templateUrl:'./my-component.html'})
- * class MyComponent {
- * constructor(route: ActivatedRoute) {
- * const id: string = route.snapshot.params.id;
- * const url: string = route.snapshot.url.join('');
- * const user = route.snapshot.data.user;
- * }
- * }
- * ```
- *
- * \@stable
- */
-var ActivatedRouteSnapshot = (function () {
- /**
- * \@internal
- * @param {?} url
- * @param {?} params
- * @param {?} queryParams
- * @param {?} fragment
- * @param {?} data
- * @param {?} outlet
- * @param {?} component
- * @param {?} routeConfig
- * @param {?} urlSegment
- * @param {?} lastPathIndex
- * @param {?} resolve
- */
- function ActivatedRouteSnapshot(url, params, queryParams, fragment, data, outlet, component, routeConfig, urlSegment, lastPathIndex, resolve) {
- this.url = url;
- this.params = params;
- this.queryParams = queryParams;
- this.fragment = fragment;
- this.data = data;
- this.outlet = outlet;
- this.component = component;
- this._routeConfig = routeConfig;
- this._urlSegment = urlSegment;
- this._lastPathIndex = lastPathIndex;
- this._resolve = resolve;
- }
- Object.defineProperty(ActivatedRouteSnapshot.prototype, "routeConfig", {
- /**
- * The configuration used to match this route
- * @return {?}
- */
- get: function () { return this._routeConfig; },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(ActivatedRouteSnapshot.prototype, "root", {
- /**
- * The root of the router state
- * @return {?}
- */
- get: function () { return this._routerState.root; },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(ActivatedRouteSnapshot.prototype, "parent", {
- /**
- * The parent of this route in the router state tree
- * @return {?}
- */
- get: function () { return this._routerState.parent(this); },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(ActivatedRouteSnapshot.prototype, "firstChild", {
- /**
- * The first child of this route in the router state tree
- * @return {?}
- */
- get: function () { return this._routerState.firstChild(this); },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(ActivatedRouteSnapshot.prototype, "children", {
- /**
- * The children of this route in the router state tree
- * @return {?}
- */
- get: function () { return this._routerState.children(this); },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(ActivatedRouteSnapshot.prototype, "pathFromRoot", {
- /**
- * The path from the root of the router state tree to this route
- * @return {?}
- */
- get: function () { return this._routerState.pathFromRoot(this); },
- enumerable: true,
- configurable: true
- });
- /**
- * @return {?}
- */
- ActivatedRouteSnapshot.prototype.toString = function () {
- var /** @type {?} */ url = this.url.map(function (segment) { return segment.toString(); }).join('/');
- var /** @type {?} */ matched = this._routeConfig ? this._routeConfig.path : '';
- return "Route(url:'" + url + "', path:'" + matched + "')";
- };
- return ActivatedRouteSnapshot;
-}());
-function ActivatedRouteSnapshot_tsickle_Closure_declarations() {
- /**
- * \@internal *
- * @type {?}
- */
- ActivatedRouteSnapshot.prototype._routeConfig;
- /**
- * \@internal *
- * @type {?}
- */
- ActivatedRouteSnapshot.prototype._urlSegment;
- /**
- * \@internal
- * @type {?}
- */
- ActivatedRouteSnapshot.prototype._lastPathIndex;
- /**
- * \@internal
- * @type {?}
- */
- ActivatedRouteSnapshot.prototype._resolve;
- /**
- * \@internal
- * @type {?}
- */
- ActivatedRouteSnapshot.prototype._resolvedData;
- /**
- * \@internal
- * @type {?}
- */
- ActivatedRouteSnapshot.prototype._routerState;
- /**
- * The URL segments matched by this route
- * @type {?}
- */
- ActivatedRouteSnapshot.prototype.url;
- /**
- * The matrix parameters scoped to this route
- * @type {?}
- */
- ActivatedRouteSnapshot.prototype.params;
- /**
- * The query parameters shared by all the routes
- * @type {?}
- */
- ActivatedRouteSnapshot.prototype.queryParams;
- /**
- * The URL fragment shared by all the routes
- * @type {?}
- */
- ActivatedRouteSnapshot.prototype.fragment;
- /**
- * The static and resolved data of this route
- * @type {?}
- */
- ActivatedRouteSnapshot.prototype.data;
- /**
- * The outlet name of the route
- * @type {?}
- */
- ActivatedRouteSnapshot.prototype.outlet;
- /**
- * The component of the route
- * @type {?}
- */
- ActivatedRouteSnapshot.prototype.component;
-}
-/**
- * \@whatItDoes Represents the state of the router at a moment in time.
- *
- * \@howToUse
- *
- * ```
- * \@Component({templateUrl:'template.html'})
- * class MyComponent {
- * constructor(router: Router) {
- * const state: RouterState = router.routerState;
- * const snapshot: RouterStateSnapshot = state.snapshot;
- * const root: ActivatedRouteSnapshot = snapshot.root;
- * const child = root.firstChild;
- * const id: Observable = child.params.map(p => p.id);
- * //...
- * }
- * }
- * ```
- *
- * \@description
- * RouterStateSnapshot is a tree of activated route snapshots. Every node in this tree knows about
- * the "consumed" URL segments, the extracted parameters, and the resolved data.
- *
- * \@stable
- */
-var RouterStateSnapshot = (function (_super) {
- __extends(RouterStateSnapshot, _super);
- /**
- * \@internal
- * @param {?} url
- * @param {?} root
- */
- function RouterStateSnapshot(url, root) {
- _super.call(this, root);
- this.url = url;
- setRouterStateSnapshot(this, root);
- }
- /**
- * @return {?}
- */
- RouterStateSnapshot.prototype.toString = function () { return serializeNode(this._root); };
- return RouterStateSnapshot;
-}(__WEBPACK_IMPORTED_MODULE_4__utils_tree__["Tree"]));
-function RouterStateSnapshot_tsickle_Closure_declarations() {
- /**
- * The url from which this snapshot was created
- * @type {?}
- */
- RouterStateSnapshot.prototype.url;
-}
-/**
- * @param {?} state
- * @param {?} node
- * @return {?}
- */
-function setRouterStateSnapshot(state, node) {
- node.value._routerState = state;
- node.children.forEach(function (c) { return setRouterStateSnapshot(state, c); });
-}
-/**
- * @param {?} node
- * @return {?}
- */
-function serializeNode(node) {
- var /** @type {?} */ c = node.children.length > 0 ? " { " + node.children.map(serializeNode).join(", ") + " } " : '';
- return "" + node.value + c;
-}
-/**
- * The expectation is that the activate route is created with the right set of parameters.
- * So we push new values into the observables only when they are not the initial values.
- * And we detect that by checking if the snapshot field is set.
- * @param {?} route
- * @return {?}
- */
-function advanceActivatedRoute(route) {
- if (route.snapshot) {
- var /** @type {?} */ currentSnapshot = route.snapshot;
- route.snapshot = route._futureSnapshot;
- if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils_collection__["shallowEqual"])(currentSnapshot.queryParams, route._futureSnapshot.queryParams)) {
- ((route.queryParams)).next(route._futureSnapshot.queryParams);
- }
- if (currentSnapshot.fragment !== route._futureSnapshot.fragment) {
- ((route.fragment)).next(route._futureSnapshot.fragment);
- }
- if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils_collection__["shallowEqual"])(currentSnapshot.params, route._futureSnapshot.params)) {
- ((route.params)).next(route._futureSnapshot.params);
- }
- if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils_collection__["shallowEqualArrays"])(currentSnapshot.url, route._futureSnapshot.url)) {
- ((route.url)).next(route._futureSnapshot.url);
- }
- if (!equalParamsAndUrlSegments(currentSnapshot, route._futureSnapshot)) {
- ((route.data)).next(route._futureSnapshot.data);
- }
- }
- else {
- route.snapshot = route._futureSnapshot;
- // this is for resolved data
- ((route.data)).next(route._futureSnapshot.data);
- }
-}
-/**
- * @param {?} a
- * @param {?} b
- * @return {?}
- */
-function equalParamsAndUrlSegments(a, b) {
- return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils_collection__["shallowEqual"])(a.params, b.params) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__url_tree__["equalSegments"])(a.url, b.url);
-}
-//# sourceMappingURL=router_state.js.map
-
-/***/ }),
-/* 105 */,
-/* 106 */,
-/* 107 */,
-/* 108 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"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 OuterSubscriber_1 = __webpack_require__(4);
-var subscribeToResult_1 = __webpack_require__(5);
-/**
- * Converts a higher-order Observable into a first-order Observable which
- * concurrently delivers all values that are emitted on the inner Observables.
- *
- * Flattens an Observable-of-Observables.
- *
- *
- *
- * `mergeAll` subscribes to an Observable that emits Observables, also known as
- * a higher-order Observable. Each time it observes one of these emitted inner
- * Observables, it subscribes to that and delivers all the values from the
- * inner Observable on the output Observable. The output Observable only
- * completes once all inner Observables have completed. Any error delivered by
- * a inner Observable will be immediately emitted on the output Observable.
- *
- * @example Spawn a new interval Observable for each click event, and blend their outputs as one Observable
- * var clicks = Rx.Observable.fromEvent(document, 'click');
- * var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000));
- * var firstOrder = higherOrder.mergeAll();
- * firstOrder.subscribe(x => console.log(x));
- *
- * @example Count from 0 to 9 every second for each click, but only allow 2 concurrent timers
- * var clicks = Rx.Observable.fromEvent(document, 'click');
- * var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000).take(10));
- * var firstOrder = higherOrder.mergeAll(2);
- * firstOrder.subscribe(x => console.log(x));
- *
- * @see {@link combineAll}
- * @see {@link concatAll}
- * @see {@link exhaust}
- * @see {@link merge}
- * @see {@link mergeMap}
- * @see {@link mergeMapTo}
- * @see {@link mergeScan}
- * @see {@link switch}
- * @see {@link zipAll}
- *
- * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of inner
- * Observables being subscribed to concurrently.
- * @return {Observable} An Observable that emits values coming from all the
- * inner Observables emitted by the source Observable.
- * @method mergeAll
- * @owner Observable
- */
-function mergeAll(concurrent) {
- if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
- return this.lift(new MergeAllOperator(concurrent));
-}
-exports.mergeAll = mergeAll;
-var MergeAllOperator = (function () {
- function MergeAllOperator(concurrent) {
- this.concurrent = concurrent;
- }
- MergeAllOperator.prototype.call = function (observer, source) {
- return source.subscribe(new MergeAllSubscriber(observer, this.concurrent));
- };
- return MergeAllOperator;
-}());
-exports.MergeAllOperator = MergeAllOperator;
-/**
- * We need this JSDoc comment for affecting ESDoc.
- * @ignore
- * @extends {Ignored}
- */
-var MergeAllSubscriber = (function (_super) {
- __extends(MergeAllSubscriber, _super);
- function MergeAllSubscriber(destination, concurrent) {
- _super.call(this, destination);
- this.concurrent = concurrent;
- this.hasCompleted = false;
- this.buffer = [];
- this.active = 0;
- }
- MergeAllSubscriber.prototype._next = function (observable) {
- if (this.active < this.concurrent) {
- this.active++;
- this.add(subscribeToResult_1.subscribeToResult(this, observable));
- }
- else {
- this.buffer.push(observable);
- }
- };
- MergeAllSubscriber.prototype._complete = function () {
- this.hasCompleted = true;
- if (this.active === 0 && this.buffer.length === 0) {
- this.destination.complete();
- }
- };
- MergeAllSubscriber.prototype.notifyComplete = function (innerSub) {
- var buffer = this.buffer;
- this.remove(innerSub);
- this.active--;
- if (buffer.length > 0) {
- this._next(buffer.shift());
- }
- else if (this.active === 0 && this.hasCompleted) {
- this.destination.complete();
- }
- };
- return MergeAllSubscriber;
-}(OuterSubscriber_1.OuterSubscriber));
-exports.MergeAllSubscriber = MergeAllSubscriber;
-//# sourceMappingURL=mergeAll.js.map
-
-/***/ }),
-/* 109 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"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 subscribeToResult_1 = __webpack_require__(5);
-var OuterSubscriber_1 = __webpack_require__(4);
-/* tslint:disable:max-line-length */
-/**
- * Projects each source value to an Observable which is merged in the output
- * Observable.
- *
- * Maps each value to an Observable, then flattens all of
- * these inner Observables using {@link mergeAll}.
- *
- *
- *
- * Returns an Observable that emits items based on applying a function that you
- * supply to each item emitted by the source Observable, where that function
- * returns an Observable, and then merging those resulting Observables and
- * emitting the results of this merger.
- *
- * @example Map and flatten each letter to an Observable ticking every 1 second
- * var letters = Rx.Observable.of('a', 'b', 'c');
- * var result = letters.mergeMap(x =>
- * Rx.Observable.interval(1000).map(i => x+i)
- * );
- * result.subscribe(x => console.log(x));
- *
- * // Results in the following:
- * // a0
- * // b0
- * // c0
- * // a1
- * // b1
- * // c1
- * // continues to list a,b,c with respective ascending integers
- *
- * @see {@link concatMap}
- * @see {@link exhaustMap}
- * @see {@link merge}
- * @see {@link mergeAll}
- * @see {@link mergeMapTo}
- * @see {@link mergeScan}
- * @see {@link switchMap}
- *
- * @param {function(value: T, ?index: number): Observable} project A function
- * that, when applied to an item emitted by the source Observable, returns an
- * Observable.
- * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]
- * A function to produce the value on the output Observable based on the values
- * and the indices of the source (outer) emission and the inner Observable
- * emission. The arguments passed to this function are:
- * - `outerValue`: the value that came from the source
- * - `innerValue`: the value that came from the projected Observable
- * - `outerIndex`: the "index" of the value that came from the source
- * - `innerIndex`: the "index" of the value from the projected Observable
- * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input
- * Observables being subscribed to concurrently.
- * @return {Observable} An Observable that emits the result of applying the
- * projection function (and the optional `resultSelector`) to each item emitted
- * by the source Observable and merging the results of the Observables obtained
- * from this transformation.
- * @method mergeMap
- * @owner Observable
- */
-function mergeMap(project, resultSelector, concurrent) {
- if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
- if (typeof resultSelector === 'number') {
- concurrent = resultSelector;
- resultSelector = null;
- }
- return this.lift(new MergeMapOperator(project, resultSelector, concurrent));
-}
-exports.mergeMap = mergeMap;
-var MergeMapOperator = (function () {
- function MergeMapOperator(project, resultSelector, concurrent) {
- if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
- this.project = project;
- this.resultSelector = resultSelector;
- this.concurrent = concurrent;
- }
- MergeMapOperator.prototype.call = function (observer, source) {
- return source.subscribe(new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent));
- };
- return MergeMapOperator;
-}());
-exports.MergeMapOperator = MergeMapOperator;
-/**
- * We need this JSDoc comment for affecting ESDoc.
- * @ignore
- * @extends {Ignored}
- */
-var MergeMapSubscriber = (function (_super) {
- __extends(MergeMapSubscriber, _super);
- function MergeMapSubscriber(destination, project, resultSelector, concurrent) {
- if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
- _super.call(this, destination);
- this.project = project;
- this.resultSelector = resultSelector;
- this.concurrent = concurrent;
- this.hasCompleted = false;
- this.buffer = [];
- this.active = 0;
- this.index = 0;
- }
- MergeMapSubscriber.prototype._next = function (value) {
- if (this.active < this.concurrent) {
- this._tryNext(value);
- }
- else {
- this.buffer.push(value);
- }
- };
- MergeMapSubscriber.prototype._tryNext = function (value) {
- var result;
- var index = this.index++;
- try {
- result = this.project(value, index);
- }
- catch (err) {
- this.destination.error(err);
- return;
- }
- this.active++;
- this._innerSub(result, value, index);
- };
- MergeMapSubscriber.prototype._innerSub = function (ish, value, index) {
- this.add(subscribeToResult_1.subscribeToResult(this, ish, value, index));
- };
- MergeMapSubscriber.prototype._complete = function () {
- this.hasCompleted = true;
- if (this.active === 0 && this.buffer.length === 0) {
- this.destination.complete();
- }
- };
- MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
- if (this.resultSelector) {
- this._notifyResultSelector(outerValue, innerValue, outerIndex, innerIndex);
- }
- else {
- this.destination.next(innerValue);
- }
- };
- MergeMapSubscriber.prototype._notifyResultSelector = function (outerValue, innerValue, outerIndex, innerIndex) {
- var result;
- try {
- result = this.resultSelector(outerValue, innerValue, outerIndex, innerIndex);
- }
- catch (err) {
- this.destination.error(err);
- return;
- }
- this.destination.next(result);
- };
- MergeMapSubscriber.prototype.notifyComplete = function (innerSub) {
- var buffer = this.buffer;
- this.remove(innerSub);
- this.active--;
- if (buffer.length > 0) {
- this._next(buffer.shift());
- }
- else if (this.active === 0 && this.hasCompleted) {
- this.destination.complete();
- }
- };
- return MergeMapSubscriber;
-}(OuterSubscriber_1.OuterSubscriber));
-exports.MergeMapSubscriber = MergeMapSubscriber;
-//# sourceMappingURL=mergeMap.js.map
-
-/***/ }),
-/* 110 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-var ConnectableObservable_1 = __webpack_require__(415);
-/* tslint:disable:max-line-length */
-/**
- * Returns an Observable that emits the results of invoking a specified selector on items
- * emitted by a ConnectableObservable that shares a single subscription to the underlying stream.
- *
- *
- *
- * @param {Function|Subject} Factory function to create an intermediate subject through
- * which the source sequence's elements will be multicast to the selector function
- * or Subject to push source elements into.
- * @param {Function} Optional selector function that can use the multicasted source stream
- * as many times as needed, without causing multiple subscriptions to the source stream.
- * Subscribers to the given source will receive all notifications of the source from the
- * time of the subscription forward.
- * @return {Observable} an Observable that emits the results of invoking the selector
- * on the items emitted by a `ConnectableObservable` that shares a single subscription to
- * the underlying stream.
- * @method multicast
- * @owner Observable
- */
-function multicast(subjectOrSubjectFactory, selector) {
- var subjectFactory;
- if (typeof subjectOrSubjectFactory === 'function') {
- subjectFactory = subjectOrSubjectFactory;
- }
- else {
- subjectFactory = function subjectFactory() {
- return subjectOrSubjectFactory;
- };
- }
- if (typeof selector === 'function') {
- return this.lift(new MulticastOperator(subjectFactory, selector));
- }
- var connectable = Object.create(this, ConnectableObservable_1.connectableObservableDescriptor);
- connectable.source = this;
- connectable.subjectFactory = subjectFactory;
- return connectable;
-}
-exports.multicast = multicast;
-var MulticastOperator = (function () {
- function MulticastOperator(subjectFactory, selector) {
- this.subjectFactory = subjectFactory;
- this.selector = selector;
- }
- MulticastOperator.prototype.call = function (subscriber, source) {
- var selector = this.selector;
- var subject = this.subjectFactory();
- var subscription = selector(subject).subscribe(subscriber);
- subscription.add(source.subscribe(subject));
- return subscription;
- };
- return MulticastOperator;
-}());
-exports.MulticastOperator = MulticastOperator;
-//# sourceMappingURL=multicast.js.map
-
-/***/ }),
-/* 111 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_common__ = __webpack_require__(450);
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NgLocalization", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["NgLocalization"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CommonModule", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["CommonModule"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NgClass", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["NgClass"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NgFor", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["NgFor"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NgIf", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["NgIf"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NgPlural", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["NgPlural"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NgPluralCase", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["NgPluralCase"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NgStyle", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["NgStyle"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NgSwitch", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["NgSwitch"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NgSwitchCase", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["NgSwitchCase"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NgSwitchDefault", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["NgSwitchDefault"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NgTemplateOutlet", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["NgTemplateOutlet"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncPipe", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["AsyncPipe"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "DatePipe", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["DatePipe"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "I18nPluralPipe", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["I18nPluralPipe"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "I18nSelectPipe", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["I18nSelectPipe"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "JsonPipe", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["JsonPipe"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "LowerCasePipe", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["LowerCasePipe"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CurrencyPipe", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["CurrencyPipe"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "DecimalPipe", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["DecimalPipe"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "PercentPipe", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["PercentPipe"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "SlicePipe", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["SlicePipe"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "UpperCasePipe", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["UpperCasePipe"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["VERSION"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Version", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["Version"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "PlatformLocation", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["PlatformLocation"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "LocationStrategy", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["LocationStrategy"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "APP_BASE_HREF", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["APP_BASE_HREF"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "HashLocationStrategy", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["HashLocationStrategy"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "PathLocationStrategy", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["PathLocationStrategy"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return __WEBPACK_IMPORTED_MODULE_0__src_common__["Location"]; });
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-/**
- * @module
- * @description
- * Entry point for all public APIs of the common package.
- */
-
-//# sourceMappingURL=index.js.map
-
-/***/ }),
-/* 112 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__expression_parser_ast__ = __webpack_require__(209);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__facade_lang__ = __webpack_require__(7);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__identifiers__ = __webpack_require__(19);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__output_output_ast__ = __webpack_require__(12);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__identifier_util__ = __webpack_require__(46);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventHandlerVars", function() { return EventHandlerVars; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConvertPropertyBindingResult", function() { return ConvertPropertyBindingResult; });
-/* harmony export (immutable) */ __webpack_exports__["convertPropertyBinding"] = convertPropertyBinding;
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConvertActionBindingResult", function() { return ConvertActionBindingResult; });
-/* harmony export (immutable) */ __webpack_exports__["convertActionBinding"] = convertActionBinding;
-/* harmony export (immutable) */ __webpack_exports__["createSharedBindingVariablesIfNeeded"] = createSharedBindingVariablesIfNeeded;
-/* harmony export (immutable) */ __webpack_exports__["temporaryDeclaration"] = temporaryDeclaration;
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-
-
-
-
-
-var /** @type {?} */ VAL_UNWRAPPER_VAR = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["variable"]("valUnwrapper");
-var EventHandlerVars = (function () {
- function EventHandlerVars() {
- }
- EventHandlerVars.event = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["variable"]('$event');
- return EventHandlerVars;
-}());
-function EventHandlerVars_tsickle_Closure_declarations() {
- /** @type {?} */
- EventHandlerVars.event;
-}
-var ConvertPropertyBindingResult = (function () {
- /**
- * @param {?} stmts
- * @param {?} currValExpr
- * @param {?} forceUpdate
- */
- function ConvertPropertyBindingResult(stmts, currValExpr, forceUpdate) {
- this.stmts = stmts;
- this.currValExpr = currValExpr;
- this.forceUpdate = forceUpdate;
- }
- return ConvertPropertyBindingResult;
-}());
-function ConvertPropertyBindingResult_tsickle_Closure_declarations() {
- /** @type {?} */
- ConvertPropertyBindingResult.prototype.stmts;
- /** @type {?} */
- ConvertPropertyBindingResult.prototype.currValExpr;
- /** @type {?} */
- ConvertPropertyBindingResult.prototype.forceUpdate;
-}
-/**
- * Converts the given expression AST into an executable output AST, assuming the expression is
- * used in a property binding.
- * @param {?} builder
- * @param {?} nameResolver
- * @param {?} implicitReceiver
- * @param {?} expression
- * @param {?} bindingId
- * @return {?}
- */
-function convertPropertyBinding(builder, nameResolver, implicitReceiver, expression, bindingId) {
- var /** @type {?} */ currValExpr = createCurrValueExpr(bindingId);
- var /** @type {?} */ stmts = [];
- if (!nameResolver) {
- nameResolver = new DefaultNameResolver();
- }
- var /** @type {?} */ visitor = new _AstToIrVisitor(builder, nameResolver, implicitReceiver, VAL_UNWRAPPER_VAR, bindingId, false);
- var /** @type {?} */ outputExpr = expression.visit(visitor, _Mode.Expression);
- if (!outputExpr) {
- // e.g. an empty expression was given
- return null;
- }
- if (visitor.temporaryCount) {
- for (var /** @type {?} */ i = 0; i < visitor.temporaryCount; i++) {
- stmts.push(temporaryDeclaration(bindingId, i));
- }
- }
- if (visitor.needsValueUnwrapper) {
- var /** @type {?} */ initValueUnwrapperStmt = VAL_UNWRAPPER_VAR.callMethod('reset', []).toStmt();
- stmts.push(initValueUnwrapperStmt);
- }
- stmts.push(currValExpr.set(outputExpr).toDeclStmt(null, [__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["StmtModifier"].Final]));
- if (visitor.needsValueUnwrapper) {
- return new ConvertPropertyBindingResult(stmts, currValExpr, VAL_UNWRAPPER_VAR.prop('hasWrappedValue'));
- }
- else {
- return new ConvertPropertyBindingResult(stmts, currValExpr, null);
- }
-}
-var ConvertActionBindingResult = (function () {
- /**
- * @param {?} stmts
- * @param {?} preventDefault
- */
- function ConvertActionBindingResult(stmts, preventDefault) {
- this.stmts = stmts;
- this.preventDefault = preventDefault;
- }
- return ConvertActionBindingResult;
-}());
-function ConvertActionBindingResult_tsickle_Closure_declarations() {
- /** @type {?} */
- ConvertActionBindingResult.prototype.stmts;
- /** @type {?} */
- ConvertActionBindingResult.prototype.preventDefault;
-}
-/**
- * Converts the given expression AST into an executable output AST, assuming the expression is
- * used in an action binding (e.g. an event handler).
- * @param {?} builder
- * @param {?} nameResolver
- * @param {?} implicitReceiver
- * @param {?} action
- * @param {?} bindingId
- * @return {?}
- */
-function convertActionBinding(builder, nameResolver, implicitReceiver, action, bindingId) {
- if (!nameResolver) {
- nameResolver = new DefaultNameResolver();
- }
- var /** @type {?} */ visitor = new _AstToIrVisitor(builder, nameResolver, implicitReceiver, null, bindingId, true);
- var /** @type {?} */ actionStmts = [];
- flattenStatements(action.visit(visitor, _Mode.Statement), actionStmts);
- prependTemporaryDecls(visitor.temporaryCount, bindingId, actionStmts);
- var /** @type {?} */ lastIndex = actionStmts.length - 1;
- var /** @type {?} */ preventDefaultVar = null;
- if (lastIndex >= 0) {
- var /** @type {?} */ lastStatement = actionStmts[lastIndex];
- var /** @type {?} */ returnExpr = convertStmtIntoExpression(lastStatement);
- if (returnExpr) {
- // Note: We need to cast the result of the method call to dynamic,
- // as it might be a void method!
- preventDefaultVar = createPreventDefaultVar(bindingId);
- actionStmts[lastIndex] =
- preventDefaultVar.set(returnExpr.cast(__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["DYNAMIC_TYPE"]).notIdentical(__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["literal"](false)))
- .toDeclStmt(null, [__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["StmtModifier"].Final]);
- }
- }
- return new ConvertActionBindingResult(actionStmts, preventDefaultVar);
-}
-/**
- * Creates variables that are shared by multiple calls to `convertActionBinding` /
- * `convertPropertyBinding`
- * @param {?} stmts
- * @return {?}
- */
-function createSharedBindingVariablesIfNeeded(stmts) {
- var /** @type {?} */ unwrapperStmts = [];
- var /** @type {?} */ readVars = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["findReadVarNames"](stmts);
- if (readVars.has(VAL_UNWRAPPER_VAR.name)) {
- unwrapperStmts.push(VAL_UNWRAPPER_VAR
- .set(__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["importExpr"](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__identifiers__["createIdentifier"])(__WEBPACK_IMPORTED_MODULE_2__identifiers__["Identifiers"].ValueUnwrapper)).instantiate([]))
- .toDeclStmt(null, [__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["StmtModifier"].Final]));
- }
- return unwrapperStmts;
-}
-/**
- * @param {?} bindingId
- * @param {?} temporaryNumber
- * @return {?}
- */
-function temporaryName(bindingId, temporaryNumber) {
- return "tmp_" + bindingId + "_" + temporaryNumber;
-}
-/**
- * @param {?} bindingId
- * @param {?} temporaryNumber
- * @return {?}
- */
-function temporaryDeclaration(bindingId, temporaryNumber) {
- return new __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["DeclareVarStmt"](temporaryName(bindingId, temporaryNumber), __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["NULL_EXPR"]);
-}
-/**
- * @param {?} temporaryCount
- * @param {?} bindingId
- * @param {?} statements
- * @return {?}
- */
-function prependTemporaryDecls(temporaryCount, bindingId, statements) {
- for (var /** @type {?} */ i = temporaryCount - 1; i >= 0; i--) {
- statements.unshift(temporaryDeclaration(bindingId, i));
- }
-}
-var _Mode = {};
-_Mode.Statement = 0;
-_Mode.Expression = 1;
-_Mode[_Mode.Statement] = "Statement";
-_Mode[_Mode.Expression] = "Expression";
-/**
- * @param {?} mode
- * @param {?} ast
- * @return {?}
- */
-function ensureStatementMode(mode, ast) {
- if (mode !== _Mode.Statement) {
- throw new Error("Expected a statement, but saw " + ast);
- }
-}
-/**
- * @param {?} mode
- * @param {?} ast
- * @return {?}
- */
-function ensureExpressionMode(mode, ast) {
- if (mode !== _Mode.Expression) {
- throw new Error("Expected an expression, but saw " + ast);
- }
-}
-/**
- * @param {?} mode
- * @param {?} expr
- * @return {?}
- */
-function convertToStatementIfNeeded(mode, expr) {
- if (mode === _Mode.Statement) {
- return expr.toStmt();
- }
- else {
- return expr;
- }
-}
-var _AstToIrVisitor = (function () {
- /**
- * @param {?} _builder
- * @param {?} _nameResolver
- * @param {?} _implicitReceiver
- * @param {?} _valueUnwrapper
- * @param {?} bindingId
- * @param {?} isAction
- */
- function _AstToIrVisitor(_builder, _nameResolver, _implicitReceiver, _valueUnwrapper, bindingId, isAction) {
- this._builder = _builder;
- this._nameResolver = _nameResolver;
- this._implicitReceiver = _implicitReceiver;
- this._valueUnwrapper = _valueUnwrapper;
- this.bindingId = bindingId;
- this.isAction = isAction;
- this._nodeMap = new Map();
- this._resultMap = new Map();
- this._currentTemporary = 0;
- this.needsValueUnwrapper = false;
- this.temporaryCount = 0;
- }
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitBinary = function (ast, mode) {
- var /** @type {?} */ op;
- switch (ast.operation) {
- case '+':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].Plus;
- break;
- case '-':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].Minus;
- break;
- case '*':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].Multiply;
- break;
- case '/':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].Divide;
- break;
- case '%':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].Modulo;
- break;
- case '&&':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].And;
- break;
- case '||':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].Or;
- break;
- case '==':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].Equals;
- break;
- case '!=':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].NotEquals;
- break;
- case '===':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].Identical;
- break;
- case '!==':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].NotIdentical;
- break;
- case '<':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].Lower;
- break;
- case '>':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].Bigger;
- break;
- case '<=':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].LowerEquals;
- break;
- case '>=':
- op = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperator"].BiggerEquals;
- break;
- default:
- throw new Error("Unsupported operation " + ast.operation);
- }
- return convertToStatementIfNeeded(mode, new __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["BinaryOperatorExpr"](op, this.visit(ast.left, _Mode.Expression), this.visit(ast.right, _Mode.Expression)));
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitChain = function (ast, mode) {
- ensureStatementMode(mode, ast);
- return this.visitAll(ast.expressions, mode);
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitConditional = function (ast, mode) {
- var /** @type {?} */ value = this.visit(ast.condition, _Mode.Expression);
- return convertToStatementIfNeeded(mode, value.conditional(this.visit(ast.trueExp, _Mode.Expression), this.visit(ast.falseExp, _Mode.Expression)));
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitPipe = function (ast, mode) {
- var /** @type {?} */ input = this.visit(ast.exp, _Mode.Expression);
- var /** @type {?} */ args = this.visitAll(ast.args, _Mode.Expression);
- var /** @type {?} */ value = this._nameResolver.callPipe(ast.name, input, args);
- if (!value) {
- throw new Error("Illegal state: Pipe " + ast.name + " is not allowed here!");
- }
- this.needsValueUnwrapper = true;
- return convertToStatementIfNeeded(mode, this._valueUnwrapper.callMethod('unwrap', [value]));
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitFunctionCall = function (ast, mode) {
- return convertToStatementIfNeeded(mode, this.visit(ast.target, _Mode.Expression).callFn(this.visitAll(ast.args, _Mode.Expression)));
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitImplicitReceiver = function (ast, mode) {
- ensureExpressionMode(mode, ast);
- return this._implicitReceiver;
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitInterpolation = function (ast, mode) {
- ensureExpressionMode(mode, ast);
- var /** @type {?} */ args = [__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["literal"](ast.expressions.length)];
- for (var /** @type {?} */ i = 0; i < ast.strings.length - 1; i++) {
- args.push(__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["literal"](ast.strings[i]));
- args.push(this.visit(ast.expressions[i], _Mode.Expression));
- }
- args.push(__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["literal"](ast.strings[ast.strings.length - 1]));
- return ast.expressions.length <= 9 ?
- __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["importExpr"](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__identifiers__["createIdentifier"])(__WEBPACK_IMPORTED_MODULE_2__identifiers__["Identifiers"].inlineInterpolate)).callFn(args) :
- __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["importExpr"](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__identifiers__["createIdentifier"])(__WEBPACK_IMPORTED_MODULE_2__identifiers__["Identifiers"].interpolate)).callFn([
- args[0], __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["literalArr"](args.slice(1))
- ]);
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitKeyedRead = function (ast, mode) {
- var /** @type {?} */ leftMostSafe = this.leftMostSafeNode(ast);
- if (leftMostSafe) {
- return this.convertSafeAccess(ast, leftMostSafe, mode);
- }
- else {
- return convertToStatementIfNeeded(mode, this.visit(ast.obj, _Mode.Expression).key(this.visit(ast.key, _Mode.Expression)));
- }
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitKeyedWrite = function (ast, mode) {
- var /** @type {?} */ obj = this.visit(ast.obj, _Mode.Expression);
- var /** @type {?} */ key = this.visit(ast.key, _Mode.Expression);
- var /** @type {?} */ value = this.visit(ast.value, _Mode.Expression);
- return convertToStatementIfNeeded(mode, obj.key(key).set(value));
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitLiteralArray = function (ast, mode) {
- var /** @type {?} */ parts = this.visitAll(ast.expressions, mode);
- var /** @type {?} */ literalArr = this.isAction ? __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["literalArr"](parts) : createCachedLiteralArray(this._builder, parts);
- return convertToStatementIfNeeded(mode, literalArr);
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitLiteralMap = function (ast, mode) {
- var /** @type {?} */ parts = [];
- for (var /** @type {?} */ i = 0; i < ast.keys.length; i++) {
- parts.push([ast.keys[i], this.visit(ast.values[i], _Mode.Expression)]);
- }
- var /** @type {?} */ literalMap = this.isAction ? __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["literalMap"](parts) : createCachedLiteralMap(this._builder, parts);
- return convertToStatementIfNeeded(mode, literalMap);
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitLiteralPrimitive = function (ast, mode) {
- return convertToStatementIfNeeded(mode, __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["literal"](ast.value));
- };
- /**
- * @param {?} name
- * @return {?}
- */
- _AstToIrVisitor.prototype._getLocal = function (name) {
- if (this.isAction && name == EventHandlerVars.event.name) {
- return EventHandlerVars.event;
- }
- return this._nameResolver.getLocal(name);
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitMethodCall = function (ast, mode) {
- var /** @type {?} */ leftMostSafe = this.leftMostSafeNode(ast);
- if (leftMostSafe) {
- return this.convertSafeAccess(ast, leftMostSafe, mode);
- }
- else {
- var /** @type {?} */ args = this.visitAll(ast.args, _Mode.Expression);
- var /** @type {?} */ result = null;
- var /** @type {?} */ receiver = this.visit(ast.receiver, _Mode.Expression);
- if (receiver === this._implicitReceiver) {
- var /** @type {?} */ varExpr = this._getLocal(ast.name);
- if (varExpr) {
- result = varExpr.callFn(args);
- }
- }
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["isBlank"])(result)) {
- result = receiver.callMethod(ast.name, args);
- }
- return convertToStatementIfNeeded(mode, result);
- }
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitPrefixNot = function (ast, mode) {
- return convertToStatementIfNeeded(mode, __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["not"](this.visit(ast.expression, _Mode.Expression)));
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitPropertyRead = function (ast, mode) {
- var /** @type {?} */ leftMostSafe = this.leftMostSafeNode(ast);
- if (leftMostSafe) {
- return this.convertSafeAccess(ast, leftMostSafe, mode);
- }
- else {
- var /** @type {?} */ result = null;
- var /** @type {?} */ receiver = this.visit(ast.receiver, _Mode.Expression);
- if (receiver === this._implicitReceiver) {
- result = this._getLocal(ast.name);
- }
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__["isBlank"])(result)) {
- result = receiver.prop(ast.name);
- }
- return convertToStatementIfNeeded(mode, result);
- }
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitPropertyWrite = function (ast, mode) {
- var /** @type {?} */ receiver = this.visit(ast.receiver, _Mode.Expression);
- if (receiver === this._implicitReceiver) {
- var /** @type {?} */ varExpr = this._getLocal(ast.name);
- if (varExpr) {
- throw new Error('Cannot assign to a reference or variable!');
- }
- }
- return convertToStatementIfNeeded(mode, receiver.prop(ast.name).set(this.visit(ast.value, _Mode.Expression)));
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitSafePropertyRead = function (ast, mode) {
- return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode);
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitSafeMethodCall = function (ast, mode) {
- return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode);
- };
- /**
- * @param {?} asts
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitAll = function (asts, mode) {
- var _this = this;
- return asts.map(function (ast) { return _this.visit(ast, mode); });
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visitQuote = function (ast, mode) {
- throw new Error('Quotes are not supported for evaluation!');
- };
- /**
- * @param {?} ast
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.visit = function (ast, mode) {
- var /** @type {?} */ result = this._resultMap.get(ast);
- if (result)
- return result;
- return (this._nodeMap.get(ast) || ast).visit(this, mode);
- };
- /**
- * @param {?} ast
- * @param {?} leftMostSafe
- * @param {?} mode
- * @return {?}
- */
- _AstToIrVisitor.prototype.convertSafeAccess = function (ast, leftMostSafe, mode) {
- // If the expression contains a safe access node on the left it needs to be converted to
- // an expression that guards the access to the member by checking the receiver for blank. As
- // execution proceeds from left to right, the left most part of the expression must be guarded
- // first but, because member access is left associative, the right side of the expression is at
- // the top of the AST. The desired result requires lifting a copy of the the left part of the
- // expression up to test it for blank before generating the unguarded version.
- // Consider, for example the following expression: a?.b.c?.d.e
- // This results in the ast:
- // .
- // / \
- // ?. e
- // / \
- // . d
- // / \
- // ?. c
- // / \
- // a b
- // The following tree should be generated:
- //
- // /---- ? ----\
- // / | \
- // a /--- ? ---\ null
- // / | \
- // . . null
- // / \ / \
- // . c . e
- // / \ / \
- // a b , d
- // / \
- // . c
- // / \
- // a b
- //
- // Notice that the first guard condition is the left hand of the left most safe access node
- // which comes in as leftMostSafe to this routine.
- var /** @type {?} */ guardedExpression = this.visit(leftMostSafe.receiver, _Mode.Expression);
- var /** @type {?} */ temporary;
- if (this.needsTemporary(leftMostSafe.receiver)) {
- // If the expression has method calls or pipes then we need to save the result into a
- // temporary variable to avoid calling stateful or impure code more than once.
- temporary = this.allocateTemporary();
- // Preserve the result in the temporary variable
- guardedExpression = temporary.set(guardedExpression);
- // Ensure all further references to the guarded expression refer to the temporary instead.
- this._resultMap.set(leftMostSafe.receiver, temporary);
- }
- var /** @type {?} */ condition = guardedExpression.isBlank();
- // Convert the ast to an unguarded access to the receiver's member. The map will substitute
- // leftMostNode with its unguarded version in the call to `this.visit()`.
- if (leftMostSafe instanceof __WEBPACK_IMPORTED_MODULE_0__expression_parser_ast__["SafeMethodCall"]) {
- this._nodeMap.set(leftMostSafe, new __WEBPACK_IMPORTED_MODULE_0__expression_parser_ast__["MethodCall"](leftMostSafe.span, leftMostSafe.receiver, leftMostSafe.name, leftMostSafe.args));
- }
- else {
- this._nodeMap.set(leftMostSafe, new __WEBPACK_IMPORTED_MODULE_0__expression_parser_ast__["PropertyRead"](leftMostSafe.span, leftMostSafe.receiver, leftMostSafe.name));
- }
- // Recursively convert the node now without the guarded member access.
- var /** @type {?} */ access = this.visit(ast, _Mode.Expression);
- // Remove the mapping. This is not strictly required as the converter only traverses each node
- // once but is safer if the conversion is changed to traverse the nodes more than once.
- this._nodeMap.delete(leftMostSafe);
- // If we allcoated a temporary, release it.
- if (temporary) {
- this.releaseTemporary(temporary);
- }
- // Produce the conditional
- return convertToStatementIfNeeded(mode, condition.conditional(__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["literal"](null), access));
- };
- /**
- * @param {?} ast
- * @return {?}
- */
- _AstToIrVisitor.prototype.leftMostSafeNode = function (ast) {
- var _this = this;
- var /** @type {?} */ visit = function (visitor, ast) {
- return (_this._nodeMap.get(ast) || ast).visit(visitor);
- };
- return ast.visit({
- /**
- * @param {?} ast
- * @return {?}
- */
- visitBinary: function (ast) { return null; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitChain: function (ast) { return null; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitConditional: function (ast) { return null; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitFunctionCall: function (ast) { return null; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitImplicitReceiver: function (ast) { return null; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitInterpolation: function (ast) { return null; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitKeyedRead: function (ast) { return visit(this, ast.obj); },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitKeyedWrite: function (ast) { return null; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitLiteralArray: function (ast) { return null; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitLiteralMap: function (ast) { return null; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitLiteralPrimitive: function (ast) { return null; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitMethodCall: function (ast) { return visit(this, ast.receiver); },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitPipe: function (ast) { return null; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitPrefixNot: function (ast) { return null; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitPropertyRead: function (ast) { return visit(this, ast.receiver); },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitPropertyWrite: function (ast) { return null; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitQuote: function (ast) { return null; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitSafeMethodCall: function (ast) { return visit(this, ast.receiver) || ast; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitSafePropertyRead: function (ast) {
- return visit(this, ast.receiver) || ast;
- }
- });
- };
- /**
- * @param {?} ast
- * @return {?}
- */
- _AstToIrVisitor.prototype.needsTemporary = function (ast) {
- var _this = this;
- var /** @type {?} */ visit = function (visitor, ast) {
- return ast && (_this._nodeMap.get(ast) || ast).visit(visitor);
- };
- var /** @type {?} */ visitSome = function (visitor, ast) {
- return ast.some(function (ast) { return visit(visitor, ast); });
- };
- return ast.visit({
- /**
- * @param {?} ast
- * @return {?}
- */
- visitBinary: function (ast) { return visit(this, ast.left) || visit(this, ast.right); },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitChain: function (ast) { return false; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitConditional: function (ast) {
- return visit(this, ast.condition) || visit(this, ast.trueExp) ||
- visit(this, ast.falseExp);
- },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitFunctionCall: function (ast) { return true; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitImplicitReceiver: function (ast) { return false; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitInterpolation: function (ast) { return visitSome(this, ast.expressions); },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitKeyedRead: function (ast) { return false; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitKeyedWrite: function (ast) { return false; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitLiteralArray: function (ast) { return true; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitLiteralMap: function (ast) { return true; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitLiteralPrimitive: function (ast) { return false; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitMethodCall: function (ast) { return true; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitPipe: function (ast) { return true; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitPrefixNot: function (ast) { return visit(this, ast.expression); },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitPropertyRead: function (ast) { return false; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitPropertyWrite: function (ast) { return false; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitQuote: function (ast) { return false; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitSafeMethodCall: function (ast) { return true; },
- /**
- * @param {?} ast
- * @return {?}
- */
- visitSafePropertyRead: function (ast) { return false; }
- });
- };
- /**
- * @return {?}
- */
- _AstToIrVisitor.prototype.allocateTemporary = function () {
- var /** @type {?} */ tempNumber = this._currentTemporary++;
- this.temporaryCount = Math.max(this._currentTemporary, this.temporaryCount);
- return new __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["ReadVarExpr"](temporaryName(this.bindingId, tempNumber));
- };
- /**
- * @param {?} temporary
- * @return {?}
- */
- _AstToIrVisitor.prototype.releaseTemporary = function (temporary) {
- this._currentTemporary--;
- if (temporary.name != temporaryName(this.bindingId, this._currentTemporary)) {
- throw new Error("Temporary " + temporary.name + " released out of order");
- }
- };
- return _AstToIrVisitor;
-}());
-function _AstToIrVisitor_tsickle_Closure_declarations() {
- /** @type {?} */
- _AstToIrVisitor.prototype._nodeMap;
- /** @type {?} */
- _AstToIrVisitor.prototype._resultMap;
- /** @type {?} */
- _AstToIrVisitor.prototype._currentTemporary;
- /** @type {?} */
- _AstToIrVisitor.prototype.needsValueUnwrapper;
- /** @type {?} */
- _AstToIrVisitor.prototype.temporaryCount;
- /** @type {?} */
- _AstToIrVisitor.prototype._builder;
- /** @type {?} */
- _AstToIrVisitor.prototype._nameResolver;
- /** @type {?} */
- _AstToIrVisitor.prototype._implicitReceiver;
- /** @type {?} */
- _AstToIrVisitor.prototype._valueUnwrapper;
- /** @type {?} */
- _AstToIrVisitor.prototype.bindingId;
- /** @type {?} */
- _AstToIrVisitor.prototype.isAction;
-}
-/**
- * @param {?} arg
- * @param {?} output
- * @return {?}
- */
-function flattenStatements(arg, output) {
- if (Array.isArray(arg)) {
- ((arg)).forEach(function (entry) { return flattenStatements(entry, output); });
- }
- else {
- output.push(arg);
- }
-}
-/**
- * @param {?} builder
- * @param {?} values
- * @return {?}
- */
-function createCachedLiteralArray(builder, values) {
- if (values.length === 0) {
- return __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["importExpr"](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__identifiers__["createIdentifier"])(__WEBPACK_IMPORTED_MODULE_2__identifiers__["Identifiers"].EMPTY_ARRAY));
- }
- var /** @type {?} */ proxyExpr = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["THIS_EXPR"].prop("_arr_" + builder.fields.length);
- var /** @type {?} */ proxyParams = [];
- var /** @type {?} */ proxyReturnEntries = [];
- for (var /** @type {?} */ i = 0; i < values.length; i++) {
- var /** @type {?} */ paramName = "p" + i;
- proxyParams.push(new __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["FnParam"](paramName));
- proxyReturnEntries.push(__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["variable"](paramName));
- }
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__identifier_util__["createPureProxy"])(__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["fn"](proxyParams, [new __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["ReturnStatement"](__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["literalArr"](proxyReturnEntries))], new __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["ArrayType"](__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["DYNAMIC_TYPE"])), values.length, proxyExpr, builder);
- return proxyExpr.callFn(values);
-}
-/**
- * @param {?} builder
- * @param {?} entries
- * @return {?}
- */
-function createCachedLiteralMap(builder, entries) {
- if (entries.length === 0) {
- return __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["importExpr"](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__identifiers__["createIdentifier"])(__WEBPACK_IMPORTED_MODULE_2__identifiers__["Identifiers"].EMPTY_MAP));
- }
- var /** @type {?} */ proxyExpr = __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["THIS_EXPR"].prop("_map_" + builder.fields.length);
- var /** @type {?} */ proxyParams = [];
- var /** @type {?} */ proxyReturnEntries = [];
- var /** @type {?} */ values = [];
- for (var /** @type {?} */ i = 0; i < entries.length; i++) {
- var /** @type {?} */ paramName = "p" + i;
- proxyParams.push(new __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["FnParam"](paramName));
- proxyReturnEntries.push([entries[i][0], __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["variable"](paramName)]);
- values.push(/** @type {?} */ (entries[i][1]));
- }
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__identifier_util__["createPureProxy"])(__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["fn"](proxyParams, [new __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["ReturnStatement"](__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["literalMap"](proxyReturnEntries))], new __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["MapType"](__WEBPACK_IMPORTED_MODULE_3__output_output_ast__["DYNAMIC_TYPE"])), entries.length, proxyExpr, builder);
- return proxyExpr.callFn(values);
-}
-var DefaultNameResolver = (function () {
- function DefaultNameResolver() {
- }
- /**
- * @param {?} name
- * @param {?} input
- * @param {?} args
- * @return {?}
- */
- DefaultNameResolver.prototype.callPipe = function (name, input, args) { return null; };
- /**
- * @param {?} name
- * @return {?}
- */
- DefaultNameResolver.prototype.getLocal = function (name) { return null; };
- return DefaultNameResolver;
-}());
-/**
- * @param {?} bindingId
- * @return {?}
- */
-function createCurrValueExpr(bindingId) {
- return __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["variable"]("currVal_" + bindingId); // fix syntax highlighting: `
-}
-/**
- * @param {?} bindingId
- * @return {?}
- */
-function createPreventDefaultVar(bindingId) {
- return __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["variable"]("pd_" + bindingId);
-}
-/**
- * @param {?} stmt
- * @return {?}
- */
-function convertStmtIntoExpression(stmt) {
- if (stmt instanceof __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["ExpressionStatement"]) {
- return stmt.expr;
- }
- else if (stmt instanceof __WEBPACK_IMPORTED_MODULE_3__output_output_ast__["ReturnStatement"]) {
- return stmt.value;
- }
- return null;
-}
-//# sourceMappingURL=expression_converter.js.map
-
-/***/ }),
-/* 113 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__compile_metadata__ = __webpack_require__(15);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config__ = __webpack_require__(67);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__facade_lang__ = __webpack_require__(7);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__injectable__ = __webpack_require__(20);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ml_parser_ast__ = __webpack_require__(69);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ml_parser_html_parser__ = __webpack_require__(79);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ml_parser_interpolation_config__ = __webpack_require__(47);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__resource_loader__ = __webpack_require__(215);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__style_url_resolver__ = __webpack_require__(319);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__template_parser_template_preparser__ = __webpack_require__(321);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__url_resolver__ = __webpack_require__(81);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__util__ = __webpack_require__(32);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DirectiveNormalizer", function() { return DirectiveNormalizer; });
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-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 DirectiveNormalizer = (function () {
- /**
- * @param {?} _resourceLoader
- * @param {?} _urlResolver
- * @param {?} _htmlParser
- * @param {?} _config
- */
- function DirectiveNormalizer(_resourceLoader, _urlResolver, _htmlParser, _config) {
- this._resourceLoader = _resourceLoader;
- this._urlResolver = _urlResolver;
- this._htmlParser = _htmlParser;
- this._config = _config;
- this._resourceLoaderCache = new Map();
- }
- /**
- * @return {?}
- */
- DirectiveNormalizer.prototype.clearCache = function () { this._resourceLoaderCache.clear(); };
- /**
- * @param {?} normalizedDirective
- * @return {?}
- */
- DirectiveNormalizer.prototype.clearCacheFor = function (normalizedDirective) {
- var _this = this;
- if (!normalizedDirective.isComponent) {
- return;
- }
- this._resourceLoaderCache.delete(normalizedDirective.template.templateUrl);
- normalizedDirective.template.externalStylesheets.forEach(function (stylesheet) { _this._resourceLoaderCache.delete(stylesheet.moduleUrl); });
- };
- /**
- * @param {?} url
- * @return {?}
- */
- DirectiveNormalizer.prototype._fetch = function (url) {
- var /** @type {?} */ result = this._resourceLoaderCache.get(url);
- if (!result) {
- result = this._resourceLoader.get(url);
- this._resourceLoaderCache.set(url, result);
- }
- return result;
- };
- /**
- * @param {?} prenormData
- * @return {?}
- */
- DirectiveNormalizer.prototype.normalizeTemplate = function (prenormData) {
- var _this = this;
- var /** @type {?} */ normalizedTemplateSync = null;
- var /** @type {?} */ normalizedTemplateAsync;
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__facade_lang__["isPresent"])(prenormData.template)) {
- normalizedTemplateSync = this.normalizeTemplateSync(prenormData);
- normalizedTemplateAsync = Promise.resolve(normalizedTemplateSync);
- }
- else if (prenormData.templateUrl) {
- normalizedTemplateAsync = this.normalizeTemplateAsync(prenormData);
- }
- else {
- throw new __WEBPACK_IMPORTED_MODULE_12__util__["SyntaxError"]("No template specified for component " + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__facade_lang__["stringify"])(prenormData.componentType));
- }
- if (normalizedTemplateSync && normalizedTemplateSync.styleUrls.length === 0) {
- // sync case
- return new __WEBPACK_IMPORTED_MODULE_12__util__["SyncAsyncResult"](normalizedTemplateSync);
- }
- else {
- // async case
- return new __WEBPACK_IMPORTED_MODULE_12__util__["SyncAsyncResult"](null, normalizedTemplateAsync.then(function (normalizedTemplate) { return _this.normalizeExternalStylesheets(normalizedTemplate); }));
- }
- };
- /**
- * @param {?} prenomData
- * @return {?}
- */
- DirectiveNormalizer.prototype.normalizeTemplateSync = function (prenomData) {
- return this.normalizeLoadedTemplate(prenomData, prenomData.template, prenomData.moduleUrl);
- };
- /**
- * @param {?} prenomData
- * @return {?}
- */
- DirectiveNormalizer.prototype.normalizeTemplateAsync = function (prenomData) {
- var _this = this;
- var /** @type {?} */ templateUrl = this._urlResolver.resolve(prenomData.moduleUrl, prenomData.templateUrl);
- return this._fetch(templateUrl)
- .then(function (value) { return _this.normalizeLoadedTemplate(prenomData, value, templateUrl); });
- };
- /**
- * @param {?} prenomData
- * @param {?} template
- * @param {?} templateAbsUrl
- * @return {?}
- */
- DirectiveNormalizer.prototype.normalizeLoadedTemplate = function (prenomData, template, templateAbsUrl) {
- var /** @type {?} */ interpolationConfig = __WEBPACK_IMPORTED_MODULE_7__ml_parser_interpolation_config__["InterpolationConfig"].fromArray(prenomData.interpolation);
- var /** @type {?} */ rootNodesAndErrors = this._htmlParser.parse(template, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__facade_lang__["stringify"])(prenomData.componentType), true, interpolationConfig);
- if (rootNodesAndErrors.errors.length > 0) {
- var /** @type {?} */ errorString = rootNodesAndErrors.errors.join('\n');
- throw new __WEBPACK_IMPORTED_MODULE_12__util__["SyntaxError"]("Template parse errors:\n" + errorString);
- }
- var /** @type {?} */ templateMetadataStyles = this.normalizeStylesheet(new __WEBPACK_IMPORTED_MODULE_1__compile_metadata__["CompileStylesheetMetadata"]({
- styles: prenomData.styles,
- styleUrls: prenomData.styleUrls,
- moduleUrl: prenomData.moduleUrl
- }));
- var /** @type {?} */ visitor = new TemplatePreparseVisitor();
- __WEBPACK_IMPORTED_MODULE_5__ml_parser_ast__["visitAll"](visitor, rootNodesAndErrors.rootNodes);
- var /** @type {?} */ templateStyles = this.normalizeStylesheet(new __WEBPACK_IMPORTED_MODULE_1__compile_metadata__["CompileStylesheetMetadata"]({ styles: visitor.styles, styleUrls: visitor.styleUrls, moduleUrl: templateAbsUrl }));
- var /** @type {?} */ encapsulation = prenomData.encapsulation;
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__facade_lang__["isBlank"])(encapsulation)) {
- encapsulation = this._config.defaultEncapsulation;
- }
- var /** @type {?} */ styles = templateMetadataStyles.styles.concat(templateStyles.styles);
- var /** @type {?} */ styleUrls = templateMetadataStyles.styleUrls.concat(templateStyles.styleUrls);
- if (encapsulation === __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewEncapsulation"].Emulated && styles.length === 0 &&
- styleUrls.length === 0) {
- encapsulation = __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewEncapsulation"].None;
- }
- return new __WEBPACK_IMPORTED_MODULE_1__compile_metadata__["CompileTemplateMetadata"]({
- encapsulation: encapsulation,
- template: template,
- templateUrl: templateAbsUrl, styles: styles, styleUrls: styleUrls,
- ngContentSelectors: visitor.ngContentSelectors,
- animations: prenomData.animations,
- interpolation: prenomData.interpolation,
- });
- };
- /**
- * @param {?} templateMeta
- * @return {?}
- */
- DirectiveNormalizer.prototype.normalizeExternalStylesheets = function (templateMeta) {
- return this._loadMissingExternalStylesheets(templateMeta.styleUrls)
- .then(function (externalStylesheets) { return new __WEBPACK_IMPORTED_MODULE_1__compile_metadata__["CompileTemplateMetadata"]({
- encapsulation: templateMeta.encapsulation,
- template: templateMeta.template,
- templateUrl: templateMeta.templateUrl,
- styles: templateMeta.styles,
- styleUrls: templateMeta.styleUrls,
- externalStylesheets: externalStylesheets,
- ngContentSelectors: templateMeta.ngContentSelectors,
- animations: templateMeta.animations,
- interpolation: templateMeta.interpolation
- }); });
- };
- /**
- * @param {?} styleUrls
- * @param {?=} loadedStylesheets
- * @return {?}
- */
- DirectiveNormalizer.prototype._loadMissingExternalStylesheets = function (styleUrls, loadedStylesheets) {
- var _this = this;
- if (loadedStylesheets === void 0) { loadedStylesheets = new Map(); }
- return Promise
- .all(styleUrls.filter(function (styleUrl) { return !loadedStylesheets.has(styleUrl); })
- .map(function (styleUrl) { return _this._fetch(styleUrl).then(function (loadedStyle) {
- var /** @type {?} */ stylesheet = _this.normalizeStylesheet(new __WEBPACK_IMPORTED_MODULE_1__compile_metadata__["CompileStylesheetMetadata"]({ styles: [loadedStyle], moduleUrl: styleUrl }));
- loadedStylesheets.set(styleUrl, stylesheet);
- return _this._loadMissingExternalStylesheets(stylesheet.styleUrls, loadedStylesheets);
- }); }))
- .then(function (_) { return Array.from(loadedStylesheets.values()); });
- };
- /**
- * @param {?} stylesheet
- * @return {?}
- */
- DirectiveNormalizer.prototype.normalizeStylesheet = function (stylesheet) {
- var _this = this;
- var /** @type {?} */ allStyleUrls = stylesheet.styleUrls.filter(__WEBPACK_IMPORTED_MODULE_9__style_url_resolver__["isStyleUrlResolvable"])
- .map(function (url) { return _this._urlResolver.resolve(stylesheet.moduleUrl, url); });
- var /** @type {?} */ allStyles = stylesheet.styles.map(function (style) {
- var /** @type {?} */ styleWithImports = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__style_url_resolver__["extractStyleUrls"])(_this._urlResolver, stylesheet.moduleUrl, style);
- allStyleUrls.push.apply(allStyleUrls, styleWithImports.styleUrls);
- return styleWithImports.style;
- });
- return new __WEBPACK_IMPORTED_MODULE_1__compile_metadata__["CompileStylesheetMetadata"]({ styles: allStyles, styleUrls: allStyleUrls, moduleUrl: stylesheet.moduleUrl });
- };
- DirectiveNormalizer = __decorate([
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__injectable__["CompilerInjectable"])(),
- __metadata('design:paramtypes', [__WEBPACK_IMPORTED_MODULE_8__resource_loader__["ResourceLoader"], __WEBPACK_IMPORTED_MODULE_11__url_resolver__["UrlResolver"], __WEBPACK_IMPORTED_MODULE_6__ml_parser_html_parser__["HtmlParser"], __WEBPACK_IMPORTED_MODULE_2__config__["CompilerConfig"]])
- ], DirectiveNormalizer);
- return DirectiveNormalizer;
-}());
-function DirectiveNormalizer_tsickle_Closure_declarations() {
- /** @type {?} */
- DirectiveNormalizer.prototype._resourceLoaderCache;
- /** @type {?} */
- DirectiveNormalizer.prototype._resourceLoader;
- /** @type {?} */
- DirectiveNormalizer.prototype._urlResolver;
- /** @type {?} */
- DirectiveNormalizer.prototype._htmlParser;
- /** @type {?} */
- DirectiveNormalizer.prototype._config;
-}
-var TemplatePreparseVisitor = (function () {
- function TemplatePreparseVisitor() {
- this.ngContentSelectors = [];
- this.styles = [];
- this.styleUrls = [];
- this.ngNonBindableStackCount = 0;
- }
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- TemplatePreparseVisitor.prototype.visitElement = function (ast, context) {
- var /** @type {?} */ preparsedElement = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__template_parser_template_preparser__["preparseElement"])(ast);
- switch (preparsedElement.type) {
- case __WEBPACK_IMPORTED_MODULE_10__template_parser_template_preparser__["PreparsedElementType"].NG_CONTENT:
- if (this.ngNonBindableStackCount === 0) {
- this.ngContentSelectors.push(preparsedElement.selectAttr);
- }
- break;
- case __WEBPACK_IMPORTED_MODULE_10__template_parser_template_preparser__["PreparsedElementType"].STYLE:
- var /** @type {?} */ textContent_1 = '';
- ast.children.forEach(function (child) {
- if (child instanceof __WEBPACK_IMPORTED_MODULE_5__ml_parser_ast__["Text"]) {
- textContent_1 += child.value;
- }
- });
- this.styles.push(textContent_1);
- break;
- case __WEBPACK_IMPORTED_MODULE_10__template_parser_template_preparser__["PreparsedElementType"].STYLESHEET:
- this.styleUrls.push(preparsedElement.hrefAttr);
- break;
- default:
- break;
- }
- if (preparsedElement.nonBindable) {
- this.ngNonBindableStackCount++;
- }
- __WEBPACK_IMPORTED_MODULE_5__ml_parser_ast__["visitAll"](this, ast.children);
- if (preparsedElement.nonBindable) {
- this.ngNonBindableStackCount--;
- }
- return null;
- };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- TemplatePreparseVisitor.prototype.visitExpansion = function (ast, context) { __WEBPACK_IMPORTED_MODULE_5__ml_parser_ast__["visitAll"](this, ast.cases); };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- TemplatePreparseVisitor.prototype.visitExpansionCase = function (ast, context) {
- __WEBPACK_IMPORTED_MODULE_5__ml_parser_ast__["visitAll"](this, ast.expression);
- };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- TemplatePreparseVisitor.prototype.visitComment = function (ast, context) { return null; };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- TemplatePreparseVisitor.prototype.visitAttribute = function (ast, context) { return null; };
- /**
- * @param {?} ast
- * @param {?} context
- * @return {?}
- */
- TemplatePreparseVisitor.prototype.visitText = function (ast, context) { return null; };
- return TemplatePreparseVisitor;
-}());
-function TemplatePreparseVisitor_tsickle_Closure_declarations() {
- /** @type {?} */
- TemplatePreparseVisitor.prototype.ngContentSelectors;
- /** @type {?} */
- TemplatePreparseVisitor.prototype.styles;
- /** @type {?} */
- TemplatePreparseVisitor.prototype.styleUrls;
- /** @type {?} */
- TemplatePreparseVisitor.prototype.ngNonBindableStackCount;
-}
-//# sourceMappingURL=directive_normalizer.js.map
-
-/***/ }),
-/* 114 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__facade_collection__ = __webpack_require__(78);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__facade_lang__ = __webpack_require__(7);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__injectable__ = __webpack_require__(20);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__private_import_core__ = __webpack_require__(18);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util__ = __webpack_require__(32);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DirectiveResolver", function() { return DirectiveResolver; });
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-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 DirectiveResolver = (function () {
- /**
- * @param {?=} _reflector
- */
- function DirectiveResolver(_reflector) {
- if (_reflector === void 0) { _reflector = __WEBPACK_IMPORTED_MODULE_4__private_import_core__["reflector"]; }
- this._reflector = _reflector;
- }
- /**
- * @param {?} type
- * @return {?}
- */
- DirectiveResolver.prototype.isDirective = function (type) {
- var /** @type {?} */ typeMetadata = this._reflector.annotations(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["resolveForwardRef"])(type));
- return typeMetadata && typeMetadata.some(isDirectiveMetadata);
- };
- /**
- * Return {\@link Directive} for a given `Type`.
- * @param {?} type
- * @param {?=} throwIfNotFound
- * @return {?}
- */
- DirectiveResolver.prototype.resolve = function (type, throwIfNotFound) {
- if (throwIfNotFound === void 0) { throwIfNotFound = true; }
- var /** @type {?} */ typeMetadata = this._reflector.annotations(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["resolveForwardRef"])(type));
- if (typeMetadata) {
- var /** @type {?} */ metadata = __WEBPACK_IMPORTED_MODULE_1__facade_collection__["ListWrapper"].findLast(typeMetadata, isDirectiveMetadata);
- if (metadata) {
- var /** @type {?} */ propertyMetadata = this._reflector.propMetadata(type);
- return this._mergeWithPropertyMetadata(metadata, propertyMetadata, type);
- }
- }
- if (throwIfNotFound) {
- throw new Error("No Directive annotation found on " + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__facade_lang__["stringify"])(type));
- }
- return null;
- };
- /**
- * @param {?} dm
- * @param {?} propertyMetadata
- * @param {?} directiveType
- * @return {?}
- */
- DirectiveResolver.prototype._mergeWithPropertyMetadata = function (dm, propertyMetadata, directiveType) {
- var /** @type {?} */ inputs = [];
- var /** @type {?} */ outputs = [];
- var /** @type {?} */ host = {};
- var /** @type {?} */ queries = {};
- Object.keys(propertyMetadata).forEach(function (propName) {
- var /** @type {?} */ input = __WEBPACK_IMPORTED_MODULE_1__facade_collection__["ListWrapper"].findLast(propertyMetadata[propName], function (a) { return a instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"]; });
- if (input) {
- if (input.bindingPropertyName) {
- inputs.push(propName + ": " + input.bindingPropertyName);
- }
- else {
- inputs.push(propName);
- }
- }
- var /** @type {?} */ output = __WEBPACK_IMPORTED_MODULE_1__facade_collection__["ListWrapper"].findLast(propertyMetadata[propName], function (a) { return a instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"]; });
- if (output) {
- if (output.bindingPropertyName) {
- outputs.push(propName + ": " + output.bindingPropertyName);
- }
- else {
- outputs.push(propName);
- }
- }
- var /** @type {?} */ hostBindings = propertyMetadata[propName].filter(function (a) { return a && a instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"]; });
- hostBindings.forEach(function (hostBinding) {
- if (hostBinding.hostPropertyName) {
- var /** @type {?} */ startWith = hostBinding.hostPropertyName[0];
- if (startWith === '(') {
- throw new Error("@HostBinding can not bind to events. Use @HostListener instead.");
- }
- else if (startWith === '[') {
- throw new Error("@HostBinding parameter should be a property name, 'class.', or 'attr.'.");
- }
- host[("[" + hostBinding.hostPropertyName + "]")] = propName;
- }
- else {
- host[("[" + propName + "]")] = propName;
- }
- });
- var /** @type {?} */ hostListeners = propertyMetadata[propName].filter(function (a) { return a && a instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"]; });
- hostListeners.forEach(function (hostListener) {
- var /** @type {?} */ args = hostListener.args || [];
- host[("(" + hostListener.eventName + ")")] = propName + "(" + args.join(',') + ")";
- });
- var /** @type {?} */ query = __WEBPACK_IMPORTED_MODULE_1__facade_collection__["ListWrapper"].findLast(propertyMetadata[propName], function (a) { return a instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Query"]; });
- if (query) {
- queries[propName] = query;
- }
- });
- return this._merge(dm, inputs, outputs, host, queries, directiveType);
- };
- /**
- * @param {?} def
- * @return {?}
- */
- DirectiveResolver.prototype._extractPublicName = function (def) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util__["splitAtColon"])(def, [null, def])[1].trim(); };
- /**
- * @param {?} bindings
- * @return {?}
- */
- DirectiveResolver.prototype._dedupeBindings = function (bindings) {
- var /** @type {?} */ names = new Set();
- var /** @type {?} */ reversedResult = [];
- // go last to first to allow later entries to overwrite previous entries
- for (var /** @type {?} */ i = bindings.length - 1; i >= 0; i--) {
- var /** @type {?} */ binding = bindings[i];
- var /** @type {?} */ name_1 = this._extractPublicName(binding);
- if (!names.has(name_1)) {
- names.add(name_1);
- reversedResult.push(binding);
- }
- }
- return reversedResult.reverse();
- };
- /**
- * @param {?} directive
- * @param {?} inputs
- * @param {?} outputs
- * @param {?} host
- * @param {?} queries
- * @param {?} directiveType
- * @return {?}
- */
- DirectiveResolver.prototype._merge = function (directive, inputs, outputs, host, queries, directiveType) {
- var /** @type {?} */ mergedInputs = this._dedupeBindings(directive.inputs ? directive.inputs.concat(inputs) : inputs);
- var /** @type {?} */ mergedOutputs = this._dedupeBindings(directive.outputs ? directive.outputs.concat(outputs) : outputs);
- var /** @type {?} */ mergedHost = directive.host ? __WEBPACK_IMPORTED_MODULE_1__facade_collection__["StringMapWrapper"].merge(directive.host, host) : host;
- var /** @type {?} */ mergedQueries = directive.queries ? __WEBPACK_IMPORTED_MODULE_1__facade_collection__["StringMapWrapper"].merge(directive.queries, queries) : queries;
- if (directive instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"]) {
- return new __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"]({
- selector: directive.selector,
- inputs: mergedInputs,
- outputs: mergedOutputs,
- host: mergedHost,
- exportAs: directive.exportAs,
- moduleId: directive.moduleId,
- queries: mergedQueries,
- changeDetection: directive.changeDetection,
- providers: directive.providers,
- viewProviders: directive.viewProviders,
- entryComponents: directive.entryComponents,
- template: directive.template,
- templateUrl: directive.templateUrl,
- styles: directive.styles,
- styleUrls: directive.styleUrls,
- encapsulation: directive.encapsulation,
- animations: directive.animations,
- interpolation: directive.interpolation
- });
- }
- else {
- return new __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"]({
- selector: directive.selector,
- inputs: mergedInputs,
- outputs: mergedOutputs,
- host: mergedHost,
- exportAs: directive.exportAs,
- queries: mergedQueries,
- providers: directive.providers
- });
- }
- };
- DirectiveResolver = __decorate([
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__injectable__["CompilerInjectable"])(),
- __metadata('design:paramtypes', [__WEBPACK_IMPORTED_MODULE_4__private_import_core__["ReflectorReader"]])
- ], DirectiveResolver);
- return DirectiveResolver;
-}());
-function DirectiveResolver_tsickle_Closure_declarations() {
- /** @type {?} */
- DirectiveResolver.prototype._reflector;
-}
-/**
- * @param {?} type
- * @return {?}
- */
-function isDirectiveMetadata(type) {
- return type instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"];
-}
-//# sourceMappingURL=directive_resolver.js.map
-
-/***/ }),
-/* 115 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__chars__ = __webpack_require__(148);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__facade_lang__ = __webpack_require__(7);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__injectable__ = __webpack_require__(20);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenType", function() { return TokenType; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Lexer", function() { return Lexer; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Token", function() { return Token; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EOF", function() { return EOF; });
-/* harmony export (immutable) */ __webpack_exports__["isIdentifier"] = isIdentifier;
-/* harmony export (immutable) */ __webpack_exports__["isQuote"] = isQuote;
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-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 TokenType = {};
-TokenType.Character = 0;
-TokenType.Identifier = 1;
-TokenType.Keyword = 2;
-TokenType.String = 3;
-TokenType.Operator = 4;
-TokenType.Number = 5;
-TokenType.Error = 6;
-TokenType[TokenType.Character] = "Character";
-TokenType[TokenType.Identifier] = "Identifier";
-TokenType[TokenType.Keyword] = "Keyword";
-TokenType[TokenType.String] = "String";
-TokenType[TokenType.Operator] = "Operator";
-TokenType[TokenType.Number] = "Number";
-TokenType[TokenType.Error] = "Error";
-var /** @type {?} */ KEYWORDS = ['var', 'let', 'null', 'undefined', 'true', 'false', 'if', 'else', 'this'];
-var Lexer = (function () {
- function Lexer() {
- }
- /**
- * @param {?} text
- * @return {?}
- */
- Lexer.prototype.tokenize = function (text) {
- var /** @type {?} */ scanner = new _Scanner(text);
- var /** @type {?} */ tokens = [];
- var /** @type {?} */ token = scanner.scanToken();
- while (token != null) {
- tokens.push(token);
- token = scanner.scanToken();
- }
- return tokens;
- };
- Lexer = __decorate([
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__injectable__["CompilerInjectable"])(),
- __metadata('design:paramtypes', [])
- ], Lexer);
- return Lexer;
-}());
-var Token = (function () {
- /**
- * @param {?} index
- * @param {?} type
- * @param {?} numValue
- * @param {?} strValue
- */
- function Token(index, type, numValue, strValue) {
- this.index = index;
- this.type = type;
- this.numValue = numValue;
- this.strValue = strValue;
- }
- /**
- * @param {?} code
- * @return {?}
- */
- Token.prototype.isCharacter = function (code) {
- return this.type == TokenType.Character && this.numValue == code;
- };
- /**
- * @return {?}
- */
- Token.prototype.isNumber = function () { return this.type == TokenType.Number; };
- /**
- * @return {?}
- */
- Token.prototype.isString = function () { return this.type == TokenType.String; };
- /**
- * @param {?} operater
- * @return {?}
- */
- Token.prototype.isOperator = function (operater) {
- return this.type == TokenType.Operator && this.strValue == operater;
- };
- /**
- * @return {?}
- */
- Token.prototype.isIdentifier = function () { return this.type == TokenType.Identifier; };
- /**
- * @return {?}
- */
- Token.prototype.isKeyword = function () { return this.type == TokenType.Keyword; };
- /**
- * @return {?}
- */
- Token.prototype.isKeywordLet = function () { return this.type == TokenType.Keyword && this.strValue == 'let'; };
- /**
- * @return {?}
- */
- Token.prototype.isKeywordNull = function () { return this.type == TokenType.Keyword && this.strValue == 'null'; };
- /**
- * @return {?}
- */
- Token.prototype.isKeywordUndefined = function () {
- return this.type == TokenType.Keyword && this.strValue == 'undefined';
- };
- /**
- * @return {?}
- */
- Token.prototype.isKeywordTrue = function () { return this.type == TokenType.Keyword && this.strValue == 'true'; };
- /**
- * @return {?}
- */
- Token.prototype.isKeywordFalse = function () { return this.type == TokenType.Keyword && this.strValue == 'false'; };
- /**
- * @return {?}
- */
- Token.prototype.isKeywordThis = function () { return this.type == TokenType.Keyword && this.strValue == 'this'; };
- /**
- * @return {?}
- */
- Token.prototype.isError = function () { return this.type == TokenType.Error; };
- /**
- * @return {?}
- */
- Token.prototype.toNumber = function () { return this.type == TokenType.Number ? this.numValue : -1; };
- /**
- * @return {?}
- */
- Token.prototype.toString = function () {
- switch (this.type) {
- case TokenType.Character:
- case TokenType.Identifier:
- case TokenType.Keyword:
- case TokenType.Operator:
- case TokenType.String:
- case TokenType.Error:
- return this.strValue;
- case TokenType.Number:
- return this.numValue.toString();
- default:
- return null;
- }
- };
- return Token;
-}());
-function Token_tsickle_Closure_declarations() {
- /** @type {?} */
- Token.prototype.index;
- /** @type {?} */
- Token.prototype.type;
- /** @type {?} */
- Token.prototype.numValue;
- /** @type {?} */
- Token.prototype.strValue;
-}
-/**
- * @param {?} index
- * @param {?} code
- * @return {?}
- */
-function newCharacterToken(index, code) {
- return new Token(index, TokenType.Character, code, String.fromCharCode(code));
-}
-/**
- * @param {?} index
- * @param {?} text
- * @return {?}
- */
-function newIdentifierToken(index, text) {
- return new Token(index, TokenType.Identifier, 0, text);
-}
-/**
- * @param {?} index
- * @param {?} text
- * @return {?}
- */
-function newKeywordToken(index, text) {
- return new Token(index, TokenType.Keyword, 0, text);
-}
-/**
- * @param {?} index
- * @param {?} text
- * @return {?}
- */
-function newOperatorToken(index, text) {
- return new Token(index, TokenType.Operator, 0, text);
-}
-/**
- * @param {?} index
- * @param {?} text
- * @return {?}
- */
-function newStringToken(index, text) {
- return new Token(index, TokenType.String, 0, text);
-}
-/**
- * @param {?} index
- * @param {?} n
- * @return {?}
- */
-function newNumberToken(index, n) {
- return new Token(index, TokenType.Number, n, '');
-}
-/**
- * @param {?} index
- * @param {?} message
- * @return {?}
- */
-function newErrorToken(index, message) {
- return new Token(index, TokenType.Error, 0, message);
-}
-var /** @type {?} */ EOF = new Token(-1, TokenType.Character, 0, '');
-var _Scanner = (function () {
- /**
- * @param {?} input
- */
- function _Scanner(input) {
- this.input = input;
- this.peek = 0;
- this.index = -1;
- this.length = input.length;
- this.advance();
- }
- /**
- * @return {?}
- */
- _Scanner.prototype.advance = function () {
- this.peek = ++this.index >= this.length ? __WEBPACK_IMPORTED_MODULE_0__chars__["$EOF"] : this.input.charCodeAt(this.index);
- };
- /**
- * @return {?}
- */
- _Scanner.prototype.scanToken = function () {
- var /** @type {?} */ input = this.input, /** @type {?} */ length = this.length;
- var /** @type {?} */ peek = this.peek, /** @type {?} */ index = this.index;
- // Skip whitespace.
- while (peek <= __WEBPACK_IMPORTED_MODULE_0__chars__["$SPACE"]) {
- if (++index >= length) {
- peek = __WEBPACK_IMPORTED_MODULE_0__chars__["$EOF"];
- break;
- }
- else {
- peek = input.charCodeAt(index);
- }
- }
- this.peek = peek;
- this.index = index;
- if (index >= length) {
- return null;
- }
- // Handle identifiers and numbers.
- if (isIdentifierStart(peek))
- return this.scanIdentifier();
- if (__WEBPACK_IMPORTED_MODULE_0__chars__["isDigit"](peek))
- return this.scanNumber(index);
- var /** @type {?} */ start = index;
- switch (peek) {
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$PERIOD"]:
- this.advance();
- return __WEBPACK_IMPORTED_MODULE_0__chars__["isDigit"](this.peek) ? this.scanNumber(start) :
- newCharacterToken(start, __WEBPACK_IMPORTED_MODULE_0__chars__["$PERIOD"]);
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$LPAREN"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$RPAREN"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$LBRACE"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$RBRACE"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$LBRACKET"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$RBRACKET"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$COMMA"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$COLON"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$SEMICOLON"]:
- return this.scanCharacter(start, peek);
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$SQ"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$DQ"]:
- return this.scanString();
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$HASH"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$PLUS"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$MINUS"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$STAR"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$SLASH"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$PERCENT"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$CARET"]:
- return this.scanOperator(start, String.fromCharCode(peek));
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$QUESTION"]:
- return this.scanComplexOperator(start, '?', __WEBPACK_IMPORTED_MODULE_0__chars__["$PERIOD"], '.');
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$LT"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$GT"]:
- return this.scanComplexOperator(start, String.fromCharCode(peek), __WEBPACK_IMPORTED_MODULE_0__chars__["$EQ"], '=');
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$BANG"]:
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$EQ"]:
- return this.scanComplexOperator(start, String.fromCharCode(peek), __WEBPACK_IMPORTED_MODULE_0__chars__["$EQ"], '=', __WEBPACK_IMPORTED_MODULE_0__chars__["$EQ"], '=');
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$AMPERSAND"]:
- return this.scanComplexOperator(start, '&', __WEBPACK_IMPORTED_MODULE_0__chars__["$AMPERSAND"], '&');
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$BAR"]:
- return this.scanComplexOperator(start, '|', __WEBPACK_IMPORTED_MODULE_0__chars__["$BAR"], '|');
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$NBSP"]:
- while (__WEBPACK_IMPORTED_MODULE_0__chars__["isWhitespace"](this.peek))
- this.advance();
- return this.scanToken();
- }
- this.advance();
- return this.error("Unexpected character [" + String.fromCharCode(peek) + "]", 0);
- };
- /**
- * @param {?} start
- * @param {?} code
- * @return {?}
- */
- _Scanner.prototype.scanCharacter = function (start, code) {
- this.advance();
- return newCharacterToken(start, code);
- };
- /**
- * @param {?} start
- * @param {?} str
- * @return {?}
- */
- _Scanner.prototype.scanOperator = function (start, str) {
- this.advance();
- return newOperatorToken(start, str);
- };
- /**
- * Tokenize a 2/3 char long operator
- *
- * @param {?} start start index in the expression
- * @param {?} one first symbol (always part of the operator)
- * @param {?} twoCode code point for the second symbol
- * @param {?} two second symbol (part of the operator when the second code point matches)
- * @param {?=} threeCode code point for the third symbol
- * @param {?=} three third symbol (part of the operator when provided and matches source expression)
- * @return {?}
- */
- _Scanner.prototype.scanComplexOperator = function (start, one, twoCode, two, threeCode, three) {
- this.advance();
- var /** @type {?} */ str = one;
- if (this.peek == twoCode) {
- this.advance();
- str += two;
- }
- if (threeCode != null && this.peek == threeCode) {
- this.advance();
- str += three;
- }
- return newOperatorToken(start, str);
- };
- /**
- * @return {?}
- */
- _Scanner.prototype.scanIdentifier = function () {
- var /** @type {?} */ start = this.index;
- this.advance();
- while (isIdentifierPart(this.peek))
- this.advance();
- var /** @type {?} */ str = this.input.substring(start, this.index);
- return KEYWORDS.indexOf(str) > -1 ? newKeywordToken(start, str) :
- newIdentifierToken(start, str);
- };
- /**
- * @param {?} start
- * @return {?}
- */
- _Scanner.prototype.scanNumber = function (start) {
- var /** @type {?} */ simple = (this.index === start);
- this.advance(); // Skip initial digit.
- while (true) {
- if (__WEBPACK_IMPORTED_MODULE_0__chars__["isDigit"](this.peek)) {
- }
- else if (this.peek == __WEBPACK_IMPORTED_MODULE_0__chars__["$PERIOD"]) {
- simple = false;
- }
- else if (isExponentStart(this.peek)) {
- this.advance();
- if (isExponentSign(this.peek))
- this.advance();
- if (!__WEBPACK_IMPORTED_MODULE_0__chars__["isDigit"](this.peek))
- return this.error('Invalid exponent', -1);
- simple = false;
- }
- else {
- break;
- }
- this.advance();
- }
- var /** @type {?} */ str = this.input.substring(start, this.index);
- var /** @type {?} */ value = simple ? __WEBPACK_IMPORTED_MODULE_1__facade_lang__["NumberWrapper"].parseIntAutoRadix(str) : parseFloat(str);
- return newNumberToken(start, value);
- };
- /**
- * @return {?}
- */
- _Scanner.prototype.scanString = function () {
- var /** @type {?} */ start = this.index;
- var /** @type {?} */ quote = this.peek;
- this.advance(); // Skip initial quote.
- var /** @type {?} */ buffer = '';
- var /** @type {?} */ marker = this.index;
- var /** @type {?} */ input = this.input;
- while (this.peek != quote) {
- if (this.peek == __WEBPACK_IMPORTED_MODULE_0__chars__["$BACKSLASH"]) {
- buffer += input.substring(marker, this.index);
- this.advance();
- var /** @type {?} */ unescapedCode = void 0;
- if (this.peek == __WEBPACK_IMPORTED_MODULE_0__chars__["$u"]) {
- // 4 character hex code for unicode character.
- var /** @type {?} */ hex = input.substring(this.index + 1, this.index + 5);
- if (/^[0-9a-f]+$/i.test(hex)) {
- unescapedCode = parseInt(hex, 16);
- }
- else {
- return this.error("Invalid unicode escape [\\u" + hex + "]", 0);
- }
- for (var /** @type {?} */ i = 0; i < 5; i++) {
- this.advance();
- }
- }
- else {
- unescapedCode = unescape(this.peek);
- this.advance();
- }
- buffer += String.fromCharCode(unescapedCode);
- marker = this.index;
- }
- else if (this.peek == __WEBPACK_IMPORTED_MODULE_0__chars__["$EOF"]) {
- return this.error('Unterminated quote', 0);
- }
- else {
- this.advance();
- }
- }
- var /** @type {?} */ last = input.substring(marker, this.index);
- this.advance(); // Skip terminating quote.
- return newStringToken(start, buffer + last);
- };
- /**
- * @param {?} message
- * @param {?} offset
- * @return {?}
- */
- _Scanner.prototype.error = function (message, offset) {
- var /** @type {?} */ position = this.index + offset;
- return newErrorToken(position, "Lexer Error: " + message + " at column " + position + " in expression [" + this.input + "]");
- };
- return _Scanner;
-}());
-function _Scanner_tsickle_Closure_declarations() {
- /** @type {?} */
- _Scanner.prototype.length;
- /** @type {?} */
- _Scanner.prototype.peek;
- /** @type {?} */
- _Scanner.prototype.index;
- /** @type {?} */
- _Scanner.prototype.input;
-}
-/**
- * @param {?} code
- * @return {?}
- */
-function isIdentifierStart(code) {
- return (__WEBPACK_IMPORTED_MODULE_0__chars__["$a"] <= code && code <= __WEBPACK_IMPORTED_MODULE_0__chars__["$z"]) || (__WEBPACK_IMPORTED_MODULE_0__chars__["$A"] <= code && code <= __WEBPACK_IMPORTED_MODULE_0__chars__["$Z"]) ||
- (code == __WEBPACK_IMPORTED_MODULE_0__chars__["$_"]) || (code == __WEBPACK_IMPORTED_MODULE_0__chars__["$$"]);
-}
-/**
- * @param {?} input
- * @return {?}
- */
-function isIdentifier(input) {
- if (input.length == 0)
- return false;
- var /** @type {?} */ scanner = new _Scanner(input);
- if (!isIdentifierStart(scanner.peek))
- return false;
- scanner.advance();
- while (scanner.peek !== __WEBPACK_IMPORTED_MODULE_0__chars__["$EOF"]) {
- if (!isIdentifierPart(scanner.peek))
- return false;
- scanner.advance();
- }
- return true;
-}
-/**
- * @param {?} code
- * @return {?}
- */
-function isIdentifierPart(code) {
- return __WEBPACK_IMPORTED_MODULE_0__chars__["isAsciiLetter"](code) || __WEBPACK_IMPORTED_MODULE_0__chars__["isDigit"](code) || (code == __WEBPACK_IMPORTED_MODULE_0__chars__["$_"]) ||
- (code == __WEBPACK_IMPORTED_MODULE_0__chars__["$$"]);
-}
-/**
- * @param {?} code
- * @return {?}
- */
-function isExponentStart(code) {
- return code == __WEBPACK_IMPORTED_MODULE_0__chars__["$e"] || code == __WEBPACK_IMPORTED_MODULE_0__chars__["$E"];
-}
-/**
- * @param {?} code
- * @return {?}
- */
-function isExponentSign(code) {
- return code == __WEBPACK_IMPORTED_MODULE_0__chars__["$MINUS"] || code == __WEBPACK_IMPORTED_MODULE_0__chars__["$PLUS"];
-}
-/**
- * @param {?} code
- * @return {?}
- */
-function isQuote(code) {
- return code === __WEBPACK_IMPORTED_MODULE_0__chars__["$SQ"] || code === __WEBPACK_IMPORTED_MODULE_0__chars__["$DQ"] || code === __WEBPACK_IMPORTED_MODULE_0__chars__["$BT"];
-}
-/**
- * @param {?} code
- * @return {?}
- */
-function unescape(code) {
- switch (code) {
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$n"]:
- return __WEBPACK_IMPORTED_MODULE_0__chars__["$LF"];
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$f"]:
- return __WEBPACK_IMPORTED_MODULE_0__chars__["$FF"];
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$r"]:
- return __WEBPACK_IMPORTED_MODULE_0__chars__["$CR"];
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$t"]:
- return __WEBPACK_IMPORTED_MODULE_0__chars__["$TAB"];
- case __WEBPACK_IMPORTED_MODULE_0__chars__["$v"]:
- return __WEBPACK_IMPORTED_MODULE_0__chars__["$VTAB"];
- default:
- return code;
- }
-}
-//# sourceMappingURL=lexer.js.map
-
-/***/ }),
-/* 116 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__aot_static_symbol__ = __webpack_require__(66);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__assertions__ = __webpack_require__(305);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__compile_metadata__ = __webpack_require__(15);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__directive_normalizer__ = __webpack_require__(113);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__directive_resolver__ = __webpack_require__(114);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__facade_lang__ = __webpack_require__(7);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__identifiers__ = __webpack_require__(19);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__injectable__ = __webpack_require__(20);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__lifecycle_reflector__ = __webpack_require__(483);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__ng_module_resolver__ = __webpack_require__(117);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__pipe_resolver__ = __webpack_require__(118);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__private_import_core__ = __webpack_require__(18);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__schema_element_schema_registry__ = __webpack_require__(70);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__summary_resolver__ = __webpack_require__(216);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__url_resolver__ = __webpack_require__(81);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__util__ = __webpack_require__(32);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ERROR_COLLECTOR_TOKEN", function() { return ERROR_COLLECTOR_TOKEN; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompileMetadataResolver", function() { return CompileMetadataResolver; });
-/* harmony export (immutable) */ __webpack_exports__["componentModuleUrl"] = componentModuleUrl;
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-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 __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 /** @type {?} */ ERROR_COLLECTOR_TOKEN = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["OpaqueToken"]('ErrorCollector');
-var CompileMetadataResolver = (function () {
- /**
- * @param {?} _ngModuleResolver
- * @param {?} _directiveResolver
- * @param {?} _pipeResolver
- * @param {?} _summaryResolver
- * @param {?} _schemaRegistry
- * @param {?} _directiveNormalizer
- * @param {?=} _reflector
- * @param {?=} _errorCollector
- */
- function CompileMetadataResolver(_ngModuleResolver, _directiveResolver, _pipeResolver, _summaryResolver, _schemaRegistry, _directiveNormalizer, _reflector, _errorCollector) {
- if (_reflector === void 0) { _reflector = __WEBPACK_IMPORTED_MODULE_12__private_import_core__["reflector"]; }
- this._ngModuleResolver = _ngModuleResolver;
- this._directiveResolver = _directiveResolver;
- this._pipeResolver = _pipeResolver;
- this._summaryResolver = _summaryResolver;
- this._schemaRegistry = _schemaRegistry;
- this._directiveNormalizer = _directiveNormalizer;
- this._reflector = _reflector;
- this._errorCollector = _errorCollector;
- this._directiveCache = new Map();
- this._summaryCache = new Map();
- this._pipeCache = new Map();
- this._ngModuleCache = new Map();
- this._ngModuleOfTypes = new Map();
- }
- /**
- * @param {?} type
- * @return {?}
- */
- CompileMetadataResolver.prototype.clearCacheFor = function (type) {
- var /** @type {?} */ dirMeta = this._directiveCache.get(type);
- this._directiveCache.delete(type);
- this._summaryCache.delete(type);
- this._pipeCache.delete(type);
- this._ngModuleOfTypes.delete(type);
- // Clear all of the NgModule as they contain transitive information!
- this._ngModuleCache.clear();
- if (dirMeta) {
- this._directiveNormalizer.clearCacheFor(dirMeta);
- }
- };
- /**
- * @return {?}
- */
- CompileMetadataResolver.prototype.clearCache = function () {
- this._directiveCache.clear();
- this._summaryCache.clear();
- this._pipeCache.clear();
- this._ngModuleCache.clear();
- this._ngModuleOfTypes.clear();
- this._directiveNormalizer.clearCache();
- };
- /**
- * @param {?} entry
- * @return {?}
- */
- CompileMetadataResolver.prototype.getAnimationEntryMetadata = function (entry) {
- var _this = this;
- var /** @type {?} */ defs = entry.definitions.map(function (def) { return _this._getAnimationStateMetadata(def); });
- return new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileAnimationEntryMetadata"](entry.name, defs);
- };
- /**
- * @param {?} value
- * @return {?}
- */
- CompileMetadataResolver.prototype._getAnimationStateMetadata = function (value) {
- if (value instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["AnimationStateDeclarationMetadata"]) {
- var /** @type {?} */ styles = this._getAnimationStyleMetadata(value.styles);
- return new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileAnimationStateDeclarationMetadata"](value.stateNameExpr, styles);
- }
- if (value instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["AnimationStateTransitionMetadata"]) {
- return new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileAnimationStateTransitionMetadata"](value.stateChangeExpr, this._getAnimationMetadata(value.steps));
- }
- return null;
- };
- /**
- * @param {?} value
- * @return {?}
- */
- CompileMetadataResolver.prototype._getAnimationStyleMetadata = function (value) {
- return new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileAnimationStyleMetadata"](value.offset, value.styles);
- };
- /**
- * @param {?} value
- * @return {?}
- */
- CompileMetadataResolver.prototype._getAnimationMetadata = function (value) {
- var _this = this;
- if (value instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["AnimationStyleMetadata"]) {
- return this._getAnimationStyleMetadata(value);
- }
- if (value instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["AnimationKeyframesSequenceMetadata"]) {
- return new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileAnimationKeyframesSequenceMetadata"](value.steps.map(function (entry) { return _this._getAnimationStyleMetadata(entry); }));
- }
- if (value instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["AnimationAnimateMetadata"]) {
- var /** @type {?} */ animateData = (this
- ._getAnimationMetadata(value.styles));
- return new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileAnimationAnimateMetadata"](value.timings, animateData);
- }
- if (value instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["AnimationWithStepsMetadata"]) {
- var /** @type {?} */ steps = value.steps.map(function (step) { return _this._getAnimationMetadata(step); });
- if (value instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["AnimationGroupMetadata"]) {
- return new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileAnimationGroupMetadata"](steps);
- }
- return new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileAnimationSequenceMetadata"](steps);
- }
- return null;
- };
- /**
- * @param {?} type
- * @param {?} kind
- * @return {?}
- */
- CompileMetadataResolver.prototype._loadSummary = function (type, kind) {
- var /** @type {?} */ typeSummary = this._summaryCache.get(type);
- if (!typeSummary) {
- var /** @type {?} */ summary = this._summaryResolver.resolveSummary(type);
- typeSummary = summary ? summary.type : null;
- this._summaryCache.set(type, typeSummary);
- }
- return typeSummary && typeSummary.summaryKind === kind ? typeSummary : null;
- };
- /**
- * @param {?} directiveType
- * @param {?} isSync
- * @return {?}
- */
- CompileMetadataResolver.prototype._loadDirectiveMetadata = function (directiveType, isSync) {
- var _this = this;
- if (this._directiveCache.has(directiveType)) {
- return;
- }
- directiveType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["resolveForwardRef"])(directiveType);
- var _a = this.getNonNormalizedDirectiveMetadata(directiveType), annotation = _a.annotation, metadata = _a.metadata;
- var /** @type {?} */ createDirectiveMetadata = function (templateMetadata) {
- var /** @type {?} */ normalizedDirMeta = new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileDirectiveMetadata"]({
- type: metadata.type,
- isComponent: metadata.isComponent,
- selector: metadata.selector,
- exportAs: metadata.exportAs,
- changeDetection: metadata.changeDetection,
- inputs: metadata.inputs,
- outputs: metadata.outputs,
- hostListeners: metadata.hostListeners,
- hostProperties: metadata.hostProperties,
- hostAttributes: metadata.hostAttributes,
- providers: metadata.providers,
- viewProviders: metadata.viewProviders,
- queries: metadata.queries,
- viewQueries: metadata.viewQueries,
- entryComponents: metadata.entryComponents,
- template: templateMetadata
- });
- _this._directiveCache.set(directiveType, normalizedDirMeta);
- _this._summaryCache.set(directiveType, normalizedDirMeta.toSummary());
- return normalizedDirMeta;
- };
- if (metadata.isComponent) {
- var /** @type {?} */ templateMeta = this._directiveNormalizer.normalizeTemplate({
- componentType: directiveType,
- moduleUrl: componentModuleUrl(this._reflector, directiveType, annotation),
- encapsulation: metadata.template.encapsulation,
- template: metadata.template.template,
- templateUrl: metadata.template.templateUrl,
- styles: metadata.template.styles,
- styleUrls: metadata.template.styleUrls,
- animations: metadata.template.animations,
- interpolation: metadata.template.interpolation
- });
- if (templateMeta.syncResult) {
- createDirectiveMetadata(templateMeta.syncResult);
- return null;
- }
- else {
- if (isSync) {
- this._reportError(new __WEBPACK_IMPORTED_MODULE_12__private_import_core__["ComponentStillLoadingError"](directiveType), directiveType);
- return null;
- }
- return templateMeta.asyncResult.then(createDirectiveMetadata);
- }
- }
- else {
- // directive
- createDirectiveMetadata(null);
- return null;
- }
- };
- /**
- * @param {?} directiveType
- * @return {?}
- */
- CompileMetadataResolver.prototype.getNonNormalizedDirectiveMetadata = function (directiveType) {
- var _this = this;
- directiveType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["resolveForwardRef"])(directiveType);
- var /** @type {?} */ dirMeta = this._directiveResolver.resolve(directiveType);
- if (!dirMeta) {
- return null;
- }
- var /** @type {?} */ nonNormalizedTemplateMetadata;
- if (dirMeta instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"]) {
- // component
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__assertions__["assertArrayOfStrings"])('styles', dirMeta.styles);
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__assertions__["assertArrayOfStrings"])('styleUrls', dirMeta.styleUrls);
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__assertions__["assertInterpolationSymbols"])('interpolation', dirMeta.interpolation);
- var /** @type {?} */ animations = dirMeta.animations ?
- dirMeta.animations.map(function (e) { return _this.getAnimationEntryMetadata(e); }) :
- null;
- nonNormalizedTemplateMetadata = new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileTemplateMetadata"]({
- encapsulation: dirMeta.encapsulation,
- template: dirMeta.template,
- templateUrl: dirMeta.templateUrl,
- styles: dirMeta.styles,
- styleUrls: dirMeta.styleUrls,
- animations: animations,
- interpolation: dirMeta.interpolation
- });
- }
- var /** @type {?} */ changeDetectionStrategy = null;
- var /** @type {?} */ viewProviders = [];
- var /** @type {?} */ entryComponentMetadata = [];
- var /** @type {?} */ selector = dirMeta.selector;
- if (dirMeta instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"]) {
- // Component
- changeDetectionStrategy = dirMeta.changeDetection;
- if (dirMeta.viewProviders) {
- viewProviders = this._getProvidersMetadata(dirMeta.viewProviders, entryComponentMetadata, "viewProviders for \"" + stringifyType(directiveType) + "\"", [], directiveType);
- }
- if (dirMeta.entryComponents) {
- entryComponentMetadata = flattenAndDedupeArray(dirMeta.entryComponents)
- .map(function (type) { return _this._getIdentifierMetadata(type); })
- .concat(entryComponentMetadata);
- }
- if (!selector) {
- selector = this._schemaRegistry.getDefaultComponentElementName();
- }
- }
- else {
- // Directive
- if (!selector) {
- this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Directive " + stringifyType(directiveType) + " has no selector, please add it!"), directiveType);
- selector = 'error';
- }
- }
- var /** @type {?} */ providers = [];
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__facade_lang__["isPresent"])(dirMeta.providers)) {
- providers = this._getProvidersMetadata(dirMeta.providers, entryComponentMetadata, "providers for \"" + stringifyType(directiveType) + "\"", [], directiveType);
- }
- var /** @type {?} */ queries = [];
- var /** @type {?} */ viewQueries = [];
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__facade_lang__["isPresent"])(dirMeta.queries)) {
- queries = this._getQueriesMetadata(dirMeta.queries, false, directiveType);
- viewQueries = this._getQueriesMetadata(dirMeta.queries, true, directiveType);
- }
- var /** @type {?} */ metadata = __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileDirectiveMetadata"].create({
- selector: selector,
- exportAs: dirMeta.exportAs,
- isComponent: !!nonNormalizedTemplateMetadata,
- type: this._getTypeMetadata(directiveType),
- template: nonNormalizedTemplateMetadata,
- changeDetection: changeDetectionStrategy,
- inputs: dirMeta.inputs,
- outputs: dirMeta.outputs,
- host: dirMeta.host,
- providers: providers,
- viewProviders: viewProviders,
- queries: queries,
- viewQueries: viewQueries,
- entryComponents: entryComponentMetadata
- });
- return { metadata: metadata, annotation: dirMeta };
- };
- /**
- * Gets the metadata for the given directive.
- * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.
- * @param {?} directiveType
- * @return {?}
- */
- CompileMetadataResolver.prototype.getDirectiveMetadata = function (directiveType) {
- var /** @type {?} */ dirMeta = this._directiveCache.get(directiveType);
- if (!dirMeta) {
- this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Illegal state: getDirectiveMetadata can only be called after loadNgModuleDirectiveAndPipeMetadata for a module that declares it. Directive " + stringifyType(directiveType) + "."), directiveType);
- }
- return dirMeta;
- };
- /**
- * @param {?} dirType
- * @return {?}
- */
- CompileMetadataResolver.prototype.getDirectiveSummary = function (dirType) {
- var /** @type {?} */ dirSummary = (this._loadSummary(dirType, __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileSummaryKind"].Directive));
- if (!dirSummary) {
- this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Illegal state: Could not load the summary for directive " + stringifyType(dirType) + "."), dirType);
- }
- return dirSummary;
- };
- /**
- * @param {?} type
- * @return {?}
- */
- CompileMetadataResolver.prototype.isDirective = function (type) { return this._directiveResolver.isDirective(type); };
- /**
- * @param {?} type
- * @return {?}
- */
- CompileMetadataResolver.prototype.isPipe = function (type) { return this._pipeResolver.isPipe(type); };
- /**
- * @param {?} moduleType
- * @return {?}
- */
- CompileMetadataResolver.prototype.getNgModuleSummary = function (moduleType) {
- var /** @type {?} */ moduleSummary = (this._loadSummary(moduleType, __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileSummaryKind"].NgModule));
- if (!moduleSummary) {
- var /** @type {?} */ moduleMeta = this.getNgModuleMetadata(moduleType, false);
- moduleSummary = moduleMeta ? moduleMeta.toSummary() : null;
- if (moduleSummary) {
- this._summaryCache.set(moduleType, moduleSummary);
- }
- }
- return moduleSummary;
- };
- /**
- * Loads the declared directives and pipes of an NgModule.
- * @param {?} moduleType
- * @param {?} isSync
- * @param {?=} throwIfNotFound
- * @return {?}
- */
- CompileMetadataResolver.prototype.loadNgModuleDirectiveAndPipeMetadata = function (moduleType, isSync, throwIfNotFound) {
- var _this = this;
- if (throwIfNotFound === void 0) { throwIfNotFound = true; }
- var /** @type {?} */ ngModule = this.getNgModuleMetadata(moduleType, throwIfNotFound);
- var /** @type {?} */ loading = [];
- if (ngModule) {
- ngModule.declaredDirectives.forEach(function (id) {
- var /** @type {?} */ promise = _this._loadDirectiveMetadata(id.reference, isSync);
- if (promise) {
- loading.push(promise);
- }
- });
- ngModule.declaredPipes.forEach(function (id) { return _this._loadPipeMetadata(id.reference); });
- }
- return Promise.all(loading);
- };
- /**
- * @param {?} moduleType
- * @param {?=} throwIfNotFound
- * @return {?}
- */
- CompileMetadataResolver.prototype.getNgModuleMetadata = function (moduleType, throwIfNotFound) {
- var _this = this;
- if (throwIfNotFound === void 0) { throwIfNotFound = true; }
- moduleType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["resolveForwardRef"])(moduleType);
- var /** @type {?} */ compileMeta = this._ngModuleCache.get(moduleType);
- if (compileMeta) {
- return compileMeta;
- }
- var /** @type {?} */ meta = this._ngModuleResolver.resolve(moduleType, throwIfNotFound);
- if (!meta) {
- return null;
- }
- var /** @type {?} */ declaredDirectives = [];
- var /** @type {?} */ exportedNonModuleIdentifiers = [];
- var /** @type {?} */ declaredPipes = [];
- var /** @type {?} */ importedModules = [];
- var /** @type {?} */ exportedModules = [];
- var /** @type {?} */ providers = [];
- var /** @type {?} */ entryComponents = [];
- var /** @type {?} */ bootstrapComponents = [];
- var /** @type {?} */ schemas = [];
- if (meta.imports) {
- flattenAndDedupeArray(meta.imports).forEach(function (importedType) {
- var /** @type {?} */ importedModuleType;
- if (isValidType(importedType)) {
- importedModuleType = importedType;
- }
- else if (importedType && importedType.ngModule) {
- var /** @type {?} */ moduleWithProviders = importedType;
- importedModuleType = moduleWithProviders.ngModule;
- if (moduleWithProviders.providers) {
- providers.push.apply(providers, _this._getProvidersMetadata(moduleWithProviders.providers, entryComponents, "provider for the NgModule '" + stringifyType(importedModuleType) + "'", [], importedType));
- }
- }
- if (importedModuleType) {
- var /** @type {?} */ importedModuleSummary = _this.getNgModuleSummary(importedModuleType);
- if (!importedModuleSummary) {
- _this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Unexpected " + _this._getTypeDescriptor(importedType) + " '" + stringifyType(importedType) + "' imported by the module '" + stringifyType(moduleType) + "'"), moduleType);
- return;
- }
- importedModules.push(importedModuleSummary);
- }
- else {
- _this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Unexpected value '" + stringifyType(importedType) + "' imported by the module '" + stringifyType(moduleType) + "'"), moduleType);
- return;
- }
- });
- }
- if (meta.exports) {
- flattenAndDedupeArray(meta.exports).forEach(function (exportedType) {
- if (!isValidType(exportedType)) {
- _this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Unexpected value '" + stringifyType(exportedType) + "' exported by the module '" + stringifyType(moduleType) + "'"), moduleType);
- return;
- }
- var /** @type {?} */ exportedModuleSummary = _this.getNgModuleSummary(exportedType);
- if (exportedModuleSummary) {
- exportedModules.push(exportedModuleSummary);
- }
- else {
- exportedNonModuleIdentifiers.push(_this._getIdentifierMetadata(exportedType));
- }
- });
- }
- // Note: This will be modified later, so we rely on
- // getting a new instance every time!
- var /** @type {?} */ transitiveModule = this._getTransitiveNgModuleMetadata(importedModules, exportedModules);
- if (meta.declarations) {
- flattenAndDedupeArray(meta.declarations).forEach(function (declaredType) {
- if (!isValidType(declaredType)) {
- _this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Unexpected value '" + stringifyType(declaredType) + "' declared by the module '" + stringifyType(moduleType) + "'"), moduleType);
- return;
- }
- var /** @type {?} */ declaredIdentifier = _this._getIdentifierMetadata(declaredType);
- if (_this._directiveResolver.isDirective(declaredType)) {
- transitiveModule.addDirective(declaredIdentifier);
- declaredDirectives.push(declaredIdentifier);
- _this._addTypeToModule(declaredType, moduleType);
- }
- else if (_this._pipeResolver.isPipe(declaredType)) {
- transitiveModule.addPipe(declaredIdentifier);
- transitiveModule.pipes.push(declaredIdentifier);
- declaredPipes.push(declaredIdentifier);
- _this._addTypeToModule(declaredType, moduleType);
- }
- else {
- _this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Unexpected " + _this._getTypeDescriptor(declaredType) + " '" + stringifyType(declaredType) + "' declared by the module '" + stringifyType(moduleType) + "'"), moduleType);
- return;
- }
- });
- }
- var /** @type {?} */ exportedDirectives = [];
- var /** @type {?} */ exportedPipes = [];
- exportedNonModuleIdentifiers.forEach(function (exportedId) {
- if (transitiveModule.directivesSet.has(exportedId.reference)) {
- exportedDirectives.push(exportedId);
- transitiveModule.addExportedDirective(exportedId);
- }
- else if (transitiveModule.pipesSet.has(exportedId.reference)) {
- exportedPipes.push(exportedId);
- transitiveModule.addExportedPipe(exportedId);
- }
- else {
- _this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Can't export " + _this._getTypeDescriptor(exportedId.reference) + " " + stringifyType(exportedId.reference) + " from " + stringifyType(moduleType) + " as it was neither declared nor imported!"), moduleType);
- }
- });
- // The providers of the module have to go last
- // so that they overwrite any other provider we already added.
- if (meta.providers) {
- providers.push.apply(providers, this._getProvidersMetadata(meta.providers, entryComponents, "provider for the NgModule '" + stringifyType(moduleType) + "'", [], moduleType));
- }
- if (meta.entryComponents) {
- entryComponents.push.apply(entryComponents, flattenAndDedupeArray(meta.entryComponents)
- .map(function (type) { return _this._getIdentifierMetadata(type); }));
- }
- if (meta.bootstrap) {
- flattenAndDedupeArray(meta.bootstrap).forEach(function (type) {
- if (!isValidType(type)) {
- _this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Unexpected value '" + stringifyType(type) + "' used in the bootstrap property of module '" + stringifyType(moduleType) + "'"), moduleType);
- return;
- }
- bootstrapComponents.push(_this._getIdentifierMetadata(type));
- });
- }
- entryComponents.push.apply(entryComponents, bootstrapComponents);
- if (meta.schemas) {
- schemas.push.apply(schemas, flattenAndDedupeArray(meta.schemas));
- }
- compileMeta = new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileNgModuleMetadata"]({
- type: this._getTypeMetadata(moduleType),
- providers: providers,
- entryComponents: entryComponents,
- bootstrapComponents: bootstrapComponents,
- schemas: schemas,
- declaredDirectives: declaredDirectives,
- exportedDirectives: exportedDirectives,
- declaredPipes: declaredPipes,
- exportedPipes: exportedPipes,
- importedModules: importedModules,
- exportedModules: exportedModules,
- transitiveModule: transitiveModule,
- id: meta.id,
- });
- entryComponents.forEach(function (id) { return transitiveModule.addEntryComponent(id); });
- providers.forEach(function (provider) { return transitiveModule.addProvider(provider, compileMeta.type); });
- transitiveModule.addModule(compileMeta.type);
- this._ngModuleCache.set(moduleType, compileMeta);
- return compileMeta;
- };
- /**
- * @param {?} type
- * @return {?}
- */
- CompileMetadataResolver.prototype._getTypeDescriptor = function (type) {
- if (this._directiveResolver.isDirective(type)) {
- return 'directive';
- }
- if (this._pipeResolver.isPipe(type)) {
- return 'pipe';
- }
- if (this._ngModuleResolver.isNgModule(type)) {
- return 'module';
- }
- if (((type)).provide) {
- return 'provider';
- }
- return 'value';
- };
- /**
- * @param {?} type
- * @param {?} moduleType
- * @return {?}
- */
- CompileMetadataResolver.prototype._addTypeToModule = function (type, moduleType) {
- var /** @type {?} */ oldModule = this._ngModuleOfTypes.get(type);
- if (oldModule && oldModule !== moduleType) {
- this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"](("Type " + stringifyType(type) + " is part of the declarations of 2 modules: " + stringifyType(oldModule) + " and " + stringifyType(moduleType) + "! ") +
- ("Please consider moving " + stringifyType(type) + " to a higher module that imports " + stringifyType(oldModule) + " and " + stringifyType(moduleType) + ". ") +
- ("You can also create a new NgModule that exports and includes " + stringifyType(type) + " then import that NgModule in " + stringifyType(oldModule) + " and " + stringifyType(moduleType) + ".")), moduleType);
- }
- this._ngModuleOfTypes.set(type, moduleType);
- };
- /**
- * @param {?} importedModules
- * @param {?} exportedModules
- * @return {?}
- */
- CompileMetadataResolver.prototype._getTransitiveNgModuleMetadata = function (importedModules, exportedModules) {
- // collect `providers` / `entryComponents` from all imported and all exported modules
- var /** @type {?} */ result = new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["TransitiveCompileNgModuleMetadata"]();
- var /** @type {?} */ modulesByToken = new Map();
- importedModules.concat(exportedModules).forEach(function (modSummary) {
- modSummary.modules.forEach(function (mod) { return result.addModule(mod); });
- modSummary.entryComponents.forEach(function (comp) { return result.addEntryComponent(comp); });
- var /** @type {?} */ addedTokens = new Set();
- modSummary.providers.forEach(function (entry) {
- var /** @type {?} */ tokenRef = __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["tokenReference"](entry.provider.token);
- var /** @type {?} */ prevModules = modulesByToken.get(tokenRef);
- if (!prevModules) {
- prevModules = new Set();
- modulesByToken.set(tokenRef, prevModules);
- }
- var /** @type {?} */ moduleRef = entry.module.reference;
- // Note: the providers of one module may still contain multiple providers
- // per token (e.g. for multi providers), and we need to preserve these.
- if (addedTokens.has(tokenRef) || !prevModules.has(moduleRef)) {
- prevModules.add(moduleRef);
- addedTokens.add(tokenRef);
- result.addProvider(entry.provider, entry.module);
- }
- });
- });
- exportedModules.forEach(function (modSummary) {
- modSummary.exportedDirectives.forEach(function (id) { return result.addExportedDirective(id); });
- modSummary.exportedPipes.forEach(function (id) { return result.addExportedPipe(id); });
- });
- importedModules.forEach(function (modSummary) {
- modSummary.exportedDirectives.forEach(function (id) { return result.addDirective(id); });
- modSummary.exportedPipes.forEach(function (id) { return result.addPipe(id); });
- });
- return result;
- };
- /**
- * @param {?} type
- * @return {?}
- */
- CompileMetadataResolver.prototype._getIdentifierMetadata = function (type) {
- type = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["resolveForwardRef"])(type);
- return { reference: type };
- };
- /**
- * @param {?} type
- * @return {?}
- */
- CompileMetadataResolver.prototype.isInjectable = function (type) {
- var /** @type {?} */ annotations = this._reflector.annotations(type);
- // Note: We need an exact check here as @Component / @Directive / ... inherit
- // from @CompilerInjectable!
- return annotations.some(function (ann) { return ann.constructor === __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"]; });
- };
- /**
- * @param {?} type
- * @return {?}
- */
- CompileMetadataResolver.prototype.getInjectableSummary = function (type) {
- return { summaryKind: __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileSummaryKind"].Injectable, type: this._getTypeMetadata(type) };
- };
- /**
- * @param {?} type
- * @param {?=} dependencies
- * @return {?}
- */
- CompileMetadataResolver.prototype._getInjectableMetadata = function (type, dependencies) {
- if (dependencies === void 0) { dependencies = null; }
- var /** @type {?} */ typeSummary = this._loadSummary(type, __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileSummaryKind"].Injectable);
- if (typeSummary) {
- return typeSummary.type;
- }
- return this._getTypeMetadata(type, dependencies);
- };
- /**
- * @param {?} type
- * @param {?=} dependencies
- * @return {?}
- */
- CompileMetadataResolver.prototype._getTypeMetadata = function (type, dependencies) {
- if (dependencies === void 0) { dependencies = null; }
- var /** @type {?} */ identifier = this._getIdentifierMetadata(type);
- return {
- reference: identifier.reference,
- diDeps: this._getDependenciesMetadata(identifier.reference, dependencies),
- lifecycleHooks: __WEBPACK_IMPORTED_MODULE_12__private_import_core__["LIFECYCLE_HOOKS_VALUES"].filter(function (hook) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__lifecycle_reflector__["hasLifecycleHook"])(hook, identifier.reference); }),
- };
- };
- /**
- * @param {?} factory
- * @param {?=} dependencies
- * @return {?}
- */
- CompileMetadataResolver.prototype._getFactoryMetadata = function (factory, dependencies) {
- if (dependencies === void 0) { dependencies = null; }
- factory = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["resolveForwardRef"])(factory);
- return { reference: factory, diDeps: this._getDependenciesMetadata(factory, dependencies) };
- };
- /**
- * Gets the metadata for the given pipe.
- * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.
- * @param {?} pipeType
- * @return {?}
- */
- CompileMetadataResolver.prototype.getPipeMetadata = function (pipeType) {
- var /** @type {?} */ pipeMeta = this._pipeCache.get(pipeType);
- if (!pipeMeta) {
- this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Illegal state: getPipeMetadata can only be called after loadNgModuleDirectiveAndPipeMetadata for a module that declares it. Pipe " + stringifyType(pipeType) + "."), pipeType);
- }
- return pipeMeta;
- };
- /**
- * @param {?} pipeType
- * @return {?}
- */
- CompileMetadataResolver.prototype.getPipeSummary = function (pipeType) {
- var /** @type {?} */ pipeSummary = (this._loadSummary(pipeType, __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileSummaryKind"].Pipe));
- if (!pipeSummary) {
- this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Illegal state: Could not load the summary for pipe " + stringifyType(pipeType) + "."), pipeType);
- }
- return pipeSummary;
- };
- /**
- * @param {?} pipeType
- * @return {?}
- */
- CompileMetadataResolver.prototype.getOrLoadPipeMetadata = function (pipeType) {
- var /** @type {?} */ pipeMeta = this._pipeCache.get(pipeType);
- if (!pipeMeta) {
- pipeMeta = this._loadPipeMetadata(pipeType);
- }
- return pipeMeta;
- };
- /**
- * @param {?} pipeType
- * @return {?}
- */
- CompileMetadataResolver.prototype._loadPipeMetadata = function (pipeType) {
- pipeType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["resolveForwardRef"])(pipeType);
- var /** @type {?} */ pipeAnnotation = this._pipeResolver.resolve(pipeType);
- var /** @type {?} */ pipeMeta = new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompilePipeMetadata"]({
- type: this._getTypeMetadata(pipeType),
- name: pipeAnnotation.name,
- pure: pipeAnnotation.pure
- });
- this._pipeCache.set(pipeType, pipeMeta);
- this._summaryCache.set(pipeType, pipeMeta.toSummary());
- return pipeMeta;
- };
- /**
- * @param {?} typeOrFunc
- * @param {?} dependencies
- * @return {?}
- */
- CompileMetadataResolver.prototype._getDependenciesMetadata = function (typeOrFunc, dependencies) {
- var _this = this;
- var /** @type {?} */ hasUnknownDeps = false;
- var /** @type {?} */ params = dependencies || this._reflector.parameters(typeOrFunc) || [];
- var /** @type {?} */ dependenciesMetadata = params.map(function (param) {
- var /** @type {?} */ isAttribute = false;
- var /** @type {?} */ isHost = false;
- var /** @type {?} */ isSelf = false;
- var /** @type {?} */ isSkipSelf = false;
- var /** @type {?} */ isOptional = false;
- var /** @type {?} */ token = null;
- if (Array.isArray(param)) {
- param.forEach(function (paramEntry) {
- if (paramEntry instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Host"]) {
- isHost = true;
- }
- else if (paramEntry instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Self"]) {
- isSelf = true;
- }
- else if (paramEntry instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["SkipSelf"]) {
- isSkipSelf = true;
- }
- else if (paramEntry instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"]) {
- isOptional = true;
- }
- else if (paramEntry instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Attribute"]) {
- isAttribute = true;
- token = paramEntry.attributeName;
- }
- else if (paramEntry instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"]) {
- token = paramEntry.token;
- }
- else if (isValidType(paramEntry) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__facade_lang__["isBlank"])(token)) {
- token = paramEntry;
- }
- });
- }
- else {
- token = param;
- }
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__facade_lang__["isBlank"])(token)) {
- hasUnknownDeps = true;
- return null;
- }
- return {
- isAttribute: isAttribute,
- isHost: isHost,
- isSelf: isSelf,
- isSkipSelf: isSkipSelf,
- isOptional: isOptional,
- token: _this._getTokenMetadata(token)
- };
- });
- if (hasUnknownDeps) {
- var /** @type {?} */ depsTokens = dependenciesMetadata.map(function (dep) { return dep ? stringifyType(dep.token) : '?'; }).join(', ');
- this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Can't resolve all parameters for " + stringifyType(typeOrFunc) + ": (" + depsTokens + ")."), typeOrFunc);
- }
- return dependenciesMetadata;
- };
- /**
- * @param {?} token
- * @return {?}
- */
- CompileMetadataResolver.prototype._getTokenMetadata = function (token) {
- token = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["resolveForwardRef"])(token);
- var /** @type {?} */ compileToken;
- if (typeof token === 'string') {
- compileToken = { value: token };
- }
- else {
- compileToken = { identifier: { reference: token } };
- }
- return compileToken;
- };
- /**
- * @param {?} providers
- * @param {?} targetEntryComponents
- * @param {?=} debugInfo
- * @param {?=} compileProviders
- * @param {?=} type
- * @return {?}
- */
- CompileMetadataResolver.prototype._getProvidersMetadata = function (providers, targetEntryComponents, debugInfo, compileProviders, type) {
- var _this = this;
- if (compileProviders === void 0) { compileProviders = []; }
- providers.forEach(function (provider, providerIdx) {
- if (Array.isArray(provider)) {
- _this._getProvidersMetadata(provider, targetEntryComponents, debugInfo, compileProviders);
- }
- else {
- provider = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["resolveForwardRef"])(provider);
- var /** @type {?} */ providerMeta = void 0;
- if (provider && typeof provider == 'object' && provider.hasOwnProperty('provide')) {
- providerMeta = new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["ProviderMeta"](provider.provide, provider);
- }
- else if (isValidType(provider)) {
- providerMeta = new __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["ProviderMeta"](provider, { useClass: provider });
- }
- else {
- var /** @type {?} */ providersInfo = ((providers.reduce(function (soFar, seenProvider, seenProviderIdx) {
- if (seenProviderIdx < providerIdx) {
- soFar.push("" + stringifyType(seenProvider));
- }
- else if (seenProviderIdx == providerIdx) {
- soFar.push("?" + stringifyType(seenProvider) + "?");
- }
- else if (seenProviderIdx == providerIdx + 1) {
- soFar.push('...');
- }
- return soFar;
- }, [])))
- .join(', ');
- _this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Invalid " + (debugInfo ? debugInfo : 'provider') + " - only instances of Provider and Type are allowed, got: [" + providersInfo + "]"), type);
- }
- if (providerMeta.token === __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__identifiers__["resolveIdentifier"])(__WEBPACK_IMPORTED_MODULE_7__identifiers__["Identifiers"].ANALYZE_FOR_ENTRY_COMPONENTS)) {
- targetEntryComponents.push.apply(targetEntryComponents, _this._getEntryComponentsFromProvider(providerMeta, type));
- }
- else {
- compileProviders.push(_this.getProviderMetadata(providerMeta));
- }
- }
- });
- return compileProviders;
- };
- /**
- * @param {?} provider
- * @param {?=} type
- * @return {?}
- */
- CompileMetadataResolver.prototype._getEntryComponentsFromProvider = function (provider, type) {
- var _this = this;
- var /** @type {?} */ components = [];
- var /** @type {?} */ collectedIdentifiers = [];
- if (provider.useFactory || provider.useExisting || provider.useClass) {
- this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("The ANALYZE_FOR_ENTRY_COMPONENTS token only supports useValue!"), type);
- return [];
- }
- if (!provider.multi) {
- this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("The ANALYZE_FOR_ENTRY_COMPONENTS token only supports 'multi = true'!"), type);
- return [];
- }
- extractIdentifiers(provider.useValue, collectedIdentifiers);
- collectedIdentifiers.forEach(function (identifier) {
- if (_this._directiveResolver.isDirective(identifier.reference) ||
- _this._loadSummary(identifier.reference, __WEBPACK_IMPORTED_MODULE_3__compile_metadata__["CompileSummaryKind"].Directive)) {
- components.push(identifier);
- }
- });
- return components;
- };
- /**
- * @param {?} provider
- * @return {?}
- */
- CompileMetadataResolver.prototype.getProviderMetadata = function (provider) {
- var /** @type {?} */ compileDeps;
- var /** @type {?} */ compileTypeMetadata = null;
- var /** @type {?} */ compileFactoryMetadata = null;
- var /** @type {?} */ token = this._getTokenMetadata(provider.token);
- if (provider.useClass) {
- compileTypeMetadata = this._getInjectableMetadata(provider.useClass, provider.dependencies);
- compileDeps = compileTypeMetadata.diDeps;
- if (provider.token === provider.useClass) {
- // use the compileTypeMetadata as it contains information about lifecycleHooks...
- token = { identifier: compileTypeMetadata };
- }
- }
- else if (provider.useFactory) {
- compileFactoryMetadata = this._getFactoryMetadata(provider.useFactory, provider.dependencies);
- compileDeps = compileFactoryMetadata.diDeps;
- }
- return {
- token: token,
- useClass: compileTypeMetadata,
- useValue: provider.useValue,
- useFactory: compileFactoryMetadata,
- useExisting: provider.useExisting ? this._getTokenMetadata(provider.useExisting) : null,
- deps: compileDeps,
- multi: provider.multi
- };
- };
- /**
- * @param {?} queries
- * @param {?} isViewQuery
- * @param {?} directiveType
- * @return {?}
- */
- CompileMetadataResolver.prototype._getQueriesMetadata = function (queries, isViewQuery, directiveType) {
- var _this = this;
- var /** @type {?} */ res = [];
- Object.keys(queries).forEach(function (propertyName) {
- var /** @type {?} */ query = queries[propertyName];
- if (query.isViewQuery === isViewQuery) {
- res.push(_this._getQueryMetadata(query, propertyName, directiveType));
- }
- });
- return res;
- };
- /**
- * @param {?} selector
- * @return {?}
- */
- CompileMetadataResolver.prototype._queryVarBindings = function (selector) { return selector.split(/\s*,\s*/); };
- /**
- * @param {?} q
- * @param {?} propertyName
- * @param {?} typeOrFunc
- * @return {?}
- */
- CompileMetadataResolver.prototype._getQueryMetadata = function (q, propertyName, typeOrFunc) {
- var _this = this;
- var /** @type {?} */ selectors;
- if (typeof q.selector === 'string') {
- selectors =
- this._queryVarBindings(q.selector).map(function (varName) { return _this._getTokenMetadata(varName); });
- }
- else {
- if (!q.selector) {
- this._reportError(new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"]("Can't construct a query for the property \"" + propertyName + "\" of \"" + stringifyType(typeOrFunc) + "\" since the query selector wasn't defined."), typeOrFunc);
- }
- selectors = [this._getTokenMetadata(q.selector)];
- }
- return {
- selectors: selectors,
- first: q.first,
- descendants: q.descendants, propertyName: propertyName,
- read: q.read ? this._getTokenMetadata(q.read) : null
- };
- };
- /**
- * @param {?} error
- * @param {?=} type
- * @param {?=} otherType
- * @return {?}
- */
- CompileMetadataResolver.prototype._reportError = function (error, type, otherType) {
- if (this._errorCollector) {
- this._errorCollector(error, type);
- if (otherType) {
- this._errorCollector(error, otherType);
- }
- }
- else {
- throw error;
- }
- };
- /** @nocollapse */
- CompileMetadataResolver.ctorParameters = function () { return [
- { type: __WEBPACK_IMPORTED_MODULE_10__ng_module_resolver__["NgModuleResolver"], },
- { type: __WEBPACK_IMPORTED_MODULE_5__directive_resolver__["DirectiveResolver"], },
- { type: __WEBPACK_IMPORTED_MODULE_11__pipe_resolver__["PipeResolver"], },
- { type: __WEBPACK_IMPORTED_MODULE_14__summary_resolver__["SummaryResolver"], },
- { type: __WEBPACK_IMPORTED_MODULE_13__schema_element_schema_registry__["ElementSchemaRegistry"], },
- { type: __WEBPACK_IMPORTED_MODULE_4__directive_normalizer__["DirectiveNormalizer"], },
- { type: __WEBPACK_IMPORTED_MODULE_12__private_import_core__["ReflectorReader"], },
- { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [ERROR_COLLECTOR_TOKEN,] },] },
- ]; };
- CompileMetadataResolver = __decorate([
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__injectable__["CompilerInjectable"])(),
- __metadata('design:paramtypes', [__WEBPACK_IMPORTED_MODULE_10__ng_module_resolver__["NgModuleResolver"], __WEBPACK_IMPORTED_MODULE_5__directive_resolver__["DirectiveResolver"], __WEBPACK_IMPORTED_MODULE_11__pipe_resolver__["PipeResolver"], __WEBPACK_IMPORTED_MODULE_14__summary_resolver__["SummaryResolver"], __WEBPACK_IMPORTED_MODULE_13__schema_element_schema_registry__["ElementSchemaRegistry"], __WEBPACK_IMPORTED_MODULE_4__directive_normalizer__["DirectiveNormalizer"], __WEBPACK_IMPORTED_MODULE_12__private_import_core__["ReflectorReader"], Function])
- ], CompileMetadataResolver);
- return CompileMetadataResolver;
-}());
-function CompileMetadataResolver_tsickle_Closure_declarations() {
- /**
- * @nocollapse
- * @type {?}
- */
- CompileMetadataResolver.ctorParameters;
- /** @type {?} */
- CompileMetadataResolver.prototype._directiveCache;
- /** @type {?} */
- CompileMetadataResolver.prototype._summaryCache;
- /** @type {?} */
- CompileMetadataResolver.prototype._pipeCache;
- /** @type {?} */
- CompileMetadataResolver.prototype._ngModuleCache;
- /** @type {?} */
- CompileMetadataResolver.prototype._ngModuleOfTypes;
- /** @type {?} */
- CompileMetadataResolver.prototype._ngModuleResolver;
- /** @type {?} */
- CompileMetadataResolver.prototype._directiveResolver;
- /** @type {?} */
- CompileMetadataResolver.prototype._pipeResolver;
- /** @type {?} */
- CompileMetadataResolver.prototype._summaryResolver;
- /** @type {?} */
- CompileMetadataResolver.prototype._schemaRegistry;
- /** @type {?} */
- CompileMetadataResolver.prototype._directiveNormalizer;
- /** @type {?} */
- CompileMetadataResolver.prototype._reflector;
- /** @type {?} */
- CompileMetadataResolver.prototype._errorCollector;
-}
-/**
- * @param {?} tree
- * @param {?=} out
- * @return {?}
- */
-function flattenArray(tree, out) {
- if (out === void 0) { out = []; }
- if (tree) {
- for (var /** @type {?} */ i = 0; i < tree.length; i++) {
- var /** @type {?} */ item = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["resolveForwardRef"])(tree[i]);
- if (Array.isArray(item)) {
- flattenArray(item, out);
- }
- else {
- out.push(item);
- }
- }
- }
- return out;
-}
-/**
- * @param {?} array
- * @return {?}
- */
-function dedupeArray(array) {
- if (array) {
- return Array.from(new Set(array));
- }
- return [];
-}
-/**
- * @param {?} tree
- * @return {?}
- */
-function flattenAndDedupeArray(tree) {
- return dedupeArray(flattenArray(tree));
-}
-/**
- * @param {?} value
- * @return {?}
- */
-function isValidType(value) {
- return (value instanceof __WEBPACK_IMPORTED_MODULE_1__aot_static_symbol__["StaticSymbol"]) || (value instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Type"]);
-}
-/**
- * @param {?} reflector
- * @param {?} type
- * @param {?} cmpMetadata
- * @return {?}
- */
-function componentModuleUrl(reflector, type, cmpMetadata) {
- if (type instanceof __WEBPACK_IMPORTED_MODULE_1__aot_static_symbol__["StaticSymbol"]) {
- return type.filePath;
- }
- var /** @type {?} */ moduleId = cmpMetadata.moduleId;
- if (typeof moduleId === 'string') {
- var /** @type {?} */ scheme = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_15__url_resolver__["getUrlScheme"])(moduleId);
- return scheme ? moduleId : "package:" + moduleId + __WEBPACK_IMPORTED_MODULE_16__util__["MODULE_SUFFIX"];
- }
- else if (moduleId !== null && moduleId !== void 0) {
- throw new __WEBPACK_IMPORTED_MODULE_16__util__["SyntaxError"](("moduleId should be a string in \"" + stringifyType(type) + "\". See https://goo.gl/wIDDiL for more information.\n") +
- "If you're using Webpack you should inline the template and the styles, see https://goo.gl/X2J8zc.");
- }
- return reflector.importUri(type);
-}
-/**
- * @param {?} value
- * @param {?} targetIdentifiers
- * @return {?}
- */
-function extractIdentifiers(value, targetIdentifiers) {
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_16__util__["visitValue"])(value, new _CompileValueConverter(), targetIdentifiers);
-}
-var _CompileValueConverter = (function (_super) {
- __extends(_CompileValueConverter, _super);
- function _CompileValueConverter() {
- _super.apply(this, arguments);
- }
- /**
- * @param {?} value
- * @param {?} targetIdentifiers
- * @return {?}
- */
- _CompileValueConverter.prototype.visitOther = function (value, targetIdentifiers) {
- targetIdentifiers.push({ reference: value });
- };
- return _CompileValueConverter;
-}(__WEBPACK_IMPORTED_MODULE_16__util__["ValueTransformer"]));
-/**
- * @param {?} type
- * @return {?}
- */
-function stringifyType(type) {
- if (type instanceof __WEBPACK_IMPORTED_MODULE_1__aot_static_symbol__["StaticSymbol"]) {
- return type.name + " in " + type.filePath;
- }
- else {
- return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__facade_lang__["stringify"])(type);
- }
-}
-//# sourceMappingURL=metadata_resolver.js.map
-
-/***/ }),
-/* 117 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__facade_collection__ = __webpack_require__(78);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__facade_lang__ = __webpack_require__(7);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__injectable__ = __webpack_require__(20);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__private_import_core__ = __webpack_require__(18);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModuleResolver", function() { return NgModuleResolver; });
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-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);
-};
-
-
-
-
-
-/**
- * @param {?} obj
- * @return {?}
- */
-function _isNgModuleMetadata(obj) {
- return obj instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"];
-}
-/**
- * Resolves types to {\@link NgModule}.
- */
-var NgModuleResolver = (function () {
- /**
- * @param {?=} _reflector
- */
- function NgModuleResolver(_reflector) {
- if (_reflector === void 0) { _reflector = __WEBPACK_IMPORTED_MODULE_4__private_import_core__["reflector"]; }
- this._reflector = _reflector;
- }
- /**
- * @param {?} type
- * @return {?}
- */
- NgModuleResolver.prototype.isNgModule = function (type) { return this._reflector.annotations(type).some(_isNgModuleMetadata); };
- /**
- * @param {?} type
- * @param {?=} throwIfNotFound
- * @return {?}
- */
- NgModuleResolver.prototype.resolve = function (type, throwIfNotFound) {
- if (throwIfNotFound === void 0) { throwIfNotFound = true; }
- var /** @type {?} */ ngModuleMeta = __WEBPACK_IMPORTED_MODULE_1__facade_collection__["ListWrapper"].findLast(this._reflector.annotations(type), _isNgModuleMetadata);
- if (ngModuleMeta) {
- return ngModuleMeta;
- }
- else {
- if (throwIfNotFound) {
- throw new Error("No NgModule metadata found for '" + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__facade_lang__["stringify"])(type) + "'.");
- }
- return null;
- }
- };
- NgModuleResolver = __decorate([
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__injectable__["CompilerInjectable"])(),
- __metadata('design:paramtypes', [__WEBPACK_IMPORTED_MODULE_4__private_import_core__["ReflectorReader"]])
- ], NgModuleResolver);
- return NgModuleResolver;
-}());
-function NgModuleResolver_tsickle_Closure_declarations() {
- /** @type {?} */
- NgModuleResolver.prototype._reflector;
-}
-//# sourceMappingURL=ng_module_resolver.js.map
-
-/***/ }),
-/* 118 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__facade_collection__ = __webpack_require__(78);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__facade_lang__ = __webpack_require__(7);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__injectable__ = __webpack_require__(20);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__private_import_core__ = __webpack_require__(18);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PipeResolver", function() { return PipeResolver; });
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-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);
-};
-
-
-
-
-
-/**
- * @param {?} type
- * @return {?}
- */
-function _isPipeMetadata(type) {
- return type instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Pipe"];
-}
-/**
- * Resolve a `Type` for {\@link Pipe}.
- *
- * This interface can be overridden by the application developer to create custom behavior.
- *
- * See {\@link Compiler}
- */
-var PipeResolver = (function () {
- /**
- * @param {?=} _reflector
- */
- function PipeResolver(_reflector) {
- if (_reflector === void 0) { _reflector = __WEBPACK_IMPORTED_MODULE_4__private_import_core__["reflector"]; }
- this._reflector = _reflector;
- }
- /**
- * @param {?} type
- * @return {?}
- */
- PipeResolver.prototype.isPipe = function (type) {
- var /** @type {?} */ typeMetadata = this._reflector.annotations(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["resolveForwardRef"])(type));
- return typeMetadata && typeMetadata.some(_isPipeMetadata);
- };
- /**
- * Return {\@link Pipe} for a given `Type`.
- * @param {?} type
- * @param {?=} throwIfNotFound
- * @return {?}
- */
- PipeResolver.prototype.resolve = function (type, throwIfNotFound) {
- if (throwIfNotFound === void 0) { throwIfNotFound = true; }
- var /** @type {?} */ metas = this._reflector.annotations(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["resolveForwardRef"])(type));
- if (metas) {
- var /** @type {?} */ annotation = __WEBPACK_IMPORTED_MODULE_1__facade_collection__["ListWrapper"].findLast(metas, _isPipeMetadata);
- if (annotation) {
- return annotation;
- }
- }
- if (throwIfNotFound) {
- throw new Error("No Pipe decorator found on " + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__facade_lang__["stringify"])(type));
- }
- return null;
- };
- PipeResolver = __decorate([
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__injectable__["CompilerInjectable"])(),
- __metadata('design:paramtypes', [__WEBPACK_IMPORTED_MODULE_4__private_import_core__["ReflectorReader"]])
- ], PipeResolver);
- return PipeResolver;
-}());
-function PipeResolver_tsickle_Closure_declarations() {
- /** @type {?} */
- PipeResolver.prototype._reflector;
-}
-//# sourceMappingURL=pipe_resolver.js.map
-
-/***/ }),
-/* 119 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__compile_metadata__ = __webpack_require__(15);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__expression_parser_parser__ = __webpack_require__(97);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__facade_lang__ = __webpack_require__(7);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__i18n_i18n_html_parser__ = __webpack_require__(150);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__identifiers__ = __webpack_require__(19);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__injectable__ = __webpack_require__(20);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ml_parser_ast__ = __webpack_require__(69);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ml_parser_html_parser__ = __webpack_require__(79);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__ml_parser_icu_ast_expander__ = __webpack_require__(484);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__ml_parser_interpolation_config__ = __webpack_require__(47);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__ml_parser_tags__ = __webpack_require__(80);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__parse_util__ = __webpack_require__(39);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__private_import_core__ = __webpack_require__(18);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__provider_analyzer__ = __webpack_require__(318);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__schema_element_schema_registry__ = __webpack_require__(70);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__selector__ = __webpack_require__(155);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__style_url_resolver__ = __webpack_require__(319);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__util__ = __webpack_require__(32);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__binding_parser__ = __webpack_require__(320);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__template_ast__ = __webpack_require__(48);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__template_preparser__ = __webpack_require__(321);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TEMPLATE_TRANSFORMS", function() { return TEMPLATE_TRANSFORMS; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateParseError", function() { return TemplateParseError; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateParseResult", function() { return TemplateParseResult; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateParser", function() { return TemplateParser; });
-/* harmony export (immutable) */ __webpack_exports__["splitClasses"] = splitClasses;
-/* harmony export (immutable) */ __webpack_exports__["createElementCssSelector"] = createElementCssSelector;
-/* harmony export (immutable) */ __webpack_exports__["removeSummaryDuplicates"] = removeSummaryDuplicates;
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-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 __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);
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// Group 1 = "bind-"
-// Group 2 = "let-"
-// Group 3 = "ref-/#"
-// Group 4 = "on-"
-// Group 5 = "bindon-"
-// Group 6 = "@"
-// Group 7 = the identifier after "bind-", "let-", "ref-/#", "on-", "bindon-" or "@"
-// Group 8 = identifier inside [()]
-// Group 9 = identifier inside []
-// Group 10 = identifier inside ()
-var /** @type {?} */ BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/;
-var /** @type {?} */ KW_BIND_IDX = 1;
-var /** @type {?} */ KW_LET_IDX = 2;
-var /** @type {?} */ KW_REF_IDX = 3;
-var /** @type {?} */ KW_ON_IDX = 4;
-var /** @type {?} */ KW_BINDON_IDX = 5;
-var /** @type {?} */ KW_AT_IDX = 6;
-var /** @type {?} */ IDENT_KW_IDX = 7;
-var /** @type {?} */ IDENT_BANANA_BOX_IDX = 8;
-var /** @type {?} */ IDENT_PROPERTY_IDX = 9;
-var /** @type {?} */ IDENT_EVENT_IDX = 10;
-var /** @type {?} */ TEMPLATE_ELEMENT = 'template';
-var /** @type {?} */ TEMPLATE_ATTR = 'template';
-var /** @type {?} */ TEMPLATE_ATTR_PREFIX = '*';
-var /** @type {?} */ CLASS_ATTR = 'class';
-var /** @type {?} */ TEXT_CSS_SELECTOR = __WEBPACK_IMPORTED_MODULE_16__selector__["CssSelector"].parse('*')[0];
-/**
- * Provides an array of {@link TemplateAstVisitor}s which will be used to transform
- * parsed templates before compilation is invoked, allowing custom expression syntax
- * and other advanced transformations.
- *
- * This is currently an internal-only feature and not meant for general use.
- */
-var /** @type {?} */ TEMPLATE_TRANSFORMS = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["OpaqueToken"]('TemplateTransforms');
-var TemplateParseError = (function (_super) {
- __extends(TemplateParseError, _super);
- /**
- * @param {?} message
- * @param {?} span
- * @param {?} level
- */
- function TemplateParseError(message, span, level) {
- _super.call(this, span, message, level);
- }
- return TemplateParseError;
-}(__WEBPACK_IMPORTED_MODULE_12__parse_util__["ParseError"]));
-var TemplateParseResult = (function () {
- /**
- * @param {?=} templateAst
- * @param {?=} errors
- */
- function TemplateParseResult(templateAst, errors) {
- this.templateAst = templateAst;
- this.errors = errors;
- }
- return TemplateParseResult;
-}());
-function TemplateParseResult_tsickle_Closure_declarations() {
- /** @type {?} */
- TemplateParseResult.prototype.templateAst;
- /** @type {?} */
- TemplateParseResult.prototype.errors;
-}
-var TemplateParser = (function () {
- /**
- * @param {?} _exprParser
- * @param {?} _schemaRegistry
- * @param {?} _htmlParser
- * @param {?} _console
- * @param {?} transforms
- */
- function TemplateParser(_exprParser, _schemaRegistry, _htmlParser, _console, transforms) {
- this._exprParser = _exprParser;
- this._schemaRegistry = _schemaRegistry;
- this._htmlParser = _htmlParser;
- this._console = _console;
- this.transforms = transforms;
- }
- /**
- * @param {?} component
- * @param {?} template
- * @param {?} directives
- * @param {?} pipes
- * @param {?} schemas
- * @param {?} templateUrl
- * @return {?}
- */
- TemplateParser.prototype.parse = function (component, template, directives, pipes, schemas, templateUrl) {
- var /** @type {?} */ result = this.tryParse(component, template, directives, pipes, schemas, templateUrl);
- var /** @type {?} */ warnings = result.errors.filter(function (error) { return error.level === __WEBPACK_IMPORTED_MODULE_12__parse_util__["ParseErrorLevel"].WARNING; });
- var /** @type {?} */ errors = result.errors.filter(function (error) { return error.level === __WEBPACK_IMPORTED_MODULE_12__parse_util__["ParseErrorLevel"].FATAL; });
- if (warnings.length > 0) {
- this._console.warn("Template parse warnings:\n" + warnings.join('\n'));
- }
- if (errors.length > 0) {
- var /** @type {?} */ errorString = errors.join('\n');
- throw new __WEBPACK_IMPORTED_MODULE_18__util__["SyntaxError"]("Template parse errors:\n" + errorString);
- }
- return result.templateAst;
- };
- /**
- * @param {?} component
- * @param {?} template
- * @param {?} directives
- * @param {?} pipes
- * @param {?} schemas
- * @param {?} templateUrl
- * @return {?}
- */
- TemplateParser.prototype.tryParse = function (component, template, directives, pipes, schemas, templateUrl) {
- return this.tryParseHtml(this.expandHtml(this._htmlParser.parse(template, templateUrl, true, this.getInterpolationConfig(component))), component, template, directives, pipes, schemas, templateUrl);
- };
- /**
- * @param {?} htmlAstWithErrors
- * @param {?} component
- * @param {?} template
- * @param {?} directives
- * @param {?} pipes
- * @param {?} schemas
- * @param {?} templateUrl
- * @return {?}
- */
- TemplateParser.prototype.tryParseHtml = function (htmlAstWithErrors, component, template, directives, pipes, schemas, templateUrl) {
- var /** @type {?} */ result;
- var /** @type {?} */ errors = htmlAstWithErrors.errors;
- if (htmlAstWithErrors.rootNodes.length > 0) {
- var /** @type {?} */ uniqDirectives = removeSummaryDuplicates(directives);
- var /** @type {?} */ uniqPipes = removeSummaryDuplicates(pipes);
- var /** @type {?} */ providerViewContext = new __WEBPACK_IMPORTED_MODULE_14__provider_analyzer__["ProviderViewContext"](component, htmlAstWithErrors.rootNodes[0].sourceSpan);
- var /** @type {?} */ interpolationConfig = void 0;
- if (component.template && component.template.interpolation) {
- interpolationConfig = {
- start: component.template.interpolation[0],
- end: component.template.interpolation[1]
- };
- }
- var /** @type {?} */ bindingParser = new __WEBPACK_IMPORTED_MODULE_19__binding_parser__["BindingParser"](this._exprParser, interpolationConfig, this._schemaRegistry, uniqPipes, errors);
- var /** @type {?} */ parseVisitor = new TemplateParseVisitor(providerViewContext, uniqDirectives, bindingParser, this._schemaRegistry, schemas, errors);
- result = __WEBPACK_IMPORTED_MODULE_7__ml_parser_ast__["visitAll"](parseVisitor, htmlAstWithErrors.rootNodes, EMPTY_ELEMENT_CONTEXT);
- errors.push.apply(errors, providerViewContext.errors);
- }
- else {
- result = [];
- }
- this._assertNoReferenceDuplicationOnTemplate(result, errors);
- if (errors.length > 0) {
- return new TemplateParseResult(result, errors);
- }
- if (this.transforms) {
- this.transforms.forEach(function (transform) { result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_20__template_ast__["templateVisitAll"])(transform, result); });
- }
- return new TemplateParseResult(result, errors);
- };
- /**
- * @param {?} htmlAstWithErrors
- * @param {?=} forced
- * @return {?}
- */
- TemplateParser.prototype.expandHtml = function (htmlAstWithErrors, forced) {
- if (forced === void 0) { forced = false; }
- var /** @type {?} */ errors = htmlAstWithErrors.errors;
- if (errors.length == 0 || forced) {
- // Transform ICU messages to angular directives
- var /** @type {?} */ expandedHtmlAst = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__ml_parser_icu_ast_expander__["expandNodes"])(htmlAstWithErrors.rootNodes);
- errors.push.apply(errors, expandedHtmlAst.errors);
- htmlAstWithErrors = new __WEBPACK_IMPORTED_MODULE_8__ml_parser_html_parser__["ParseTreeResult"](expandedHtmlAst.nodes, errors);
- }
- return htmlAstWithErrors;
- };
- /**
- * @param {?} component
- * @return {?}
- */
- TemplateParser.prototype.getInterpolationConfig = function (component) {
- if (component.template) {
- return __WEBPACK_IMPORTED_MODULE_10__ml_parser_interpolation_config__["InterpolationConfig"].fromArray(component.template.interpolation);
- }
- };
- /**
- * \@internal
- * @param {?} result
- * @param {?} errors
- * @return {?}
- */
- TemplateParser.prototype._assertNoReferenceDuplicationOnTemplate = function (result, errors) {
- var /** @type {?} */ existingReferences = [];
- result.filter(function (element) { return !!((element)).references; })
- .forEach(function (element) { return ((element)).references.forEach(function (reference) {
- var /** @type {?} */ name = reference.name;
- if (existingReferences.indexOf(name) < 0) {
- existingReferences.push(name);
- }
- else {
- var /** @type {?} */ error = new TemplateParseError("Reference \"#" + name + "\" is defined several times", reference.sourceSpan, __WEBPACK_IMPORTED_MODULE_12__parse_util__["ParseErrorLevel"].FATAL);
- errors.push(error);
- }
- }); });
- };
- /** @nocollapse */
- TemplateParser.ctorParameters = function () { return [
- { type: __WEBPACK_IMPORTED_MODULE_2__expression_parser_parser__["Parser"], },
- { type: __WEBPACK_IMPORTED_MODULE_15__schema_element_schema_registry__["ElementSchemaRegistry"], },
- { type: __WEBPACK_IMPORTED_MODULE_4__i18n_i18n_html_parser__["I18NHtmlParser"], },
- { type: __WEBPACK_IMPORTED_MODULE_13__private_import_core__["Console"], },
- { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [TEMPLATE_TRANSFORMS,] },] },
- ]; };
- TemplateParser = __decorate([
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__injectable__["CompilerInjectable"])(),
- __metadata('design:paramtypes', [__WEBPACK_IMPORTED_MODULE_2__expression_parser_parser__["Parser"], __WEBPACK_IMPORTED_MODULE_15__schema_element_schema_registry__["ElementSchemaRegistry"], __WEBPACK_IMPORTED_MODULE_4__i18n_i18n_html_parser__["I18NHtmlParser"], __WEBPACK_IMPORTED_MODULE_13__private_import_core__["Console"], Array])
- ], TemplateParser);
- return TemplateParser;
-}());
-function TemplateParser_tsickle_Closure_declarations() {
- /**
- * @nocollapse
- * @type {?}
- */
- TemplateParser.ctorParameters;
- /** @type {?} */
- TemplateParser.prototype._exprParser;
- /** @type {?} */
- TemplateParser.prototype._schemaRegistry;
- /** @type {?} */
- TemplateParser.prototype._htmlParser;
- /** @type {?} */
- TemplateParser.prototype._console;
- /** @type {?} */
- TemplateParser.prototype.transforms;
-}
-var TemplateParseVisitor = (function () {
- /**
- * @param {?} providerViewContext
- * @param {?} directives
- * @param {?} _bindingParser
- * @param {?} _schemaRegistry
- * @param {?} _schemas
- * @param {?} _targetErrors
- */
- function TemplateParseVisitor(providerViewContext, directives, _bindingParser, _schemaRegistry, _schemas, _targetErrors) {
- var _this = this;
- this.providerViewContext = providerViewContext;
- this._bindingParser = _bindingParser;
- this._schemaRegistry = _schemaRegistry;
- this._schemas = _schemas;
- this._targetErrors = _targetErrors;
- this.selectorMatcher = new __WEBPACK_IMPORTED_MODULE_16__selector__["SelectorMatcher"]();
- this.directivesIndex = new Map();
- this.ngContentCount = 0;
- directives.forEach(function (directive, index) {
- var selector = __WEBPACK_IMPORTED_MODULE_16__selector__["CssSelector"].parse(directive.selector);
- _this.selectorMatcher.addSelectables(selector, directive);
- _this.directivesIndex.set(directive, index);
- });
- }
- /**
- * @param {?} expansion
- * @param {?} context
- * @return {?}
- */
- TemplateParseVisitor.prototype.visitExpansion = function (expansion, context) { return null; };
- /**
- * @param {?} expansionCase
- * @param {?} context
- * @return {?}
- */
- TemplateParseVisitor.prototype.visitExpansionCase = function (expansionCase, context) { return null; };
- /**
- * @param {?} text
- * @param {?} parent
- * @return {?}
- */
- TemplateParseVisitor.prototype.visitText = function (text, parent) {
- var /** @type {?} */ ngContentIndex = parent.findNgContentIndex(TEXT_CSS_SELECTOR);
- var /** @type {?} */ expr = this._bindingParser.parseInterpolation(text.value, text.sourceSpan);
- if (expr) {
- return new __WEBPACK_IMPORTED_MODULE_20__template_ast__["BoundTextAst"](expr, ngContentIndex, text.sourceSpan);
- }
- else {
- return new __WEBPACK_IMPORTED_MODULE_20__template_ast__["TextAst"](text.value, ngContentIndex, text.sourceSpan);
- }
- };
- /**
- * @param {?} attribute
- * @param {?} context
- * @return {?}
- */
- TemplateParseVisitor.prototype.visitAttribute = function (attribute, context) {
- return new __WEBPACK_IMPORTED_MODULE_20__template_ast__["AttrAst"](attribute.name, attribute.value, attribute.sourceSpan);
- };
- /**
- * @param {?} comment
- * @param {?} context
- * @return {?}
- */
- TemplateParseVisitor.prototype.visitComment = function (comment, context) { return null; };
- /**
- * @param {?} element
- * @param {?} parent
- * @return {?}
- */
- TemplateParseVisitor.prototype.visitElement = function (element, parent) {
- var _this = this;
- var /** @type {?} */ nodeName = element.name;
- var /** @type {?} */ preparsedElement = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__template_preparser__["preparseElement"])(element);
- if (preparsedElement.type === __WEBPACK_IMPORTED_MODULE_21__template_preparser__["PreparsedElementType"].SCRIPT ||
- preparsedElement.type === __WEBPACK_IMPORTED_MODULE_21__template_preparser__["PreparsedElementType"].STYLE) {
- // Skipping
-<% } %>
-
-
-