element instead (\" + comment.sourceSpan.start + details + \")\");\n }\n this._inI18nBlock = true;\n this._blockStartDepth = this._depth;\n this._blockChildren = [];\n this._blockMeaningAndDesc = /** @type {?} */ ((comment.value)).replace(_I18N_COMMENT_PREFIX_REGEXP, '').trim();\n this._openTranslatableSection(comment);\n }\n }\n else {\n if (isClosing) {\n if (this._depth == this._blockStartDepth) {\n this._closeTranslatableSection(comment, this._blockChildren);\n this._inI18nBlock = false;\n var /** @type {?} */ message = /** @type {?} */ ((this._addMessage(this._blockChildren, this._blockMeaningAndDesc)));\n // merge attributes in sections\n var /** @type {?} */ nodes = this._translateMessage(comment, message);\n return visitAll(this, nodes);\n }\n else {\n this._reportError(comment, 'I18N blocks should not cross element boundaries');\n return;\n }\n }\n }\n }\n };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n _Visitor.prototype.visitText = /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n function (text, context) {\n if (this._isInTranslatableSection) {\n this._mayBeAddBlockChildren(text);\n }\n return text;\n };\n /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n _Visitor.prototype.visitElement = /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n function (el, context) {\n var _this = this;\n this._mayBeAddBlockChildren(el);\n this._depth++;\n var /** @type {?} */ wasInI18nNode = this._inI18nNode;\n var /** @type {?} */ wasInImplicitNode = this._inImplicitNode;\n var /** @type {?} */ childNodes = [];\n var /** @type {?} */ translatedChildNodes = /** @type {?} */ ((undefined));\n // Extract:\n // - top level nodes with the (implicit) \"i18n\" attribute if not already in a section\n // - ICU messages\n var /** @type {?} */ i18nAttr = _getI18nAttr(el);\n var /** @type {?} */ i18nMeta = i18nAttr ? i18nAttr.value : '';\n var /** @type {?} */ isImplicit = this._implicitTags.some(function (tag) { return el.name === tag; }) && !this._inIcu &&\n !this._isInTranslatableSection;\n var /** @type {?} */ isTopLevelImplicit = !wasInImplicitNode && isImplicit;\n this._inImplicitNode = wasInImplicitNode || isImplicit;\n if (!this._isInTranslatableSection && !this._inIcu) {\n if (i18nAttr || isTopLevelImplicit) {\n this._inI18nNode = true;\n var /** @type {?} */ message = /** @type {?} */ ((this._addMessage(el.children, i18nMeta)));\n translatedChildNodes = this._translateMessage(el, message);\n }\n if (this._mode == _VisitorMode.Extract) {\n var /** @type {?} */ isTranslatable = i18nAttr || isTopLevelImplicit;\n if (isTranslatable)\n this._openTranslatableSection(el);\n visitAll(this, el.children);\n if (isTranslatable)\n this._closeTranslatableSection(el, el.children);\n }\n }\n else {\n if (i18nAttr || isTopLevelImplicit) {\n this._reportError(el, 'Could not mark an element as translatable inside a translatable section');\n }\n if (this._mode == _VisitorMode.Extract) {\n // Descend into child nodes for extraction\n visitAll(this, el.children);\n }\n }\n if (this._mode === _VisitorMode.Merge) {\n var /** @type {?} */ visitNodes = translatedChildNodes || el.children;\n visitNodes.forEach(function (child) {\n var /** @type {?} */ visited = child.visit(_this, context);\n if (visited && !_this._isInTranslatableSection) {\n // Do not add the children from translatable sections (= i18n blocks here)\n // They will be added later in this loop when the block closes (i.e. on ``)\n childNodes = childNodes.concat(visited);\n }\n });\n }\n this._visitAttributesOf(el);\n this._depth--;\n this._inI18nNode = wasInI18nNode;\n this._inImplicitNode = wasInImplicitNode;\n if (this._mode === _VisitorMode.Merge) {\n var /** @type {?} */ translatedAttrs = this._translateAttributes(el);\n return new Element(el.name, translatedAttrs, childNodes, el.sourceSpan, el.startSourceSpan, el.endSourceSpan);\n }\n return null;\n };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n _Visitor.prototype.visitAttribute = /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n function (attribute, context) {\n throw new Error('unreachable code');\n };\n /**\n * @param {?} mode\n * @param {?} interpolationConfig\n * @return {?}\n */\n _Visitor.prototype._init = /**\n * @param {?} mode\n * @param {?} interpolationConfig\n * @return {?}\n */\n function (mode, interpolationConfig) {\n this._mode = mode;\n this._inI18nBlock = false;\n this._inI18nNode = false;\n this._depth = 0;\n this._inIcu = false;\n this._msgCountAtSectionStart = undefined;\n this._errors = [];\n this._messages = [];\n this._inImplicitNode = false;\n this._createI18nMessage = createI18nMessageFactory(interpolationConfig);\n };\n /**\n * @param {?} el\n * @return {?}\n */\n _Visitor.prototype._visitAttributesOf = /**\n * @param {?} el\n * @return {?}\n */\n function (el) {\n var _this = this;\n var /** @type {?} */ explicitAttrNameToValue = {};\n var /** @type {?} */ implicitAttrNames = this._implicitAttrs[el.name] || [];\n el.attrs.filter(function (attr) { return attr.name.startsWith(_I18N_ATTR_PREFIX); })\n .forEach(function (attr) {\n return explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n attr.value;\n });\n el.attrs.forEach(function (attr) {\n if (attr.name in explicitAttrNameToValue) {\n _this._addMessage([attr], explicitAttrNameToValue[attr.name]);\n }\n else if (implicitAttrNames.some(function (name) { return attr.name === name; })) {\n _this._addMessage([attr]);\n }\n });\n };\n /**\n * @param {?} ast\n * @param {?=} msgMeta\n * @return {?}\n */\n _Visitor.prototype._addMessage = /**\n * @param {?} ast\n * @param {?=} msgMeta\n * @return {?}\n */\n function (ast, msgMeta) {\n if (ast.length == 0 ||\n ast.length == 1 && ast[0] instanceof Attribute$1 && !(/** @type {?} */ (ast[0])).value) {\n // Do not create empty messages\n return null;\n }\n var _a = _parseMessageMeta(msgMeta), meaning = _a.meaning, description = _a.description, id = _a.id;\n var /** @type {?} */ message = this._createI18nMessage(ast, meaning, description, id);\n this._messages.push(message);\n return message;\n };\n /**\n * @param {?} el\n * @param {?} message\n * @return {?}\n */\n _Visitor.prototype._translateMessage = /**\n * @param {?} el\n * @param {?} message\n * @return {?}\n */\n function (el, message) {\n if (message && this._mode === _VisitorMode.Merge) {\n var /** @type {?} */ nodes = this._translations.get(message);\n if (nodes) {\n return nodes;\n }\n this._reportError(el, \"Translation unavailable for message id=\\\"\" + this._translations.digest(message) + \"\\\"\");\n }\n return [];\n };\n /**\n * @param {?} el\n * @return {?}\n */\n _Visitor.prototype._translateAttributes = /**\n * @param {?} el\n * @return {?}\n */\n function (el) {\n var _this = this;\n var /** @type {?} */ attributes = el.attrs;\n var /** @type {?} */ i18nParsedMessageMeta = {};\n attributes.forEach(function (attr) {\n if (attr.name.startsWith(_I18N_ATTR_PREFIX)) {\n i18nParsedMessageMeta[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n _parseMessageMeta(attr.value);\n }\n });\n var /** @type {?} */ translatedAttributes = [];\n attributes.forEach(function (attr) {\n if (attr.name === _I18N_ATTR || attr.name.startsWith(_I18N_ATTR_PREFIX)) {\n // strip i18n specific attributes\n return;\n }\n if (attr.value && attr.value != '' && i18nParsedMessageMeta.hasOwnProperty(attr.name)) {\n var _a = i18nParsedMessageMeta[attr.name], meaning = _a.meaning, description = _a.description, id = _a.id;\n var /** @type {?} */ message = _this._createI18nMessage([attr], meaning, description, id);\n var /** @type {?} */ nodes = _this._translations.get(message);\n if (nodes) {\n if (nodes.length == 0) {\n translatedAttributes.push(new Attribute$1(attr.name, '', attr.sourceSpan));\n }\n else if (nodes[0] instanceof Text) {\n var /** @type {?} */ value = (/** @type {?} */ (nodes[0])).value;\n translatedAttributes.push(new Attribute$1(attr.name, value, attr.sourceSpan));\n }\n else {\n _this._reportError(el, \"Unexpected translation for attribute \\\"\" + attr.name + \"\\\" (id=\\\"\" + (id || _this._translations.digest(message)) + \"\\\")\");\n }\n }\n else {\n _this._reportError(el, \"Translation unavailable for attribute \\\"\" + attr.name + \"\\\" (id=\\\"\" + (id || _this._translations.digest(message)) + \"\\\")\");\n }\n }\n else {\n translatedAttributes.push(attr);\n }\n });\n return translatedAttributes;\n };\n /**\n * Add the node as a child of the block when:\n * - we are in a block,\n * - we are not inside a ICU message (those are handled separately),\n * - the node is a \"direct child\" of the block\n * @param {?} node\n * @return {?}\n */\n _Visitor.prototype._mayBeAddBlockChildren = /**\n * Add the node as a child of the block when:\n * - we are in a block,\n * - we are not inside a ICU message (those are handled separately),\n * - the node is a \"direct child\" of the block\n * @param {?} node\n * @return {?}\n */\n function (node) {\n if (this._inI18nBlock && !this._inIcu && this._depth == this._blockStartDepth) {\n this._blockChildren.push(node);\n }\n };\n /**\n * Marks the start of a section, see `_closeTranslatableSection`\n * @param {?} node\n * @return {?}\n */\n _Visitor.prototype._openTranslatableSection = /**\n * Marks the start of a section, see `_closeTranslatableSection`\n * @param {?} node\n * @return {?}\n */\n function (node) {\n if (this._isInTranslatableSection) {\n this._reportError(node, 'Unexpected section start');\n }\n else {\n this._msgCountAtSectionStart = this._messages.length;\n }\n };\n Object.defineProperty(_Visitor.prototype, \"_isInTranslatableSection\", {\n get: /**\n * A translatable section could be:\n * - the content of translatable element,\n * - nodes between `` and `` comments\n * @return {?}\n */\n function () {\n return this._msgCountAtSectionStart !== void 0;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Terminates a section.\n *\n * If a section has only one significant children (comments not significant) then we should not\n * keep the message from this children:\n *\n * `{ICU message}
` would produce two messages:\n * - one for the content with meaning and description,\n * - another one for the ICU message.\n *\n * In this case the last message is discarded as it contains less information (the AST is\n * otherwise identical).\n *\n * Note that we should still keep messages extracted from attributes inside the section (ie in the\n * ICU message here)\n * @param {?} node\n * @param {?} directChildren\n * @return {?}\n */\n _Visitor.prototype._closeTranslatableSection = /**\n * Terminates a section.\n *\n * If a section has only one significant children (comments not significant) then we should not\n * keep the message from this children:\n *\n * `
{ICU message}
` would produce two messages:\n * - one for the content with meaning and description,\n * - another one for the ICU message.\n *\n * In this case the last message is discarded as it contains less information (the AST is\n * otherwise identical).\n *\n * Note that we should still keep messages extracted from attributes inside the section (ie in the\n * ICU message here)\n * @param {?} node\n * @param {?} directChildren\n * @return {?}\n */\n function (node, directChildren) {\n if (!this._isInTranslatableSection) {\n this._reportError(node, 'Unexpected section end');\n return;\n }\n var /** @type {?} */ startIndex = this._msgCountAtSectionStart;\n var /** @type {?} */ significantChildren = directChildren.reduce(function (count, node) { return count + (node instanceof Comment ? 0 : 1); }, 0);\n if (significantChildren == 1) {\n for (var /** @type {?} */ i = this._messages.length - 1; i >= /** @type {?} */ ((startIndex)); i--) {\n var /** @type {?} */ ast = this._messages[i].nodes;\n if (!(ast.length == 1 && ast[0] instanceof Text$1)) {\n this._messages.splice(i, 1);\n break;\n }\n }\n }\n this._msgCountAtSectionStart = undefined;\n };\n /**\n * @param {?} node\n * @param {?} msg\n * @return {?}\n */\n _Visitor.prototype._reportError = /**\n * @param {?} node\n * @param {?} msg\n * @return {?}\n */\n function (node, msg) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), msg));\n };\n return _Visitor;\n}());\n/**\n * @param {?} n\n * @return {?}\n */\nfunction _isOpeningComment(n) {\n return !!(n instanceof Comment && n.value && n.value.startsWith('i18n'));\n}\n/**\n * @param {?} n\n * @return {?}\n */\nfunction _isClosingComment(n) {\n return !!(n instanceof Comment && n.value && n.value === '/i18n');\n}\n/**\n * @param {?} p\n * @return {?}\n */\nfunction _getI18nAttr(p) {\n return p.attrs.find(function (attr) { return attr.name === _I18N_ATTR; }) || null;\n}\n/**\n * @param {?=} i18n\n * @return {?}\n */\nfunction _parseMessageMeta(i18n) {\n if (!i18n)\n return { meaning: '', description: '', id: '' };\n var /** @type {?} */ idIndex = i18n.indexOf(ID_SEPARATOR);\n var /** @type {?} */ descIndex = i18n.indexOf(MEANING_SEPARATOR);\n var _a = (idIndex > -1) ? [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)] : [i18n, ''], meaningAndDesc = _a[0], id = _a[1];\n var _b = (descIndex > -1) ?\n [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] :\n ['', meaningAndDesc], meaning = _b[0], description = _b[1];\n return { meaning: meaning, description: description, id: id };\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar XmlTagDefinition = /** @class */ (function () {\n function XmlTagDefinition() {\n this.closedByParent = false;\n this.contentType = TagContentType.PARSABLE_DATA;\n this.isVoid = false;\n this.ignoreFirstLf = false;\n this.canSelfClose = true;\n }\n /**\n * @param {?} currentParent\n * @return {?}\n */\n XmlTagDefinition.prototype.requireExtraParent = /**\n * @param {?} currentParent\n * @return {?}\n */\n function (currentParent) { return false; };\n /**\n * @param {?} name\n * @return {?}\n */\n XmlTagDefinition.prototype.isClosedByChild = /**\n * @param {?} name\n * @return {?}\n */\n function (name) { return false; };\n return XmlTagDefinition;\n}());\nvar _TAG_DEFINITION = new XmlTagDefinition();\n/**\n * @param {?} tagName\n * @return {?}\n */\nfunction getXmlTagDefinition(tagName) {\n return _TAG_DEFINITION;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar XmlParser = /** @class */ (function (_super) {\n __extends(XmlParser, _super);\n function XmlParser() {\n return _super.call(this, getXmlTagDefinition) || this;\n }\n /**\n * @param {?} source\n * @param {?} url\n * @param {?=} parseExpansionForms\n * @return {?}\n */\n XmlParser.prototype.parse = /**\n * @param {?} source\n * @param {?} url\n * @param {?=} parseExpansionForms\n * @return {?}\n */\n function (source, url, parseExpansionForms) {\n if (parseExpansionForms === void 0) { parseExpansionForms = false; }\n return _super.prototype.parse.call(this, source, url, parseExpansionForms);\n };\n return XmlParser;\n}(Parser$1));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @abstract\n */\nvar Serializer = /** @class */ (function () {\n function Serializer() {\n }\n // Creates a name mapper, see `PlaceholderMapper`\n // Returning `null` means that no name mapping is used.\n /**\n * @param {?} message\n * @return {?}\n */\n Serializer.prototype.createNameMapper = /**\n * @param {?} message\n * @return {?}\n */\n function (message) { return null; };\n return Serializer;\n}());\n/**\n * A `PlaceholderMapper` converts placeholder names from internal to serialized representation and\n * back.\n *\n * It should be used for serialization format that put constraints on the placeholder names.\n * @record\n */\n\n/**\n * A simple mapper that take a function to transform an internal name to a public name\n */\nvar SimplePlaceholderMapper = /** @class */ (function (_super) {\n __extends(SimplePlaceholderMapper, _super);\n // create a mapping from the message\n function SimplePlaceholderMapper(message, mapName) {\n var _this = _super.call(this) || this;\n _this.mapName = mapName;\n _this.internalToPublic = {};\n _this.publicToNextId = {};\n _this.publicToInternal = {};\n message.nodes.forEach(function (node) { return node.visit(_this); });\n return _this;\n }\n /**\n * @param {?} internalName\n * @return {?}\n */\n SimplePlaceholderMapper.prototype.toPublicName = /**\n * @param {?} internalName\n * @return {?}\n */\n function (internalName) {\n return this.internalToPublic.hasOwnProperty(internalName) ?\n this.internalToPublic[internalName] :\n null;\n };\n /**\n * @param {?} publicName\n * @return {?}\n */\n SimplePlaceholderMapper.prototype.toInternalName = /**\n * @param {?} publicName\n * @return {?}\n */\n function (publicName) {\n return this.publicToInternal.hasOwnProperty(publicName) ? this.publicToInternal[publicName] :\n null;\n };\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n SimplePlaceholderMapper.prototype.visitText = /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n function (text, context) { return null; };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n SimplePlaceholderMapper.prototype.visitTagPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) {\n this.visitPlaceholderName(ph.startName);\n _super.prototype.visitTagPlaceholder.call(this, ph, context);\n this.visitPlaceholderName(ph.closeName);\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n SimplePlaceholderMapper.prototype.visitPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) { this.visitPlaceholderName(ph.name); };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n SimplePlaceholderMapper.prototype.visitIcuPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) {\n this.visitPlaceholderName(ph.name);\n };\n /**\n * @param {?} internalName\n * @return {?}\n */\n SimplePlaceholderMapper.prototype.visitPlaceholderName = /**\n * @param {?} internalName\n * @return {?}\n */\n function (internalName) {\n if (!internalName || this.internalToPublic.hasOwnProperty(internalName)) {\n return;\n }\n var /** @type {?} */ publicName = this.mapName(internalName);\n if (this.publicToInternal.hasOwnProperty(publicName)) {\n // Create a new XMB when it has already been used\n var /** @type {?} */ nextId = this.publicToNextId[publicName];\n this.publicToNextId[publicName] = nextId + 1;\n publicName = publicName + \"_\" + nextId;\n }\n else {\n this.publicToNextId[publicName] = 1;\n }\n this.internalToPublic[internalName] = publicName;\n this.publicToInternal[publicName] = internalName;\n };\n return SimplePlaceholderMapper;\n}(RecurseVisitor));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @record\n */\n\nvar _Visitor$1 = /** @class */ (function () {\n function _Visitor() {\n }\n /**\n * @param {?} tag\n * @return {?}\n */\n _Visitor.prototype.visitTag = /**\n * @param {?} tag\n * @return {?}\n */\n function (tag) {\n var _this = this;\n var /** @type {?} */ strAttrs = this._serializeAttributes(tag.attrs);\n if (tag.children.length == 0) {\n return \"<\" + tag.name + strAttrs + \"/>\";\n }\n var /** @type {?} */ strChildren = tag.children.map(function (node) { return node.visit(_this); });\n return \"<\" + tag.name + strAttrs + \">\" + strChildren.join('') + \"\" + tag.name + \">\";\n };\n /**\n * @param {?} text\n * @return {?}\n */\n _Visitor.prototype.visitText = /**\n * @param {?} text\n * @return {?}\n */\n function (text) { return text.value; };\n /**\n * @param {?} decl\n * @return {?}\n */\n _Visitor.prototype.visitDeclaration = /**\n * @param {?} decl\n * @return {?}\n */\n function (decl) {\n return \"\";\n };\n /**\n * @param {?} attrs\n * @return {?}\n */\n _Visitor.prototype._serializeAttributes = /**\n * @param {?} attrs\n * @return {?}\n */\n function (attrs) {\n var /** @type {?} */ strAttrs = Object.keys(attrs).map(function (name) { return name + \"=\\\"\" + attrs[name] + \"\\\"\"; }).join(' ');\n return strAttrs.length > 0 ? ' ' + strAttrs : '';\n };\n /**\n * @param {?} doctype\n * @return {?}\n */\n _Visitor.prototype.visitDoctype = /**\n * @param {?} doctype\n * @return {?}\n */\n function (doctype) {\n return \"\";\n };\n return _Visitor;\n}());\nvar _visitor = new _Visitor$1();\n/**\n * @param {?} nodes\n * @return {?}\n */\nfunction serialize(nodes) {\n return nodes.map(function (node) { return node.visit(_visitor); }).join('');\n}\n/**\n * @record\n */\n\nvar Declaration = /** @class */ (function () {\n function Declaration(unescapedAttrs) {\n var _this = this;\n this.attrs = {};\n Object.keys(unescapedAttrs).forEach(function (k) {\n _this.attrs[k] = _escapeXml(unescapedAttrs[k]);\n });\n }\n /**\n * @param {?} visitor\n * @return {?}\n */\n Declaration.prototype.visit = /**\n * @param {?} visitor\n * @return {?}\n */\n function (visitor) { return visitor.visitDeclaration(this); };\n return Declaration;\n}());\nvar Doctype = /** @class */ (function () {\n function Doctype(rootTag, dtd) {\n this.rootTag = rootTag;\n this.dtd = dtd;\n }\n /**\n * @param {?} visitor\n * @return {?}\n */\n Doctype.prototype.visit = /**\n * @param {?} visitor\n * @return {?}\n */\n function (visitor) { return visitor.visitDoctype(this); };\n return Doctype;\n}());\nvar Tag = /** @class */ (function () {\n function Tag(name, unescapedAttrs, children) {\n if (unescapedAttrs === void 0) { unescapedAttrs = {}; }\n if (children === void 0) { children = []; }\n var _this = this;\n this.name = name;\n this.children = children;\n this.attrs = {};\n Object.keys(unescapedAttrs).forEach(function (k) {\n _this.attrs[k] = _escapeXml(unescapedAttrs[k]);\n });\n }\n /**\n * @param {?} visitor\n * @return {?}\n */\n Tag.prototype.visit = /**\n * @param {?} visitor\n * @return {?}\n */\n function (visitor) { return visitor.visitTag(this); };\n return Tag;\n}());\nvar Text$2 = /** @class */ (function () {\n function Text(unescapedValue) {\n this.value = _escapeXml(unescapedValue);\n }\n /**\n * @param {?} visitor\n * @return {?}\n */\n Text.prototype.visit = /**\n * @param {?} visitor\n * @return {?}\n */\n function (visitor) { return visitor.visitText(this); };\n return Text;\n}());\nvar CR = /** @class */ (function (_super) {\n __extends(CR, _super);\n function CR(ws) {\n if (ws === void 0) { ws = 0; }\n return _super.call(this, \"\\n\" + new Array(ws + 1).join(' ')) || this;\n }\n return CR;\n}(Text$2));\nvar _ESCAPED_CHARS = [\n [/&/g, '&'],\n [/\"/g, '"'],\n [/'/g, '''],\n [//g, '>'],\n];\n/**\n * @param {?} text\n * @return {?}\n */\nfunction _escapeXml(text) {\n return _ESCAPED_CHARS.reduce(function (text, entry) { return text.replace(entry[0], entry[1]); }, text);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar _VERSION = '1.2';\nvar _XMLNS = 'urn:oasis:names:tc:xliff:document:1.2';\n// TODO(vicb): make this a param (s/_/-/)\nvar _DEFAULT_SOURCE_LANG = 'en';\nvar _PLACEHOLDER_TAG = 'x';\nvar _MARKER_TAG = 'mrk';\nvar _FILE_TAG = 'file';\nvar _SOURCE_TAG = 'source';\nvar _SEGMENT_SOURCE_TAG = 'seg-source';\nvar _TARGET_TAG = 'target';\nvar _UNIT_TAG = 'trans-unit';\nvar _CONTEXT_GROUP_TAG = 'context-group';\nvar _CONTEXT_TAG = 'context';\nvar Xliff = /** @class */ (function (_super) {\n __extends(Xliff, _super);\n function Xliff() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n Xliff.prototype.write = /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n function (messages, locale) {\n var /** @type {?} */ visitor = new _WriteVisitor();\n var /** @type {?} */ transUnits = [];\n messages.forEach(function (message) {\n var /** @type {?} */ contextTags = [];\n message.sources.forEach(function (source) {\n var /** @type {?} */ contextGroupTag = new Tag(_CONTEXT_GROUP_TAG, { purpose: 'location' });\n contextGroupTag.children.push(new CR(10), new Tag(_CONTEXT_TAG, { 'context-type': 'sourcefile' }, [new Text$2(source.filePath)]), new CR(10), new Tag(_CONTEXT_TAG, { 'context-type': 'linenumber' }, [new Text$2(\"\" + source.startLine)]), new CR(8));\n contextTags.push(new CR(8), contextGroupTag);\n });\n var /** @type {?} */ transUnit = new Tag(_UNIT_TAG, { id: message.id, datatype: 'html' });\n (_a = transUnit.children).push.apply(_a, [new CR(8), new Tag(_SOURCE_TAG, {}, visitor.serialize(message.nodes))].concat(contextTags));\n if (message.description) {\n transUnit.children.push(new CR(8), new Tag('note', { priority: '1', from: 'description' }, [new Text$2(message.description)]));\n }\n if (message.meaning) {\n transUnit.children.push(new CR(8), new Tag('note', { priority: '1', from: 'meaning' }, [new Text$2(message.meaning)]));\n }\n transUnit.children.push(new CR(6));\n transUnits.push(new CR(6), transUnit);\n var _a;\n });\n var /** @type {?} */ body = new Tag('body', {}, transUnits.concat([new CR(4)]));\n var /** @type {?} */ file = new Tag('file', {\n 'source-language': locale || _DEFAULT_SOURCE_LANG,\n datatype: 'plaintext',\n original: 'ng2.template',\n }, [new CR(4), body, new CR(2)]);\n var /** @type {?} */ xliff = new Tag('xliff', { version: _VERSION, xmlns: _XMLNS }, [new CR(2), file, new CR()]);\n return serialize([\n new Declaration({ version: '1.0', encoding: 'UTF-8' }), new CR(), xliff, new CR()\n ]);\n };\n /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n Xliff.prototype.load = /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n function (content, url) {\n // xliff to xml nodes\n var /** @type {?} */ xliffParser = new XliffParser();\n var _a = xliffParser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;\n // xml nodes to i18n nodes\n var /** @type {?} */ i18nNodesByMsgId = {};\n var /** @type {?} */ converter = new XmlToI18n();\n Object.keys(msgIdToHtml).forEach(function (msgId) {\n var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, e = _a.errors;\n errors.push.apply(errors, e);\n i18nNodesByMsgId[msgId] = i18nNodes;\n });\n if (errors.length) {\n throw new Error(\"xliff parse errors:\\n\" + errors.join('\\n'));\n }\n return { locale: /** @type {?} */ ((locale)), i18nNodesByMsgId: i18nNodesByMsgId };\n };\n /**\n * @param {?} message\n * @return {?}\n */\n Xliff.prototype.digest = /**\n * @param {?} message\n * @return {?}\n */\n function (message) { return digest(message); };\n return Xliff;\n}(Serializer));\nvar _WriteVisitor = /** @class */ (function () {\n function _WriteVisitor() {\n }\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitText = /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n function (text, context) { return [new Text$2(text.value)]; };\n /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitContainer = /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n function (container, context) {\n var _this = this;\n var /** @type {?} */ nodes = [];\n container.children.forEach(function (node) { return nodes.push.apply(nodes, node.visit(_this)); });\n return nodes;\n };\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitIcu = /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n function (icu, context) {\n var _this = this;\n var /** @type {?} */ nodes = [new Text$2(\"{\" + icu.expressionPlaceholder + \", \" + icu.type + \", \")];\n Object.keys(icu.cases).forEach(function (c) {\n nodes.push.apply(nodes, [new Text$2(c + \" {\")].concat(icu.cases[c].visit(_this), [new Text$2(\"} \")]));\n });\n nodes.push(new Text$2(\"}\"));\n return nodes;\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitTagPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) {\n var /** @type {?} */ ctype = getCtypeForTag(ph.tag);\n if (ph.isVoid) {\n // void tags have no children nor closing tags\n return [new Tag(_PLACEHOLDER_TAG, { id: ph.startName, ctype: ctype, 'equiv-text': \"<\" + ph.tag + \"/>\" })];\n }\n var /** @type {?} */ startTagPh = new Tag(_PLACEHOLDER_TAG, { id: ph.startName, ctype: ctype, 'equiv-text': \"<\" + ph.tag + \">\" });\n var /** @type {?} */ closeTagPh = new Tag(_PLACEHOLDER_TAG, { id: ph.closeName, ctype: ctype, 'equiv-text': \"\" + ph.tag + \">\" });\n return [startTagPh].concat(this.serialize(ph.children), [closeTagPh]);\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) {\n return [new Tag(_PLACEHOLDER_TAG, { id: ph.name, 'equiv-text': \"{{\" + ph.value + \"}}\" })];\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitIcuPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) {\n var /** @type {?} */ equivText = \"{\" + ph.value.expression + \", \" + ph.value.type + \", \" + Object.keys(ph.value.cases).map(function (value) { return value + ' {...}'; }).join(' ') + \"}\";\n return [new Tag(_PLACEHOLDER_TAG, { id: ph.name, 'equiv-text': equivText })];\n };\n /**\n * @param {?} nodes\n * @return {?}\n */\n _WriteVisitor.prototype.serialize = /**\n * @param {?} nodes\n * @return {?}\n */\n function (nodes) {\n var _this = this;\n return [].concat.apply([], nodes.map(function (node) { return node.visit(_this); }));\n };\n return _WriteVisitor;\n}());\nvar XliffParser = /** @class */ (function () {\n function XliffParser() {\n this._locale = null;\n }\n /**\n * @param {?} xliff\n * @param {?} url\n * @return {?}\n */\n XliffParser.prototype.parse = /**\n * @param {?} xliff\n * @param {?} url\n * @return {?}\n */\n function (xliff, url) {\n this._unitMlString = null;\n this._msgIdToHtml = {};\n var /** @type {?} */ xml = new XmlParser().parse(xliff, url, false);\n this._errors = xml.errors;\n visitAll(this, xml.rootNodes, null);\n return {\n msgIdToHtml: this._msgIdToHtml,\n errors: this._errors,\n locale: this._locale,\n };\n };\n /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n XliffParser.prototype.visitElement = /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n function (element, context) {\n switch (element.name) {\n case _UNIT_TAG:\n this._unitMlString = /** @type {?} */ ((null));\n var /** @type {?} */ idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });\n if (!idAttr) {\n this._addError(element, \"<\" + _UNIT_TAG + \"> misses the \\\"id\\\" attribute\");\n }\n else {\n var /** @type {?} */ id = idAttr.value;\n if (this._msgIdToHtml.hasOwnProperty(id)) {\n this._addError(element, \"Duplicated translations for msg \" + id);\n }\n else {\n visitAll(this, element.children, null);\n if (typeof this._unitMlString === 'string') {\n this._msgIdToHtml[id] = this._unitMlString;\n }\n else {\n this._addError(element, \"Message \" + id + \" misses a translation\");\n }\n }\n }\n break;\n // ignore those tags\n case _SOURCE_TAG:\n case _SEGMENT_SOURCE_TAG:\n break;\n case _TARGET_TAG:\n var /** @type {?} */ innerTextStart = /** @type {?} */ ((element.startSourceSpan)).end.offset;\n var /** @type {?} */ innerTextEnd = /** @type {?} */ ((element.endSourceSpan)).start.offset;\n var /** @type {?} */ content = /** @type {?} */ ((element.startSourceSpan)).start.file.content;\n var /** @type {?} */ innerText = content.slice(innerTextStart, innerTextEnd);\n this._unitMlString = innerText;\n break;\n case _FILE_TAG:\n var /** @type {?} */ localeAttr = element.attrs.find(function (attr) { return attr.name === 'target-language'; });\n if (localeAttr) {\n this._locale = localeAttr.value;\n }\n visitAll(this, element.children, null);\n break;\n default:\n // TODO(vicb): assert file structure, xliff version\n // For now only recurse on unhandled nodes\n visitAll(this, element.children, null);\n }\n };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n XliffParser.prototype.visitAttribute = /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n function (attribute, context) { };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n XliffParser.prototype.visitText = /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n function (text, context) { };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n XliffParser.prototype.visitComment = /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n function (comment, context) { };\n /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n XliffParser.prototype.visitExpansion = /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n function (expansion, context) { };\n /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n XliffParser.prototype.visitExpansionCase = /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n function (expansionCase, context) { };\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n XliffParser.prototype._addError = /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n function (node, message) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n };\n return XliffParser;\n}());\nvar XmlToI18n = /** @class */ (function () {\n function XmlToI18n() {\n }\n /**\n * @param {?} message\n * @param {?} url\n * @return {?}\n */\n XmlToI18n.prototype.convert = /**\n * @param {?} message\n * @param {?} url\n * @return {?}\n */\n function (message, url) {\n var /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);\n this._errors = xmlIcu.errors;\n var /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n [] : [].concat.apply([], visitAll(this, xmlIcu.rootNodes));\n return {\n i18nNodes: i18nNodes,\n errors: this._errors,\n };\n };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitText = /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n function (text, context) { return new Text$1(text.value, /** @type {?} */ ((text.sourceSpan))); };\n /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitElement = /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n function (el, context) {\n if (el.name === _PLACEHOLDER_TAG) {\n var /** @type {?} */ nameAttr = el.attrs.find(function (attr) { return attr.name === 'id'; });\n if (nameAttr) {\n return new Placeholder('', nameAttr.value, /** @type {?} */ ((el.sourceSpan)));\n }\n this._addError(el, \"<\" + _PLACEHOLDER_TAG + \"> misses the \\\"id\\\" attribute\");\n return null;\n }\n if (el.name === _MARKER_TAG) {\n return [].concat.apply([], visitAll(this, el.children));\n }\n this._addError(el, \"Unexpected tag\");\n return null;\n };\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitExpansion = /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n function (icu, context) {\n var /** @type {?} */ caseMap = {};\n visitAll(this, icu.cases).forEach(function (c) {\n caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);\n });\n return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n };\n /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitExpansionCase = /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n function (icuCase, context) {\n return {\n value: icuCase.value,\n nodes: visitAll(this, icuCase.expression),\n };\n };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitComment = /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n function (comment, context) { };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitAttribute = /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n function (attribute, context) { };\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n XmlToI18n.prototype._addError = /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n function (node, message) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n };\n return XmlToI18n;\n}());\n/**\n * @param {?} tag\n * @return {?}\n */\nfunction getCtypeForTag(tag) {\n switch (tag.toLowerCase()) {\n case 'br':\n return 'lb';\n case 'img':\n return 'image';\n default:\n return \"x-\" + tag;\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar _VERSION$1 = '2.0';\nvar _XMLNS$1 = 'urn:oasis:names:tc:xliff:document:2.0';\n// TODO(vicb): make this a param (s/_/-/)\nvar _DEFAULT_SOURCE_LANG$1 = 'en';\nvar _PLACEHOLDER_TAG$1 = 'ph';\nvar _PLACEHOLDER_SPANNING_TAG = 'pc';\nvar _MARKER_TAG$1 = 'mrk';\nvar _XLIFF_TAG = 'xliff';\nvar _SOURCE_TAG$1 = 'source';\nvar _TARGET_TAG$1 = 'target';\nvar _UNIT_TAG$1 = 'unit';\nvar Xliff2 = /** @class */ (function (_super) {\n __extends(Xliff2, _super);\n function Xliff2() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n Xliff2.prototype.write = /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n function (messages, locale) {\n var /** @type {?} */ visitor = new _WriteVisitor$1();\n var /** @type {?} */ units = [];\n messages.forEach(function (message) {\n var /** @type {?} */ unit = new Tag(_UNIT_TAG$1, { id: message.id });\n var /** @type {?} */ notes = new Tag('notes');\n if (message.description || message.meaning) {\n if (message.description) {\n notes.children.push(new CR(8), new Tag('note', { category: 'description' }, [new Text$2(message.description)]));\n }\n if (message.meaning) {\n notes.children.push(new CR(8), new Tag('note', { category: 'meaning' }, [new Text$2(message.meaning)]));\n }\n }\n message.sources.forEach(function (source) {\n notes.children.push(new CR(8), new Tag('note', { category: 'location' }, [\n new Text$2(source.filePath + \":\" + source.startLine + (source.endLine !== source.startLine ? ',' + source.endLine : ''))\n ]));\n });\n notes.children.push(new CR(6));\n unit.children.push(new CR(6), notes);\n var /** @type {?} */ segment = new Tag('segment');\n segment.children.push(new CR(8), new Tag(_SOURCE_TAG$1, {}, visitor.serialize(message.nodes)), new CR(6));\n unit.children.push(new CR(6), segment, new CR(4));\n units.push(new CR(4), unit);\n });\n var /** @type {?} */ file = new Tag('file', { 'original': 'ng.template', id: 'ngi18n' }, units.concat([new CR(2)]));\n var /** @type {?} */ xliff = new Tag(_XLIFF_TAG, { version: _VERSION$1, xmlns: _XMLNS$1, srcLang: locale || _DEFAULT_SOURCE_LANG$1 }, [new CR(2), file, new CR()]);\n return serialize([\n new Declaration({ version: '1.0', encoding: 'UTF-8' }), new CR(), xliff, new CR()\n ]);\n };\n /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n Xliff2.prototype.load = /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n function (content, url) {\n // xliff to xml nodes\n var /** @type {?} */ xliff2Parser = new Xliff2Parser();\n var _a = xliff2Parser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;\n // xml nodes to i18n nodes\n var /** @type {?} */ i18nNodesByMsgId = {};\n var /** @type {?} */ converter = new XmlToI18n$1();\n Object.keys(msgIdToHtml).forEach(function (msgId) {\n var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, e = _a.errors;\n errors.push.apply(errors, e);\n i18nNodesByMsgId[msgId] = i18nNodes;\n });\n if (errors.length) {\n throw new Error(\"xliff2 parse errors:\\n\" + errors.join('\\n'));\n }\n return { locale: /** @type {?} */ ((locale)), i18nNodesByMsgId: i18nNodesByMsgId };\n };\n /**\n * @param {?} message\n * @return {?}\n */\n Xliff2.prototype.digest = /**\n * @param {?} message\n * @return {?}\n */\n function (message) { return decimalDigest(message); };\n return Xliff2;\n}(Serializer));\nvar _WriteVisitor$1 = /** @class */ (function () {\n function _WriteVisitor() {\n }\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitText = /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n function (text, context) { return [new Text$2(text.value)]; };\n /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitContainer = /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n function (container, context) {\n var _this = this;\n var /** @type {?} */ nodes = [];\n container.children.forEach(function (node) { return nodes.push.apply(nodes, node.visit(_this)); });\n return nodes;\n };\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitIcu = /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n function (icu, context) {\n var _this = this;\n var /** @type {?} */ nodes = [new Text$2(\"{\" + icu.expressionPlaceholder + \", \" + icu.type + \", \")];\n Object.keys(icu.cases).forEach(function (c) {\n nodes.push.apply(nodes, [new Text$2(c + \" {\")].concat(icu.cases[c].visit(_this), [new Text$2(\"} \")]));\n });\n nodes.push(new Text$2(\"}\"));\n return nodes;\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitTagPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) {\n var _this = this;\n var /** @type {?} */ type = getTypeForTag(ph.tag);\n if (ph.isVoid) {\n var /** @type {?} */ tagPh = new Tag(_PLACEHOLDER_TAG$1, {\n id: (this._nextPlaceholderId++).toString(),\n equiv: ph.startName,\n type: type,\n disp: \"<\" + ph.tag + \"/>\",\n });\n return [tagPh];\n }\n var /** @type {?} */ tagPc = new Tag(_PLACEHOLDER_SPANNING_TAG, {\n id: (this._nextPlaceholderId++).toString(),\n equivStart: ph.startName,\n equivEnd: ph.closeName,\n type: type,\n dispStart: \"<\" + ph.tag + \">\",\n dispEnd: \"\" + ph.tag + \">\",\n });\n var /** @type {?} */ nodes = [].concat.apply([], ph.children.map(function (node) { return node.visit(_this); }));\n if (nodes.length) {\n nodes.forEach(function (node) { return tagPc.children.push(node); });\n }\n else {\n tagPc.children.push(new Text$2(''));\n }\n return [tagPc];\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) {\n var /** @type {?} */ idStr = (this._nextPlaceholderId++).toString();\n return [new Tag(_PLACEHOLDER_TAG$1, {\n id: idStr,\n equiv: ph.name,\n disp: \"{{\" + ph.value + \"}}\",\n })];\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitIcuPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) {\n var /** @type {?} */ cases = Object.keys(ph.value.cases).map(function (value) { return value + ' {...}'; }).join(' ');\n var /** @type {?} */ idStr = (this._nextPlaceholderId++).toString();\n return [new Tag(_PLACEHOLDER_TAG$1, { id: idStr, equiv: ph.name, disp: \"{\" + ph.value.expression + \", \" + ph.value.type + \", \" + cases + \"}\" })];\n };\n /**\n * @param {?} nodes\n * @return {?}\n */\n _WriteVisitor.prototype.serialize = /**\n * @param {?} nodes\n * @return {?}\n */\n function (nodes) {\n var _this = this;\n this._nextPlaceholderId = 0;\n return [].concat.apply([], nodes.map(function (node) { return node.visit(_this); }));\n };\n return _WriteVisitor;\n}());\nvar Xliff2Parser = /** @class */ (function () {\n function Xliff2Parser() {\n this._locale = null;\n }\n /**\n * @param {?} xliff\n * @param {?} url\n * @return {?}\n */\n Xliff2Parser.prototype.parse = /**\n * @param {?} xliff\n * @param {?} url\n * @return {?}\n */\n function (xliff, url) {\n this._unitMlString = null;\n this._msgIdToHtml = {};\n var /** @type {?} */ xml = new XmlParser().parse(xliff, url, false);\n this._errors = xml.errors;\n visitAll(this, xml.rootNodes, null);\n return {\n msgIdToHtml: this._msgIdToHtml,\n errors: this._errors,\n locale: this._locale,\n };\n };\n /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n Xliff2Parser.prototype.visitElement = /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n function (element, context) {\n switch (element.name) {\n case _UNIT_TAG$1:\n this._unitMlString = null;\n var /** @type {?} */ idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });\n if (!idAttr) {\n this._addError(element, \"<\" + _UNIT_TAG$1 + \"> misses the \\\"id\\\" attribute\");\n }\n else {\n var /** @type {?} */ id = idAttr.value;\n if (this._msgIdToHtml.hasOwnProperty(id)) {\n this._addError(element, \"Duplicated translations for msg \" + id);\n }\n else {\n visitAll(this, element.children, null);\n if (typeof this._unitMlString === 'string') {\n this._msgIdToHtml[id] = this._unitMlString;\n }\n else {\n this._addError(element, \"Message \" + id + \" misses a translation\");\n }\n }\n }\n break;\n case _SOURCE_TAG$1:\n // ignore source message\n break;\n case _TARGET_TAG$1:\n var /** @type {?} */ innerTextStart = /** @type {?} */ ((element.startSourceSpan)).end.offset;\n var /** @type {?} */ innerTextEnd = /** @type {?} */ ((element.endSourceSpan)).start.offset;\n var /** @type {?} */ content = /** @type {?} */ ((element.startSourceSpan)).start.file.content;\n var /** @type {?} */ innerText = content.slice(innerTextStart, innerTextEnd);\n this._unitMlString = innerText;\n break;\n case _XLIFF_TAG:\n var /** @type {?} */ localeAttr = element.attrs.find(function (attr) { return attr.name === 'trgLang'; });\n if (localeAttr) {\n this._locale = localeAttr.value;\n }\n var /** @type {?} */ versionAttr = element.attrs.find(function (attr) { return attr.name === 'version'; });\n if (versionAttr) {\n var /** @type {?} */ version = versionAttr.value;\n if (version !== '2.0') {\n this._addError(element, \"The XLIFF file version \" + version + \" is not compatible with XLIFF 2.0 serializer\");\n }\n else {\n visitAll(this, element.children, null);\n }\n }\n break;\n default:\n visitAll(this, element.children, null);\n }\n };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n Xliff2Parser.prototype.visitAttribute = /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n function (attribute, context) { };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n Xliff2Parser.prototype.visitText = /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n function (text, context) { };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n Xliff2Parser.prototype.visitComment = /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n function (comment, context) { };\n /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n Xliff2Parser.prototype.visitExpansion = /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n function (expansion, context) { };\n /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n Xliff2Parser.prototype.visitExpansionCase = /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n function (expansionCase, context) { };\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n Xliff2Parser.prototype._addError = /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n function (node, message) {\n this._errors.push(new I18nError(node.sourceSpan, message));\n };\n return Xliff2Parser;\n}());\nvar XmlToI18n$1 = /** @class */ (function () {\n function XmlToI18n() {\n }\n /**\n * @param {?} message\n * @param {?} url\n * @return {?}\n */\n XmlToI18n.prototype.convert = /**\n * @param {?} message\n * @param {?} url\n * @return {?}\n */\n function (message, url) {\n var /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);\n this._errors = xmlIcu.errors;\n var /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n [] : [].concat.apply([], visitAll(this, xmlIcu.rootNodes));\n return {\n i18nNodes: i18nNodes,\n errors: this._errors,\n };\n };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitText = /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n function (text, context) { return new Text$1(text.value, text.sourceSpan); };\n /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitElement = /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n function (el, context) {\n var _this = this;\n switch (el.name) {\n case _PLACEHOLDER_TAG$1:\n var /** @type {?} */ nameAttr = el.attrs.find(function (attr) { return attr.name === 'equiv'; });\n if (nameAttr) {\n return [new Placeholder('', nameAttr.value, el.sourceSpan)];\n }\n this._addError(el, \"<\" + _PLACEHOLDER_TAG$1 + \"> misses the \\\"equiv\\\" attribute\");\n break;\n case _PLACEHOLDER_SPANNING_TAG:\n var /** @type {?} */ startAttr = el.attrs.find(function (attr) { return attr.name === 'equivStart'; });\n var /** @type {?} */ endAttr = el.attrs.find(function (attr) { return attr.name === 'equivEnd'; });\n if (!startAttr) {\n this._addError(el, \"<\" + _PLACEHOLDER_TAG$1 + \"> misses the \\\"equivStart\\\" attribute\");\n }\n else if (!endAttr) {\n this._addError(el, \"<\" + _PLACEHOLDER_TAG$1 + \"> misses the \\\"equivEnd\\\" attribute\");\n }\n else {\n var /** @type {?} */ startId = startAttr.value;\n var /** @type {?} */ endId = endAttr.value;\n var /** @type {?} */ nodes = [];\n return nodes.concat.apply(nodes, [new Placeholder('', startId, el.sourceSpan)].concat(el.children.map(function (node) { return node.visit(_this, null); }), [new Placeholder('', endId, el.sourceSpan)]));\n }\n break;\n case _MARKER_TAG$1:\n return [].concat.apply([], visitAll(this, el.children));\n default:\n this._addError(el, \"Unexpected tag\");\n }\n return null;\n };\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitExpansion = /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n function (icu, context) {\n var /** @type {?} */ caseMap = {};\n visitAll(this, icu.cases).forEach(function (c) {\n caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);\n });\n return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n };\n /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitExpansionCase = /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n function (icuCase, context) {\n return {\n value: icuCase.value,\n nodes: [].concat.apply([], visitAll(this, icuCase.expression)),\n };\n };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitComment = /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n function (comment, context) { };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitAttribute = /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n function (attribute, context) { };\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n XmlToI18n.prototype._addError = /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n function (node, message) {\n this._errors.push(new I18nError(node.sourceSpan, message));\n };\n return XmlToI18n;\n}());\n/**\n * @param {?} tag\n * @return {?}\n */\nfunction getTypeForTag(tag) {\n switch (tag.toLowerCase()) {\n case 'br':\n case 'b':\n case 'i':\n case 'u':\n return 'fmt';\n case 'img':\n return 'image';\n case 'a':\n return 'link';\n default:\n return 'other';\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar _MESSAGES_TAG = 'messagebundle';\nvar _MESSAGE_TAG = 'msg';\nvar _PLACEHOLDER_TAG$2 = 'ph';\nvar _EXEMPLE_TAG = 'ex';\nvar _SOURCE_TAG$2 = 'source';\nvar _DOCTYPE = \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\";\nvar Xmb = /** @class */ (function (_super) {\n __extends(Xmb, _super);\n function Xmb() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n Xmb.prototype.write = /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n function (messages, locale) {\n var /** @type {?} */ exampleVisitor = new ExampleVisitor();\n var /** @type {?} */ visitor = new _Visitor$2();\n var /** @type {?} */ rootNode = new Tag(_MESSAGES_TAG);\n messages.forEach(function (message) {\n var /** @type {?} */ attrs = { id: message.id };\n if (message.description) {\n attrs['desc'] = message.description;\n }\n if (message.meaning) {\n attrs['meaning'] = message.meaning;\n }\n var /** @type {?} */ sourceTags = [];\n message.sources.forEach(function (source) {\n sourceTags.push(new Tag(_SOURCE_TAG$2, {}, [\n new Text$2(source.filePath + \":\" + source.startLine + (source.endLine !== source.startLine ? ',' + source.endLine : ''))\n ]));\n });\n rootNode.children.push(new CR(2), new Tag(_MESSAGE_TAG, attrs, sourceTags.concat(visitor.serialize(message.nodes))));\n });\n rootNode.children.push(new CR());\n return serialize([\n new Declaration({ version: '1.0', encoding: 'UTF-8' }),\n new CR(),\n new Doctype(_MESSAGES_TAG, _DOCTYPE),\n new CR(),\n exampleVisitor.addDefaultExamples(rootNode),\n new CR(),\n ]);\n };\n /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n Xmb.prototype.load = /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n function (content, url) {\n throw new Error('Unsupported');\n };\n /**\n * @param {?} message\n * @return {?}\n */\n Xmb.prototype.digest = /**\n * @param {?} message\n * @return {?}\n */\n function (message) { return digest$1(message); };\n /**\n * @param {?} message\n * @return {?}\n */\n Xmb.prototype.createNameMapper = /**\n * @param {?} message\n * @return {?}\n */\n function (message) {\n return new SimplePlaceholderMapper(message, toPublicName);\n };\n return Xmb;\n}(Serializer));\nvar _Visitor$2 = /** @class */ (function () {\n function _Visitor() {\n }\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n _Visitor.prototype.visitText = /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n function (text, context) { return [new Text$2(text.value)]; };\n /**\n * @param {?} container\n * @param {?} context\n * @return {?}\n */\n _Visitor.prototype.visitContainer = /**\n * @param {?} container\n * @param {?} context\n * @return {?}\n */\n function (container, context) {\n var _this = this;\n var /** @type {?} */ nodes = [];\n container.children.forEach(function (node) { return nodes.push.apply(nodes, node.visit(_this)); });\n return nodes;\n };\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n _Visitor.prototype.visitIcu = /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n function (icu, context) {\n var _this = this;\n var /** @type {?} */ nodes = [new Text$2(\"{\" + icu.expressionPlaceholder + \", \" + icu.type + \", \")];\n Object.keys(icu.cases).forEach(function (c) {\n nodes.push.apply(nodes, [new Text$2(c + \" {\")].concat(icu.cases[c].visit(_this), [new Text$2(\"} \")]));\n });\n nodes.push(new Text$2(\"}\"));\n return nodes;\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _Visitor.prototype.visitTagPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) {\n var /** @type {?} */ startEx = new Tag(_EXEMPLE_TAG, {}, [new Text$2(\"<\" + ph.tag + \">\")]);\n var /** @type {?} */ startTagPh = new Tag(_PLACEHOLDER_TAG$2, { name: ph.startName }, [startEx]);\n if (ph.isVoid) {\n // void tags have no children nor closing tags\n return [startTagPh];\n }\n var /** @type {?} */ closeEx = new Tag(_EXEMPLE_TAG, {}, [new Text$2(\"\" + ph.tag + \">\")]);\n var /** @type {?} */ closeTagPh = new Tag(_PLACEHOLDER_TAG$2, { name: ph.closeName }, [closeEx]);\n return [startTagPh].concat(this.serialize(ph.children), [closeTagPh]);\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _Visitor.prototype.visitPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) {\n var /** @type {?} */ exTag = new Tag(_EXEMPLE_TAG, {}, [new Text$2(\"{{\" + ph.value + \"}}\")]);\n return [new Tag(_PLACEHOLDER_TAG$2, { name: ph.name }, [exTag])];\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _Visitor.prototype.visitIcuPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) {\n var /** @type {?} */ exTag = new Tag(_EXEMPLE_TAG, {}, [\n new Text$2(\"{\" + ph.value.expression + \", \" + ph.value.type + \", \" + Object.keys(ph.value.cases).map(function (value) { return value + ' {...}'; }).join(' ') + \"}\")\n ]);\n return [new Tag(_PLACEHOLDER_TAG$2, { name: ph.name }, [exTag])];\n };\n /**\n * @param {?} nodes\n * @return {?}\n */\n _Visitor.prototype.serialize = /**\n * @param {?} nodes\n * @return {?}\n */\n function (nodes) {\n var _this = this;\n return [].concat.apply([], nodes.map(function (node) { return node.visit(_this); }));\n };\n return _Visitor;\n}());\n/**\n * @param {?} message\n * @return {?}\n */\nfunction digest$1(message) {\n return decimalDigest(message);\n}\nvar ExampleVisitor = /** @class */ (function () {\n function ExampleVisitor() {\n }\n /**\n * @param {?} node\n * @return {?}\n */\n ExampleVisitor.prototype.addDefaultExamples = /**\n * @param {?} node\n * @return {?}\n */\n function (node) {\n node.visit(this);\n return node;\n };\n /**\n * @param {?} tag\n * @return {?}\n */\n ExampleVisitor.prototype.visitTag = /**\n * @param {?} tag\n * @return {?}\n */\n function (tag) {\n var _this = this;\n if (tag.name === _PLACEHOLDER_TAG$2) {\n if (!tag.children || tag.children.length == 0) {\n var /** @type {?} */ exText = new Text$2(tag.attrs['name'] || '...');\n tag.children = [new Tag(_EXEMPLE_TAG, {}, [exText])];\n }\n }\n else if (tag.children) {\n tag.children.forEach(function (node) { return node.visit(_this); });\n }\n };\n /**\n * @param {?} text\n * @return {?}\n */\n ExampleVisitor.prototype.visitText = /**\n * @param {?} text\n * @return {?}\n */\n function (text) { };\n /**\n * @param {?} decl\n * @return {?}\n */\n ExampleVisitor.prototype.visitDeclaration = /**\n * @param {?} decl\n * @return {?}\n */\n function (decl) { };\n /**\n * @param {?} doctype\n * @return {?}\n */\n ExampleVisitor.prototype.visitDoctype = /**\n * @param {?} doctype\n * @return {?}\n */\n function (doctype) { };\n return ExampleVisitor;\n}());\n/**\n * @param {?} internalName\n * @return {?}\n */\nfunction toPublicName(internalName) {\n return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, '_');\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar _TRANSLATIONS_TAG = 'translationbundle';\nvar _TRANSLATION_TAG = 'translation';\nvar _PLACEHOLDER_TAG$3 = 'ph';\nvar Xtb = /** @class */ (function (_super) {\n __extends(Xtb, _super);\n function Xtb() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n Xtb.prototype.write = /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n function (messages, locale) { throw new Error('Unsupported'); };\n /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n Xtb.prototype.load = /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n function (content, url) {\n // xtb to xml nodes\n var /** @type {?} */ xtbParser = new XtbParser();\n var _a = xtbParser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;\n // xml nodes to i18n nodes\n var /** @type {?} */ i18nNodesByMsgId = {};\n var /** @type {?} */ converter = new XmlToI18n$2();\n // Because we should be able to load xtb files that rely on features not supported by angular,\n // we need to delay the conversion of html to i18n nodes so that non angular messages are not\n // converted\n Object.keys(msgIdToHtml).forEach(function (msgId) {\n var /** @type {?} */ valueFn = function () {\n var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, errors = _a.errors;\n if (errors.length) {\n throw new Error(\"xtb parse errors:\\n\" + errors.join('\\n'));\n }\n return i18nNodes;\n };\n createLazyProperty(i18nNodesByMsgId, msgId, valueFn);\n });\n if (errors.length) {\n throw new Error(\"xtb parse errors:\\n\" + errors.join('\\n'));\n }\n return { locale: /** @type {?} */ ((locale)), i18nNodesByMsgId: i18nNodesByMsgId };\n };\n /**\n * @param {?} message\n * @return {?}\n */\n Xtb.prototype.digest = /**\n * @param {?} message\n * @return {?}\n */\n function (message) { return digest$1(message); };\n /**\n * @param {?} message\n * @return {?}\n */\n Xtb.prototype.createNameMapper = /**\n * @param {?} message\n * @return {?}\n */\n function (message) {\n return new SimplePlaceholderMapper(message, toPublicName);\n };\n return Xtb;\n}(Serializer));\n/**\n * @param {?} messages\n * @param {?} id\n * @param {?} valueFn\n * @return {?}\n */\nfunction createLazyProperty(messages, id, valueFn) {\n Object.defineProperty(messages, id, {\n configurable: true,\n enumerable: true,\n get: function () {\n var /** @type {?} */ value = valueFn();\n Object.defineProperty(messages, id, { enumerable: true, value: value });\n return value;\n },\n set: function (_) { throw new Error('Could not overwrite an XTB translation'); },\n });\n}\nvar XtbParser = /** @class */ (function () {\n function XtbParser() {\n this._locale = null;\n }\n /**\n * @param {?} xtb\n * @param {?} url\n * @return {?}\n */\n XtbParser.prototype.parse = /**\n * @param {?} xtb\n * @param {?} url\n * @return {?}\n */\n function (xtb, url) {\n this._bundleDepth = 0;\n this._msgIdToHtml = {};\n // We can not parse the ICU messages at this point as some messages might not originate\n // from Angular that could not be lex'd.\n var /** @type {?} */ xml = new XmlParser().parse(xtb, url, false);\n this._errors = xml.errors;\n visitAll(this, xml.rootNodes);\n return {\n msgIdToHtml: this._msgIdToHtml,\n errors: this._errors,\n locale: this._locale,\n };\n };\n /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n XtbParser.prototype.visitElement = /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n function (element, context) {\n switch (element.name) {\n case _TRANSLATIONS_TAG:\n this._bundleDepth++;\n if (this._bundleDepth > 1) {\n this._addError(element, \"<\" + _TRANSLATIONS_TAG + \"> elements can not be nested\");\n }\n var /** @type {?} */ langAttr = element.attrs.find(function (attr) { return attr.name === 'lang'; });\n if (langAttr) {\n this._locale = langAttr.value;\n }\n visitAll(this, element.children, null);\n this._bundleDepth--;\n break;\n case _TRANSLATION_TAG:\n var /** @type {?} */ idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });\n if (!idAttr) {\n this._addError(element, \"<\" + _TRANSLATION_TAG + \"> misses the \\\"id\\\" attribute\");\n }\n else {\n var /** @type {?} */ id = idAttr.value;\n if (this._msgIdToHtml.hasOwnProperty(id)) {\n this._addError(element, \"Duplicated translations for msg \" + id);\n }\n else {\n var /** @type {?} */ innerTextStart = /** @type {?} */ ((element.startSourceSpan)).end.offset;\n var /** @type {?} */ innerTextEnd = /** @type {?} */ ((element.endSourceSpan)).start.offset;\n var /** @type {?} */ content = /** @type {?} */ ((element.startSourceSpan)).start.file.content;\n var /** @type {?} */ innerText = content.slice(/** @type {?} */ ((innerTextStart)), /** @type {?} */ ((innerTextEnd)));\n this._msgIdToHtml[id] = innerText;\n }\n }\n break;\n default:\n this._addError(element, 'Unexpected tag');\n }\n };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n XtbParser.prototype.visitAttribute = /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n function (attribute, context) { };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n XtbParser.prototype.visitText = /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n function (text, context) { };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n XtbParser.prototype.visitComment = /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n function (comment, context) { };\n /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n XtbParser.prototype.visitExpansion = /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n function (expansion, context) { };\n /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n XtbParser.prototype.visitExpansionCase = /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n function (expansionCase, context) { };\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n XtbParser.prototype._addError = /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n function (node, message) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n };\n return XtbParser;\n}());\nvar XmlToI18n$2 = /** @class */ (function () {\n function XmlToI18n() {\n }\n /**\n * @param {?} message\n * @param {?} url\n * @return {?}\n */\n XmlToI18n.prototype.convert = /**\n * @param {?} message\n * @param {?} url\n * @return {?}\n */\n function (message, url) {\n var /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);\n this._errors = xmlIcu.errors;\n var /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n [] :\n visitAll(this, xmlIcu.rootNodes);\n return {\n i18nNodes: i18nNodes,\n errors: this._errors,\n };\n };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitText = /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n function (text, context) { return new Text$1(text.value, /** @type {?} */ ((text.sourceSpan))); };\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitExpansion = /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n function (icu, context) {\n var /** @type {?} */ caseMap = {};\n visitAll(this, icu.cases).forEach(function (c) {\n caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);\n });\n return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n };\n /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitExpansionCase = /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n function (icuCase, context) {\n return {\n value: icuCase.value,\n nodes: visitAll(this, icuCase.expression),\n };\n };\n /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitElement = /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n function (el, context) {\n if (el.name === _PLACEHOLDER_TAG$3) {\n var /** @type {?} */ nameAttr = el.attrs.find(function (attr) { return attr.name === 'name'; });\n if (nameAttr) {\n return new Placeholder('', nameAttr.value, /** @type {?} */ ((el.sourceSpan)));\n }\n this._addError(el, \"<\" + _PLACEHOLDER_TAG$3 + \"> misses the \\\"name\\\" attribute\");\n }\n else {\n this._addError(el, \"Unexpected tag\");\n }\n return null;\n };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitComment = /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n function (comment, context) { };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitAttribute = /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n function (attribute, context) { };\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n XmlToI18n.prototype._addError = /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n function (node, message) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n };\n return XmlToI18n;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar HtmlParser = /** @class */ (function (_super) {\n __extends(HtmlParser, _super);\n function HtmlParser() {\n return _super.call(this, getHtmlTagDefinition) || this;\n }\n /**\n * @param {?} source\n * @param {?} url\n * @param {?=} parseExpansionForms\n * @param {?=} interpolationConfig\n * @return {?}\n */\n HtmlParser.prototype.parse = /**\n * @param {?} source\n * @param {?} url\n * @param {?=} parseExpansionForms\n * @param {?=} interpolationConfig\n * @return {?}\n */\n function (source, url, parseExpansionForms, interpolationConfig) {\n if (parseExpansionForms === void 0) { parseExpansionForms = false; }\n if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n return _super.prototype.parse.call(this, source, url, parseExpansionForms, interpolationConfig);\n };\n return HtmlParser;\n}(Parser$1));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A container for translated messages\n */\nvar TranslationBundle = /** @class */ (function () {\n function TranslationBundle(_i18nNodesByMsgId, locale, digest, mapperFactory, missingTranslationStrategy, console) {\n if (_i18nNodesByMsgId === void 0) { _i18nNodesByMsgId = {}; }\n if (missingTranslationStrategy === void 0) { missingTranslationStrategy = MissingTranslationStrategy.Warning; }\n this._i18nNodesByMsgId = _i18nNodesByMsgId;\n this.digest = digest;\n this.mapperFactory = mapperFactory;\n this._i18nToHtml = new I18nToHtmlVisitor(_i18nNodesByMsgId, locale, digest, /** @type {?} */ ((mapperFactory)), missingTranslationStrategy, console);\n }\n // Creates a `TranslationBundle` by parsing the given `content` with the `serializer`.\n /**\n * @param {?} content\n * @param {?} url\n * @param {?} serializer\n * @param {?} missingTranslationStrategy\n * @param {?=} console\n * @return {?}\n */\n TranslationBundle.load = /**\n * @param {?} content\n * @param {?} url\n * @param {?} serializer\n * @param {?} missingTranslationStrategy\n * @param {?=} console\n * @return {?}\n */\n function (content, url, serializer, missingTranslationStrategy, console) {\n var _a = serializer.load(content, url), locale = _a.locale, i18nNodesByMsgId = _a.i18nNodesByMsgId;\n var /** @type {?} */ digestFn = function (m) { return serializer.digest(m); };\n var /** @type {?} */ mapperFactory = function (m) { return ((serializer.createNameMapper(m))); };\n return new TranslationBundle(i18nNodesByMsgId, locale, digestFn, mapperFactory, missingTranslationStrategy, console);\n };\n // Returns the translation as HTML nodes from the given source message.\n /**\n * @param {?} srcMsg\n * @return {?}\n */\n TranslationBundle.prototype.get = /**\n * @param {?} srcMsg\n * @return {?}\n */\n function (srcMsg) {\n var /** @type {?} */ html = this._i18nToHtml.convert(srcMsg);\n if (html.errors.length) {\n throw new Error(html.errors.join('\\n'));\n }\n return html.nodes;\n };\n /**\n * @param {?} srcMsg\n * @return {?}\n */\n TranslationBundle.prototype.has = /**\n * @param {?} srcMsg\n * @return {?}\n */\n function (srcMsg) { return this.digest(srcMsg) in this._i18nNodesByMsgId; };\n return TranslationBundle;\n}());\nvar I18nToHtmlVisitor = /** @class */ (function () {\n function I18nToHtmlVisitor(_i18nNodesByMsgId, _locale, _digest, _mapperFactory, _missingTranslationStrategy, _console) {\n if (_i18nNodesByMsgId === void 0) { _i18nNodesByMsgId = {}; }\n this._i18nNodesByMsgId = _i18nNodesByMsgId;\n this._locale = _locale;\n this._digest = _digest;\n this._mapperFactory = _mapperFactory;\n this._missingTranslationStrategy = _missingTranslationStrategy;\n this._console = _console;\n this._contextStack = [];\n this._errors = [];\n }\n /**\n * @param {?} srcMsg\n * @return {?}\n */\n I18nToHtmlVisitor.prototype.convert = /**\n * @param {?} srcMsg\n * @return {?}\n */\n function (srcMsg) {\n this._contextStack.length = 0;\n this._errors.length = 0;\n // i18n to text\n var /** @type {?} */ text = this._convertToText(srcMsg);\n // text to html\n var /** @type {?} */ url = srcMsg.nodes[0].sourceSpan.start.file.url;\n var /** @type {?} */ html = new HtmlParser().parse(text, url, true);\n return {\n nodes: html.rootNodes,\n errors: this._errors.concat(html.errors),\n };\n };\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n I18nToHtmlVisitor.prototype.visitText = /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n function (text, context) { return text.value; };\n /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n I18nToHtmlVisitor.prototype.visitContainer = /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n function (container, context) {\n var _this = this;\n return container.children.map(function (n) { return n.visit(_this); }).join('');\n };\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n I18nToHtmlVisitor.prototype.visitIcu = /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n function (icu, context) {\n var _this = this;\n var /** @type {?} */ cases = Object.keys(icu.cases).map(function (k) { return k + \" {\" + icu.cases[k].visit(_this) + \"}\"; });\n // TODO(vicb): Once all format switch to using expression placeholders\n // we should throw when the placeholder is not in the source message\n var /** @type {?} */ exp = this._srcMsg.placeholders.hasOwnProperty(icu.expression) ?\n this._srcMsg.placeholders[icu.expression] :\n icu.expression;\n return \"{\" + exp + \", \" + icu.type + \", \" + cases.join(' ') + \"}\";\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n I18nToHtmlVisitor.prototype.visitPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) {\n var /** @type {?} */ phName = this._mapper(ph.name);\n if (this._srcMsg.placeholders.hasOwnProperty(phName)) {\n return this._srcMsg.placeholders[phName];\n }\n if (this._srcMsg.placeholderToMessage.hasOwnProperty(phName)) {\n return this._convertToText(this._srcMsg.placeholderToMessage[phName]);\n }\n this._addError(ph, \"Unknown placeholder \\\"\" + ph.name + \"\\\"\");\n return '';\n };\n // Loaded message contains only placeholders (vs tag and icu placeholders).\n // However when a translation can not be found, we need to serialize the source message\n // which can contain tag placeholders\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n I18nToHtmlVisitor.prototype.visitTagPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) {\n var _this = this;\n var /** @type {?} */ tag = \"\" + ph.tag;\n var /** @type {?} */ attrs = Object.keys(ph.attrs).map(function (name) { return name + \"=\\\"\" + ph.attrs[name] + \"\\\"\"; }).join(' ');\n if (ph.isVoid) {\n return \"<\" + tag + \" \" + attrs + \"/>\";\n }\n var /** @type {?} */ children = ph.children.map(function (c) { return c.visit(_this); }).join('');\n return \"<\" + tag + \" \" + attrs + \">\" + children + \"\" + tag + \">\";\n };\n // Loaded message contains only placeholders (vs tag and icu placeholders).\n // However when a translation can not be found, we need to serialize the source message\n // which can contain tag placeholders\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n I18nToHtmlVisitor.prototype.visitIcuPlaceholder = /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n function (ph, context) {\n // An ICU placeholder references the source message to be serialized\n return this._convertToText(this._srcMsg.placeholderToMessage[ph.name]);\n };\n /**\n * Convert a source message to a translated text string:\n * - text nodes are replaced with their translation,\n * - placeholders are replaced with their content,\n * - ICU nodes are converted to ICU expressions.\n * @param {?} srcMsg\n * @return {?}\n */\n I18nToHtmlVisitor.prototype._convertToText = /**\n * Convert a source message to a translated text string:\n * - text nodes are replaced with their translation,\n * - placeholders are replaced with their content,\n * - ICU nodes are converted to ICU expressions.\n * @param {?} srcMsg\n * @return {?}\n */\n function (srcMsg) {\n var _this = this;\n var /** @type {?} */ id = this._digest(srcMsg);\n var /** @type {?} */ mapper = this._mapperFactory ? this._mapperFactory(srcMsg) : null;\n var /** @type {?} */ nodes;\n this._contextStack.push({ msg: this._srcMsg, mapper: this._mapper });\n this._srcMsg = srcMsg;\n if (this._i18nNodesByMsgId.hasOwnProperty(id)) {\n // When there is a translation use its nodes as the source\n // And create a mapper to convert serialized placeholder names to internal names\n nodes = this._i18nNodesByMsgId[id];\n this._mapper = function (name) { return mapper ? /** @type {?} */ ((mapper.toInternalName(name))) : name; };\n }\n else {\n // When no translation has been found\n // - report an error / a warning / nothing,\n // - use the nodes from the original message\n // - placeholders are already internal and need no mapper\n if (this._missingTranslationStrategy === MissingTranslationStrategy.Error) {\n var /** @type {?} */ ctx = this._locale ? \" for locale \\\"\" + this._locale + \"\\\"\" : '';\n this._addError(srcMsg.nodes[0], \"Missing translation for message \\\"\" + id + \"\\\"\" + ctx);\n }\n else if (this._console &&\n this._missingTranslationStrategy === MissingTranslationStrategy.Warning) {\n var /** @type {?} */ ctx = this._locale ? \" for locale \\\"\" + this._locale + \"\\\"\" : '';\n this._console.warn(\"Missing translation for message \\\"\" + id + \"\\\"\" + ctx);\n }\n nodes = srcMsg.nodes;\n this._mapper = function (name) { return name; };\n }\n var /** @type {?} */ text = nodes.map(function (node) { return node.visit(_this); }).join('');\n var /** @type {?} */ context = /** @type {?} */ ((this._contextStack.pop()));\n this._srcMsg = context.msg;\n this._mapper = context.mapper;\n return text;\n };\n /**\n * @param {?} el\n * @param {?} msg\n * @return {?}\n */\n I18nToHtmlVisitor.prototype._addError = /**\n * @param {?} el\n * @param {?} msg\n * @return {?}\n */\n function (el, msg) {\n this._errors.push(new I18nError(el.sourceSpan, msg));\n };\n return I18nToHtmlVisitor;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar I18NHtmlParser = /** @class */ (function () {\n function I18NHtmlParser(_htmlParser, translations, translationsFormat, missingTranslation, console) {\n if (missingTranslation === void 0) { missingTranslation = MissingTranslationStrategy.Warning; }\n this._htmlParser = _htmlParser;\n if (translations) {\n var /** @type {?} */ serializer = createSerializer(translationsFormat);\n this._translationBundle =\n TranslationBundle.load(translations, 'i18n', serializer, missingTranslation, console);\n }\n else {\n this._translationBundle =\n new TranslationBundle({}, null, digest, undefined, missingTranslation, console);\n }\n }\n /**\n * @param {?} source\n * @param {?} url\n * @param {?=} parseExpansionForms\n * @param {?=} interpolationConfig\n * @return {?}\n */\n I18NHtmlParser.prototype.parse = /**\n * @param {?} source\n * @param {?} url\n * @param {?=} parseExpansionForms\n * @param {?=} interpolationConfig\n * @return {?}\n */\n function (source, url, parseExpansionForms, interpolationConfig) {\n if (parseExpansionForms === void 0) { parseExpansionForms = false; }\n if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n var /** @type {?} */ parseResult = this._htmlParser.parse(source, url, parseExpansionForms, interpolationConfig);\n if (parseResult.errors.length) {\n return new ParseTreeResult(parseResult.rootNodes, parseResult.errors);\n }\n return mergeTranslations(parseResult.rootNodes, this._translationBundle, interpolationConfig, [], {});\n };\n return I18NHtmlParser;\n}());\n/**\n * @param {?=} format\n * @return {?}\n */\nfunction createSerializer(format) {\n format = (format || 'xlf').toLowerCase();\n switch (format) {\n case 'xmb':\n return new Xmb();\n case 'xtb':\n return new Xtb();\n case 'xliff2':\n case 'xlf2':\n return new Xliff2();\n case 'xliff':\n case 'xlf':\n default:\n return new Xliff();\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar STRIP_SRC_FILE_SUFFIXES = /(\\.ts|\\.d\\.ts|\\.js|\\.jsx|\\.tsx)$/;\nvar GENERATED_FILE = /\\.ngfactory\\.|\\.ngsummary\\./;\nvar JIT_SUMMARY_FILE = /\\.ngsummary\\./;\nvar JIT_SUMMARY_NAME = /NgSummary$/;\n/**\n * @param {?} filePath\n * @param {?=} forceSourceFile\n * @return {?}\n */\nfunction ngfactoryFilePath(filePath, forceSourceFile) {\n if (forceSourceFile === void 0) { forceSourceFile = false; }\n var /** @type {?} */ urlWithSuffix = splitTypescriptSuffix(filePath, forceSourceFile);\n return urlWithSuffix[0] + \".ngfactory\" + normalizeGenFileSuffix(urlWithSuffix[1]);\n}\n/**\n * @param {?} filePath\n * @return {?}\n */\nfunction stripGeneratedFileSuffix(filePath) {\n return filePath.replace(GENERATED_FILE, '.');\n}\n/**\n * @param {?} filePath\n * @return {?}\n */\nfunction isGeneratedFile(filePath) {\n return GENERATED_FILE.test(filePath);\n}\n/**\n * @param {?} path\n * @param {?=} forceSourceFile\n * @return {?}\n */\nfunction splitTypescriptSuffix(path, forceSourceFile) {\n if (forceSourceFile === void 0) { forceSourceFile = false; }\n if (path.endsWith('.d.ts')) {\n return [path.slice(0, -5), forceSourceFile ? '.ts' : '.d.ts'];\n }\n var /** @type {?} */ lastDot = path.lastIndexOf('.');\n if (lastDot !== -1) {\n return [path.substring(0, lastDot), path.substring(lastDot)];\n }\n return [path, ''];\n}\n/**\n * @param {?} srcFileSuffix\n * @return {?}\n */\nfunction normalizeGenFileSuffix(srcFileSuffix) {\n return srcFileSuffix === '.tsx' ? '.ts' : srcFileSuffix;\n}\n/**\n * @param {?} fileName\n * @return {?}\n */\nfunction summaryFileName(fileName) {\n var /** @type {?} */ fileNameWithoutSuffix = fileName.replace(STRIP_SRC_FILE_SUFFIXES, '');\n return fileNameWithoutSuffix + \".ngsummary.json\";\n}\n/**\n * @param {?} fileName\n * @param {?=} forceSourceFile\n * @return {?}\n */\nfunction summaryForJitFileName(fileName, forceSourceFile) {\n if (forceSourceFile === void 0) { forceSourceFile = false; }\n var /** @type {?} */ urlWithSuffix = splitTypescriptSuffix(stripGeneratedFileSuffix(fileName), forceSourceFile);\n return urlWithSuffix[0] + \".ngsummary\" + urlWithSuffix[1];\n}\n/**\n * @param {?} filePath\n * @return {?}\n */\nfunction stripSummaryForJitFileSuffix(filePath) {\n return filePath.replace(JIT_SUMMARY_FILE, '.');\n}\n/**\n * @param {?} symbolName\n * @return {?}\n */\nfunction summaryForJitName(symbolName) {\n return symbolName + \"NgSummary\";\n}\n/**\n * @param {?} symbolName\n * @return {?}\n */\nfunction stripSummaryForJitNameSuffix(symbolName) {\n return symbolName.replace(JIT_SUMMARY_NAME, '');\n}\nvar LOWERED_SYMBOL = /\\u0275\\d+/;\n/**\n * @param {?} name\n * @return {?}\n */\nfunction isLoweredSymbol(name) {\n return LOWERED_SYMBOL.test(name);\n}\n/**\n * @param {?} id\n * @return {?}\n */\nfunction createLoweredSymbol(id) {\n return \"\\u0275\" + id;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar CORE = '@angular/core';\nvar Identifiers = /** @class */ (function () {\n function Identifiers() {\n }\n Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS = {\n name: 'ANALYZE_FOR_ENTRY_COMPONENTS',\n moduleName: CORE,\n };\n Identifiers.ElementRef = { name: 'ElementRef', moduleName: CORE };\n Identifiers.NgModuleRef = { name: 'NgModuleRef', moduleName: CORE };\n Identifiers.ViewContainerRef = { name: 'ViewContainerRef', moduleName: CORE };\n Identifiers.ChangeDetectorRef = {\n name: 'ChangeDetectorRef',\n moduleName: CORE,\n };\n Identifiers.QueryList = { name: 'QueryList', moduleName: CORE };\n Identifiers.TemplateRef = { name: 'TemplateRef', moduleName: CORE };\n Identifiers.CodegenComponentFactoryResolver = {\n name: 'ɵCodegenComponentFactoryResolver',\n moduleName: CORE,\n };\n Identifiers.ComponentFactoryResolver = {\n name: 'ComponentFactoryResolver',\n moduleName: CORE,\n };\n Identifiers.ComponentFactory = { name: 'ComponentFactory', moduleName: CORE };\n Identifiers.ComponentRef = { name: 'ComponentRef', moduleName: CORE };\n Identifiers.NgModuleFactory = { name: 'NgModuleFactory', moduleName: CORE };\n Identifiers.createModuleFactory = {\n name: 'ɵcmf',\n moduleName: CORE,\n };\n Identifiers.moduleDef = {\n name: 'ɵmod',\n moduleName: CORE,\n };\n Identifiers.moduleProviderDef = {\n name: 'ɵmpd',\n moduleName: CORE,\n };\n Identifiers.RegisterModuleFactoryFn = {\n name: 'ɵregisterModuleFactory',\n moduleName: CORE,\n };\n Identifiers.Injector = { name: 'Injector', moduleName: CORE };\n Identifiers.ViewEncapsulation = {\n name: 'ViewEncapsulation',\n moduleName: CORE,\n };\n Identifiers.ChangeDetectionStrategy = {\n name: 'ChangeDetectionStrategy',\n moduleName: CORE,\n };\n Identifiers.SecurityContext = {\n name: 'SecurityContext',\n moduleName: CORE,\n };\n Identifiers.LOCALE_ID = { name: 'LOCALE_ID', moduleName: CORE };\n Identifiers.TRANSLATIONS_FORMAT = {\n name: 'TRANSLATIONS_FORMAT',\n moduleName: CORE,\n };\n Identifiers.inlineInterpolate = {\n name: 'ɵinlineInterpolate',\n moduleName: CORE,\n };\n Identifiers.interpolate = { name: 'ɵinterpolate', moduleName: CORE };\n Identifiers.EMPTY_ARRAY = { name: 'ɵEMPTY_ARRAY', moduleName: CORE };\n Identifiers.EMPTY_MAP = { name: 'ɵEMPTY_MAP', moduleName: CORE };\n Identifiers.Renderer = { name: 'Renderer', moduleName: CORE };\n Identifiers.viewDef = { name: 'ɵvid', moduleName: CORE };\n Identifiers.elementDef = { name: 'ɵeld', moduleName: CORE };\n Identifiers.anchorDef = { name: 'ɵand', moduleName: CORE };\n Identifiers.textDef = { name: 'ɵted', moduleName: CORE };\n Identifiers.directiveDef = { name: 'ɵdid', moduleName: CORE };\n Identifiers.providerDef = { name: 'ɵprd', moduleName: CORE };\n Identifiers.queryDef = { name: 'ɵqud', moduleName: CORE };\n Identifiers.pureArrayDef = { name: 'ɵpad', moduleName: CORE };\n Identifiers.pureObjectDef = { name: 'ɵpod', moduleName: CORE };\n Identifiers.purePipeDef = { name: 'ɵppd', moduleName: CORE };\n Identifiers.pipeDef = { name: 'ɵpid', moduleName: CORE };\n Identifiers.nodeValue = { name: 'ɵnov', moduleName: CORE };\n Identifiers.ngContentDef = { name: 'ɵncd', moduleName: CORE };\n Identifiers.unwrapValue = { name: 'ɵunv', moduleName: CORE };\n Identifiers.createRendererType2 = { name: 'ɵcrt', moduleName: CORE };\n // type only\n Identifiers.RendererType2 = {\n name: 'RendererType2',\n moduleName: CORE,\n };\n // type only\n Identifiers.ViewDefinition = {\n name: 'ɵViewDefinition',\n moduleName: CORE,\n };\n Identifiers.createComponentFactory = { name: 'ɵccf', moduleName: CORE };\n return Identifiers;\n}());\n/**\n * @param {?} reference\n * @return {?}\n */\nfunction createTokenForReference(reference) {\n return { identifier: { reference: reference } };\n}\n/**\n * @param {?} reflector\n * @param {?} reference\n * @return {?}\n */\nfunction createTokenForExternalReference(reflector, reference) {\n return createTokenForReference(reflector.resolveExternalReference(reference));\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/** @enum {number} */\nvar LifecycleHooks = {\n OnInit: 0,\n OnDestroy: 1,\n DoCheck: 2,\n OnChanges: 3,\n AfterContentInit: 4,\n AfterContentChecked: 5,\n AfterViewInit: 6,\n AfterViewChecked: 7,\n};\nLifecycleHooks[LifecycleHooks.OnInit] = \"OnInit\";\nLifecycleHooks[LifecycleHooks.OnDestroy] = \"OnDestroy\";\nLifecycleHooks[LifecycleHooks.DoCheck] = \"DoCheck\";\nLifecycleHooks[LifecycleHooks.OnChanges] = \"OnChanges\";\nLifecycleHooks[LifecycleHooks.AfterContentInit] = \"AfterContentInit\";\nLifecycleHooks[LifecycleHooks.AfterContentChecked] = \"AfterContentChecked\";\nLifecycleHooks[LifecycleHooks.AfterViewInit] = \"AfterViewInit\";\nLifecycleHooks[LifecycleHooks.AfterViewChecked] = \"AfterViewChecked\";\nvar LIFECYCLE_HOOKS_VALUES = [\n LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges,\n LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit,\n LifecycleHooks.AfterViewChecked\n];\n/**\n * @param {?} reflector\n * @param {?} hook\n * @param {?} token\n * @return {?}\n */\nfunction hasLifecycleHook(reflector, hook, token) {\n return reflector.hasLifecycleHook(token, getHookName(hook));\n}\n/**\n * @param {?} reflector\n * @param {?} token\n * @return {?}\n */\nfunction getAllLifecycleHooks(reflector, token) {\n return LIFECYCLE_HOOKS_VALUES.filter(function (hook) { return hasLifecycleHook(reflector, hook, token); });\n}\n/**\n * @param {?} hook\n * @return {?}\n */\nfunction getHookName(hook) {\n switch (hook) {\n case LifecycleHooks.OnInit:\n return 'ngOnInit';\n case LifecycleHooks.OnDestroy:\n return 'ngOnDestroy';\n case LifecycleHooks.DoCheck:\n return 'ngDoCheck';\n case LifecycleHooks.OnChanges:\n return 'ngOnChanges';\n case LifecycleHooks.AfterContentInit:\n return 'ngAfterContentInit';\n case LifecycleHooks.AfterContentChecked:\n return 'ngAfterContentChecked';\n case LifecycleHooks.AfterViewInit:\n return 'ngAfterViewInit';\n case LifecycleHooks.AfterViewChecked:\n return 'ngAfterViewChecked';\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar _SELECTOR_REGEXP = new RegExp('(\\\\:not\\\\()|' + //\":not(\"\n '([-\\\\w]+)|' + // \"tag\"\n '(?:\\\\.([-\\\\w]+))|' + // \".class\"\n '(?:\\\\[([-.\\\\w*]+)(?:=([\\\"\\']?)([^\\\\]\\\"\\']*)\\\\5)?\\\\])|' + // \"[name]\", \"[name=value]\",\n '(\\\\))|' + // \")\"\n '(\\\\s*,\\\\s*)', // \",\"\n'g');\n/**\n * A css selector contains an element name,\n * css classes and attribute/value pairs with the purpose\n * of selecting subsets out of them.\n */\nvar CssSelector = /** @class */ (function () {\n function CssSelector() {\n this.element = null;\n this.classNames = [];\n this.attrs = [];\n this.notSelectors = [];\n }\n /**\n * @param {?} selector\n * @return {?}\n */\n CssSelector.parse = /**\n * @param {?} selector\n * @return {?}\n */\n function (selector) {\n var /** @type {?} */ results = [];\n var /** @type {?} */ _addResult = function (res, cssSel) {\n if (cssSel.notSelectors.length > 0 && !cssSel.element && cssSel.classNames.length == 0 &&\n cssSel.attrs.length == 0) {\n cssSel.element = '*';\n }\n res.push(cssSel);\n };\n var /** @type {?} */ cssSelector = new CssSelector();\n var /** @type {?} */ match;\n var /** @type {?} */ current = cssSelector;\n var /** @type {?} */ inNot = false;\n _SELECTOR_REGEXP.lastIndex = 0;\n while (match = _SELECTOR_REGEXP.exec(selector)) {\n if (match[1]) {\n if (inNot) {\n throw new Error('Nesting :not is not allowed in a selector');\n }\n inNot = true;\n current = new CssSelector();\n cssSelector.notSelectors.push(current);\n }\n if (match[2]) {\n current.setElement(match[2]);\n }\n if (match[3]) {\n current.addClassName(match[3]);\n }\n if (match[4]) {\n current.addAttribute(match[4], match[6]);\n }\n if (match[7]) {\n inNot = false;\n current = cssSelector;\n }\n if (match[8]) {\n if (inNot) {\n throw new Error('Multiple selectors in :not are not supported');\n }\n _addResult(results, cssSelector);\n cssSelector = current = new CssSelector();\n }\n }\n _addResult(results, cssSelector);\n return results;\n };\n /**\n * @return {?}\n */\n CssSelector.prototype.isElementSelector = /**\n * @return {?}\n */\n function () {\n return this.hasElementSelector() && this.classNames.length == 0 && this.attrs.length == 0 &&\n this.notSelectors.length === 0;\n };\n /**\n * @return {?}\n */\n CssSelector.prototype.hasElementSelector = /**\n * @return {?}\n */\n function () { return !!this.element; };\n /**\n * @param {?=} element\n * @return {?}\n */\n CssSelector.prototype.setElement = /**\n * @param {?=} element\n * @return {?}\n */\n function (element) {\n if (element === void 0) { element = null; }\n this.element = element;\n };\n /** Gets a template string for an element that matches the selector. */\n /**\n * Gets a template string for an element that matches the selector.\n * @return {?}\n */\n CssSelector.prototype.getMatchingElementTemplate = /**\n * Gets a template string for an element that matches the selector.\n * @return {?}\n */\n function () {\n var /** @type {?} */ tagName = this.element || 'div';\n var /** @type {?} */ classAttr = this.classNames.length > 0 ? \" class=\\\"\" + this.classNames.join(' ') + \"\\\"\" : '';\n var /** @type {?} */ attrs = '';\n for (var /** @type {?} */ i = 0; i < this.attrs.length; i += 2) {\n var /** @type {?} */ attrName = this.attrs[i];\n var /** @type {?} */ attrValue = this.attrs[i + 1] !== '' ? \"=\\\"\" + this.attrs[i + 1] + \"\\\"\" : '';\n attrs += \" \" + attrName + attrValue;\n }\n return getHtmlTagDefinition(tagName).isVoid ? \"<\" + tagName + classAttr + attrs + \"/>\" :\n \"<\" + tagName + classAttr + attrs + \">\" + tagName + \">\";\n };\n /**\n * @param {?} name\n * @param {?=} value\n * @return {?}\n */\n CssSelector.prototype.addAttribute = /**\n * @param {?} name\n * @param {?=} value\n * @return {?}\n */\n function (name, value) {\n if (value === void 0) { value = ''; }\n this.attrs.push(name, value && value.toLowerCase() || '');\n };\n /**\n * @param {?} name\n * @return {?}\n */\n CssSelector.prototype.addClassName = /**\n * @param {?} name\n * @return {?}\n */\n function (name) { this.classNames.push(name.toLowerCase()); };\n /**\n * @return {?}\n */\n CssSelector.prototype.toString = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ res = this.element || '';\n if (this.classNames) {\n this.classNames.forEach(function (klass) { return res += \".\" + klass; });\n }\n if (this.attrs) {\n for (var /** @type {?} */ i = 0; i < this.attrs.length; i += 2) {\n var /** @type {?} */ name_1 = this.attrs[i];\n var /** @type {?} */ value = this.attrs[i + 1];\n res += \"[\" + name_1 + (value ? '=' + value : '') + \"]\";\n }\n }\n this.notSelectors.forEach(function (notSelector) { return res += \":not(\" + notSelector + \")\"; });\n return res;\n };\n return CssSelector;\n}());\n/**\n * Reads a list of CssSelectors and allows to calculate which ones\n * are contained in a given CssSelector.\n */\nvar SelectorMatcher = /** @class */ (function () {\n function SelectorMatcher() {\n this._elementMap = new Map();\n this._elementPartialMap = new Map();\n this._classMap = new Map();\n this._classPartialMap = new Map();\n this._attrValueMap = new Map();\n this._attrValuePartialMap = new Map();\n this._listContexts = [];\n }\n /**\n * @param {?} notSelectors\n * @return {?}\n */\n SelectorMatcher.createNotMatcher = /**\n * @param {?} notSelectors\n * @return {?}\n */\n function (notSelectors) {\n var /** @type {?} */ notMatcher = new SelectorMatcher();\n notMatcher.addSelectables(notSelectors, null);\n return notMatcher;\n };\n /**\n * @param {?} cssSelectors\n * @param {?=} callbackCtxt\n * @return {?}\n */\n SelectorMatcher.prototype.addSelectables = /**\n * @param {?} cssSelectors\n * @param {?=} callbackCtxt\n * @return {?}\n */\n function (cssSelectors, callbackCtxt) {\n var /** @type {?} */ listContext = /** @type {?} */ ((null));\n if (cssSelectors.length > 1) {\n listContext = new SelectorListContext(cssSelectors);\n this._listContexts.push(listContext);\n }\n for (var /** @type {?} */ i = 0; i < cssSelectors.length; i++) {\n this._addSelectable(cssSelectors[i], callbackCtxt, listContext);\n }\n };\n /**\n * Add an object that can be found later on by calling `match`.\n * @param {?} cssSelector A css selector\n * @param {?} callbackCtxt An opaque object that will be given to the callback of the `match` function\n * @param {?} listContext\n * @return {?}\n */\n SelectorMatcher.prototype._addSelectable = /**\n * Add an object that can be found later on by calling `match`.\n * @param {?} cssSelector A css selector\n * @param {?} callbackCtxt An opaque object that will be given to the callback of the `match` function\n * @param {?} listContext\n * @return {?}\n */\n function (cssSelector, callbackCtxt, listContext) {\n var /** @type {?} */ matcher = this;\n var /** @type {?} */ element = cssSelector.element;\n var /** @type {?} */ classNames = cssSelector.classNames;\n var /** @type {?} */ attrs = cssSelector.attrs;\n var /** @type {?} */ selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n if (element) {\n var /** @type {?} */ isTerminal = attrs.length === 0 && classNames.length === 0;\n if (isTerminal) {\n this._addTerminal(matcher._elementMap, element, selectable);\n }\n else {\n matcher = this._addPartial(matcher._elementPartialMap, element);\n }\n }\n if (classNames) {\n for (var /** @type {?} */ i = 0; i < classNames.length; i++) {\n var /** @type {?} */ isTerminal = attrs.length === 0 && i === classNames.length - 1;\n var /** @type {?} */ className = classNames[i];\n if (isTerminal) {\n this._addTerminal(matcher._classMap, className, selectable);\n }\n else {\n matcher = this._addPartial(matcher._classPartialMap, className);\n }\n }\n }\n if (attrs) {\n for (var /** @type {?} */ i = 0; i < attrs.length; i += 2) {\n var /** @type {?} */ isTerminal = i === attrs.length - 2;\n var /** @type {?} */ name_2 = attrs[i];\n var /** @type {?} */ value = attrs[i + 1];\n if (isTerminal) {\n var /** @type {?} */ terminalMap = matcher._attrValueMap;\n var /** @type {?} */ terminalValuesMap = terminalMap.get(name_2);\n if (!terminalValuesMap) {\n terminalValuesMap = new Map();\n terminalMap.set(name_2, terminalValuesMap);\n }\n this._addTerminal(terminalValuesMap, value, selectable);\n }\n else {\n var /** @type {?} */ partialMap = matcher._attrValuePartialMap;\n var /** @type {?} */ partialValuesMap = partialMap.get(name_2);\n if (!partialValuesMap) {\n partialValuesMap = new Map();\n partialMap.set(name_2, partialValuesMap);\n }\n matcher = this._addPartial(partialValuesMap, value);\n }\n }\n }\n };\n /**\n * @param {?} map\n * @param {?} name\n * @param {?} selectable\n * @return {?}\n */\n SelectorMatcher.prototype._addTerminal = /**\n * @param {?} map\n * @param {?} name\n * @param {?} selectable\n * @return {?}\n */\n function (map, name, selectable) {\n var /** @type {?} */ terminalList = map.get(name);\n if (!terminalList) {\n terminalList = [];\n map.set(name, terminalList);\n }\n terminalList.push(selectable);\n };\n /**\n * @param {?} map\n * @param {?} name\n * @return {?}\n */\n SelectorMatcher.prototype._addPartial = /**\n * @param {?} map\n * @param {?} name\n * @return {?}\n */\n function (map, name) {\n var /** @type {?} */ matcher = map.get(name);\n if (!matcher) {\n matcher = new SelectorMatcher();\n map.set(name, matcher);\n }\n return matcher;\n };\n /**\n * Find the objects that have been added via `addSelectable`\n * whose css selector is contained in the given css selector.\n * @param cssSelector A css selector\n * @param matchedCallback This callback will be called with the object handed into `addSelectable`\n * @return boolean true if a match was found\n */\n /**\n * Find the objects that have been added via `addSelectable`\n * whose css selector is contained in the given css selector.\n * @param {?} cssSelector A css selector\n * @param {?} matchedCallback This callback will be called with the object handed into `addSelectable`\n * @return {?} boolean true if a match was found\n */\n SelectorMatcher.prototype.match = /**\n * Find the objects that have been added via `addSelectable`\n * whose css selector is contained in the given css selector.\n * @param {?} cssSelector A css selector\n * @param {?} matchedCallback This callback will be called with the object handed into `addSelectable`\n * @return {?} boolean true if a match was found\n */\n function (cssSelector, matchedCallback) {\n var /** @type {?} */ result = false;\n var /** @type {?} */ element = /** @type {?} */ ((cssSelector.element));\n var /** @type {?} */ classNames = cssSelector.classNames;\n var /** @type {?} */ attrs = cssSelector.attrs;\n for (var /** @type {?} */ i = 0; i < this._listContexts.length; i++) {\n this._listContexts[i].alreadyMatched = false;\n }\n result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result;\n result = this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) ||\n result;\n if (classNames) {\n for (var /** @type {?} */ i = 0; i < classNames.length; i++) {\n var /** @type {?} */ className = classNames[i];\n result =\n this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result;\n result =\n this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) ||\n result;\n }\n }\n if (attrs) {\n for (var /** @type {?} */ i = 0; i < attrs.length; i += 2) {\n var /** @type {?} */ name_3 = attrs[i];\n var /** @type {?} */ value = attrs[i + 1];\n var /** @type {?} */ terminalValuesMap = /** @type {?} */ ((this._attrValueMap.get(name_3)));\n if (value) {\n result =\n this._matchTerminal(terminalValuesMap, '', cssSelector, matchedCallback) || result;\n }\n result =\n this._matchTerminal(terminalValuesMap, value, cssSelector, matchedCallback) || result;\n var /** @type {?} */ partialValuesMap = /** @type {?} */ ((this._attrValuePartialMap.get(name_3)));\n if (value) {\n result = this._matchPartial(partialValuesMap, '', cssSelector, matchedCallback) || result;\n }\n result =\n this._matchPartial(partialValuesMap, value, cssSelector, matchedCallback) || result;\n }\n }\n return result;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} map\n * @param {?} name\n * @param {?} cssSelector\n * @param {?} matchedCallback\n * @return {?}\n */\n SelectorMatcher.prototype._matchTerminal = /**\n * \\@internal\n * @param {?} map\n * @param {?} name\n * @param {?} cssSelector\n * @param {?} matchedCallback\n * @return {?}\n */\n function (map, name, cssSelector, matchedCallback) {\n if (!map || typeof name !== 'string') {\n return false;\n }\n var /** @type {?} */ selectables = map.get(name) || [];\n var /** @type {?} */ starSelectables = /** @type {?} */ ((map.get('*')));\n if (starSelectables) {\n selectables = selectables.concat(starSelectables);\n }\n if (selectables.length === 0) {\n return false;\n }\n var /** @type {?} */ selectable;\n var /** @type {?} */ result = false;\n for (var /** @type {?} */ i = 0; i < selectables.length; i++) {\n selectable = selectables[i];\n result = selectable.finalize(cssSelector, matchedCallback) || result;\n }\n return result;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} map\n * @param {?} name\n * @param {?} cssSelector\n * @param {?} matchedCallback\n * @return {?}\n */\n SelectorMatcher.prototype._matchPartial = /**\n * \\@internal\n * @param {?} map\n * @param {?} name\n * @param {?} cssSelector\n * @param {?} matchedCallback\n * @return {?}\n */\n function (map, name, cssSelector, matchedCallback) {\n if (!map || typeof name !== 'string') {\n return false;\n }\n var /** @type {?} */ nestedSelector = map.get(name);\n if (!nestedSelector) {\n return false;\n }\n // TODO(perf): get rid of recursion and measure again\n // TODO(perf): don't pass the whole selector into the recursion,\n // but only the not processed parts\n return nestedSelector.match(cssSelector, matchedCallback);\n };\n return SelectorMatcher;\n}());\nvar SelectorListContext = /** @class */ (function () {\n function SelectorListContext(selectors) {\n this.selectors = selectors;\n this.alreadyMatched = false;\n }\n return SelectorListContext;\n}());\nvar SelectorContext = /** @class */ (function () {\n function SelectorContext(selector, cbContext, listContext) {\n this.selector = selector;\n this.cbContext = cbContext;\n this.listContext = listContext;\n this.notSelectors = selector.notSelectors;\n }\n /**\n * @param {?} cssSelector\n * @param {?} callback\n * @return {?}\n */\n SelectorContext.prototype.finalize = /**\n * @param {?} cssSelector\n * @param {?} callback\n * @return {?}\n */\n function (cssSelector, callback) {\n var /** @type {?} */ result = true;\n if (this.notSelectors.length > 0 && (!this.listContext || !this.listContext.alreadyMatched)) {\n var /** @type {?} */ notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors);\n result = !notMatcher.match(cssSelector, null);\n }\n if (result && callback && (!this.listContext || !this.listContext.alreadyMatched)) {\n if (this.listContext) {\n this.listContext.alreadyMatched = true;\n }\n callback(this.selector, this.cbContext);\n }\n return result;\n };\n return SelectorContext;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar ERROR_COMPONENT_TYPE = 'ngComponentType';\nvar CompileMetadataResolver = /** @class */ (function () {\n function CompileMetadataResolver(_config, _htmlParser, _ngModuleResolver, _directiveResolver, _pipeResolver, _summaryResolver, _schemaRegistry, _directiveNormalizer, _console, _staticSymbolCache, _reflector, _errorCollector) {\n this._config = _config;\n this._htmlParser = _htmlParser;\n this._ngModuleResolver = _ngModuleResolver;\n this._directiveResolver = _directiveResolver;\n this._pipeResolver = _pipeResolver;\n this._summaryResolver = _summaryResolver;\n this._schemaRegistry = _schemaRegistry;\n this._directiveNormalizer = _directiveNormalizer;\n this._console = _console;\n this._staticSymbolCache = _staticSymbolCache;\n this._reflector = _reflector;\n this._errorCollector = _errorCollector;\n this._nonNormalizedDirectiveCache = new Map();\n this._directiveCache = new Map();\n this._summaryCache = new Map();\n this._pipeCache = new Map();\n this._ngModuleCache = new Map();\n this._ngModuleOfTypes = new Map();\n }\n /**\n * @return {?}\n */\n CompileMetadataResolver.prototype.getReflector = /**\n * @return {?}\n */\n function () { return this._reflector; };\n /**\n * @param {?} type\n * @return {?}\n */\n CompileMetadataResolver.prototype.clearCacheFor = /**\n * @param {?} type\n * @return {?}\n */\n function (type) {\n var /** @type {?} */ dirMeta = this._directiveCache.get(type);\n this._directiveCache.delete(type);\n this._nonNormalizedDirectiveCache.delete(type);\n this._summaryCache.delete(type);\n this._pipeCache.delete(type);\n this._ngModuleOfTypes.delete(type);\n // Clear all of the NgModule as they contain transitive information!\n this._ngModuleCache.clear();\n if (dirMeta) {\n this._directiveNormalizer.clearCacheFor(dirMeta);\n }\n };\n /**\n * @return {?}\n */\n CompileMetadataResolver.prototype.clearCache = /**\n * @return {?}\n */\n function () {\n this._directiveCache.clear();\n this._nonNormalizedDirectiveCache.clear();\n this._summaryCache.clear();\n this._pipeCache.clear();\n this._ngModuleCache.clear();\n this._ngModuleOfTypes.clear();\n this._directiveNormalizer.clearCache();\n };\n /**\n * @param {?} baseType\n * @param {?} name\n * @return {?}\n */\n CompileMetadataResolver.prototype._createProxyClass = /**\n * @param {?} baseType\n * @param {?} name\n * @return {?}\n */\n function (baseType, name) {\n var /** @type {?} */ delegate = null;\n var /** @type {?} */ proxyClass = /** @type {?} */ (function () {\n if (!delegate) {\n throw new Error(\"Illegal state: Class \" + name + \" for type \" + stringify(baseType) + \" is not compiled yet!\");\n }\n return delegate.apply(this, arguments);\n });\n proxyClass.setDelegate = function (d) {\n delegate = d;\n (/** @type {?} */ (proxyClass)).prototype = d.prototype;\n };\n // Make stringify work correctly\n (/** @type {?} */ (proxyClass)).overriddenName = name;\n return proxyClass;\n };\n /**\n * @param {?} dirType\n * @param {?} name\n * @return {?}\n */\n CompileMetadataResolver.prototype.getGeneratedClass = /**\n * @param {?} dirType\n * @param {?} name\n * @return {?}\n */\n function (dirType, name) {\n if (dirType instanceof StaticSymbol) {\n return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), name);\n }\n else {\n return this._createProxyClass(dirType, name);\n }\n };\n /**\n * @param {?} dirType\n * @return {?}\n */\n CompileMetadataResolver.prototype.getComponentViewClass = /**\n * @param {?} dirType\n * @return {?}\n */\n function (dirType) {\n return this.getGeneratedClass(dirType, viewClassName(dirType, 0));\n };\n /**\n * @param {?} dirType\n * @return {?}\n */\n CompileMetadataResolver.prototype.getHostComponentViewClass = /**\n * @param {?} dirType\n * @return {?}\n */\n function (dirType) {\n return this.getGeneratedClass(dirType, hostViewClassName(dirType));\n };\n /**\n * @param {?} dirType\n * @return {?}\n */\n CompileMetadataResolver.prototype.getHostComponentType = /**\n * @param {?} dirType\n * @return {?}\n */\n function (dirType) {\n var /** @type {?} */ name = identifierName({ reference: dirType }) + \"_Host\";\n if (dirType instanceof StaticSymbol) {\n return this._staticSymbolCache.get(dirType.filePath, name);\n }\n else {\n var /** @type {?} */ HostClass = /** @type {?} */ (function HostClass() { });\n HostClass.overriddenName = name;\n return HostClass;\n }\n };\n /**\n * @param {?} dirType\n * @return {?}\n */\n CompileMetadataResolver.prototype.getRendererType = /**\n * @param {?} dirType\n * @return {?}\n */\n function (dirType) {\n if (dirType instanceof StaticSymbol) {\n return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), rendererTypeName(dirType));\n }\n else {\n // returning an object as proxy,\n // that we fill later during runtime compilation.\n return /** @type {?} */ ({});\n }\n };\n /**\n * @param {?} selector\n * @param {?} dirType\n * @param {?} inputs\n * @param {?} outputs\n * @return {?}\n */\n CompileMetadataResolver.prototype.getComponentFactory = /**\n * @param {?} selector\n * @param {?} dirType\n * @param {?} inputs\n * @param {?} outputs\n * @return {?}\n */\n function (selector, dirType, inputs, outputs) {\n if (dirType instanceof StaticSymbol) {\n return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), componentFactoryName(dirType));\n }\n else {\n var /** @type {?} */ hostView = this.getHostComponentViewClass(dirType);\n // Note: ngContentSelectors will be filled later once the template is\n // loaded.\n var /** @type {?} */ createComponentFactory = this._reflector.resolveExternalReference(Identifiers.createComponentFactory);\n return createComponentFactory(selector, dirType, /** @type {?} */ (hostView), inputs, outputs, []);\n }\n };\n /**\n * @param {?} factory\n * @param {?} ngContentSelectors\n * @return {?}\n */\n CompileMetadataResolver.prototype.initComponentFactory = /**\n * @param {?} factory\n * @param {?} ngContentSelectors\n * @return {?}\n */\n function (factory, ngContentSelectors) {\n if (!(factory instanceof StaticSymbol)) {\n (_a = (/** @type {?} */ (factory)).ngContentSelectors).push.apply(_a, ngContentSelectors);\n }\n var _a;\n };\n /**\n * @param {?} type\n * @param {?} kind\n * @return {?}\n */\n CompileMetadataResolver.prototype._loadSummary = /**\n * @param {?} type\n * @param {?} kind\n * @return {?}\n */\n function (type, kind) {\n var /** @type {?} */ typeSummary = this._summaryCache.get(type);\n if (!typeSummary) {\n var /** @type {?} */ summary = this._summaryResolver.resolveSummary(type);\n typeSummary = summary ? summary.type : null;\n this._summaryCache.set(type, typeSummary || null);\n }\n return typeSummary && typeSummary.summaryKind === kind ? typeSummary : null;\n };\n /**\n * @param {?} compMeta\n * @param {?=} hostViewType\n * @return {?}\n */\n CompileMetadataResolver.prototype.getHostComponentMetadata = /**\n * @param {?} compMeta\n * @param {?=} hostViewType\n * @return {?}\n */\n function (compMeta, hostViewType) {\n var /** @type {?} */ hostType = this.getHostComponentType(compMeta.type.reference);\n if (!hostViewType) {\n hostViewType = this.getHostComponentViewClass(hostType);\n }\n // Note: ! is ok here as this method should only be called with normalized directive\n // metadata, which always fills in the selector.\n var /** @type {?} */ template = CssSelector.parse(/** @type {?} */ ((compMeta.selector)))[0].getMatchingElementTemplate();\n var /** @type {?} */ templateUrl = '';\n var /** @type {?} */ htmlAst = this._htmlParser.parse(template, templateUrl);\n return CompileDirectiveMetadata.create({\n isHost: true,\n type: { reference: hostType, diDeps: [], lifecycleHooks: [] },\n template: new CompileTemplateMetadata({\n encapsulation: ViewEncapsulation.None,\n template: template,\n templateUrl: templateUrl,\n htmlAst: htmlAst,\n styles: [],\n styleUrls: [],\n ngContentSelectors: [],\n animations: [],\n isInline: true,\n externalStylesheets: [],\n interpolation: null,\n preserveWhitespaces: false,\n }),\n exportAs: null,\n changeDetection: ChangeDetectionStrategy.Default,\n inputs: [],\n outputs: [],\n host: {},\n isComponent: true,\n selector: '*',\n providers: [],\n viewProviders: [],\n queries: [],\n guards: {},\n viewQueries: [],\n componentViewType: hostViewType,\n rendererType: /** @type {?} */ ({ id: '__Host__', encapsulation: ViewEncapsulation.None, styles: [], data: {} }),\n entryComponents: [],\n componentFactory: null\n });\n };\n /**\n * @param {?} ngModuleType\n * @param {?} directiveType\n * @param {?} isSync\n * @return {?}\n */\n CompileMetadataResolver.prototype.loadDirectiveMetadata = /**\n * @param {?} ngModuleType\n * @param {?} directiveType\n * @param {?} isSync\n * @return {?}\n */\n function (ngModuleType, directiveType, isSync) {\n var _this = this;\n if (this._directiveCache.has(directiveType)) {\n return null;\n }\n directiveType = resolveForwardRef(directiveType);\n var _a = /** @type {?} */ ((this.getNonNormalizedDirectiveMetadata(directiveType))), annotation = _a.annotation, metadata = _a.metadata;\n var /** @type {?} */ createDirectiveMetadata = function (templateMetadata) {\n var /** @type {?} */ normalizedDirMeta = new CompileDirectiveMetadata({\n isHost: false,\n type: metadata.type,\n isComponent: metadata.isComponent,\n selector: metadata.selector,\n exportAs: metadata.exportAs,\n changeDetection: metadata.changeDetection,\n inputs: metadata.inputs,\n outputs: metadata.outputs,\n hostListeners: metadata.hostListeners,\n hostProperties: metadata.hostProperties,\n hostAttributes: metadata.hostAttributes,\n providers: metadata.providers,\n viewProviders: metadata.viewProviders,\n queries: metadata.queries,\n guards: metadata.guards,\n viewQueries: metadata.viewQueries,\n entryComponents: metadata.entryComponents,\n componentViewType: metadata.componentViewType,\n rendererType: metadata.rendererType,\n componentFactory: metadata.componentFactory,\n template: templateMetadata\n });\n if (templateMetadata) {\n _this.initComponentFactory(/** @type {?} */ ((metadata.componentFactory)), templateMetadata.ngContentSelectors);\n }\n _this._directiveCache.set(directiveType, normalizedDirMeta);\n _this._summaryCache.set(directiveType, normalizedDirMeta.toSummary());\n return null;\n };\n if (metadata.isComponent) {\n var /** @type {?} */ template = /** @type {?} */ ((metadata.template));\n var /** @type {?} */ templateMeta = this._directiveNormalizer.normalizeTemplate({\n ngModuleType: ngModuleType,\n componentType: directiveType,\n moduleUrl: this._reflector.componentModuleUrl(directiveType, annotation),\n encapsulation: template.encapsulation,\n template: template.template,\n templateUrl: template.templateUrl,\n styles: template.styles,\n styleUrls: template.styleUrls,\n animations: template.animations,\n interpolation: template.interpolation,\n preserveWhitespaces: template.preserveWhitespaces\n });\n if (isPromise(templateMeta) && isSync) {\n this._reportError(componentStillLoadingError(directiveType), directiveType);\n return null;\n }\n return SyncAsync.then(templateMeta, createDirectiveMetadata);\n }\n else {\n // directive\n createDirectiveMetadata(null);\n return null;\n }\n };\n /**\n * @param {?} directiveType\n * @return {?}\n */\n CompileMetadataResolver.prototype.getNonNormalizedDirectiveMetadata = /**\n * @param {?} directiveType\n * @return {?}\n */\n function (directiveType) {\n var _this = this;\n directiveType = resolveForwardRef(directiveType);\n if (!directiveType) {\n return null;\n }\n var /** @type {?} */ cacheEntry = this._nonNormalizedDirectiveCache.get(directiveType);\n if (cacheEntry) {\n return cacheEntry;\n }\n var /** @type {?} */ dirMeta = this._directiveResolver.resolve(directiveType, false);\n if (!dirMeta) {\n return null;\n }\n var /** @type {?} */ nonNormalizedTemplateMetadata = /** @type {?} */ ((undefined));\n if (createComponent.isTypeOf(dirMeta)) {\n // component\n var /** @type {?} */ compMeta = /** @type {?} */ (dirMeta);\n assertArrayOfStrings('styles', compMeta.styles);\n assertArrayOfStrings('styleUrls', compMeta.styleUrls);\n assertInterpolationSymbols('interpolation', compMeta.interpolation);\n var /** @type {?} */ animations = compMeta.animations;\n nonNormalizedTemplateMetadata = new CompileTemplateMetadata({\n encapsulation: noUndefined(compMeta.encapsulation),\n template: noUndefined(compMeta.template),\n templateUrl: noUndefined(compMeta.templateUrl),\n htmlAst: null,\n styles: compMeta.styles || [],\n styleUrls: compMeta.styleUrls || [],\n animations: animations || [],\n interpolation: noUndefined(compMeta.interpolation),\n isInline: !!compMeta.template,\n externalStylesheets: [],\n ngContentSelectors: [],\n preserveWhitespaces: noUndefined(dirMeta.preserveWhitespaces),\n });\n }\n var /** @type {?} */ changeDetectionStrategy = /** @type {?} */ ((null));\n var /** @type {?} */ viewProviders = [];\n var /** @type {?} */ entryComponentMetadata = [];\n var /** @type {?} */ selector = dirMeta.selector;\n if (createComponent.isTypeOf(dirMeta)) {\n // Component\n var /** @type {?} */ compMeta = /** @type {?} */ (dirMeta);\n changeDetectionStrategy = /** @type {?} */ ((compMeta.changeDetection));\n if (compMeta.viewProviders) {\n viewProviders = this._getProvidersMetadata(compMeta.viewProviders, entryComponentMetadata, \"viewProviders for \\\"\" + stringifyType(directiveType) + \"\\\"\", [], directiveType);\n }\n if (compMeta.entryComponents) {\n entryComponentMetadata = flattenAndDedupeArray(compMeta.entryComponents)\n .map(function (type) { return ((_this._getEntryComponentMetadata(type))); })\n .concat(entryComponentMetadata);\n }\n if (!selector) {\n selector = this._schemaRegistry.getDefaultComponentElementName();\n }\n }\n else {\n // Directive\n if (!selector) {\n this._reportError(syntaxError(\"Directive \" + stringifyType(directiveType) + \" has no selector, please add it!\"), directiveType);\n selector = 'error';\n }\n }\n var /** @type {?} */ providers = [];\n if (dirMeta.providers != null) {\n providers = this._getProvidersMetadata(dirMeta.providers, entryComponentMetadata, \"providers for \\\"\" + stringifyType(directiveType) + \"\\\"\", [], directiveType);\n }\n var /** @type {?} */ queries = [];\n var /** @type {?} */ viewQueries = [];\n if (dirMeta.queries != null) {\n queries = this._getQueriesMetadata(dirMeta.queries, false, directiveType);\n viewQueries = this._getQueriesMetadata(dirMeta.queries, true, directiveType);\n }\n var /** @type {?} */ metadata = CompileDirectiveMetadata.create({\n isHost: false,\n selector: selector,\n exportAs: noUndefined(dirMeta.exportAs),\n isComponent: !!nonNormalizedTemplateMetadata,\n type: this._getTypeMetadata(directiveType),\n template: nonNormalizedTemplateMetadata,\n changeDetection: changeDetectionStrategy,\n inputs: dirMeta.inputs || [],\n outputs: dirMeta.outputs || [],\n host: dirMeta.host || {},\n providers: providers || [],\n viewProviders: viewProviders || [],\n queries: queries || [],\n guards: dirMeta.guards || {},\n viewQueries: viewQueries || [],\n entryComponents: entryComponentMetadata,\n componentViewType: nonNormalizedTemplateMetadata ? this.getComponentViewClass(directiveType) :\n null,\n rendererType: nonNormalizedTemplateMetadata ? this.getRendererType(directiveType) : null,\n componentFactory: null\n });\n if (nonNormalizedTemplateMetadata) {\n metadata.componentFactory =\n this.getComponentFactory(selector, directiveType, metadata.inputs, metadata.outputs);\n }\n cacheEntry = { metadata: metadata, annotation: dirMeta };\n this._nonNormalizedDirectiveCache.set(directiveType, cacheEntry);\n return cacheEntry;\n };\n /**\n * Gets the metadata for the given directive.\n * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.\n */\n /**\n * Gets the metadata for the given directive.\n * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.\n * @param {?} directiveType\n * @return {?}\n */\n CompileMetadataResolver.prototype.getDirectiveMetadata = /**\n * Gets the metadata for the given directive.\n * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.\n * @param {?} directiveType\n * @return {?}\n */\n function (directiveType) {\n var /** @type {?} */ dirMeta = /** @type {?} */ ((this._directiveCache.get(directiveType)));\n if (!dirMeta) {\n this._reportError(syntaxError(\"Illegal state: getDirectiveMetadata can only be called after loadNgModuleDirectiveAndPipeMetadata for a module that declares it. Directive \" + stringifyType(directiveType) + \".\"), directiveType);\n }\n return dirMeta;\n };\n /**\n * @param {?} dirType\n * @return {?}\n */\n CompileMetadataResolver.prototype.getDirectiveSummary = /**\n * @param {?} dirType\n * @return {?}\n */\n function (dirType) {\n var /** @type {?} */ dirSummary = /** @type {?} */ (this._loadSummary(dirType, CompileSummaryKind.Directive));\n if (!dirSummary) {\n this._reportError(syntaxError(\"Illegal state: Could not load the summary for directive \" + stringifyType(dirType) + \".\"), dirType);\n }\n return dirSummary;\n };\n /**\n * @param {?} type\n * @return {?}\n */\n CompileMetadataResolver.prototype.isDirective = /**\n * @param {?} type\n * @return {?}\n */\n function (type) {\n return !!this._loadSummary(type, CompileSummaryKind.Directive) ||\n this._directiveResolver.isDirective(type);\n };\n /**\n * @param {?} type\n * @return {?}\n */\n CompileMetadataResolver.prototype.isPipe = /**\n * @param {?} type\n * @return {?}\n */\n function (type) {\n return !!this._loadSummary(type, CompileSummaryKind.Pipe) ||\n this._pipeResolver.isPipe(type);\n };\n /**\n * @param {?} type\n * @return {?}\n */\n CompileMetadataResolver.prototype.isNgModule = /**\n * @param {?} type\n * @return {?}\n */\n function (type) {\n return !!this._loadSummary(type, CompileSummaryKind.NgModule) ||\n this._ngModuleResolver.isNgModule(type);\n };\n /**\n * @param {?} moduleType\n * @param {?=} alreadyCollecting\n * @return {?}\n */\n CompileMetadataResolver.prototype.getNgModuleSummary = /**\n * @param {?} moduleType\n * @param {?=} alreadyCollecting\n * @return {?}\n */\n function (moduleType, alreadyCollecting) {\n if (alreadyCollecting === void 0) { alreadyCollecting = null; }\n var /** @type {?} */ moduleSummary = /** @type {?} */ (this._loadSummary(moduleType, CompileSummaryKind.NgModule));\n if (!moduleSummary) {\n var /** @type {?} */ moduleMeta = this.getNgModuleMetadata(moduleType, false, alreadyCollecting);\n moduleSummary = moduleMeta ? moduleMeta.toSummary() : null;\n if (moduleSummary) {\n this._summaryCache.set(moduleType, moduleSummary);\n }\n }\n return moduleSummary;\n };\n /**\n * Loads the declared directives and pipes of an NgModule.\n */\n /**\n * Loads the declared directives and pipes of an NgModule.\n * @param {?} moduleType\n * @param {?} isSync\n * @param {?=} throwIfNotFound\n * @return {?}\n */\n CompileMetadataResolver.prototype.loadNgModuleDirectiveAndPipeMetadata = /**\n * Loads the declared directives and pipes of an NgModule.\n * @param {?} moduleType\n * @param {?} isSync\n * @param {?=} throwIfNotFound\n * @return {?}\n */\n function (moduleType, isSync, throwIfNotFound) {\n var _this = this;\n if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n var /** @type {?} */ ngModule = this.getNgModuleMetadata(moduleType, throwIfNotFound);\n var /** @type {?} */ loading = [];\n if (ngModule) {\n ngModule.declaredDirectives.forEach(function (id) {\n var /** @type {?} */ promise = _this.loadDirectiveMetadata(moduleType, id.reference, isSync);\n if (promise) {\n loading.push(promise);\n }\n });\n ngModule.declaredPipes.forEach(function (id) { return _this._loadPipeMetadata(id.reference); });\n }\n return Promise.all(loading);\n };\n /**\n * @param {?} moduleType\n * @param {?=} throwIfNotFound\n * @param {?=} alreadyCollecting\n * @return {?}\n */\n CompileMetadataResolver.prototype.getNgModuleMetadata = /**\n * @param {?} moduleType\n * @param {?=} throwIfNotFound\n * @param {?=} alreadyCollecting\n * @return {?}\n */\n function (moduleType, throwIfNotFound, alreadyCollecting) {\n var _this = this;\n if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n if (alreadyCollecting === void 0) { alreadyCollecting = null; }\n moduleType = resolveForwardRef(moduleType);\n var /** @type {?} */ compileMeta = this._ngModuleCache.get(moduleType);\n if (compileMeta) {\n return compileMeta;\n }\n var /** @type {?} */ meta = this._ngModuleResolver.resolve(moduleType, throwIfNotFound);\n if (!meta) {\n return null;\n }\n var /** @type {?} */ declaredDirectives = [];\n var /** @type {?} */ exportedNonModuleIdentifiers = [];\n var /** @type {?} */ declaredPipes = [];\n var /** @type {?} */ importedModules = [];\n var /** @type {?} */ exportedModules = [];\n var /** @type {?} */ providers = [];\n var /** @type {?} */ entryComponents = [];\n var /** @type {?} */ bootstrapComponents = [];\n var /** @type {?} */ schemas = [];\n if (meta.imports) {\n flattenAndDedupeArray(meta.imports).forEach(function (importedType) {\n var /** @type {?} */ importedModuleType = /** @type {?} */ ((undefined));\n if (isValidType(importedType)) {\n importedModuleType = importedType;\n }\n else if (importedType && importedType.ngModule) {\n var /** @type {?} */ moduleWithProviders = importedType;\n importedModuleType = moduleWithProviders.ngModule;\n if (moduleWithProviders.providers) {\n providers.push.apply(providers, _this._getProvidersMetadata(moduleWithProviders.providers, entryComponents, \"provider for the NgModule '\" + stringifyType(importedModuleType) + \"'\", [], importedType));\n }\n }\n if (importedModuleType) {\n if (_this._checkSelfImport(moduleType, importedModuleType))\n return;\n if (!alreadyCollecting)\n alreadyCollecting = new Set();\n if (alreadyCollecting.has(importedModuleType)) {\n _this._reportError(syntaxError(_this._getTypeDescriptor(importedModuleType) + \" '\" + stringifyType(importedType) + \"' is imported recursively by the module '\" + stringifyType(moduleType) + \"'.\"), moduleType);\n return;\n }\n alreadyCollecting.add(importedModuleType);\n var /** @type {?} */ importedModuleSummary = _this.getNgModuleSummary(importedModuleType, alreadyCollecting);\n alreadyCollecting.delete(importedModuleType);\n if (!importedModuleSummary) {\n _this._reportError(syntaxError(\"Unexpected \" + _this._getTypeDescriptor(importedType) + \" '\" + stringifyType(importedType) + \"' imported by the module '\" + stringifyType(moduleType) + \"'. Please add a @NgModule annotation.\"), moduleType);\n return;\n }\n importedModules.push(importedModuleSummary);\n }\n else {\n _this._reportError(syntaxError(\"Unexpected value '\" + stringifyType(importedType) + \"' imported by the module '\" + stringifyType(moduleType) + \"'\"), moduleType);\n return;\n }\n });\n }\n if (meta.exports) {\n flattenAndDedupeArray(meta.exports).forEach(function (exportedType) {\n if (!isValidType(exportedType)) {\n _this._reportError(syntaxError(\"Unexpected value '\" + stringifyType(exportedType) + \"' exported by the module '\" + stringifyType(moduleType) + \"'\"), moduleType);\n return;\n }\n if (!alreadyCollecting)\n alreadyCollecting = new Set();\n if (alreadyCollecting.has(exportedType)) {\n _this._reportError(syntaxError(_this._getTypeDescriptor(exportedType) + \" '\" + stringify(exportedType) + \"' is exported recursively by the module '\" + stringifyType(moduleType) + \"'\"), moduleType);\n return;\n }\n alreadyCollecting.add(exportedType);\n var /** @type {?} */ exportedModuleSummary = _this.getNgModuleSummary(exportedType, alreadyCollecting);\n alreadyCollecting.delete(exportedType);\n if (exportedModuleSummary) {\n exportedModules.push(exportedModuleSummary);\n }\n else {\n exportedNonModuleIdentifiers.push(_this._getIdentifierMetadata(exportedType));\n }\n });\n }\n // Note: This will be modified later, so we rely on\n // getting a new instance every time!\n var /** @type {?} */ transitiveModule = this._getTransitiveNgModuleMetadata(importedModules, exportedModules);\n if (meta.declarations) {\n flattenAndDedupeArray(meta.declarations).forEach(function (declaredType) {\n if (!isValidType(declaredType)) {\n _this._reportError(syntaxError(\"Unexpected value '\" + stringifyType(declaredType) + \"' declared by the module '\" + stringifyType(moduleType) + \"'\"), moduleType);\n return;\n }\n var /** @type {?} */ declaredIdentifier = _this._getIdentifierMetadata(declaredType);\n if (_this.isDirective(declaredType)) {\n transitiveModule.addDirective(declaredIdentifier);\n declaredDirectives.push(declaredIdentifier);\n _this._addTypeToModule(declaredType, moduleType);\n }\n else if (_this.isPipe(declaredType)) {\n transitiveModule.addPipe(declaredIdentifier);\n transitiveModule.pipes.push(declaredIdentifier);\n declaredPipes.push(declaredIdentifier);\n _this._addTypeToModule(declaredType, moduleType);\n }\n else {\n _this._reportError(syntaxError(\"Unexpected \" + _this._getTypeDescriptor(declaredType) + \" '\" + stringifyType(declaredType) + \"' declared by the module '\" + stringifyType(moduleType) + \"'. Please add a @Pipe/@Directive/@Component annotation.\"), moduleType);\n return;\n }\n });\n }\n var /** @type {?} */ exportedDirectives = [];\n var /** @type {?} */ exportedPipes = [];\n exportedNonModuleIdentifiers.forEach(function (exportedId) {\n if (transitiveModule.directivesSet.has(exportedId.reference)) {\n exportedDirectives.push(exportedId);\n transitiveModule.addExportedDirective(exportedId);\n }\n else if (transitiveModule.pipesSet.has(exportedId.reference)) {\n exportedPipes.push(exportedId);\n transitiveModule.addExportedPipe(exportedId);\n }\n else {\n _this._reportError(syntaxError(\"Can't export \" + _this._getTypeDescriptor(exportedId.reference) + \" \" + stringifyType(exportedId.reference) + \" from \" + stringifyType(moduleType) + \" as it was neither declared nor imported!\"), moduleType);\n return;\n }\n });\n // The providers of the module have to go last\n // so that they overwrite any other provider we already added.\n if (meta.providers) {\n providers.push.apply(providers, this._getProvidersMetadata(meta.providers, entryComponents, \"provider for the NgModule '\" + stringifyType(moduleType) + \"'\", [], moduleType));\n }\n if (meta.entryComponents) {\n entryComponents.push.apply(entryComponents, flattenAndDedupeArray(meta.entryComponents)\n .map(function (type) { return ((_this._getEntryComponentMetadata(type))); }));\n }\n if (meta.bootstrap) {\n flattenAndDedupeArray(meta.bootstrap).forEach(function (type) {\n if (!isValidType(type)) {\n _this._reportError(syntaxError(\"Unexpected value '\" + stringifyType(type) + \"' used in the bootstrap property of module '\" + stringifyType(moduleType) + \"'\"), moduleType);\n return;\n }\n bootstrapComponents.push(_this._getIdentifierMetadata(type));\n });\n }\n entryComponents.push.apply(entryComponents, bootstrapComponents.map(function (type) { return ((_this._getEntryComponentMetadata(type.reference))); }));\n if (meta.schemas) {\n schemas.push.apply(schemas, flattenAndDedupeArray(meta.schemas));\n }\n compileMeta = new CompileNgModuleMetadata({\n type: this._getTypeMetadata(moduleType),\n providers: providers,\n entryComponents: entryComponents,\n bootstrapComponents: bootstrapComponents,\n schemas: schemas,\n declaredDirectives: declaredDirectives,\n exportedDirectives: exportedDirectives,\n declaredPipes: declaredPipes,\n exportedPipes: exportedPipes,\n importedModules: importedModules,\n exportedModules: exportedModules,\n transitiveModule: transitiveModule,\n id: meta.id || null,\n });\n entryComponents.forEach(function (id) { return transitiveModule.addEntryComponent(id); });\n providers.forEach(function (provider) { return transitiveModule.addProvider(provider, /** @type {?} */ ((compileMeta)).type); });\n transitiveModule.addModule(compileMeta.type);\n this._ngModuleCache.set(moduleType, compileMeta);\n return compileMeta;\n };\n /**\n * @param {?} moduleType\n * @param {?} importedModuleType\n * @return {?}\n */\n CompileMetadataResolver.prototype._checkSelfImport = /**\n * @param {?} moduleType\n * @param {?} importedModuleType\n * @return {?}\n */\n function (moduleType, importedModuleType) {\n if (moduleType === importedModuleType) {\n this._reportError(syntaxError(\"'\" + stringifyType(moduleType) + \"' module can't import itself\"), moduleType);\n return true;\n }\n return false;\n };\n /**\n * @param {?} type\n * @return {?}\n */\n CompileMetadataResolver.prototype._getTypeDescriptor = /**\n * @param {?} type\n * @return {?}\n */\n function (type) {\n if (isValidType(type)) {\n if (this.isDirective(type)) {\n return 'directive';\n }\n if (this.isPipe(type)) {\n return 'pipe';\n }\n if (this.isNgModule(type)) {\n return 'module';\n }\n }\n if ((/** @type {?} */ (type)).provide) {\n return 'provider';\n }\n return 'value';\n };\n /**\n * @param {?} type\n * @param {?} moduleType\n * @return {?}\n */\n CompileMetadataResolver.prototype._addTypeToModule = /**\n * @param {?} type\n * @param {?} moduleType\n * @return {?}\n */\n function (type, moduleType) {\n var /** @type {?} */ oldModule = this._ngModuleOfTypes.get(type);\n if (oldModule && oldModule !== moduleType) {\n this._reportError(syntaxError(\"Type \" + stringifyType(type) + \" is part of the declarations of 2 modules: \" + stringifyType(oldModule) + \" and \" + stringifyType(moduleType) + \"! \" +\n (\"Please consider moving \" + stringifyType(type) + \" to a higher module that imports \" + stringifyType(oldModule) + \" and \" + stringifyType(moduleType) + \". \") +\n (\"You can also create a new NgModule that exports and includes \" + stringifyType(type) + \" then import that NgModule in \" + stringifyType(oldModule) + \" and \" + stringifyType(moduleType) + \".\")), moduleType);\n return;\n }\n this._ngModuleOfTypes.set(type, moduleType);\n };\n /**\n * @param {?} importedModules\n * @param {?} exportedModules\n * @return {?}\n */\n CompileMetadataResolver.prototype._getTransitiveNgModuleMetadata = /**\n * @param {?} importedModules\n * @param {?} exportedModules\n * @return {?}\n */\n function (importedModules, exportedModules) {\n // collect `providers` / `entryComponents` from all imported and all exported modules\n var /** @type {?} */ result = new TransitiveCompileNgModuleMetadata();\n var /** @type {?} */ modulesByToken = new Map();\n importedModules.concat(exportedModules).forEach(function (modSummary) {\n modSummary.modules.forEach(function (mod) { return result.addModule(mod); });\n modSummary.entryComponents.forEach(function (comp) { return result.addEntryComponent(comp); });\n var /** @type {?} */ addedTokens = new Set();\n modSummary.providers.forEach(function (entry) {\n var /** @type {?} */ tokenRef = tokenReference(entry.provider.token);\n var /** @type {?} */ prevModules = modulesByToken.get(tokenRef);\n if (!prevModules) {\n prevModules = new Set();\n modulesByToken.set(tokenRef, prevModules);\n }\n var /** @type {?} */ moduleRef = entry.module.reference;\n // Note: the providers of one module may still contain multiple providers\n // per token (e.g. for multi providers), and we need to preserve these.\n if (addedTokens.has(tokenRef) || !prevModules.has(moduleRef)) {\n prevModules.add(moduleRef);\n addedTokens.add(tokenRef);\n result.addProvider(entry.provider, entry.module);\n }\n });\n });\n exportedModules.forEach(function (modSummary) {\n modSummary.exportedDirectives.forEach(function (id) { return result.addExportedDirective(id); });\n modSummary.exportedPipes.forEach(function (id) { return result.addExportedPipe(id); });\n });\n importedModules.forEach(function (modSummary) {\n modSummary.exportedDirectives.forEach(function (id) { return result.addDirective(id); });\n modSummary.exportedPipes.forEach(function (id) { return result.addPipe(id); });\n });\n return result;\n };\n /**\n * @param {?} type\n * @return {?}\n */\n CompileMetadataResolver.prototype._getIdentifierMetadata = /**\n * @param {?} type\n * @return {?}\n */\n function (type) {\n type = resolveForwardRef(type);\n return { reference: type };\n };\n /**\n * @param {?} type\n * @return {?}\n */\n CompileMetadataResolver.prototype.isInjectable = /**\n * @param {?} type\n * @return {?}\n */\n function (type) {\n var /** @type {?} */ annotations = this._reflector.annotations(type);\n return annotations.some(function (ann) { return createInjectable.isTypeOf(ann); });\n };\n /**\n * @param {?} type\n * @return {?}\n */\n CompileMetadataResolver.prototype.getInjectableSummary = /**\n * @param {?} type\n * @return {?}\n */\n function (type) {\n return {\n summaryKind: CompileSummaryKind.Injectable,\n type: this._getTypeMetadata(type, null, false)\n };\n };\n /**\n * @param {?} type\n * @param {?=} dependencies\n * @return {?}\n */\n CompileMetadataResolver.prototype._getInjectableMetadata = /**\n * @param {?} type\n * @param {?=} dependencies\n * @return {?}\n */\n function (type, dependencies) {\n if (dependencies === void 0) { dependencies = null; }\n var /** @type {?} */ typeSummary = this._loadSummary(type, CompileSummaryKind.Injectable);\n if (typeSummary) {\n return typeSummary.type;\n }\n return this._getTypeMetadata(type, dependencies);\n };\n /**\n * @param {?} type\n * @param {?=} dependencies\n * @param {?=} throwOnUnknownDeps\n * @return {?}\n */\n CompileMetadataResolver.prototype._getTypeMetadata = /**\n * @param {?} type\n * @param {?=} dependencies\n * @param {?=} throwOnUnknownDeps\n * @return {?}\n */\n function (type, dependencies, throwOnUnknownDeps) {\n if (dependencies === void 0) { dependencies = null; }\n if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }\n var /** @type {?} */ identifier = this._getIdentifierMetadata(type);\n return {\n reference: identifier.reference,\n diDeps: this._getDependenciesMetadata(identifier.reference, dependencies, throwOnUnknownDeps),\n lifecycleHooks: getAllLifecycleHooks(this._reflector, identifier.reference),\n };\n };\n /**\n * @param {?} factory\n * @param {?=} dependencies\n * @return {?}\n */\n CompileMetadataResolver.prototype._getFactoryMetadata = /**\n * @param {?} factory\n * @param {?=} dependencies\n * @return {?}\n */\n function (factory, dependencies) {\n if (dependencies === void 0) { dependencies = null; }\n factory = resolveForwardRef(factory);\n return { reference: factory, diDeps: this._getDependenciesMetadata(factory, dependencies) };\n };\n /**\n * Gets the metadata for the given pipe.\n * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.\n */\n /**\n * Gets the metadata for the given pipe.\n * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.\n * @param {?} pipeType\n * @return {?}\n */\n CompileMetadataResolver.prototype.getPipeMetadata = /**\n * Gets the metadata for the given pipe.\n * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.\n * @param {?} pipeType\n * @return {?}\n */\n function (pipeType) {\n var /** @type {?} */ pipeMeta = this._pipeCache.get(pipeType);\n if (!pipeMeta) {\n this._reportError(syntaxError(\"Illegal state: getPipeMetadata can only be called after loadNgModuleDirectiveAndPipeMetadata for a module that declares it. Pipe \" + stringifyType(pipeType) + \".\"), pipeType);\n }\n return pipeMeta || null;\n };\n /**\n * @param {?} pipeType\n * @return {?}\n */\n CompileMetadataResolver.prototype.getPipeSummary = /**\n * @param {?} pipeType\n * @return {?}\n */\n function (pipeType) {\n var /** @type {?} */ pipeSummary = /** @type {?} */ (this._loadSummary(pipeType, CompileSummaryKind.Pipe));\n if (!pipeSummary) {\n this._reportError(syntaxError(\"Illegal state: Could not load the summary for pipe \" + stringifyType(pipeType) + \".\"), pipeType);\n }\n return pipeSummary;\n };\n /**\n * @param {?} pipeType\n * @return {?}\n */\n CompileMetadataResolver.prototype.getOrLoadPipeMetadata = /**\n * @param {?} pipeType\n * @return {?}\n */\n function (pipeType) {\n var /** @type {?} */ pipeMeta = this._pipeCache.get(pipeType);\n if (!pipeMeta) {\n pipeMeta = this._loadPipeMetadata(pipeType);\n }\n return pipeMeta;\n };\n /**\n * @param {?} pipeType\n * @return {?}\n */\n CompileMetadataResolver.prototype._loadPipeMetadata = /**\n * @param {?} pipeType\n * @return {?}\n */\n function (pipeType) {\n pipeType = resolveForwardRef(pipeType);\n var /** @type {?} */ pipeAnnotation = /** @type {?} */ ((this._pipeResolver.resolve(pipeType)));\n var /** @type {?} */ pipeMeta = new CompilePipeMetadata({\n type: this._getTypeMetadata(pipeType),\n name: pipeAnnotation.name,\n pure: !!pipeAnnotation.pure\n });\n this._pipeCache.set(pipeType, pipeMeta);\n this._summaryCache.set(pipeType, pipeMeta.toSummary());\n return pipeMeta;\n };\n /**\n * @param {?} typeOrFunc\n * @param {?} dependencies\n * @param {?=} throwOnUnknownDeps\n * @return {?}\n */\n CompileMetadataResolver.prototype._getDependenciesMetadata = /**\n * @param {?} typeOrFunc\n * @param {?} dependencies\n * @param {?=} throwOnUnknownDeps\n * @return {?}\n */\n function (typeOrFunc, dependencies, throwOnUnknownDeps) {\n var _this = this;\n if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }\n var /** @type {?} */ hasUnknownDeps = false;\n var /** @type {?} */ params = dependencies || this._reflector.parameters(typeOrFunc) || [];\n var /** @type {?} */ dependenciesMetadata = params.map(function (param) {\n var /** @type {?} */ isAttribute = false;\n var /** @type {?} */ isHost = false;\n var /** @type {?} */ isSelf = false;\n var /** @type {?} */ isSkipSelf = false;\n var /** @type {?} */ isOptional = false;\n var /** @type {?} */ token = null;\n if (Array.isArray(param)) {\n param.forEach(function (paramEntry) {\n if (createHost.isTypeOf(paramEntry)) {\n isHost = true;\n }\n else if (createSelf.isTypeOf(paramEntry)) {\n isSelf = true;\n }\n else if (createSkipSelf.isTypeOf(paramEntry)) {\n isSkipSelf = true;\n }\n else if (createOptional.isTypeOf(paramEntry)) {\n isOptional = true;\n }\n else if (createAttribute.isTypeOf(paramEntry)) {\n isAttribute = true;\n token = paramEntry.attributeName;\n }\n else if (createInject.isTypeOf(paramEntry)) {\n token = paramEntry.token;\n }\n else if (createInjectionToken.isTypeOf(paramEntry) || paramEntry instanceof StaticSymbol) {\n token = paramEntry;\n }\n else if (isValidType(paramEntry) && token == null) {\n token = paramEntry;\n }\n });\n }\n else {\n token = param;\n }\n if (token == null) {\n hasUnknownDeps = true;\n return /** @type {?} */ ((null));\n }\n return {\n isAttribute: isAttribute,\n isHost: isHost,\n isSelf: isSelf,\n isSkipSelf: isSkipSelf,\n isOptional: isOptional,\n token: _this._getTokenMetadata(token)\n };\n });\n if (hasUnknownDeps) {\n var /** @type {?} */ depsTokens = dependenciesMetadata.map(function (dep) { return dep ? stringifyType(dep.token) : '?'; }).join(', ');\n var /** @type {?} */ message = \"Can't resolve all parameters for \" + stringifyType(typeOrFunc) + \": (\" + depsTokens + \").\";\n if (throwOnUnknownDeps || this._config.strictInjectionParameters) {\n this._reportError(syntaxError(message), typeOrFunc);\n }\n else {\n this._console.warn(\"Warning: \" + message + \" This will become an error in Angular v6.x\");\n }\n }\n return dependenciesMetadata;\n };\n /**\n * @param {?} token\n * @return {?}\n */\n CompileMetadataResolver.prototype._getTokenMetadata = /**\n * @param {?} token\n * @return {?}\n */\n function (token) {\n token = resolveForwardRef(token);\n var /** @type {?} */ compileToken;\n if (typeof token === 'string') {\n compileToken = { value: token };\n }\n else {\n compileToken = { identifier: { reference: token } };\n }\n return compileToken;\n };\n /**\n * @param {?} providers\n * @param {?} targetEntryComponents\n * @param {?=} debugInfo\n * @param {?=} compileProviders\n * @param {?=} type\n * @return {?}\n */\n CompileMetadataResolver.prototype._getProvidersMetadata = /**\n * @param {?} providers\n * @param {?} targetEntryComponents\n * @param {?=} debugInfo\n * @param {?=} compileProviders\n * @param {?=} type\n * @return {?}\n */\n function (providers, targetEntryComponents, debugInfo, compileProviders, type) {\n var _this = this;\n if (compileProviders === void 0) { compileProviders = []; }\n providers.forEach(function (provider, providerIdx) {\n if (Array.isArray(provider)) {\n _this._getProvidersMetadata(provider, targetEntryComponents, debugInfo, compileProviders);\n }\n else {\n provider = resolveForwardRef(provider);\n var /** @type {?} */ providerMeta = /** @type {?} */ ((undefined));\n if (provider && typeof provider === 'object' && provider.hasOwnProperty('provide')) {\n _this._validateProvider(provider);\n providerMeta = new ProviderMeta(provider.provide, provider);\n }\n else if (isValidType(provider)) {\n providerMeta = new ProviderMeta(provider, { useClass: provider });\n }\n else if (provider === void 0) {\n _this._reportError(syntaxError(\"Encountered undefined provider! Usually this means you have a circular dependencies (might be caused by using 'barrel' index.ts files.\"));\n return;\n }\n else {\n var /** @type {?} */ providersInfo = (/** @type {?} */ (providers.reduce(function (soFar, seenProvider, seenProviderIdx) {\n if (seenProviderIdx < providerIdx) {\n soFar.push(\"\" + stringifyType(seenProvider));\n }\n else if (seenProviderIdx == providerIdx) {\n soFar.push(\"?\" + stringifyType(seenProvider) + \"?\");\n }\n else if (seenProviderIdx == providerIdx + 1) {\n soFar.push('...');\n }\n return soFar;\n }, [])))\n .join(', ');\n _this._reportError(syntaxError(\"Invalid \" + (debugInfo ? debugInfo : 'provider') + \" - only instances of Provider and Type are allowed, got: [\" + providersInfo + \"]\"), type);\n return;\n }\n if (providerMeta.token ===\n _this._reflector.resolveExternalReference(Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS)) {\n targetEntryComponents.push.apply(targetEntryComponents, _this._getEntryComponentsFromProvider(providerMeta, type));\n }\n else {\n compileProviders.push(_this.getProviderMetadata(providerMeta));\n }\n }\n });\n return compileProviders;\n };\n /**\n * @param {?} provider\n * @return {?}\n */\n CompileMetadataResolver.prototype._validateProvider = /**\n * @param {?} provider\n * @return {?}\n */\n function (provider) {\n if (provider.hasOwnProperty('useClass') && provider.useClass == null) {\n this._reportError(syntaxError(\"Invalid provider for \" + stringifyType(provider.provide) + \". useClass cannot be \" + provider.useClass + \".\\n Usually it happens when:\\n 1. There's a circular dependency (might be caused by using index.ts (barrel) files).\\n 2. Class was used before it was declared. Use forwardRef in this case.\"));\n }\n };\n /**\n * @param {?} provider\n * @param {?=} type\n * @return {?}\n */\n CompileMetadataResolver.prototype._getEntryComponentsFromProvider = /**\n * @param {?} provider\n * @param {?=} type\n * @return {?}\n */\n function (provider, type) {\n var _this = this;\n var /** @type {?} */ components = [];\n var /** @type {?} */ collectedIdentifiers = [];\n if (provider.useFactory || provider.useExisting || provider.useClass) {\n this._reportError(syntaxError(\"The ANALYZE_FOR_ENTRY_COMPONENTS token only supports useValue!\"), type);\n return [];\n }\n if (!provider.multi) {\n this._reportError(syntaxError(\"The ANALYZE_FOR_ENTRY_COMPONENTS token only supports 'multi = true'!\"), type);\n return [];\n }\n extractIdentifiers(provider.useValue, collectedIdentifiers);\n collectedIdentifiers.forEach(function (identifier) {\n var /** @type {?} */ entry = _this._getEntryComponentMetadata(identifier.reference, false);\n if (entry) {\n components.push(entry);\n }\n });\n return components;\n };\n /**\n * @param {?} dirType\n * @param {?=} throwIfNotFound\n * @return {?}\n */\n CompileMetadataResolver.prototype._getEntryComponentMetadata = /**\n * @param {?} dirType\n * @param {?=} throwIfNotFound\n * @return {?}\n */\n function (dirType, throwIfNotFound) {\n if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n var /** @type {?} */ dirMeta = this.getNonNormalizedDirectiveMetadata(dirType);\n if (dirMeta && dirMeta.metadata.isComponent) {\n return { componentType: dirType, componentFactory: /** @type {?} */ ((dirMeta.metadata.componentFactory)) };\n }\n var /** @type {?} */ dirSummary = /** @type {?} */ (this._loadSummary(dirType, CompileSummaryKind.Directive));\n if (dirSummary && dirSummary.isComponent) {\n return { componentType: dirType, componentFactory: /** @type {?} */ ((dirSummary.componentFactory)) };\n }\n if (throwIfNotFound) {\n throw syntaxError(dirType.name + \" cannot be used as an entry component.\");\n }\n return null;\n };\n /**\n * @param {?} provider\n * @return {?}\n */\n CompileMetadataResolver.prototype.getProviderMetadata = /**\n * @param {?} provider\n * @return {?}\n */\n function (provider) {\n var /** @type {?} */ compileDeps = /** @type {?} */ ((undefined));\n var /** @type {?} */ compileTypeMetadata = /** @type {?} */ ((null));\n var /** @type {?} */ compileFactoryMetadata = /** @type {?} */ ((null));\n var /** @type {?} */ token = this._getTokenMetadata(provider.token);\n if (provider.useClass) {\n compileTypeMetadata = this._getInjectableMetadata(provider.useClass, provider.dependencies);\n compileDeps = compileTypeMetadata.diDeps;\n if (provider.token === provider.useClass) {\n // use the compileTypeMetadata as it contains information about lifecycleHooks...\n token = { identifier: compileTypeMetadata };\n }\n }\n else if (provider.useFactory) {\n compileFactoryMetadata = this._getFactoryMetadata(provider.useFactory, provider.dependencies);\n compileDeps = compileFactoryMetadata.diDeps;\n }\n return {\n token: token,\n useClass: compileTypeMetadata,\n useValue: provider.useValue,\n useFactory: compileFactoryMetadata,\n useExisting: provider.useExisting ? this._getTokenMetadata(provider.useExisting) : undefined,\n deps: compileDeps,\n multi: provider.multi\n };\n };\n /**\n * @param {?} queries\n * @param {?} isViewQuery\n * @param {?} directiveType\n * @return {?}\n */\n CompileMetadataResolver.prototype._getQueriesMetadata = /**\n * @param {?} queries\n * @param {?} isViewQuery\n * @param {?} directiveType\n * @return {?}\n */\n function (queries, isViewQuery, directiveType) {\n var _this = this;\n var /** @type {?} */ res = [];\n Object.keys(queries).forEach(function (propertyName) {\n var /** @type {?} */ query = queries[propertyName];\n if (query.isViewQuery === isViewQuery) {\n res.push(_this._getQueryMetadata(query, propertyName, directiveType));\n }\n });\n return res;\n };\n /**\n * @param {?} selector\n * @return {?}\n */\n CompileMetadataResolver.prototype._queryVarBindings = /**\n * @param {?} selector\n * @return {?}\n */\n function (selector) { return selector.split(/\\s*,\\s*/); };\n /**\n * @param {?} q\n * @param {?} propertyName\n * @param {?} typeOrFunc\n * @return {?}\n */\n CompileMetadataResolver.prototype._getQueryMetadata = /**\n * @param {?} q\n * @param {?} propertyName\n * @param {?} typeOrFunc\n * @return {?}\n */\n function (q, propertyName, typeOrFunc) {\n var _this = this;\n var /** @type {?} */ selectors;\n if (typeof q.selector === 'string') {\n selectors =\n this._queryVarBindings(q.selector).map(function (varName) { return _this._getTokenMetadata(varName); });\n }\n else {\n if (!q.selector) {\n this._reportError(syntaxError(\"Can't construct a query for the property \\\"\" + propertyName + \"\\\" of \\\"\" + stringifyType(typeOrFunc) + \"\\\" since the query selector wasn't defined.\"), typeOrFunc);\n selectors = [];\n }\n else {\n selectors = [this._getTokenMetadata(q.selector)];\n }\n }\n return {\n selectors: selectors,\n first: q.first,\n descendants: q.descendants, propertyName: propertyName,\n read: q.read ? this._getTokenMetadata(q.read) : /** @type {?} */ ((null))\n };\n };\n /**\n * @param {?} error\n * @param {?=} type\n * @param {?=} otherType\n * @return {?}\n */\n CompileMetadataResolver.prototype._reportError = /**\n * @param {?} error\n * @param {?=} type\n * @param {?=} otherType\n * @return {?}\n */\n function (error, type, otherType) {\n if (this._errorCollector) {\n this._errorCollector(error, type);\n if (otherType) {\n this._errorCollector(error, otherType);\n }\n }\n else {\n throw error;\n }\n };\n return CompileMetadataResolver;\n}());\n/**\n * @param {?} tree\n * @param {?=} out\n * @return {?}\n */\nfunction flattenArray(tree, out) {\n if (out === void 0) { out = []; }\n if (tree) {\n for (var /** @type {?} */ i = 0; i < tree.length; i++) {\n var /** @type {?} */ item = resolveForwardRef(tree[i]);\n if (Array.isArray(item)) {\n flattenArray(item, out);\n }\n else {\n out.push(item);\n }\n }\n }\n return out;\n}\n/**\n * @param {?} array\n * @return {?}\n */\nfunction dedupeArray(array) {\n if (array) {\n return Array.from(new Set(array));\n }\n return [];\n}\n/**\n * @param {?} tree\n * @return {?}\n */\nfunction flattenAndDedupeArray(tree) {\n return dedupeArray(flattenArray(tree));\n}\n/**\n * @param {?} value\n * @return {?}\n */\nfunction isValidType(value) {\n return (value instanceof StaticSymbol) || (value instanceof Type);\n}\n/**\n * @param {?} value\n * @param {?} targetIdentifiers\n * @return {?}\n */\nfunction extractIdentifiers(value, targetIdentifiers) {\n visitValue(value, new _CompileValueConverter(), targetIdentifiers);\n}\nvar _CompileValueConverter = /** @class */ (function (_super) {\n __extends(_CompileValueConverter, _super);\n function _CompileValueConverter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} value\n * @param {?} targetIdentifiers\n * @return {?}\n */\n _CompileValueConverter.prototype.visitOther = /**\n * @param {?} value\n * @param {?} targetIdentifiers\n * @return {?}\n */\n function (value, targetIdentifiers) {\n targetIdentifiers.push({ reference: value });\n };\n return _CompileValueConverter;\n}(ValueTransformer));\n/**\n * @param {?} type\n * @return {?}\n */\nfunction stringifyType(type) {\n if (type instanceof StaticSymbol) {\n return type.name + \" in \" + type.filePath;\n }\n else {\n return stringify(type);\n }\n}\n/**\n * Indicates that a component is still being loaded in a synchronous compile.\n * @param {?} compType\n * @return {?}\n */\nfunction componentStillLoadingError(compType) {\n var /** @type {?} */ error = Error(\"Can't compile synchronously as \" + stringify(compType) + \" is still being loaded!\");\n (/** @type {?} */ (error))[ERROR_COMPONENT_TYPE] = compType;\n return error;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/** @enum {number} */\nvar TypeModifier = {\n Const: 0,\n};\nTypeModifier[TypeModifier.Const] = \"Const\";\n/**\n * @abstract\n */\nvar Type$1 = /** @class */ (function () {\n function Type(modifiers) {\n if (modifiers === void 0) { modifiers = null; }\n this.modifiers = modifiers;\n if (!modifiers) {\n this.modifiers = [];\n }\n }\n /**\n * @param {?} modifier\n * @return {?}\n */\n Type.prototype.hasModifier = /**\n * @param {?} modifier\n * @return {?}\n */\n function (modifier) { return /** @type {?} */ ((this.modifiers)).indexOf(modifier) !== -1; };\n return Type;\n}());\n/** @enum {number} */\nvar BuiltinTypeName = {\n Dynamic: 0,\n Bool: 1,\n String: 2,\n Int: 3,\n Number: 4,\n Function: 5,\n Inferred: 6,\n};\nBuiltinTypeName[BuiltinTypeName.Dynamic] = \"Dynamic\";\nBuiltinTypeName[BuiltinTypeName.Bool] = \"Bool\";\nBuiltinTypeName[BuiltinTypeName.String] = \"String\";\nBuiltinTypeName[BuiltinTypeName.Int] = \"Int\";\nBuiltinTypeName[BuiltinTypeName.Number] = \"Number\";\nBuiltinTypeName[BuiltinTypeName.Function] = \"Function\";\nBuiltinTypeName[BuiltinTypeName.Inferred] = \"Inferred\";\nvar BuiltinType = /** @class */ (function (_super) {\n __extends(BuiltinType, _super);\n function BuiltinType(name, modifiers) {\n if (modifiers === void 0) { modifiers = null; }\n var _this = _super.call(this, modifiers) || this;\n _this.name = name;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n BuiltinType.prototype.visitType = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitBuiltintType(this, context);\n };\n return BuiltinType;\n}(Type$1));\nvar ExpressionType = /** @class */ (function (_super) {\n __extends(ExpressionType, _super);\n function ExpressionType(value, modifiers) {\n if (modifiers === void 0) { modifiers = null; }\n var _this = _super.call(this, modifiers) || this;\n _this.value = value;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n ExpressionType.prototype.visitType = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitExpressionType(this, context);\n };\n return ExpressionType;\n}(Type$1));\nvar ArrayType = /** @class */ (function (_super) {\n __extends(ArrayType, _super);\n function ArrayType(of, modifiers) {\n if (modifiers === void 0) { modifiers = null; }\n var _this = _super.call(this, modifiers) || this;\n _this.of = of;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n ArrayType.prototype.visitType = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitArrayType(this, context);\n };\n return ArrayType;\n}(Type$1));\nvar MapType = /** @class */ (function (_super) {\n __extends(MapType, _super);\n function MapType(valueType, modifiers) {\n if (modifiers === void 0) { modifiers = null; }\n var _this = _super.call(this, modifiers) || this;\n _this.valueType = valueType || null;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n MapType.prototype.visitType = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) { return visitor.visitMapType(this, context); };\n return MapType;\n}(Type$1));\nvar DYNAMIC_TYPE = new BuiltinType(BuiltinTypeName.Dynamic);\nvar INFERRED_TYPE = new BuiltinType(BuiltinTypeName.Inferred);\nvar BOOL_TYPE = new BuiltinType(BuiltinTypeName.Bool);\nvar INT_TYPE = new BuiltinType(BuiltinTypeName.Int);\nvar NUMBER_TYPE = new BuiltinType(BuiltinTypeName.Number);\nvar STRING_TYPE = new BuiltinType(BuiltinTypeName.String);\nvar FUNCTION_TYPE = new BuiltinType(BuiltinTypeName.Function);\n/**\n * @record\n */\n\n/** @enum {number} */\nvar BinaryOperator = {\n Equals: 0,\n NotEquals: 1,\n Identical: 2,\n NotIdentical: 3,\n Minus: 4,\n Plus: 5,\n Divide: 6,\n Multiply: 7,\n Modulo: 8,\n And: 9,\n Or: 10,\n Lower: 11,\n LowerEquals: 12,\n Bigger: 13,\n BiggerEquals: 14,\n};\nBinaryOperator[BinaryOperator.Equals] = \"Equals\";\nBinaryOperator[BinaryOperator.NotEquals] = \"NotEquals\";\nBinaryOperator[BinaryOperator.Identical] = \"Identical\";\nBinaryOperator[BinaryOperator.NotIdentical] = \"NotIdentical\";\nBinaryOperator[BinaryOperator.Minus] = \"Minus\";\nBinaryOperator[BinaryOperator.Plus] = \"Plus\";\nBinaryOperator[BinaryOperator.Divide] = \"Divide\";\nBinaryOperator[BinaryOperator.Multiply] = \"Multiply\";\nBinaryOperator[BinaryOperator.Modulo] = \"Modulo\";\nBinaryOperator[BinaryOperator.And] = \"And\";\nBinaryOperator[BinaryOperator.Or] = \"Or\";\nBinaryOperator[BinaryOperator.Lower] = \"Lower\";\nBinaryOperator[BinaryOperator.LowerEquals] = \"LowerEquals\";\nBinaryOperator[BinaryOperator.Bigger] = \"Bigger\";\nBinaryOperator[BinaryOperator.BiggerEquals] = \"BiggerEquals\";\n/**\n * @template T\n * @param {?} base\n * @param {?} other\n * @return {?}\n */\nfunction nullSafeIsEquivalent(base, other) {\n if (base == null || other == null) {\n return base == other;\n }\n return base.isEquivalent(other);\n}\n/**\n * @template T\n * @param {?} base\n * @param {?} other\n * @return {?}\n */\nfunction areAllEquivalent(base, other) {\n var /** @type {?} */ len = base.length;\n if (len !== other.length) {\n return false;\n }\n for (var /** @type {?} */ i = 0; i < len; i++) {\n if (!base[i].isEquivalent(other[i])) {\n return false;\n }\n }\n return true;\n}\n/**\n * @abstract\n */\nvar Expression = /** @class */ (function () {\n function Expression(type, sourceSpan) {\n this.type = type || null;\n this.sourceSpan = sourceSpan || null;\n }\n /**\n * @param {?} name\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.prop = /**\n * @param {?} name\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (name, sourceSpan) {\n return new ReadPropExpr(this, name, null, sourceSpan);\n };\n /**\n * @param {?} index\n * @param {?=} type\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.key = /**\n * @param {?} index\n * @param {?=} type\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (index, type, sourceSpan) {\n return new ReadKeyExpr(this, index, type, sourceSpan);\n };\n /**\n * @param {?} name\n * @param {?} params\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.callMethod = /**\n * @param {?} name\n * @param {?} params\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (name, params, sourceSpan) {\n return new InvokeMethodExpr(this, name, params, null, sourceSpan);\n };\n /**\n * @param {?} params\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.callFn = /**\n * @param {?} params\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (params, sourceSpan) {\n return new InvokeFunctionExpr(this, params, null, sourceSpan);\n };\n /**\n * @param {?} params\n * @param {?=} type\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.instantiate = /**\n * @param {?} params\n * @param {?=} type\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (params, type, sourceSpan) {\n return new InstantiateExpr(this, params, type, sourceSpan);\n };\n /**\n * @param {?} trueCase\n * @param {?=} falseCase\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.conditional = /**\n * @param {?} trueCase\n * @param {?=} falseCase\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (trueCase, falseCase, sourceSpan) {\n if (falseCase === void 0) { falseCase = null; }\n return new ConditionalExpr(this, trueCase, falseCase, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.equals = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Equals, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.notEquals = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.NotEquals, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.identical = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Identical, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.notIdentical = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.NotIdentical, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.minus = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Minus, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.plus = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Plus, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.divide = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Divide, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.multiply = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Multiply, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.modulo = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Modulo, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.and = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.And, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.or = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Or, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.lower = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Lower, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.lowerEquals = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.LowerEquals, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.bigger = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Bigger, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.biggerEquals = /**\n * @param {?} rhs\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.BiggerEquals, this, rhs, null, sourceSpan);\n };\n /**\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.isBlank = /**\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (sourceSpan) {\n // Note: We use equals by purpose here to compare to null and undefined in JS.\n // We use the typed null to allow strictNullChecks to narrow types.\n return this.equals(TYPED_NULL_EXPR, sourceSpan);\n };\n /**\n * @param {?} type\n * @param {?=} sourceSpan\n * @return {?}\n */\n Expression.prototype.cast = /**\n * @param {?} type\n * @param {?=} sourceSpan\n * @return {?}\n */\n function (type, sourceSpan) {\n return new CastExpr(this, type, sourceSpan);\n };\n /**\n * @return {?}\n */\n Expression.prototype.toStmt = /**\n * @return {?}\n */\n function () { return new ExpressionStatement(this, null); };\n return Expression;\n}());\n/** @enum {number} */\nvar BuiltinVar = {\n This: 0,\n Super: 1,\n CatchError: 2,\n CatchStack: 3,\n};\nBuiltinVar[BuiltinVar.This] = \"This\";\nBuiltinVar[BuiltinVar.Super] = \"Super\";\nBuiltinVar[BuiltinVar.CatchError] = \"CatchError\";\nBuiltinVar[BuiltinVar.CatchStack] = \"CatchStack\";\nvar ReadVarExpr = /** @class */ (function (_super) {\n __extends(ReadVarExpr, _super);\n function ReadVarExpr(name, type, sourceSpan) {\n var _this = _super.call(this, type, sourceSpan) || this;\n if (typeof name === 'string') {\n _this.name = name;\n _this.builtin = null;\n }\n else {\n _this.name = null;\n _this.builtin = /** @type {?} */ (name);\n }\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n ReadVarExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof ReadVarExpr && this.name === e.name && this.builtin === e.builtin;\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n ReadVarExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitReadVarExpr(this, context);\n };\n /**\n * @param {?} value\n * @return {?}\n */\n ReadVarExpr.prototype.set = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n if (!this.name) {\n throw new Error(\"Built in variable \" + this.builtin + \" can not be assigned to.\");\n }\n return new WriteVarExpr(this.name, value, null, this.sourceSpan);\n };\n return ReadVarExpr;\n}(Expression));\nvar WriteVarExpr = /** @class */ (function (_super) {\n __extends(WriteVarExpr, _super);\n function WriteVarExpr(name, value, type, sourceSpan) {\n var _this = _super.call(this, type || value.type, sourceSpan) || this;\n _this.name = name;\n _this.value = value;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n WriteVarExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof WriteVarExpr && this.name === e.name && this.value.isEquivalent(e.value);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n WriteVarExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitWriteVarExpr(this, context);\n };\n /**\n * @param {?=} type\n * @param {?=} modifiers\n * @return {?}\n */\n WriteVarExpr.prototype.toDeclStmt = /**\n * @param {?=} type\n * @param {?=} modifiers\n * @return {?}\n */\n function (type, modifiers) {\n return new DeclareVarStmt(this.name, this.value, type, modifiers, this.sourceSpan);\n };\n return WriteVarExpr;\n}(Expression));\nvar WriteKeyExpr = /** @class */ (function (_super) {\n __extends(WriteKeyExpr, _super);\n function WriteKeyExpr(receiver, index, value, type, sourceSpan) {\n var _this = _super.call(this, type || value.type, sourceSpan) || this;\n _this.receiver = receiver;\n _this.index = index;\n _this.value = value;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n WriteKeyExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof WriteKeyExpr && this.receiver.isEquivalent(e.receiver) &&\n this.index.isEquivalent(e.index) && this.value.isEquivalent(e.value);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n WriteKeyExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitWriteKeyExpr(this, context);\n };\n return WriteKeyExpr;\n}(Expression));\nvar WritePropExpr = /** @class */ (function (_super) {\n __extends(WritePropExpr, _super);\n function WritePropExpr(receiver, name, value, type, sourceSpan) {\n var _this = _super.call(this, type || value.type, sourceSpan) || this;\n _this.receiver = receiver;\n _this.name = name;\n _this.value = value;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n WritePropExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof WritePropExpr && this.receiver.isEquivalent(e.receiver) &&\n this.name === e.name && this.value.isEquivalent(e.value);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n WritePropExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitWritePropExpr(this, context);\n };\n return WritePropExpr;\n}(Expression));\n/** @enum {number} */\nvar BuiltinMethod = {\n ConcatArray: 0,\n SubscribeObservable: 1,\n Bind: 2,\n};\nBuiltinMethod[BuiltinMethod.ConcatArray] = \"ConcatArray\";\nBuiltinMethod[BuiltinMethod.SubscribeObservable] = \"SubscribeObservable\";\nBuiltinMethod[BuiltinMethod.Bind] = \"Bind\";\nvar InvokeMethodExpr = /** @class */ (function (_super) {\n __extends(InvokeMethodExpr, _super);\n function InvokeMethodExpr(receiver, method, args, type, sourceSpan) {\n var _this = _super.call(this, type, sourceSpan) || this;\n _this.receiver = receiver;\n _this.args = args;\n if (typeof method === 'string') {\n _this.name = method;\n _this.builtin = null;\n }\n else {\n _this.name = null;\n _this.builtin = /** @type {?} */ (method);\n }\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n InvokeMethodExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof InvokeMethodExpr && this.receiver.isEquivalent(e.receiver) &&\n this.name === e.name && this.builtin === e.builtin && areAllEquivalent(this.args, e.args);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n InvokeMethodExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitInvokeMethodExpr(this, context);\n };\n return InvokeMethodExpr;\n}(Expression));\nvar InvokeFunctionExpr = /** @class */ (function (_super) {\n __extends(InvokeFunctionExpr, _super);\n function InvokeFunctionExpr(fn, args, type, sourceSpan) {\n var _this = _super.call(this, type, sourceSpan) || this;\n _this.fn = fn;\n _this.args = args;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n InvokeFunctionExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof InvokeFunctionExpr && this.fn.isEquivalent(e.fn) &&\n areAllEquivalent(this.args, e.args);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n InvokeFunctionExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitInvokeFunctionExpr(this, context);\n };\n return InvokeFunctionExpr;\n}(Expression));\nvar InstantiateExpr = /** @class */ (function (_super) {\n __extends(InstantiateExpr, _super);\n function InstantiateExpr(classExpr, args, type, sourceSpan) {\n var _this = _super.call(this, type, sourceSpan) || this;\n _this.classExpr = classExpr;\n _this.args = args;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n InstantiateExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof InstantiateExpr && this.classExpr.isEquivalent(e.classExpr) &&\n areAllEquivalent(this.args, e.args);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n InstantiateExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitInstantiateExpr(this, context);\n };\n return InstantiateExpr;\n}(Expression));\nvar LiteralExpr = /** @class */ (function (_super) {\n __extends(LiteralExpr, _super);\n function LiteralExpr(value, type, sourceSpan) {\n var _this = _super.call(this, type, sourceSpan) || this;\n _this.value = value;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n LiteralExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof LiteralExpr && this.value === e.value;\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n LiteralExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitLiteralExpr(this, context);\n };\n return LiteralExpr;\n}(Expression));\nvar ExternalExpr = /** @class */ (function (_super) {\n __extends(ExternalExpr, _super);\n function ExternalExpr(value, type, typeParams, sourceSpan) {\n if (typeParams === void 0) { typeParams = null; }\n var _this = _super.call(this, type, sourceSpan) || this;\n _this.value = value;\n _this.typeParams = typeParams;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n ExternalExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof ExternalExpr && this.value.name === e.value.name &&\n this.value.moduleName === e.value.moduleName && this.value.runtime === e.value.runtime;\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n ExternalExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitExternalExpr(this, context);\n };\n return ExternalExpr;\n}(Expression));\nvar ExternalReference = /** @class */ (function () {\n function ExternalReference(moduleName, name, runtime) {\n this.moduleName = moduleName;\n this.name = name;\n this.runtime = runtime;\n }\n return ExternalReference;\n}());\nvar ConditionalExpr = /** @class */ (function (_super) {\n __extends(ConditionalExpr, _super);\n function ConditionalExpr(condition, trueCase, falseCase, type, sourceSpan) {\n if (falseCase === void 0) { falseCase = null; }\n var _this = _super.call(this, type || trueCase.type, sourceSpan) || this;\n _this.condition = condition;\n _this.falseCase = falseCase;\n _this.trueCase = trueCase;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n ConditionalExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof ConditionalExpr && this.condition.isEquivalent(e.condition) &&\n this.trueCase.isEquivalent(e.trueCase) && nullSafeIsEquivalent(this.falseCase, e.falseCase);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n ConditionalExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitConditionalExpr(this, context);\n };\n return ConditionalExpr;\n}(Expression));\nvar NotExpr = /** @class */ (function (_super) {\n __extends(NotExpr, _super);\n function NotExpr(condition, sourceSpan) {\n var _this = _super.call(this, BOOL_TYPE, sourceSpan) || this;\n _this.condition = condition;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n NotExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof NotExpr && this.condition.isEquivalent(e.condition);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n NotExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitNotExpr(this, context);\n };\n return NotExpr;\n}(Expression));\nvar AssertNotNull = /** @class */ (function (_super) {\n __extends(AssertNotNull, _super);\n function AssertNotNull(condition, sourceSpan) {\n var _this = _super.call(this, condition.type, sourceSpan) || this;\n _this.condition = condition;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n AssertNotNull.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof AssertNotNull && this.condition.isEquivalent(e.condition);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n AssertNotNull.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitAssertNotNullExpr(this, context);\n };\n return AssertNotNull;\n}(Expression));\nvar CastExpr = /** @class */ (function (_super) {\n __extends(CastExpr, _super);\n function CastExpr(value, type, sourceSpan) {\n var _this = _super.call(this, type, sourceSpan) || this;\n _this.value = value;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n CastExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof CastExpr && this.value.isEquivalent(e.value);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n CastExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitCastExpr(this, context);\n };\n return CastExpr;\n}(Expression));\nvar FnParam = /** @class */ (function () {\n function FnParam(name, type) {\n if (type === void 0) { type = null; }\n this.name = name;\n this.type = type;\n }\n /**\n * @param {?} param\n * @return {?}\n */\n FnParam.prototype.isEquivalent = /**\n * @param {?} param\n * @return {?}\n */\n function (param) { return this.name === param.name; };\n return FnParam;\n}());\nvar FunctionExpr = /** @class */ (function (_super) {\n __extends(FunctionExpr, _super);\n function FunctionExpr(params, statements, type, sourceSpan) {\n var _this = _super.call(this, type, sourceSpan) || this;\n _this.params = params;\n _this.statements = statements;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n FunctionExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof FunctionExpr && areAllEquivalent(this.params, e.params) &&\n areAllEquivalent(this.statements, e.statements);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n FunctionExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitFunctionExpr(this, context);\n };\n /**\n * @param {?} name\n * @param {?=} modifiers\n * @return {?}\n */\n FunctionExpr.prototype.toDeclStmt = /**\n * @param {?} name\n * @param {?=} modifiers\n * @return {?}\n */\n function (name, modifiers) {\n if (modifiers === void 0) { modifiers = null; }\n return new DeclareFunctionStmt(name, this.params, this.statements, this.type, modifiers, this.sourceSpan);\n };\n return FunctionExpr;\n}(Expression));\nvar BinaryOperatorExpr = /** @class */ (function (_super) {\n __extends(BinaryOperatorExpr, _super);\n function BinaryOperatorExpr(operator, lhs, rhs, type, sourceSpan) {\n var _this = _super.call(this, type || lhs.type, sourceSpan) || this;\n _this.operator = operator;\n _this.rhs = rhs;\n _this.lhs = lhs;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n BinaryOperatorExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof BinaryOperatorExpr && this.operator === e.operator &&\n this.lhs.isEquivalent(e.lhs) && this.rhs.isEquivalent(e.rhs);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n BinaryOperatorExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitBinaryOperatorExpr(this, context);\n };\n return BinaryOperatorExpr;\n}(Expression));\nvar ReadPropExpr = /** @class */ (function (_super) {\n __extends(ReadPropExpr, _super);\n function ReadPropExpr(receiver, name, type, sourceSpan) {\n var _this = _super.call(this, type, sourceSpan) || this;\n _this.receiver = receiver;\n _this.name = name;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n ReadPropExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof ReadPropExpr && this.receiver.isEquivalent(e.receiver) &&\n this.name === e.name;\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n ReadPropExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitReadPropExpr(this, context);\n };\n /**\n * @param {?} value\n * @return {?}\n */\n ReadPropExpr.prototype.set = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n return new WritePropExpr(this.receiver, this.name, value, null, this.sourceSpan);\n };\n return ReadPropExpr;\n}(Expression));\nvar ReadKeyExpr = /** @class */ (function (_super) {\n __extends(ReadKeyExpr, _super);\n function ReadKeyExpr(receiver, index, type, sourceSpan) {\n var _this = _super.call(this, type, sourceSpan) || this;\n _this.receiver = receiver;\n _this.index = index;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n ReadKeyExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof ReadKeyExpr && this.receiver.isEquivalent(e.receiver) &&\n this.index.isEquivalent(e.index);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n ReadKeyExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitReadKeyExpr(this, context);\n };\n /**\n * @param {?} value\n * @return {?}\n */\n ReadKeyExpr.prototype.set = /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n return new WriteKeyExpr(this.receiver, this.index, value, null, this.sourceSpan);\n };\n return ReadKeyExpr;\n}(Expression));\nvar LiteralArrayExpr = /** @class */ (function (_super) {\n __extends(LiteralArrayExpr, _super);\n function LiteralArrayExpr(entries, type, sourceSpan) {\n var _this = _super.call(this, type, sourceSpan) || this;\n _this.entries = entries;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n LiteralArrayExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof LiteralArrayExpr && areAllEquivalent(this.entries, e.entries);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n LiteralArrayExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitLiteralArrayExpr(this, context);\n };\n return LiteralArrayExpr;\n}(Expression));\nvar LiteralMapEntry = /** @class */ (function () {\n function LiteralMapEntry(key, value, quoted) {\n this.key = key;\n this.value = value;\n this.quoted = quoted;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n LiteralMapEntry.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return this.key === e.key && this.value.isEquivalent(e.value);\n };\n return LiteralMapEntry;\n}());\nvar LiteralMapExpr = /** @class */ (function (_super) {\n __extends(LiteralMapExpr, _super);\n function LiteralMapExpr(entries, type, sourceSpan) {\n var _this = _super.call(this, type, sourceSpan) || this;\n _this.entries = entries;\n _this.valueType = null;\n if (type) {\n _this.valueType = type.valueType;\n }\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n LiteralMapExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof LiteralMapExpr && areAllEquivalent(this.entries, e.entries);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n LiteralMapExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitLiteralMapExpr(this, context);\n };\n return LiteralMapExpr;\n}(Expression));\nvar CommaExpr = /** @class */ (function (_super) {\n __extends(CommaExpr, _super);\n function CommaExpr(parts, sourceSpan) {\n var _this = _super.call(this, parts[parts.length - 1].type, sourceSpan) || this;\n _this.parts = parts;\n return _this;\n }\n /**\n * @param {?} e\n * @return {?}\n */\n CommaExpr.prototype.isEquivalent = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n return e instanceof CommaExpr && areAllEquivalent(this.parts, e.parts);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n CommaExpr.prototype.visitExpression = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitCommaExpr(this, context);\n };\n return CommaExpr;\n}(Expression));\n/**\n * @record\n */\n\nvar THIS_EXPR = new ReadVarExpr(BuiltinVar.This, null, null);\nvar SUPER_EXPR = new ReadVarExpr(BuiltinVar.Super, null, null);\nvar CATCH_ERROR_VAR = new ReadVarExpr(BuiltinVar.CatchError, null, null);\nvar CATCH_STACK_VAR = new ReadVarExpr(BuiltinVar.CatchStack, null, null);\nvar NULL_EXPR = new LiteralExpr(null, null, null);\nvar TYPED_NULL_EXPR = new LiteralExpr(null, INFERRED_TYPE, null);\n/** @enum {number} */\nvar StmtModifier = {\n Final: 0,\n Private: 1,\n Exported: 2,\n};\nStmtModifier[StmtModifier.Final] = \"Final\";\nStmtModifier[StmtModifier.Private] = \"Private\";\nStmtModifier[StmtModifier.Exported] = \"Exported\";\n/**\n * @abstract\n */\nvar Statement = /** @class */ (function () {\n function Statement(modifiers, sourceSpan) {\n this.modifiers = modifiers || [];\n this.sourceSpan = sourceSpan || null;\n }\n /**\n * @param {?} modifier\n * @return {?}\n */\n Statement.prototype.hasModifier = /**\n * @param {?} modifier\n * @return {?}\n */\n function (modifier) { return /** @type {?} */ ((this.modifiers)).indexOf(modifier) !== -1; };\n return Statement;\n}());\nvar DeclareVarStmt = /** @class */ (function (_super) {\n __extends(DeclareVarStmt, _super);\n function DeclareVarStmt(name, value, type, modifiers, sourceSpan) {\n if (modifiers === void 0) { modifiers = null; }\n var _this = _super.call(this, modifiers, sourceSpan) || this;\n _this.name = name;\n _this.value = value;\n _this.type = type || value.type;\n return _this;\n }\n /**\n * @param {?} stmt\n * @return {?}\n */\n DeclareVarStmt.prototype.isEquivalent = /**\n * @param {?} stmt\n * @return {?}\n */\n function (stmt) {\n return stmt instanceof DeclareVarStmt && this.name === stmt.name &&\n this.value.isEquivalent(stmt.value);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n DeclareVarStmt.prototype.visitStatement = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitDeclareVarStmt(this, context);\n };\n return DeclareVarStmt;\n}(Statement));\nvar DeclareFunctionStmt = /** @class */ (function (_super) {\n __extends(DeclareFunctionStmt, _super);\n function DeclareFunctionStmt(name, params, statements, type, modifiers, sourceSpan) {\n if (modifiers === void 0) { modifiers = null; }\n var _this = _super.call(this, modifiers, sourceSpan) || this;\n _this.name = name;\n _this.params = params;\n _this.statements = statements;\n _this.type = type || null;\n return _this;\n }\n /**\n * @param {?} stmt\n * @return {?}\n */\n DeclareFunctionStmt.prototype.isEquivalent = /**\n * @param {?} stmt\n * @return {?}\n */\n function (stmt) {\n return stmt instanceof DeclareFunctionStmt && areAllEquivalent(this.params, stmt.params) &&\n areAllEquivalent(this.statements, stmt.statements);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n DeclareFunctionStmt.prototype.visitStatement = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitDeclareFunctionStmt(this, context);\n };\n return DeclareFunctionStmt;\n}(Statement));\nvar ExpressionStatement = /** @class */ (function (_super) {\n __extends(ExpressionStatement, _super);\n function ExpressionStatement(expr, sourceSpan) {\n var _this = _super.call(this, null, sourceSpan) || this;\n _this.expr = expr;\n return _this;\n }\n /**\n * @param {?} stmt\n * @return {?}\n */\n ExpressionStatement.prototype.isEquivalent = /**\n * @param {?} stmt\n * @return {?}\n */\n function (stmt) {\n return stmt instanceof ExpressionStatement && this.expr.isEquivalent(stmt.expr);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n ExpressionStatement.prototype.visitStatement = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitExpressionStmt(this, context);\n };\n return ExpressionStatement;\n}(Statement));\nvar ReturnStatement = /** @class */ (function (_super) {\n __extends(ReturnStatement, _super);\n function ReturnStatement(value, sourceSpan) {\n var _this = _super.call(this, null, sourceSpan) || this;\n _this.value = value;\n return _this;\n }\n /**\n * @param {?} stmt\n * @return {?}\n */\n ReturnStatement.prototype.isEquivalent = /**\n * @param {?} stmt\n * @return {?}\n */\n function (stmt) {\n return stmt instanceof ReturnStatement && this.value.isEquivalent(stmt.value);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n ReturnStatement.prototype.visitStatement = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitReturnStmt(this, context);\n };\n return ReturnStatement;\n}(Statement));\nvar AbstractClassPart = /** @class */ (function () {\n function AbstractClassPart(type, modifiers) {\n this.modifiers = modifiers;\n if (!modifiers) {\n this.modifiers = [];\n }\n this.type = type || null;\n }\n /**\n * @param {?} modifier\n * @return {?}\n */\n AbstractClassPart.prototype.hasModifier = /**\n * @param {?} modifier\n * @return {?}\n */\n function (modifier) { return /** @type {?} */ ((this.modifiers)).indexOf(modifier) !== -1; };\n return AbstractClassPart;\n}());\nvar ClassField = /** @class */ (function (_super) {\n __extends(ClassField, _super);\n function ClassField(name, type, modifiers) {\n if (modifiers === void 0) { modifiers = null; }\n var _this = _super.call(this, type, modifiers) || this;\n _this.name = name;\n return _this;\n }\n /**\n * @param {?} f\n * @return {?}\n */\n ClassField.prototype.isEquivalent = /**\n * @param {?} f\n * @return {?}\n */\n function (f) { return this.name === f.name; };\n return ClassField;\n}(AbstractClassPart));\nvar ClassMethod = /** @class */ (function (_super) {\n __extends(ClassMethod, _super);\n function ClassMethod(name, params, body, type, modifiers) {\n if (modifiers === void 0) { modifiers = null; }\n var _this = _super.call(this, type, modifiers) || this;\n _this.name = name;\n _this.params = params;\n _this.body = body;\n return _this;\n }\n /**\n * @param {?} m\n * @return {?}\n */\n ClassMethod.prototype.isEquivalent = /**\n * @param {?} m\n * @return {?}\n */\n function (m) {\n return this.name === m.name && areAllEquivalent(this.body, m.body);\n };\n return ClassMethod;\n}(AbstractClassPart));\nvar ClassGetter = /** @class */ (function (_super) {\n __extends(ClassGetter, _super);\n function ClassGetter(name, body, type, modifiers) {\n if (modifiers === void 0) { modifiers = null; }\n var _this = _super.call(this, type, modifiers) || this;\n _this.name = name;\n _this.body = body;\n return _this;\n }\n /**\n * @param {?} m\n * @return {?}\n */\n ClassGetter.prototype.isEquivalent = /**\n * @param {?} m\n * @return {?}\n */\n function (m) {\n return this.name === m.name && areAllEquivalent(this.body, m.body);\n };\n return ClassGetter;\n}(AbstractClassPart));\nvar ClassStmt = /** @class */ (function (_super) {\n __extends(ClassStmt, _super);\n function ClassStmt(name, parent, fields, getters, constructorMethod, methods, modifiers, sourceSpan) {\n if (modifiers === void 0) { modifiers = null; }\n var _this = _super.call(this, modifiers, sourceSpan) || this;\n _this.name = name;\n _this.parent = parent;\n _this.fields = fields;\n _this.getters = getters;\n _this.constructorMethod = constructorMethod;\n _this.methods = methods;\n return _this;\n }\n /**\n * @param {?} stmt\n * @return {?}\n */\n ClassStmt.prototype.isEquivalent = /**\n * @param {?} stmt\n * @return {?}\n */\n function (stmt) {\n return stmt instanceof ClassStmt && this.name === stmt.name &&\n nullSafeIsEquivalent(this.parent, stmt.parent) &&\n areAllEquivalent(this.fields, stmt.fields) &&\n areAllEquivalent(this.getters, stmt.getters) &&\n this.constructorMethod.isEquivalent(stmt.constructorMethod) &&\n areAllEquivalent(this.methods, stmt.methods);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n ClassStmt.prototype.visitStatement = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitDeclareClassStmt(this, context);\n };\n return ClassStmt;\n}(Statement));\nvar IfStmt = /** @class */ (function (_super) {\n __extends(IfStmt, _super);\n function IfStmt(condition, trueCase, falseCase, sourceSpan) {\n if (falseCase === void 0) { falseCase = []; }\n var _this = _super.call(this, null, sourceSpan) || this;\n _this.condition = condition;\n _this.trueCase = trueCase;\n _this.falseCase = falseCase;\n return _this;\n }\n /**\n * @param {?} stmt\n * @return {?}\n */\n IfStmt.prototype.isEquivalent = /**\n * @param {?} stmt\n * @return {?}\n */\n function (stmt) {\n return stmt instanceof IfStmt && this.condition.isEquivalent(stmt.condition) &&\n areAllEquivalent(this.trueCase, stmt.trueCase) &&\n areAllEquivalent(this.falseCase, stmt.falseCase);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n IfStmt.prototype.visitStatement = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitIfStmt(this, context);\n };\n return IfStmt;\n}(Statement));\nvar CommentStmt = /** @class */ (function (_super) {\n __extends(CommentStmt, _super);\n function CommentStmt(comment, sourceSpan) {\n var _this = _super.call(this, null, sourceSpan) || this;\n _this.comment = comment;\n return _this;\n }\n /**\n * @param {?} stmt\n * @return {?}\n */\n CommentStmt.prototype.isEquivalent = /**\n * @param {?} stmt\n * @return {?}\n */\n function (stmt) { return stmt instanceof CommentStmt; };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n CommentStmt.prototype.visitStatement = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitCommentStmt(this, context);\n };\n return CommentStmt;\n}(Statement));\nvar TryCatchStmt = /** @class */ (function (_super) {\n __extends(TryCatchStmt, _super);\n function TryCatchStmt(bodyStmts, catchStmts, sourceSpan) {\n var _this = _super.call(this, null, sourceSpan) || this;\n _this.bodyStmts = bodyStmts;\n _this.catchStmts = catchStmts;\n return _this;\n }\n /**\n * @param {?} stmt\n * @return {?}\n */\n TryCatchStmt.prototype.isEquivalent = /**\n * @param {?} stmt\n * @return {?}\n */\n function (stmt) {\n return stmt instanceof TryCatchStmt && areAllEquivalent(this.bodyStmts, stmt.bodyStmts) &&\n areAllEquivalent(this.catchStmts, stmt.catchStmts);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n TryCatchStmt.prototype.visitStatement = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitTryCatchStmt(this, context);\n };\n return TryCatchStmt;\n}(Statement));\nvar ThrowStmt = /** @class */ (function (_super) {\n __extends(ThrowStmt, _super);\n function ThrowStmt(error, sourceSpan) {\n var _this = _super.call(this, null, sourceSpan) || this;\n _this.error = error;\n return _this;\n }\n /**\n * @param {?} stmt\n * @return {?}\n */\n ThrowStmt.prototype.isEquivalent = /**\n * @param {?} stmt\n * @return {?}\n */\n function (stmt) {\n return stmt instanceof TryCatchStmt && this.error.isEquivalent(stmt.error);\n };\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n ThrowStmt.prototype.visitStatement = /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n function (visitor, context) {\n return visitor.visitThrowStmt(this, context);\n };\n return ThrowStmt;\n}(Statement));\n/**\n * @record\n */\n\nvar AstTransformer$1 = /** @class */ (function () {\n function AstTransformer() {\n }\n /**\n * @param {?} expr\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.transformExpr = /**\n * @param {?} expr\n * @param {?} context\n * @return {?}\n */\n function (expr, context) { return expr; };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.transformStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) { return stmt; };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitReadVarExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) { return this.transformExpr(ast, context); };\n /**\n * @param {?} expr\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitWriteVarExpr = /**\n * @param {?} expr\n * @param {?} context\n * @return {?}\n */\n function (expr, context) {\n return this.transformExpr(new WriteVarExpr(expr.name, expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);\n };\n /**\n * @param {?} expr\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitWriteKeyExpr = /**\n * @param {?} expr\n * @param {?} context\n * @return {?}\n */\n function (expr, context) {\n return this.transformExpr(new WriteKeyExpr(expr.receiver.visitExpression(this, context), expr.index.visitExpression(this, context), expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);\n };\n /**\n * @param {?} expr\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitWritePropExpr = /**\n * @param {?} expr\n * @param {?} context\n * @return {?}\n */\n function (expr, context) {\n return this.transformExpr(new WritePropExpr(expr.receiver.visitExpression(this, context), expr.name, expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitInvokeMethodExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n var /** @type {?} */ method = ast.builtin || ast.name;\n return this.transformExpr(new InvokeMethodExpr(ast.receiver.visitExpression(this, context), /** @type {?} */ ((method)), this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitInvokeFunctionExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.transformExpr(new InvokeFunctionExpr(ast.fn.visitExpression(this, context), this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitInstantiateExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.transformExpr(new InstantiateExpr(ast.classExpr.visitExpression(this, context), this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitLiteralExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) { return this.transformExpr(ast, context); };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitExternalExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.transformExpr(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitConditionalExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.transformExpr(new ConditionalExpr(ast.condition.visitExpression(this, context), ast.trueCase.visitExpression(this, context), /** @type {?} */ ((ast.falseCase)).visitExpression(this, context), ast.type, ast.sourceSpan), context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitNotExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.transformExpr(new NotExpr(ast.condition.visitExpression(this, context), ast.sourceSpan), context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitAssertNotNullExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.transformExpr(new AssertNotNull(ast.condition.visitExpression(this, context), ast.sourceSpan), context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitCastExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.transformExpr(new CastExpr(ast.value.visitExpression(this, context), ast.type, ast.sourceSpan), context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitFunctionExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.transformExpr(new FunctionExpr(ast.params, this.visitAllStatements(ast.statements, context), ast.type, ast.sourceSpan), context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitBinaryOperatorExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.transformExpr(new BinaryOperatorExpr(ast.operator, ast.lhs.visitExpression(this, context), ast.rhs.visitExpression(this, context), ast.type, ast.sourceSpan), context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitReadPropExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.transformExpr(new ReadPropExpr(ast.receiver.visitExpression(this, context), ast.name, ast.type, ast.sourceSpan), context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitReadKeyExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.transformExpr(new ReadKeyExpr(ast.receiver.visitExpression(this, context), ast.index.visitExpression(this, context), ast.type, ast.sourceSpan), context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitLiteralArrayExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.transformExpr(new LiteralArrayExpr(this.visitAllExpressions(ast.entries, context), ast.type, ast.sourceSpan), context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitLiteralMapExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n var _this = this;\n var /** @type {?} */ entries = ast.entries.map(function (entry) {\n return new LiteralMapEntry(entry.key, entry.value.visitExpression(_this, context), entry.quoted);\n });\n var /** @type {?} */ mapType = new MapType(ast.valueType, null);\n return this.transformExpr(new LiteralMapExpr(entries, mapType, ast.sourceSpan), context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitCommaExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.transformExpr(new CommaExpr(this.visitAllExpressions(ast.parts, context), ast.sourceSpan), context);\n };\n /**\n * @param {?} exprs\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitAllExpressions = /**\n * @param {?} exprs\n * @param {?} context\n * @return {?}\n */\n function (exprs, context) {\n var _this = this;\n return exprs.map(function (expr) { return expr.visitExpression(_this, context); });\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitDeclareVarStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n return this.transformStmt(new DeclareVarStmt(stmt.name, stmt.value.visitExpression(this, context), stmt.type, stmt.modifiers, stmt.sourceSpan), context);\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitDeclareFunctionStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n return this.transformStmt(new DeclareFunctionStmt(stmt.name, stmt.params, this.visitAllStatements(stmt.statements, context), stmt.type, stmt.modifiers, stmt.sourceSpan), context);\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitExpressionStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n return this.transformStmt(new ExpressionStatement(stmt.expr.visitExpression(this, context), stmt.sourceSpan), context);\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitReturnStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n return this.transformStmt(new ReturnStatement(stmt.value.visitExpression(this, context), stmt.sourceSpan), context);\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitDeclareClassStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n var _this = this;\n var /** @type {?} */ parent = /** @type {?} */ ((stmt.parent)).visitExpression(this, context);\n var /** @type {?} */ getters = stmt.getters.map(function (getter) {\n return new ClassGetter(getter.name, _this.visitAllStatements(getter.body, context), getter.type, getter.modifiers);\n });\n var /** @type {?} */ ctorMethod = stmt.constructorMethod &&\n new ClassMethod(stmt.constructorMethod.name, stmt.constructorMethod.params, this.visitAllStatements(stmt.constructorMethod.body, context), stmt.constructorMethod.type, stmt.constructorMethod.modifiers);\n var /** @type {?} */ methods = stmt.methods.map(function (method) {\n return new ClassMethod(method.name, method.params, _this.visitAllStatements(method.body, context), method.type, method.modifiers);\n });\n return this.transformStmt(new ClassStmt(stmt.name, parent, stmt.fields, getters, ctorMethod, methods, stmt.modifiers, stmt.sourceSpan), context);\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitIfStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n return this.transformStmt(new IfStmt(stmt.condition.visitExpression(this, context), this.visitAllStatements(stmt.trueCase, context), this.visitAllStatements(stmt.falseCase, context), stmt.sourceSpan), context);\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitTryCatchStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n return this.transformStmt(new TryCatchStmt(this.visitAllStatements(stmt.bodyStmts, context), this.visitAllStatements(stmt.catchStmts, context), stmt.sourceSpan), context);\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitThrowStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n return this.transformStmt(new ThrowStmt(stmt.error.visitExpression(this, context), stmt.sourceSpan), context);\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitCommentStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n return this.transformStmt(stmt, context);\n };\n /**\n * @param {?} stmts\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitAllStatements = /**\n * @param {?} stmts\n * @param {?} context\n * @return {?}\n */\n function (stmts, context) {\n var _this = this;\n return stmts.map(function (stmt) { return stmt.visitStatement(_this, context); });\n };\n return AstTransformer;\n}());\nvar RecursiveAstVisitor$1 = /** @class */ (function () {\n function RecursiveAstVisitor() {\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitType = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) { return ast; };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitExpression = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n if (ast.type) {\n ast.type.visitType(this, context);\n }\n return ast;\n };\n /**\n * @param {?} type\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitBuiltintType = /**\n * @param {?} type\n * @param {?} context\n * @return {?}\n */\n function (type, context) { return this.visitType(type, context); };\n /**\n * @param {?} type\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitExpressionType = /**\n * @param {?} type\n * @param {?} context\n * @return {?}\n */\n function (type, context) {\n type.value.visitExpression(this, context);\n return this.visitType(type, context);\n };\n /**\n * @param {?} type\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitArrayType = /**\n * @param {?} type\n * @param {?} context\n * @return {?}\n */\n function (type, context) { return this.visitType(type, context); };\n /**\n * @param {?} type\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitMapType = /**\n * @param {?} type\n * @param {?} context\n * @return {?}\n */\n function (type, context) { return this.visitType(type, context); };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitReadVarExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitWriteVarExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n ast.value.visitExpression(this, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitWriteKeyExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n ast.receiver.visitExpression(this, context);\n ast.index.visitExpression(this, context);\n ast.value.visitExpression(this, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitWritePropExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n ast.receiver.visitExpression(this, context);\n ast.value.visitExpression(this, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitInvokeMethodExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n ast.receiver.visitExpression(this, context);\n this.visitAllExpressions(ast.args, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitInvokeFunctionExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n ast.fn.visitExpression(this, context);\n this.visitAllExpressions(ast.args, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitInstantiateExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n ast.classExpr.visitExpression(this, context);\n this.visitAllExpressions(ast.args, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitLiteralExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitExternalExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n var _this = this;\n if (ast.typeParams) {\n ast.typeParams.forEach(function (type) { return type.visitType(_this, context); });\n }\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitConditionalExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n ast.condition.visitExpression(this, context);\n ast.trueCase.visitExpression(this, context); /** @type {?} */\n ((ast.falseCase)).visitExpression(this, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitNotExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n ast.condition.visitExpression(this, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitAssertNotNullExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n ast.condition.visitExpression(this, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitCastExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n ast.value.visitExpression(this, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitFunctionExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n this.visitAllStatements(ast.statements, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitBinaryOperatorExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n ast.lhs.visitExpression(this, context);\n ast.rhs.visitExpression(this, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitReadPropExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n ast.receiver.visitExpression(this, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitReadKeyExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n ast.receiver.visitExpression(this, context);\n ast.index.visitExpression(this, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitLiteralArrayExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n this.visitAllExpressions(ast.entries, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitLiteralMapExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n var _this = this;\n ast.entries.forEach(function (entry) { return entry.value.visitExpression(_this, context); });\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitCommaExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n this.visitAllExpressions(ast.parts, context);\n return this.visitExpression(ast, context);\n };\n /**\n * @param {?} exprs\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitAllExpressions = /**\n * @param {?} exprs\n * @param {?} context\n * @return {?}\n */\n function (exprs, context) {\n var _this = this;\n exprs.forEach(function (expr) { return expr.visitExpression(_this, context); });\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitDeclareVarStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n stmt.value.visitExpression(this, context);\n if (stmt.type) {\n stmt.type.visitType(this, context);\n }\n return stmt;\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitDeclareFunctionStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n this.visitAllStatements(stmt.statements, context);\n if (stmt.type) {\n stmt.type.visitType(this, context);\n }\n return stmt;\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitExpressionStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n stmt.expr.visitExpression(this, context);\n return stmt;\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitReturnStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n stmt.value.visitExpression(this, context);\n return stmt;\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitDeclareClassStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n var _this = this;\n /** @type {?} */ ((stmt.parent)).visitExpression(this, context);\n stmt.getters.forEach(function (getter) { return _this.visitAllStatements(getter.body, context); });\n if (stmt.constructorMethod) {\n this.visitAllStatements(stmt.constructorMethod.body, context);\n }\n stmt.methods.forEach(function (method) { return _this.visitAllStatements(method.body, context); });\n return stmt;\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitIfStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n stmt.condition.visitExpression(this, context);\n this.visitAllStatements(stmt.trueCase, context);\n this.visitAllStatements(stmt.falseCase, context);\n return stmt;\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitTryCatchStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n this.visitAllStatements(stmt.bodyStmts, context);\n this.visitAllStatements(stmt.catchStmts, context);\n return stmt;\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitThrowStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n stmt.error.visitExpression(this, context);\n return stmt;\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitCommentStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) { return stmt; };\n /**\n * @param {?} stmts\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitAllStatements = /**\n * @param {?} stmts\n * @param {?} context\n * @return {?}\n */\n function (stmts, context) {\n var _this = this;\n stmts.forEach(function (stmt) { return stmt.visitStatement(_this, context); });\n };\n return RecursiveAstVisitor;\n}());\n/**\n * @param {?} stmts\n * @return {?}\n */\nfunction findReadVarNames(stmts) {\n var /** @type {?} */ visitor = new _ReadVarVisitor();\n visitor.visitAllStatements(stmts, null);\n return visitor.varNames;\n}\nvar _ReadVarVisitor = /** @class */ (function (_super) {\n __extends(_ReadVarVisitor, _super);\n function _ReadVarVisitor() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.varNames = new Set();\n return _this;\n }\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n _ReadVarVisitor.prototype.visitDeclareFunctionStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n // Don't descend into nested functions\n return stmt;\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n _ReadVarVisitor.prototype.visitDeclareClassStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n // Don't descend into nested classes\n return stmt;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n _ReadVarVisitor.prototype.visitReadVarExpr = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n if (ast.name) {\n this.varNames.add(ast.name);\n }\n return null;\n };\n return _ReadVarVisitor;\n}(RecursiveAstVisitor$1));\n/**\n * @param {?} stmts\n * @return {?}\n */\nfunction collectExternalReferences(stmts) {\n var /** @type {?} */ visitor = new _FindExternalReferencesVisitor();\n visitor.visitAllStatements(stmts, null);\n return visitor.externalReferences;\n}\nvar _FindExternalReferencesVisitor = /** @class */ (function (_super) {\n __extends(_FindExternalReferencesVisitor, _super);\n function _FindExternalReferencesVisitor() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.externalReferences = [];\n return _this;\n }\n /**\n * @param {?} e\n * @param {?} context\n * @return {?}\n */\n _FindExternalReferencesVisitor.prototype.visitExternalExpr = /**\n * @param {?} e\n * @param {?} context\n * @return {?}\n */\n function (e, context) {\n this.externalReferences.push(e.value);\n return _super.prototype.visitExternalExpr.call(this, e, context);\n };\n return _FindExternalReferencesVisitor;\n}(RecursiveAstVisitor$1));\n/**\n * @param {?} stmt\n * @param {?} sourceSpan\n * @return {?}\n */\nfunction applySourceSpanToStatementIfNeeded(stmt, sourceSpan) {\n if (!sourceSpan) {\n return stmt;\n }\n var /** @type {?} */ transformer = new _ApplySourceSpanTransformer(sourceSpan);\n return stmt.visitStatement(transformer, null);\n}\n/**\n * @param {?} expr\n * @param {?} sourceSpan\n * @return {?}\n */\nfunction applySourceSpanToExpressionIfNeeded(expr, sourceSpan) {\n if (!sourceSpan) {\n return expr;\n }\n var /** @type {?} */ transformer = new _ApplySourceSpanTransformer(sourceSpan);\n return expr.visitExpression(transformer, null);\n}\nvar _ApplySourceSpanTransformer = /** @class */ (function (_super) {\n __extends(_ApplySourceSpanTransformer, _super);\n function _ApplySourceSpanTransformer(sourceSpan) {\n var _this = _super.call(this) || this;\n _this.sourceSpan = sourceSpan;\n return _this;\n }\n /**\n * @param {?} obj\n * @return {?}\n */\n _ApplySourceSpanTransformer.prototype._clone = /**\n * @param {?} obj\n * @return {?}\n */\n function (obj) {\n var /** @type {?} */ clone = Object.create(obj.constructor.prototype);\n for (var /** @type {?} */ prop in obj) {\n clone[prop] = obj[prop];\n }\n return clone;\n };\n /**\n * @param {?} expr\n * @param {?} context\n * @return {?}\n */\n _ApplySourceSpanTransformer.prototype.transformExpr = /**\n * @param {?} expr\n * @param {?} context\n * @return {?}\n */\n function (expr, context) {\n if (!expr.sourceSpan) {\n expr = this._clone(expr);\n expr.sourceSpan = this.sourceSpan;\n }\n return expr;\n };\n /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n _ApplySourceSpanTransformer.prototype.transformStmt = /**\n * @param {?} stmt\n * @param {?} context\n * @return {?}\n */\n function (stmt, context) {\n if (!stmt.sourceSpan) {\n stmt = this._clone(stmt);\n stmt.sourceSpan = this.sourceSpan;\n }\n return stmt;\n };\n return _ApplySourceSpanTransformer;\n}(AstTransformer$1));\n/**\n * @param {?} name\n * @param {?=} type\n * @param {?=} sourceSpan\n * @return {?}\n */\nfunction variable(name, type, sourceSpan) {\n return new ReadVarExpr(name, type, sourceSpan);\n}\n/**\n * @param {?} id\n * @param {?=} typeParams\n * @param {?=} sourceSpan\n * @return {?}\n */\nfunction importExpr(id, typeParams, sourceSpan) {\n if (typeParams === void 0) { typeParams = null; }\n return new ExternalExpr(id, null, typeParams, sourceSpan);\n}\n/**\n * @param {?} id\n * @param {?=} typeParams\n * @param {?=} typeModifiers\n * @return {?}\n */\nfunction importType(id, typeParams, typeModifiers) {\n if (typeParams === void 0) { typeParams = null; }\n if (typeModifiers === void 0) { typeModifiers = null; }\n return id != null ? expressionType(importExpr(id, typeParams, null), typeModifiers) : null;\n}\n/**\n * @param {?} expr\n * @param {?=} typeModifiers\n * @return {?}\n */\nfunction expressionType(expr, typeModifiers) {\n if (typeModifiers === void 0) { typeModifiers = null; }\n return new ExpressionType(expr, typeModifiers);\n}\n/**\n * @param {?} values\n * @param {?=} type\n * @param {?=} sourceSpan\n * @return {?}\n */\nfunction literalArr(values, type, sourceSpan) {\n return new LiteralArrayExpr(values, type, sourceSpan);\n}\n/**\n * @param {?} values\n * @param {?=} type\n * @return {?}\n */\nfunction literalMap(values, type) {\n if (type === void 0) { type = null; }\n return new LiteralMapExpr(values.map(function (e) { return new LiteralMapEntry(e.key, e.value, e.quoted); }), type, null);\n}\n/**\n * @param {?} expr\n * @param {?=} sourceSpan\n * @return {?}\n */\nfunction not(expr, sourceSpan) {\n return new NotExpr(expr, sourceSpan);\n}\n/**\n * @param {?} expr\n * @param {?=} sourceSpan\n * @return {?}\n */\nfunction assertNotNull(expr, sourceSpan) {\n return new AssertNotNull(expr, sourceSpan);\n}\n/**\n * @param {?} params\n * @param {?} body\n * @param {?=} type\n * @param {?=} sourceSpan\n * @return {?}\n */\nfunction fn(params, body, type, sourceSpan) {\n return new FunctionExpr(params, body, type, sourceSpan);\n}\n/**\n * @param {?} value\n * @param {?=} type\n * @param {?=} sourceSpan\n * @return {?}\n */\nfunction literal(value, type, sourceSpan) {\n return new LiteralExpr(value, type, sourceSpan);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar ProviderError = /** @class */ (function (_super) {\n __extends(ProviderError, _super);\n function ProviderError(message, span) {\n return _super.call(this, span, message) || this;\n }\n return ProviderError;\n}(ParseError));\n/**\n * @record\n */\n\nvar ProviderViewContext = /** @class */ (function () {\n function ProviderViewContext(reflector, component) {\n var _this = this;\n this.reflector = reflector;\n this.component = component;\n this.errors = [];\n this.viewQueries = _getViewQueries(component);\n this.viewProviders = new Map();\n component.viewProviders.forEach(function (provider) {\n if (_this.viewProviders.get(tokenReference(provider.token)) == null) {\n _this.viewProviders.set(tokenReference(provider.token), true);\n }\n });\n }\n return ProviderViewContext;\n}());\nvar ProviderElementContext = /** @class */ (function () {\n function ProviderElementContext(viewContext, _parent, _isViewRoot, _directiveAsts, attrs, refs, isTemplate, contentQueryStartId, _sourceSpan) {\n var _this = this;\n this.viewContext = viewContext;\n this._parent = _parent;\n this._isViewRoot = _isViewRoot;\n this._directiveAsts = _directiveAsts;\n this._sourceSpan = _sourceSpan;\n this._transformedProviders = new Map();\n this._seenProviders = new Map();\n this._queriedTokens = new Map();\n this.transformedHasViewContainer = false;\n this._attrs = {};\n attrs.forEach(function (attrAst) { return _this._attrs[attrAst.name] = attrAst.value; });\n var /** @type {?} */ directivesMeta = _directiveAsts.map(function (directiveAst) { return directiveAst.directive; });\n this._allProviders =\n _resolveProvidersFromDirectives(directivesMeta, _sourceSpan, viewContext.errors);\n this._contentQueries = _getContentQueries(contentQueryStartId, directivesMeta);\n Array.from(this._allProviders.values()).forEach(function (provider) {\n _this._addQueryReadsTo(provider.token, provider.token, _this._queriedTokens);\n });\n if (isTemplate) {\n var /** @type {?} */ templateRefId = createTokenForExternalReference(this.viewContext.reflector, Identifiers.TemplateRef);\n this._addQueryReadsTo(templateRefId, templateRefId, this._queriedTokens);\n }\n refs.forEach(function (refAst) {\n var /** @type {?} */ defaultQueryValue = refAst.value ||\n createTokenForExternalReference(_this.viewContext.reflector, Identifiers.ElementRef);\n _this._addQueryReadsTo({ value: refAst.name }, defaultQueryValue, _this._queriedTokens);\n });\n if (this._queriedTokens.get(this.viewContext.reflector.resolveExternalReference(Identifiers.ViewContainerRef))) {\n this.transformedHasViewContainer = true;\n }\n // create the providers that we know are eager first\n Array.from(this._allProviders.values()).forEach(function (provider) {\n var /** @type {?} */ eager = provider.eager || _this._queriedTokens.get(tokenReference(provider.token));\n if (eager) {\n _this._getOrCreateLocalProvider(provider.providerType, provider.token, true);\n }\n });\n }\n /**\n * @return {?}\n */\n ProviderElementContext.prototype.afterElement = /**\n * @return {?}\n */\n function () {\n var _this = this;\n // collect lazy providers\n Array.from(this._allProviders.values()).forEach(function (provider) {\n _this._getOrCreateLocalProvider(provider.providerType, provider.token, false);\n });\n };\n Object.defineProperty(ProviderElementContext.prototype, \"transformProviders\", {\n get: /**\n * @return {?}\n */\n function () {\n // Note: Maps keep their insertion order.\n var /** @type {?} */ lazyProviders = [];\n var /** @type {?} */ eagerProviders = [];\n this._transformedProviders.forEach(function (provider) {\n if (provider.eager) {\n eagerProviders.push(provider);\n }\n else {\n lazyProviders.push(provider);\n }\n });\n return lazyProviders.concat(eagerProviders);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ProviderElementContext.prototype, \"transformedDirectiveAsts\", {\n get: /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ sortedProviderTypes = this.transformProviders.map(function (provider) { return provider.token.identifier; });\n var /** @type {?} */ sortedDirectives = this._directiveAsts.slice();\n sortedDirectives.sort(function (dir1, dir2) {\n return sortedProviderTypes.indexOf(dir1.directive.type) -\n sortedProviderTypes.indexOf(dir2.directive.type);\n });\n return sortedDirectives;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ProviderElementContext.prototype, \"queryMatches\", {\n get: /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ allMatches = [];\n this._queriedTokens.forEach(function (matches) { allMatches.push.apply(allMatches, matches); });\n return allMatches;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} token\n * @param {?} defaultValue\n * @param {?} queryReadTokens\n * @return {?}\n */\n ProviderElementContext.prototype._addQueryReadsTo = /**\n * @param {?} token\n * @param {?} defaultValue\n * @param {?} queryReadTokens\n * @return {?}\n */\n function (token, defaultValue, queryReadTokens) {\n this._getQueriesFor(token).forEach(function (query) {\n var /** @type {?} */ queryValue = query.meta.read || defaultValue;\n var /** @type {?} */ tokenRef = tokenReference(queryValue);\n var /** @type {?} */ queryMatches = queryReadTokens.get(tokenRef);\n if (!queryMatches) {\n queryMatches = [];\n queryReadTokens.set(tokenRef, queryMatches);\n }\n queryMatches.push({ queryId: query.queryId, value: queryValue });\n });\n };\n /**\n * @param {?} token\n * @return {?}\n */\n ProviderElementContext.prototype._getQueriesFor = /**\n * @param {?} token\n * @return {?}\n */\n function (token) {\n var /** @type {?} */ result = [];\n var /** @type {?} */ currentEl = this;\n var /** @type {?} */ distance = 0;\n var /** @type {?} */ queries;\n while (currentEl !== null) {\n queries = currentEl._contentQueries.get(tokenReference(token));\n if (queries) {\n result.push.apply(result, queries.filter(function (query) { return query.meta.descendants || distance <= 1; }));\n }\n if (currentEl._directiveAsts.length > 0) {\n distance++;\n }\n currentEl = currentEl._parent;\n }\n queries = this.viewContext.viewQueries.get(tokenReference(token));\n if (queries) {\n result.push.apply(result, queries);\n }\n return result;\n };\n /**\n * @param {?} requestingProviderType\n * @param {?} token\n * @param {?} eager\n * @return {?}\n */\n ProviderElementContext.prototype._getOrCreateLocalProvider = /**\n * @param {?} requestingProviderType\n * @param {?} token\n * @param {?} eager\n * @return {?}\n */\n function (requestingProviderType, token, eager) {\n var _this = this;\n var /** @type {?} */ resolvedProvider = this._allProviders.get(tokenReference(token));\n if (!resolvedProvider || ((requestingProviderType === ProviderAstType.Directive ||\n requestingProviderType === ProviderAstType.PublicService) &&\n resolvedProvider.providerType === ProviderAstType.PrivateService) ||\n ((requestingProviderType === ProviderAstType.PrivateService ||\n requestingProviderType === ProviderAstType.PublicService) &&\n resolvedProvider.providerType === ProviderAstType.Builtin)) {\n return null;\n }\n var /** @type {?} */ transformedProviderAst = this._transformedProviders.get(tokenReference(token));\n if (transformedProviderAst) {\n return transformedProviderAst;\n }\n if (this._seenProviders.get(tokenReference(token)) != null) {\n this.viewContext.errors.push(new ProviderError(\"Cannot instantiate cyclic dependency! \" + tokenName(token), this._sourceSpan));\n return null;\n }\n this._seenProviders.set(tokenReference(token), true);\n var /** @type {?} */ transformedProviders = resolvedProvider.providers.map(function (provider) {\n var /** @type {?} */ transformedUseValue = provider.useValue;\n var /** @type {?} */ transformedUseExisting = /** @type {?} */ ((provider.useExisting));\n var /** @type {?} */ transformedDeps = /** @type {?} */ ((undefined));\n if (provider.useExisting != null) {\n var /** @type {?} */ existingDiDep = /** @type {?} */ ((_this._getDependency(resolvedProvider.providerType, { token: provider.useExisting }, eager)));\n if (existingDiDep.token != null) {\n transformedUseExisting = existingDiDep.token;\n }\n else {\n transformedUseExisting = /** @type {?} */ ((null));\n transformedUseValue = existingDiDep.value;\n }\n }\n else if (provider.useFactory) {\n var /** @type {?} */ deps = provider.deps || provider.useFactory.diDeps;\n transformedDeps =\n deps.map(function (dep) { return ((_this._getDependency(resolvedProvider.providerType, dep, eager))); });\n }\n else if (provider.useClass) {\n var /** @type {?} */ deps = provider.deps || provider.useClass.diDeps;\n transformedDeps =\n deps.map(function (dep) { return ((_this._getDependency(resolvedProvider.providerType, dep, eager))); });\n }\n return _transformProvider(provider, {\n useExisting: transformedUseExisting,\n useValue: transformedUseValue,\n deps: transformedDeps\n });\n });\n transformedProviderAst =\n _transformProviderAst(resolvedProvider, { eager: eager, providers: transformedProviders });\n this._transformedProviders.set(tokenReference(token), transformedProviderAst);\n return transformedProviderAst;\n };\n /**\n * @param {?} requestingProviderType\n * @param {?} dep\n * @param {?=} eager\n * @return {?}\n */\n ProviderElementContext.prototype._getLocalDependency = /**\n * @param {?} requestingProviderType\n * @param {?} dep\n * @param {?=} eager\n * @return {?}\n */\n function (requestingProviderType, dep, eager) {\n if (eager === void 0) { eager = false; }\n if (dep.isAttribute) {\n var /** @type {?} */ attrValue = this._attrs[/** @type {?} */ ((dep.token)).value];\n return { isValue: true, value: attrValue == null ? null : attrValue };\n }\n if (dep.token != null) {\n // access builtints\n if ((requestingProviderType === ProviderAstType.Directive ||\n requestingProviderType === ProviderAstType.Component)) {\n if (tokenReference(dep.token) ===\n this.viewContext.reflector.resolveExternalReference(Identifiers.Renderer) ||\n tokenReference(dep.token) ===\n this.viewContext.reflector.resolveExternalReference(Identifiers.ElementRef) ||\n tokenReference(dep.token) ===\n this.viewContext.reflector.resolveExternalReference(Identifiers.ChangeDetectorRef) ||\n tokenReference(dep.token) ===\n this.viewContext.reflector.resolveExternalReference(Identifiers.TemplateRef)) {\n return dep;\n }\n if (tokenReference(dep.token) ===\n this.viewContext.reflector.resolveExternalReference(Identifiers.ViewContainerRef)) {\n (/** @type {?} */ (this)).transformedHasViewContainer = true;\n }\n }\n // access the injector\n if (tokenReference(dep.token) ===\n this.viewContext.reflector.resolveExternalReference(Identifiers.Injector)) {\n return dep;\n }\n // access providers\n if (this._getOrCreateLocalProvider(requestingProviderType, dep.token, eager) != null) {\n return dep;\n }\n }\n return null;\n };\n /**\n * @param {?} requestingProviderType\n * @param {?} dep\n * @param {?=} eager\n * @return {?}\n */\n ProviderElementContext.prototype._getDependency = /**\n * @param {?} requestingProviderType\n * @param {?} dep\n * @param {?=} eager\n * @return {?}\n */\n function (requestingProviderType, dep, eager) {\n if (eager === void 0) { eager = false; }\n var /** @type {?} */ currElement = this;\n var /** @type {?} */ currEager = eager;\n var /** @type {?} */ result = null;\n if (!dep.isSkipSelf) {\n result = this._getLocalDependency(requestingProviderType, dep, eager);\n }\n if (dep.isSelf) {\n if (!result && dep.isOptional) {\n result = { isValue: true, value: null };\n }\n }\n else {\n // check parent elements\n while (!result && currElement._parent) {\n var /** @type {?} */ prevElement = currElement;\n currElement = currElement._parent;\n if (prevElement._isViewRoot) {\n currEager = false;\n }\n result = currElement._getLocalDependency(ProviderAstType.PublicService, dep, currEager);\n }\n // check @Host restriction\n if (!result) {\n if (!dep.isHost || this.viewContext.component.isHost ||\n this.viewContext.component.type.reference === tokenReference(/** @type {?} */ ((dep.token))) ||\n this.viewContext.viewProviders.get(tokenReference(/** @type {?} */ ((dep.token)))) != null) {\n result = dep;\n }\n else {\n result = dep.isOptional ? result = { isValue: true, value: null } : null;\n }\n }\n }\n if (!result) {\n this.viewContext.errors.push(new ProviderError(\"No provider for \" + tokenName((/** @type {?} */ ((dep.token)))), this._sourceSpan));\n }\n return result;\n };\n return ProviderElementContext;\n}());\nvar NgModuleProviderAnalyzer = /** @class */ (function () {\n function NgModuleProviderAnalyzer(reflector, ngModule, extraProviders, sourceSpan) {\n var _this = this;\n this.reflector = reflector;\n this._transformedProviders = new Map();\n this._seenProviders = new Map();\n this._errors = [];\n this._allProviders = new Map();\n ngModule.transitiveModule.modules.forEach(function (ngModuleType) {\n var /** @type {?} */ ngModuleProvider = { token: { identifier: ngModuleType }, useClass: ngModuleType };\n _resolveProviders([ngModuleProvider], ProviderAstType.PublicService, true, sourceSpan, _this._errors, _this._allProviders);\n });\n _resolveProviders(ngModule.transitiveModule.providers.map(function (entry) { return entry.provider; }).concat(extraProviders), ProviderAstType.PublicService, false, sourceSpan, this._errors, this._allProviders);\n }\n /**\n * @return {?}\n */\n NgModuleProviderAnalyzer.prototype.parse = /**\n * @return {?}\n */\n function () {\n var _this = this;\n Array.from(this._allProviders.values()).forEach(function (provider) {\n _this._getOrCreateLocalProvider(provider.token, provider.eager);\n });\n if (this._errors.length > 0) {\n var /** @type {?} */ errorString = this._errors.join('\\n');\n throw new Error(\"Provider parse errors:\\n\" + errorString);\n }\n // Note: Maps keep their insertion order.\n var /** @type {?} */ lazyProviders = [];\n var /** @type {?} */ eagerProviders = [];\n this._transformedProviders.forEach(function (provider) {\n if (provider.eager) {\n eagerProviders.push(provider);\n }\n else {\n lazyProviders.push(provider);\n }\n });\n return lazyProviders.concat(eagerProviders);\n };\n /**\n * @param {?} token\n * @param {?} eager\n * @return {?}\n */\n NgModuleProviderAnalyzer.prototype._getOrCreateLocalProvider = /**\n * @param {?} token\n * @param {?} eager\n * @return {?}\n */\n function (token, eager) {\n var _this = this;\n var /** @type {?} */ resolvedProvider = this._allProviders.get(tokenReference(token));\n if (!resolvedProvider) {\n return null;\n }\n var /** @type {?} */ transformedProviderAst = this._transformedProviders.get(tokenReference(token));\n if (transformedProviderAst) {\n return transformedProviderAst;\n }\n if (this._seenProviders.get(tokenReference(token)) != null) {\n this._errors.push(new ProviderError(\"Cannot instantiate cyclic dependency! \" + tokenName(token), resolvedProvider.sourceSpan));\n return null;\n }\n this._seenProviders.set(tokenReference(token), true);\n var /** @type {?} */ transformedProviders = resolvedProvider.providers.map(function (provider) {\n var /** @type {?} */ transformedUseValue = provider.useValue;\n var /** @type {?} */ transformedUseExisting = /** @type {?} */ ((provider.useExisting));\n var /** @type {?} */ transformedDeps = /** @type {?} */ ((undefined));\n if (provider.useExisting != null) {\n var /** @type {?} */ existingDiDep = _this._getDependency({ token: provider.useExisting }, eager, resolvedProvider.sourceSpan);\n if (existingDiDep.token != null) {\n transformedUseExisting = existingDiDep.token;\n }\n else {\n transformedUseExisting = /** @type {?} */ ((null));\n transformedUseValue = existingDiDep.value;\n }\n }\n else if (provider.useFactory) {\n var /** @type {?} */ deps = provider.deps || provider.useFactory.diDeps;\n transformedDeps =\n deps.map(function (dep) { return _this._getDependency(dep, eager, resolvedProvider.sourceSpan); });\n }\n else if (provider.useClass) {\n var /** @type {?} */ deps = provider.deps || provider.useClass.diDeps;\n transformedDeps =\n deps.map(function (dep) { return _this._getDependency(dep, eager, resolvedProvider.sourceSpan); });\n }\n return _transformProvider(provider, {\n useExisting: transformedUseExisting,\n useValue: transformedUseValue,\n deps: transformedDeps\n });\n });\n transformedProviderAst =\n _transformProviderAst(resolvedProvider, { eager: eager, providers: transformedProviders });\n this._transformedProviders.set(tokenReference(token), transformedProviderAst);\n return transformedProviderAst;\n };\n /**\n * @param {?} dep\n * @param {?=} eager\n * @param {?=} requestorSourceSpan\n * @return {?}\n */\n NgModuleProviderAnalyzer.prototype._getDependency = /**\n * @param {?} dep\n * @param {?=} eager\n * @param {?=} requestorSourceSpan\n * @return {?}\n */\n function (dep, eager, requestorSourceSpan) {\n if (eager === void 0) { eager = false; }\n var /** @type {?} */ foundLocal = false;\n if (!dep.isSkipSelf && dep.token != null) {\n // access the injector\n if (tokenReference(dep.token) ===\n this.reflector.resolveExternalReference(Identifiers.Injector) ||\n tokenReference(dep.token) ===\n this.reflector.resolveExternalReference(Identifiers.ComponentFactoryResolver)) {\n foundLocal = true;\n // access providers\n }\n else if (this._getOrCreateLocalProvider(dep.token, eager) != null) {\n foundLocal = true;\n }\n }\n var /** @type {?} */ result = dep;\n if (dep.isSelf && !foundLocal) {\n if (dep.isOptional) {\n result = { isValue: true, value: null };\n }\n else {\n this._errors.push(new ProviderError(\"No provider for \" + tokenName((/** @type {?} */ ((dep.token)))), requestorSourceSpan));\n }\n }\n return result;\n };\n return NgModuleProviderAnalyzer;\n}());\n/**\n * @param {?} provider\n * @param {?} __1\n * @return {?}\n */\nfunction _transformProvider(provider, _a) {\n var useExisting = _a.useExisting, useValue = _a.useValue, deps = _a.deps;\n return {\n token: provider.token,\n useClass: provider.useClass,\n useExisting: useExisting,\n useFactory: provider.useFactory,\n useValue: useValue,\n deps: deps,\n multi: provider.multi\n };\n}\n/**\n * @param {?} provider\n * @param {?} __1\n * @return {?}\n */\nfunction _transformProviderAst(provider, _a) {\n var eager = _a.eager, providers = _a.providers;\n return new ProviderAst(provider.token, provider.multiProvider, provider.eager || eager, providers, provider.providerType, provider.lifecycleHooks, provider.sourceSpan);\n}\n/**\n * @param {?} directives\n * @param {?} sourceSpan\n * @param {?} targetErrors\n * @return {?}\n */\nfunction _resolveProvidersFromDirectives(directives, sourceSpan, targetErrors) {\n var /** @type {?} */ providersByToken = new Map();\n directives.forEach(function (directive) {\n var /** @type {?} */ dirProvider = { token: { identifier: directive.type }, useClass: directive.type };\n _resolveProviders([dirProvider], directive.isComponent ? ProviderAstType.Component : ProviderAstType.Directive, true, sourceSpan, targetErrors, providersByToken);\n });\n // Note: directives need to be able to overwrite providers of a component!\n var /** @type {?} */ directivesWithComponentFirst = directives.filter(function (dir) { return dir.isComponent; }).concat(directives.filter(function (dir) { return !dir.isComponent; }));\n directivesWithComponentFirst.forEach(function (directive) {\n _resolveProviders(directive.providers, ProviderAstType.PublicService, false, sourceSpan, targetErrors, providersByToken);\n _resolveProviders(directive.viewProviders, ProviderAstType.PrivateService, false, sourceSpan, targetErrors, providersByToken);\n });\n return providersByToken;\n}\n/**\n * @param {?} providers\n * @param {?} providerType\n * @param {?} eager\n * @param {?} sourceSpan\n * @param {?} targetErrors\n * @param {?} targetProvidersByToken\n * @return {?}\n */\nfunction _resolveProviders(providers, providerType, eager, sourceSpan, targetErrors, targetProvidersByToken) {\n providers.forEach(function (provider) {\n var /** @type {?} */ resolvedProvider = targetProvidersByToken.get(tokenReference(provider.token));\n if (resolvedProvider != null && !!resolvedProvider.multiProvider !== !!provider.multi) {\n targetErrors.push(new ProviderError(\"Mixing multi and non multi provider is not possible for token \" + tokenName(resolvedProvider.token), sourceSpan));\n }\n if (!resolvedProvider) {\n var /** @type {?} */ lifecycleHooks = provider.token.identifier &&\n (/** @type {?} */ (provider.token.identifier)).lifecycleHooks ?\n (/** @type {?} */ (provider.token.identifier)).lifecycleHooks :\n [];\n var /** @type {?} */ isUseValue = !(provider.useClass || provider.useExisting || provider.useFactory);\n resolvedProvider = new ProviderAst(provider.token, !!provider.multi, eager || isUseValue, [provider], providerType, lifecycleHooks, sourceSpan);\n targetProvidersByToken.set(tokenReference(provider.token), resolvedProvider);\n }\n else {\n if (!provider.multi) {\n resolvedProvider.providers.length = 0;\n }\n resolvedProvider.providers.push(provider);\n }\n });\n}\n/**\n * @param {?} component\n * @return {?}\n */\nfunction _getViewQueries(component) {\n // Note: queries start with id 1 so we can use the number in a Bloom filter!\n var /** @type {?} */ viewQueryId = 1;\n var /** @type {?} */ viewQueries = new Map();\n if (component.viewQueries) {\n component.viewQueries.forEach(function (query) { return _addQueryToTokenMap(viewQueries, { meta: query, queryId: viewQueryId++ }); });\n }\n return viewQueries;\n}\n/**\n * @param {?} contentQueryStartId\n * @param {?} directives\n * @return {?}\n */\nfunction _getContentQueries(contentQueryStartId, directives) {\n var /** @type {?} */ contentQueryId = contentQueryStartId;\n var /** @type {?} */ contentQueries = new Map();\n directives.forEach(function (directive, directiveIndex) {\n if (directive.queries) {\n directive.queries.forEach(function (query) { return _addQueryToTokenMap(contentQueries, { meta: query, queryId: contentQueryId++ }); });\n }\n });\n return contentQueries;\n}\n/**\n * @param {?} map\n * @param {?} query\n * @return {?}\n */\nfunction _addQueryToTokenMap(map, query) {\n query.meta.selectors.forEach(function (token) {\n var /** @type {?} */ entry = map.get(tokenReference(token));\n if (!entry) {\n entry = [];\n map.set(tokenReference(token), entry);\n }\n entry.push(query);\n });\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar QUOTED_KEYS = '$quoted$';\n/**\n * @param {?} ctx\n * @param {?} value\n * @param {?=} type\n * @return {?}\n */\nfunction convertValueToOutputAst(ctx, value, type) {\n if (type === void 0) { type = null; }\n return visitValue(value, new _ValueOutputAstTransformer(ctx), type);\n}\nvar _ValueOutputAstTransformer = /** @class */ (function () {\n function _ValueOutputAstTransformer(ctx) {\n this.ctx = ctx;\n }\n /**\n * @param {?} arr\n * @param {?} type\n * @return {?}\n */\n _ValueOutputAstTransformer.prototype.visitArray = /**\n * @param {?} arr\n * @param {?} type\n * @return {?}\n */\n function (arr, type) {\n var _this = this;\n return literalArr(arr.map(function (value) { return visitValue(value, _this, null); }), type);\n };\n /**\n * @param {?} map\n * @param {?} type\n * @return {?}\n */\n _ValueOutputAstTransformer.prototype.visitStringMap = /**\n * @param {?} map\n * @param {?} type\n * @return {?}\n */\n function (map, type) {\n var _this = this;\n var /** @type {?} */ entries = [];\n var /** @type {?} */ quotedSet = new Set(map && map[QUOTED_KEYS]);\n Object.keys(map).forEach(function (key) {\n entries.push(new LiteralMapEntry(key, visitValue(map[key], _this, null), quotedSet.has(key)));\n });\n return new LiteralMapExpr(entries, type);\n };\n /**\n * @param {?} value\n * @param {?} type\n * @return {?}\n */\n _ValueOutputAstTransformer.prototype.visitPrimitive = /**\n * @param {?} value\n * @param {?} type\n * @return {?}\n */\n function (value, type) { return literal(value, type); };\n /**\n * @param {?} value\n * @param {?} type\n * @return {?}\n */\n _ValueOutputAstTransformer.prototype.visitOther = /**\n * @param {?} value\n * @param {?} type\n * @return {?}\n */\n function (value, type) {\n if (value instanceof Expression) {\n return value;\n }\n else {\n return this.ctx.importExpr(value);\n }\n };\n return _ValueOutputAstTransformer;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} ctx\n * @param {?} providerAst\n * @return {?}\n */\nfunction providerDef(ctx, providerAst) {\n var /** @type {?} */ flags = 0;\n if (!providerAst.eager) {\n flags |= 4096 /* LazyProvider */;\n }\n if (providerAst.providerType === ProviderAstType.PrivateService) {\n flags |= 8192 /* PrivateProvider */;\n }\n providerAst.lifecycleHooks.forEach(function (lifecycleHook) {\n // for regular providers, we only support ngOnDestroy\n if (lifecycleHook === LifecycleHooks.OnDestroy ||\n providerAst.providerType === ProviderAstType.Directive ||\n providerAst.providerType === ProviderAstType.Component) {\n flags |= lifecycleHookToNodeFlag(lifecycleHook);\n }\n });\n var _a = providerAst.multiProvider ?\n multiProviderDef(ctx, flags, providerAst.providers) :\n singleProviderDef(ctx, flags, providerAst.providerType, providerAst.providers[0]), providerExpr = _a.providerExpr, providerFlags = _a.flags, depsExpr = _a.depsExpr;\n return {\n providerExpr: providerExpr,\n flags: providerFlags, depsExpr: depsExpr,\n tokenExpr: tokenExpr(ctx, providerAst.token),\n };\n}\n/**\n * @param {?} ctx\n * @param {?} flags\n * @param {?} providers\n * @return {?}\n */\nfunction multiProviderDef(ctx, flags, providers) {\n var /** @type {?} */ allDepDefs = [];\n var /** @type {?} */ allParams = [];\n var /** @type {?} */ exprs = providers.map(function (provider, providerIndex) {\n var /** @type {?} */ expr;\n if (provider.useClass) {\n var /** @type {?} */ depExprs = convertDeps(providerIndex, provider.deps || provider.useClass.diDeps);\n expr = ctx.importExpr(provider.useClass.reference).instantiate(depExprs);\n }\n else if (provider.useFactory) {\n var /** @type {?} */ depExprs = convertDeps(providerIndex, provider.deps || provider.useFactory.diDeps);\n expr = ctx.importExpr(provider.useFactory.reference).callFn(depExprs);\n }\n else if (provider.useExisting) {\n var /** @type {?} */ depExprs = convertDeps(providerIndex, [{ token: provider.useExisting }]);\n expr = depExprs[0];\n }\n else {\n expr = convertValueToOutputAst(ctx, provider.useValue);\n }\n return expr;\n });\n var /** @type {?} */ providerExpr = fn(allParams, [new ReturnStatement(literalArr(exprs))], INFERRED_TYPE);\n return {\n providerExpr: providerExpr,\n flags: flags | 1024 /* TypeFactoryProvider */,\n depsExpr: literalArr(allDepDefs)\n };\n /**\n * @param {?} providerIndex\n * @param {?} deps\n * @return {?}\n */\n function convertDeps(providerIndex, deps) {\n return deps.map(function (dep, depIndex) {\n var /** @type {?} */ paramName = \"p\" + providerIndex + \"_\" + depIndex;\n allParams.push(new FnParam(paramName, DYNAMIC_TYPE));\n allDepDefs.push(depDef(ctx, dep));\n return variable(paramName);\n });\n }\n}\n/**\n * @param {?} ctx\n * @param {?} flags\n * @param {?} providerType\n * @param {?} providerMeta\n * @return {?}\n */\nfunction singleProviderDef(ctx, flags, providerType, providerMeta) {\n var /** @type {?} */ providerExpr;\n var /** @type {?} */ deps;\n if (providerType === ProviderAstType.Directive || providerType === ProviderAstType.Component) {\n providerExpr = ctx.importExpr(/** @type {?} */ ((providerMeta.useClass)).reference);\n flags |= 16384 /* TypeDirective */;\n deps = providerMeta.deps || /** @type {?} */ ((providerMeta.useClass)).diDeps;\n }\n else {\n if (providerMeta.useClass) {\n providerExpr = ctx.importExpr(providerMeta.useClass.reference);\n flags |= 512 /* TypeClassProvider */;\n deps = providerMeta.deps || providerMeta.useClass.diDeps;\n }\n else if (providerMeta.useFactory) {\n providerExpr = ctx.importExpr(providerMeta.useFactory.reference);\n flags |= 1024 /* TypeFactoryProvider */;\n deps = providerMeta.deps || providerMeta.useFactory.diDeps;\n }\n else if (providerMeta.useExisting) {\n providerExpr = NULL_EXPR;\n flags |= 2048 /* TypeUseExistingProvider */;\n deps = [{ token: providerMeta.useExisting }];\n }\n else {\n providerExpr = convertValueToOutputAst(ctx, providerMeta.useValue);\n flags |= 256 /* TypeValueProvider */;\n deps = [];\n }\n }\n var /** @type {?} */ depsExpr = literalArr(deps.map(function (dep) { return depDef(ctx, dep); }));\n return { providerExpr: providerExpr, flags: flags, depsExpr: depsExpr };\n}\n/**\n * @param {?} ctx\n * @param {?} tokenMeta\n * @return {?}\n */\nfunction tokenExpr(ctx, tokenMeta) {\n return tokenMeta.identifier ? ctx.importExpr(tokenMeta.identifier.reference) :\n literal(tokenMeta.value);\n}\n/**\n * @param {?} ctx\n * @param {?} dep\n * @return {?}\n */\nfunction depDef(ctx, dep) {\n // Note: the following fields have already been normalized out by provider_analyzer:\n // - isAttribute, isSelf, isHost\n var /** @type {?} */ expr = dep.isValue ? convertValueToOutputAst(ctx, dep.value) : tokenExpr(ctx, /** @type {?} */ ((dep.token)));\n var /** @type {?} */ flags = 0;\n if (dep.isSkipSelf) {\n flags |= 1 /* SkipSelf */;\n }\n if (dep.isOptional) {\n flags |= 2 /* Optional */;\n }\n if (dep.isValue) {\n flags |= 8 /* Value */;\n }\n return flags === 0 /* None */ ? expr : literalArr([literal(flags), expr]);\n}\n/**\n * @param {?} lifecycleHook\n * @return {?}\n */\nfunction lifecycleHookToNodeFlag(lifecycleHook) {\n var /** @type {?} */ nodeFlag = 0;\n switch (lifecycleHook) {\n case LifecycleHooks.AfterContentChecked:\n nodeFlag = 2097152 /* AfterContentChecked */;\n break;\n case LifecycleHooks.AfterContentInit:\n nodeFlag = 1048576 /* AfterContentInit */;\n break;\n case LifecycleHooks.AfterViewChecked:\n nodeFlag = 8388608 /* AfterViewChecked */;\n break;\n case LifecycleHooks.AfterViewInit:\n nodeFlag = 4194304 /* AfterViewInit */;\n break;\n case LifecycleHooks.DoCheck:\n nodeFlag = 262144 /* DoCheck */;\n break;\n case LifecycleHooks.OnChanges:\n nodeFlag = 524288 /* OnChanges */;\n break;\n case LifecycleHooks.OnDestroy:\n nodeFlag = 131072 /* OnDestroy */;\n break;\n case LifecycleHooks.OnInit:\n nodeFlag = 65536 /* OnInit */;\n break;\n }\n return nodeFlag;\n}\n/**\n * @param {?} reflector\n * @param {?} ctx\n * @param {?} flags\n * @param {?} entryComponents\n * @return {?}\n */\nfunction componentFactoryResolverProviderDef(reflector, ctx, flags, entryComponents) {\n var /** @type {?} */ entryComponentFactories = entryComponents.map(function (entryComponent) { return ctx.importExpr(entryComponent.componentFactory); });\n var /** @type {?} */ token = createTokenForExternalReference(reflector, Identifiers.ComponentFactoryResolver);\n var /** @type {?} */ classMeta = {\n diDeps: [\n { isValue: true, value: literalArr(entryComponentFactories) },\n { token: token, isSkipSelf: true, isOptional: true },\n { token: createTokenForExternalReference(reflector, Identifiers.NgModuleRef) },\n ],\n lifecycleHooks: [],\n reference: reflector.resolveExternalReference(Identifiers.CodegenComponentFactoryResolver)\n };\n var _a = singleProviderDef(ctx, flags, ProviderAstType.PrivateService, {\n token: token,\n multi: false,\n useClass: classMeta,\n }), providerExpr = _a.providerExpr, providerFlags = _a.flags, depsExpr = _a.depsExpr;\n return { providerExpr: providerExpr, flags: providerFlags, depsExpr: depsExpr, tokenExpr: tokenExpr(ctx, token) };\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar NgModuleCompileResult = /** @class */ (function () {\n function NgModuleCompileResult(ngModuleFactoryVar) {\n this.ngModuleFactoryVar = ngModuleFactoryVar;\n }\n return NgModuleCompileResult;\n}());\nvar LOG_VAR = variable('_l');\nvar NgModuleCompiler = /** @class */ (function () {\n function NgModuleCompiler(reflector) {\n this.reflector = reflector;\n }\n /**\n * @param {?} ctx\n * @param {?} ngModuleMeta\n * @param {?} extraProviders\n * @return {?}\n */\n NgModuleCompiler.prototype.compile = /**\n * @param {?} ctx\n * @param {?} ngModuleMeta\n * @param {?} extraProviders\n * @return {?}\n */\n function (ctx, ngModuleMeta, extraProviders) {\n var /** @type {?} */ sourceSpan = typeSourceSpan('NgModule', ngModuleMeta.type);\n var /** @type {?} */ entryComponentFactories = ngModuleMeta.transitiveModule.entryComponents;\n var /** @type {?} */ bootstrapComponents = ngModuleMeta.bootstrapComponents;\n var /** @type {?} */ providerParser = new NgModuleProviderAnalyzer(this.reflector, ngModuleMeta, extraProviders, sourceSpan);\n var /** @type {?} */ providerDefs = [componentFactoryResolverProviderDef(this.reflector, ctx, 0 /* None */, entryComponentFactories)]\n .concat(providerParser.parse().map(function (provider) { return providerDef(ctx, provider); }))\n .map(function (_a) {\n var providerExpr = _a.providerExpr, depsExpr = _a.depsExpr, flags = _a.flags, tokenExpr = _a.tokenExpr;\n return importExpr(Identifiers.moduleProviderDef).callFn([\n literal(flags), tokenExpr, providerExpr, depsExpr\n ]);\n });\n var /** @type {?} */ ngModuleDef = importExpr(Identifiers.moduleDef).callFn([literalArr(providerDefs)]);\n var /** @type {?} */ ngModuleDefFactory = fn([new FnParam(/** @type {?} */ ((LOG_VAR.name)))], [new ReturnStatement(ngModuleDef)], INFERRED_TYPE);\n var /** @type {?} */ ngModuleFactoryVar = identifierName(ngModuleMeta.type) + \"NgFactory\";\n this._createNgModuleFactory(ctx, ngModuleMeta.type.reference, importExpr(Identifiers.createModuleFactory).callFn([\n ctx.importExpr(ngModuleMeta.type.reference),\n literalArr(bootstrapComponents.map(function (id) { return ctx.importExpr(id.reference); })),\n ngModuleDefFactory\n ]));\n if (ngModuleMeta.id) {\n var /** @type {?} */ registerFactoryStmt = importExpr(Identifiers.RegisterModuleFactoryFn)\n .callFn([literal(ngModuleMeta.id), variable(ngModuleFactoryVar)])\n .toStmt();\n ctx.statements.push(registerFactoryStmt);\n }\n return new NgModuleCompileResult(ngModuleFactoryVar);\n };\n /**\n * @param {?} ctx\n * @param {?} ngModuleReference\n * @return {?}\n */\n NgModuleCompiler.prototype.createStub = /**\n * @param {?} ctx\n * @param {?} ngModuleReference\n * @return {?}\n */\n function (ctx, ngModuleReference) {\n this._createNgModuleFactory(ctx, ngModuleReference, NULL_EXPR);\n };\n /**\n * @param {?} ctx\n * @param {?} reference\n * @param {?} value\n * @return {?}\n */\n NgModuleCompiler.prototype._createNgModuleFactory = /**\n * @param {?} ctx\n * @param {?} reference\n * @param {?} value\n * @return {?}\n */\n function (ctx, reference, value) {\n var /** @type {?} */ ngModuleFactoryVar = identifierName({ reference: reference }) + \"NgFactory\";\n var /** @type {?} */ ngModuleFactoryStmt = variable(ngModuleFactoryVar)\n .set(value)\n .toDeclStmt(importType(Identifiers.NgModuleFactory, [/** @type {?} */ ((expressionType(ctx.importExpr(reference))))], [TypeModifier.Const]), [StmtModifier.Final, StmtModifier.Exported]);\n ctx.statements.push(ngModuleFactoryStmt);\n };\n return NgModuleCompiler;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Resolves types to {\\@link NgModule}.\n */\nvar NgModuleResolver = /** @class */ (function () {\n function NgModuleResolver(_reflector) {\n this._reflector = _reflector;\n }\n /**\n * @param {?} type\n * @return {?}\n */\n NgModuleResolver.prototype.isNgModule = /**\n * @param {?} type\n * @return {?}\n */\n function (type) { return this._reflector.annotations(type).some(createNgModule.isTypeOf); };\n /**\n * @param {?} type\n * @param {?=} throwIfNotFound\n * @return {?}\n */\n NgModuleResolver.prototype.resolve = /**\n * @param {?} type\n * @param {?=} throwIfNotFound\n * @return {?}\n */\n function (type, throwIfNotFound) {\n if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n var /** @type {?} */ ngModuleMeta = findLast(this._reflector.annotations(type), createNgModule.isTypeOf);\n if (ngModuleMeta) {\n return ngModuleMeta;\n }\n else {\n if (throwIfNotFound) {\n throw new Error(\"No NgModule metadata found for '\" + stringify(type) + \"'.\");\n }\n return null;\n }\n };\n return NgModuleResolver;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n// https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit\nvar VERSION$1 = 3;\nvar JS_B64_PREFIX = '# sourceMappingURL=data:application/json;base64,';\nvar SourceMapGenerator = /** @class */ (function () {\n function SourceMapGenerator(file) {\n if (file === void 0) { file = null; }\n this.file = file;\n this.sourcesContent = new Map();\n this.lines = [];\n this.lastCol0 = 0;\n this.hasMappings = false;\n }\n // The content is `null` when the content is expected to be loaded using the URL\n /**\n * @param {?} url\n * @param {?=} content\n * @return {?}\n */\n SourceMapGenerator.prototype.addSource = /**\n * @param {?} url\n * @param {?=} content\n * @return {?}\n */\n function (url, content) {\n if (content === void 0) { content = null; }\n if (!this.sourcesContent.has(url)) {\n this.sourcesContent.set(url, content);\n }\n return this;\n };\n /**\n * @return {?}\n */\n SourceMapGenerator.prototype.addLine = /**\n * @return {?}\n */\n function () {\n this.lines.push([]);\n this.lastCol0 = 0;\n return this;\n };\n /**\n * @param {?} col0\n * @param {?=} sourceUrl\n * @param {?=} sourceLine0\n * @param {?=} sourceCol0\n * @return {?}\n */\n SourceMapGenerator.prototype.addMapping = /**\n * @param {?} col0\n * @param {?=} sourceUrl\n * @param {?=} sourceLine0\n * @param {?=} sourceCol0\n * @return {?}\n */\n function (col0, sourceUrl, sourceLine0, sourceCol0) {\n if (!this.currentLine) {\n throw new Error(\"A line must be added before mappings can be added\");\n }\n if (sourceUrl != null && !this.sourcesContent.has(sourceUrl)) {\n throw new Error(\"Unknown source file \\\"\" + sourceUrl + \"\\\"\");\n }\n if (col0 == null) {\n throw new Error(\"The column in the generated code must be provided\");\n }\n if (col0 < this.lastCol0) {\n throw new Error(\"Mapping should be added in output order\");\n }\n if (sourceUrl && (sourceLine0 == null || sourceCol0 == null)) {\n throw new Error(\"The source location must be provided when a source url is provided\");\n }\n this.hasMappings = true;\n this.lastCol0 = col0;\n this.currentLine.push({ col0: col0, sourceUrl: sourceUrl, sourceLine0: sourceLine0, sourceCol0: sourceCol0 });\n return this;\n };\n Object.defineProperty(SourceMapGenerator.prototype, \"currentLine\", {\n get: /**\n * @return {?}\n */\n function () { return this.lines.slice(-1)[0]; },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n SourceMapGenerator.prototype.toJSON = /**\n * @return {?}\n */\n function () {\n var _this = this;\n if (!this.hasMappings) {\n return null;\n }\n var /** @type {?} */ sourcesIndex = new Map();\n var /** @type {?} */ sources = [];\n var /** @type {?} */ sourcesContent = [];\n Array.from(this.sourcesContent.keys()).forEach(function (url, i) {\n sourcesIndex.set(url, i);\n sources.push(url);\n sourcesContent.push(_this.sourcesContent.get(url) || null);\n });\n var /** @type {?} */ mappings = '';\n var /** @type {?} */ lastCol0 = 0;\n var /** @type {?} */ lastSourceIndex = 0;\n var /** @type {?} */ lastSourceLine0 = 0;\n var /** @type {?} */ lastSourceCol0 = 0;\n this.lines.forEach(function (segments) {\n lastCol0 = 0;\n mappings += segments\n .map(function (segment) {\n // zero-based starting column of the line in the generated code\n var /** @type {?} */ segAsStr = toBase64VLQ(segment.col0 - lastCol0);\n lastCol0 = segment.col0;\n if (segment.sourceUrl != null) {\n // zero-based index into the “sources” list\n segAsStr +=\n toBase64VLQ(/** @type {?} */ ((sourcesIndex.get(segment.sourceUrl))) - lastSourceIndex);\n lastSourceIndex = /** @type {?} */ ((sourcesIndex.get(segment.sourceUrl)));\n // the zero-based starting line in the original source\n segAsStr += toBase64VLQ(/** @type {?} */ ((segment.sourceLine0)) - lastSourceLine0);\n lastSourceLine0 = /** @type {?} */ ((segment.sourceLine0));\n // the zero-based starting column in the original source\n segAsStr += toBase64VLQ(/** @type {?} */ ((segment.sourceCol0)) - lastSourceCol0);\n lastSourceCol0 = /** @type {?} */ ((segment.sourceCol0));\n }\n return segAsStr;\n })\n .join(',');\n mappings += ';';\n });\n mappings = mappings.slice(0, -1);\n return {\n 'file': this.file || '',\n 'version': VERSION$1,\n 'sourceRoot': '',\n 'sources': sources,\n 'sourcesContent': sourcesContent,\n 'mappings': mappings,\n };\n };\n /**\n * @return {?}\n */\n SourceMapGenerator.prototype.toJsComment = /**\n * @return {?}\n */\n function () {\n return this.hasMappings ? '//' + JS_B64_PREFIX + toBase64String(JSON.stringify(this, null, 0)) :\n '';\n };\n return SourceMapGenerator;\n}());\n/**\n * @param {?} value\n * @return {?}\n */\nfunction toBase64String(value) {\n var /** @type {?} */ b64 = '';\n value = utf8Encode(value);\n for (var /** @type {?} */ i = 0; i < value.length;) {\n var /** @type {?} */ i1 = value.charCodeAt(i++);\n var /** @type {?} */ i2 = value.charCodeAt(i++);\n var /** @type {?} */ i3 = value.charCodeAt(i++);\n b64 += toBase64Digit(i1 >> 2);\n b64 += toBase64Digit(((i1 & 3) << 4) | (isNaN(i2) ? 0 : i2 >> 4));\n b64 += isNaN(i2) ? '=' : toBase64Digit(((i2 & 15) << 2) | (i3 >> 6));\n b64 += isNaN(i2) || isNaN(i3) ? '=' : toBase64Digit(i3 & 63);\n }\n return b64;\n}\n/**\n * @param {?} value\n * @return {?}\n */\nfunction toBase64VLQ(value) {\n value = value < 0 ? ((-value) << 1) + 1 : value << 1;\n var /** @type {?} */ out = '';\n do {\n var /** @type {?} */ digit = value & 31;\n value = value >> 5;\n if (value > 0) {\n digit = digit | 32;\n }\n out += toBase64Digit(digit);\n } while (value > 0);\n return out;\n}\nvar B64_DIGITS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n/**\n * @param {?} value\n * @return {?}\n */\nfunction toBase64Digit(value) {\n if (value < 0 || value >= 64) {\n throw new Error(\"Can only encode value in the range [0, 63]\");\n }\n return B64_DIGITS[value];\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\\\|\\n|\\r|\\$/g;\nvar _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;\nvar _INDENT_WITH = ' ';\nvar CATCH_ERROR_VAR$1 = variable('error', null, null);\nvar CATCH_STACK_VAR$1 = variable('stack', null, null);\n/**\n * @record\n */\n\nvar _EmittedLine = /** @class */ (function () {\n function _EmittedLine(indent) {\n this.indent = indent;\n this.partsLength = 0;\n this.parts = [];\n this.srcSpans = [];\n }\n return _EmittedLine;\n}());\nvar EmitterVisitorContext = /** @class */ (function () {\n function EmitterVisitorContext(_indent) {\n this._indent = _indent;\n this._classes = [];\n this._preambleLineCount = 0;\n this._lines = [new _EmittedLine(_indent)];\n }\n /**\n * @return {?}\n */\n EmitterVisitorContext.createRoot = /**\n * @return {?}\n */\n function () { return new EmitterVisitorContext(0); };\n Object.defineProperty(EmitterVisitorContext.prototype, \"_currentLine\", {\n get: /**\n * @return {?}\n */\n function () { return this._lines[this._lines.length - 1]; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?=} from\n * @param {?=} lastPart\n * @return {?}\n */\n EmitterVisitorContext.prototype.println = /**\n * @param {?=} from\n * @param {?=} lastPart\n * @return {?}\n */\n function (from, lastPart) {\n if (lastPart === void 0) { lastPart = ''; }\n this.print(from || null, lastPart, true);\n };\n /**\n * @return {?}\n */\n EmitterVisitorContext.prototype.lineIsEmpty = /**\n * @return {?}\n */\n function () { return this._currentLine.parts.length === 0; };\n /**\n * @return {?}\n */\n EmitterVisitorContext.prototype.lineLength = /**\n * @return {?}\n */\n function () {\n return this._currentLine.indent * _INDENT_WITH.length + this._currentLine.partsLength;\n };\n /**\n * @param {?} from\n * @param {?} part\n * @param {?=} newLine\n * @return {?}\n */\n EmitterVisitorContext.prototype.print = /**\n * @param {?} from\n * @param {?} part\n * @param {?=} newLine\n * @return {?}\n */\n function (from, part, newLine) {\n if (newLine === void 0) { newLine = false; }\n if (part.length > 0) {\n this._currentLine.parts.push(part);\n this._currentLine.partsLength += part.length;\n this._currentLine.srcSpans.push(from && from.sourceSpan || null);\n }\n if (newLine) {\n this._lines.push(new _EmittedLine(this._indent));\n }\n };\n /**\n * @return {?}\n */\n EmitterVisitorContext.prototype.removeEmptyLastLine = /**\n * @return {?}\n */\n function () {\n if (this.lineIsEmpty()) {\n this._lines.pop();\n }\n };\n /**\n * @return {?}\n */\n EmitterVisitorContext.prototype.incIndent = /**\n * @return {?}\n */\n function () {\n this._indent++;\n if (this.lineIsEmpty()) {\n this._currentLine.indent = this._indent;\n }\n };\n /**\n * @return {?}\n */\n EmitterVisitorContext.prototype.decIndent = /**\n * @return {?}\n */\n function () {\n this._indent--;\n if (this.lineIsEmpty()) {\n this._currentLine.indent = this._indent;\n }\n };\n /**\n * @param {?} clazz\n * @return {?}\n */\n EmitterVisitorContext.prototype.pushClass = /**\n * @param {?} clazz\n * @return {?}\n */\n function (clazz) { this._classes.push(clazz); };\n /**\n * @return {?}\n */\n EmitterVisitorContext.prototype.popClass = /**\n * @return {?}\n */\n function () { return /** @type {?} */ ((this._classes.pop())); };\n Object.defineProperty(EmitterVisitorContext.prototype, \"currentClass\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._classes.length > 0 ? this._classes[this._classes.length - 1] : null;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n EmitterVisitorContext.prototype.toSource = /**\n * @return {?}\n */\n function () {\n return this.sourceLines\n .map(function (l) { return l.parts.length > 0 ? _createIndent(l.indent) + l.parts.join('') : ''; })\n .join('\\n');\n };\n /**\n * @param {?} genFilePath\n * @param {?=} startsAtLine\n * @return {?}\n */\n EmitterVisitorContext.prototype.toSourceMapGenerator = /**\n * @param {?} genFilePath\n * @param {?=} startsAtLine\n * @return {?}\n */\n function (genFilePath, startsAtLine) {\n if (startsAtLine === void 0) { startsAtLine = 0; }\n var /** @type {?} */ map = new SourceMapGenerator(genFilePath);\n var /** @type {?} */ firstOffsetMapped = false;\n var /** @type {?} */ mapFirstOffsetIfNeeded = function () {\n if (!firstOffsetMapped) {\n // Add a single space so that tools won't try to load the file from disk.\n // Note: We are using virtual urls like `ng:///`, so we have to\n // provide a content here.\n map.addSource(genFilePath, ' ').addMapping(0, genFilePath, 0, 0);\n firstOffsetMapped = true;\n }\n };\n for (var /** @type {?} */ i = 0; i < startsAtLine; i++) {\n map.addLine();\n mapFirstOffsetIfNeeded();\n }\n this.sourceLines.forEach(function (line, lineIdx) {\n map.addLine();\n var /** @type {?} */ spans = line.srcSpans;\n var /** @type {?} */ parts = line.parts;\n var /** @type {?} */ col0 = line.indent * _INDENT_WITH.length;\n var /** @type {?} */ spanIdx = 0;\n // skip leading parts without source spans\n while (spanIdx < spans.length && !spans[spanIdx]) {\n col0 += parts[spanIdx].length;\n spanIdx++;\n }\n if (spanIdx < spans.length && lineIdx === 0 && col0 === 0) {\n firstOffsetMapped = true;\n }\n else {\n mapFirstOffsetIfNeeded();\n }\n while (spanIdx < spans.length) {\n var /** @type {?} */ span = /** @type {?} */ ((spans[spanIdx]));\n var /** @type {?} */ source = span.start.file;\n var /** @type {?} */ sourceLine = span.start.line;\n var /** @type {?} */ sourceCol = span.start.col;\n map.addSource(source.url, source.content)\n .addMapping(col0, source.url, sourceLine, sourceCol);\n col0 += parts[spanIdx].length;\n spanIdx++;\n // assign parts without span or the same span to the previous segment\n while (spanIdx < spans.length && (span === spans[spanIdx] || !spans[spanIdx])) {\n col0 += parts[spanIdx].length;\n spanIdx++;\n }\n }\n });\n return map;\n };\n /**\n * @param {?} count\n * @return {?}\n */\n EmitterVisitorContext.prototype.setPreambleLineCount = /**\n * @param {?} count\n * @return {?}\n */\n function (count) { return this._preambleLineCount = count; };\n /**\n * @param {?} line\n * @param {?} column\n * @return {?}\n */\n EmitterVisitorContext.prototype.spanOf = /**\n * @param {?} line\n * @param {?} column\n * @return {?}\n */\n function (line, column) {\n var /** @type {?} */ emittedLine = this._lines[line - this._preambleLineCount];\n if (emittedLine) {\n var /** @type {?} */ columnsLeft = column - _createIndent(emittedLine.indent).length;\n for (var /** @type {?} */ partIndex = 0; partIndex < emittedLine.parts.length; partIndex++) {\n var /** @type {?} */ part = emittedLine.parts[partIndex];\n if (part.length > columnsLeft) {\n return emittedLine.srcSpans[partIndex];\n }\n columnsLeft -= part.length;\n }\n }\n return null;\n };\n Object.defineProperty(EmitterVisitorContext.prototype, \"sourceLines\", {\n get: /**\n * @return {?}\n */\n function () {\n if (this._lines.length && this._lines[this._lines.length - 1].parts.length === 0) {\n return this._lines.slice(0, -1);\n }\n return this._lines;\n },\n enumerable: true,\n configurable: true\n });\n return EmitterVisitorContext;\n}());\n/**\n * @abstract\n */\nvar AbstractEmitterVisitor = /** @class */ (function () {\n function AbstractEmitterVisitor(_escapeDollarInStrings) {\n this._escapeDollarInStrings = _escapeDollarInStrings;\n }\n /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitExpressionStmt = /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n function (stmt, ctx) {\n stmt.expr.visitExpression(this, ctx);\n ctx.println(stmt, ';');\n return null;\n };\n /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitReturnStmt = /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n function (stmt, ctx) {\n ctx.print(stmt, \"return \");\n stmt.value.visitExpression(this, ctx);\n ctx.println(stmt, ';');\n return null;\n };\n /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitIfStmt = /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n function (stmt, ctx) {\n ctx.print(stmt, \"if (\");\n stmt.condition.visitExpression(this, ctx);\n ctx.print(stmt, \") {\");\n var /** @type {?} */ hasElseCase = stmt.falseCase != null && stmt.falseCase.length > 0;\n if (stmt.trueCase.length <= 1 && !hasElseCase) {\n ctx.print(stmt, \" \");\n this.visitAllStatements(stmt.trueCase, ctx);\n ctx.removeEmptyLastLine();\n ctx.print(stmt, \" \");\n }\n else {\n ctx.println();\n ctx.incIndent();\n this.visitAllStatements(stmt.trueCase, ctx);\n ctx.decIndent();\n if (hasElseCase) {\n ctx.println(stmt, \"} else {\");\n ctx.incIndent();\n this.visitAllStatements(stmt.falseCase, ctx);\n ctx.decIndent();\n }\n }\n ctx.println(stmt, \"}\");\n return null;\n };\n /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitThrowStmt = /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n function (stmt, ctx) {\n ctx.print(stmt, \"throw \");\n stmt.error.visitExpression(this, ctx);\n ctx.println(stmt, \";\");\n return null;\n };\n /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitCommentStmt = /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n function (stmt, ctx) {\n var /** @type {?} */ lines = stmt.comment.split('\\n');\n lines.forEach(function (line) { ctx.println(stmt, \"// \" + line); });\n return null;\n };\n /**\n * @param {?} expr\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitWriteVarExpr = /**\n * @param {?} expr\n * @param {?} ctx\n * @return {?}\n */\n function (expr, ctx) {\n var /** @type {?} */ lineWasEmpty = ctx.lineIsEmpty();\n if (!lineWasEmpty) {\n ctx.print(expr, '(');\n }\n ctx.print(expr, expr.name + \" = \");\n expr.value.visitExpression(this, ctx);\n if (!lineWasEmpty) {\n ctx.print(expr, ')');\n }\n return null;\n };\n /**\n * @param {?} expr\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitWriteKeyExpr = /**\n * @param {?} expr\n * @param {?} ctx\n * @return {?}\n */\n function (expr, ctx) {\n var /** @type {?} */ lineWasEmpty = ctx.lineIsEmpty();\n if (!lineWasEmpty) {\n ctx.print(expr, '(');\n }\n expr.receiver.visitExpression(this, ctx);\n ctx.print(expr, \"[\");\n expr.index.visitExpression(this, ctx);\n ctx.print(expr, \"] = \");\n expr.value.visitExpression(this, ctx);\n if (!lineWasEmpty) {\n ctx.print(expr, ')');\n }\n return null;\n };\n /**\n * @param {?} expr\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitWritePropExpr = /**\n * @param {?} expr\n * @param {?} ctx\n * @return {?}\n */\n function (expr, ctx) {\n var /** @type {?} */ lineWasEmpty = ctx.lineIsEmpty();\n if (!lineWasEmpty) {\n ctx.print(expr, '(');\n }\n expr.receiver.visitExpression(this, ctx);\n ctx.print(expr, \".\" + expr.name + \" = \");\n expr.value.visitExpression(this, ctx);\n if (!lineWasEmpty) {\n ctx.print(expr, ')');\n }\n return null;\n };\n /**\n * @param {?} expr\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitInvokeMethodExpr = /**\n * @param {?} expr\n * @param {?} ctx\n * @return {?}\n */\n function (expr, ctx) {\n expr.receiver.visitExpression(this, ctx);\n var /** @type {?} */ name = expr.name;\n if (expr.builtin != null) {\n name = this.getBuiltinMethodName(expr.builtin);\n if (name == null) {\n // some builtins just mean to skip the call.\n return null;\n }\n }\n ctx.print(expr, \".\" + name + \"(\");\n this.visitAllExpressions(expr.args, ctx, \",\");\n ctx.print(expr, \")\");\n return null;\n };\n /**\n * @param {?} expr\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitInvokeFunctionExpr = /**\n * @param {?} expr\n * @param {?} ctx\n * @return {?}\n */\n function (expr, ctx) {\n expr.fn.visitExpression(this, ctx);\n ctx.print(expr, \"(\");\n this.visitAllExpressions(expr.args, ctx, ',');\n ctx.print(expr, \")\");\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitReadVarExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n var /** @type {?} */ varName = /** @type {?} */ ((ast.name));\n if (ast.builtin != null) {\n switch (ast.builtin) {\n case BuiltinVar.Super:\n varName = 'super';\n break;\n case BuiltinVar.This:\n varName = 'this';\n break;\n case BuiltinVar.CatchError:\n varName = /** @type {?} */ ((CATCH_ERROR_VAR$1.name));\n break;\n case BuiltinVar.CatchStack:\n varName = /** @type {?} */ ((CATCH_STACK_VAR$1.name));\n break;\n default:\n throw new Error(\"Unknown builtin variable \" + ast.builtin);\n }\n }\n ctx.print(ast, varName);\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitInstantiateExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n ctx.print(ast, \"new \");\n ast.classExpr.visitExpression(this, ctx);\n ctx.print(ast, \"(\");\n this.visitAllExpressions(ast.args, ctx, ',');\n ctx.print(ast, \")\");\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitLiteralExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n var /** @type {?} */ value = ast.value;\n if (typeof value === 'string') {\n ctx.print(ast, escapeIdentifier(value, this._escapeDollarInStrings));\n }\n else {\n ctx.print(ast, \"\" + value);\n }\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitConditionalExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n ctx.print(ast, \"(\");\n ast.condition.visitExpression(this, ctx);\n ctx.print(ast, '? ');\n ast.trueCase.visitExpression(this, ctx);\n ctx.print(ast, ': '); /** @type {?} */\n ((ast.falseCase)).visitExpression(this, ctx);\n ctx.print(ast, \")\");\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitNotExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n ctx.print(ast, '!');\n ast.condition.visitExpression(this, ctx);\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitAssertNotNullExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n ast.condition.visitExpression(this, ctx);\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitBinaryOperatorExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n var /** @type {?} */ opStr;\n switch (ast.operator) {\n case BinaryOperator.Equals:\n opStr = '==';\n break;\n case BinaryOperator.Identical:\n opStr = '===';\n break;\n case BinaryOperator.NotEquals:\n opStr = '!=';\n break;\n case BinaryOperator.NotIdentical:\n opStr = '!==';\n break;\n case BinaryOperator.And:\n opStr = '&&';\n break;\n case BinaryOperator.Or:\n opStr = '||';\n break;\n case BinaryOperator.Plus:\n opStr = '+';\n break;\n case BinaryOperator.Minus:\n opStr = '-';\n break;\n case BinaryOperator.Divide:\n opStr = '/';\n break;\n case BinaryOperator.Multiply:\n opStr = '*';\n break;\n case BinaryOperator.Modulo:\n opStr = '%';\n break;\n case BinaryOperator.Lower:\n opStr = '<';\n break;\n case BinaryOperator.LowerEquals:\n opStr = '<=';\n break;\n case BinaryOperator.Bigger:\n opStr = '>';\n break;\n case BinaryOperator.BiggerEquals:\n opStr = '>=';\n break;\n default:\n throw new Error(\"Unknown operator \" + ast.operator);\n }\n ctx.print(ast, \"(\");\n ast.lhs.visitExpression(this, ctx);\n ctx.print(ast, \" \" + opStr + \" \");\n ast.rhs.visitExpression(this, ctx);\n ctx.print(ast, \")\");\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitReadPropExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n ast.receiver.visitExpression(this, ctx);\n ctx.print(ast, \".\");\n ctx.print(ast, ast.name);\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitReadKeyExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n ast.receiver.visitExpression(this, ctx);\n ctx.print(ast, \"[\");\n ast.index.visitExpression(this, ctx);\n ctx.print(ast, \"]\");\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitLiteralArrayExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n ctx.print(ast, \"[\");\n this.visitAllExpressions(ast.entries, ctx, ',');\n ctx.print(ast, \"]\");\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitLiteralMapExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n var _this = this;\n ctx.print(ast, \"{\");\n this.visitAllObjects(function (entry) {\n ctx.print(ast, escapeIdentifier(entry.key, _this._escapeDollarInStrings, entry.quoted) + \":\");\n entry.value.visitExpression(_this, ctx);\n }, ast.entries, ctx, ',');\n ctx.print(ast, \"}\");\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitCommaExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n ctx.print(ast, '(');\n this.visitAllExpressions(ast.parts, ctx, ',');\n ctx.print(ast, ')');\n return null;\n };\n /**\n * @param {?} expressions\n * @param {?} ctx\n * @param {?} separator\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitAllExpressions = /**\n * @param {?} expressions\n * @param {?} ctx\n * @param {?} separator\n * @return {?}\n */\n function (expressions, ctx, separator) {\n var _this = this;\n this.visitAllObjects(function (expr) { return expr.visitExpression(_this, ctx); }, expressions, ctx, separator);\n };\n /**\n * @template T\n * @param {?} handler\n * @param {?} expressions\n * @param {?} ctx\n * @param {?} separator\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitAllObjects = /**\n * @template T\n * @param {?} handler\n * @param {?} expressions\n * @param {?} ctx\n * @param {?} separator\n * @return {?}\n */\n function (handler, expressions, ctx, separator) {\n var /** @type {?} */ incrementedIndent = false;\n for (var /** @type {?} */ i = 0; i < expressions.length; i++) {\n if (i > 0) {\n if (ctx.lineLength() > 80) {\n ctx.print(null, separator, true);\n if (!incrementedIndent) {\n // continuation are marked with double indent.\n ctx.incIndent();\n ctx.incIndent();\n incrementedIndent = true;\n }\n }\n else {\n ctx.print(null, separator, false);\n }\n }\n handler(expressions[i]);\n }\n if (incrementedIndent) {\n // continuation are marked with double indent.\n ctx.decIndent();\n ctx.decIndent();\n }\n };\n /**\n * @param {?} statements\n * @param {?} ctx\n * @return {?}\n */\n AbstractEmitterVisitor.prototype.visitAllStatements = /**\n * @param {?} statements\n * @param {?} ctx\n * @return {?}\n */\n function (statements, ctx) {\n var _this = this;\n statements.forEach(function (stmt) { return stmt.visitStatement(_this, ctx); });\n };\n return AbstractEmitterVisitor;\n}());\n/**\n * @param {?} input\n * @param {?} escapeDollar\n * @param {?=} alwaysQuote\n * @return {?}\n */\nfunction escapeIdentifier(input, escapeDollar, alwaysQuote) {\n if (alwaysQuote === void 0) { alwaysQuote = true; }\n if (input == null) {\n return null;\n }\n var /** @type {?} */ body = input.replace(_SINGLE_QUOTE_ESCAPE_STRING_RE, function () {\n var match = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n match[_i] = arguments[_i];\n }\n if (match[0] == '$') {\n return escapeDollar ? '\\\\$' : '$';\n }\n else if (match[0] == '\\n') {\n return '\\\\n';\n }\n else if (match[0] == '\\r') {\n return '\\\\r';\n }\n else {\n return \"\\\\\" + match[0];\n }\n });\n var /** @type {?} */ requiresQuotes = alwaysQuote || !_LEGAL_IDENTIFIER_RE.test(body);\n return requiresQuotes ? \"'\" + body + \"'\" : body;\n}\n/**\n * @param {?} count\n * @return {?}\n */\nfunction _createIndent(count) {\n var /** @type {?} */ res = '';\n for (var /** @type {?} */ i = 0; i < count; i++) {\n res += _INDENT_WITH;\n }\n return res;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @param {?} ast\n * @return {?}\n */\nfunction debugOutputAstAsTypeScript(ast) {\n var /** @type {?} */ converter = new _TsEmitterVisitor();\n var /** @type {?} */ ctx = EmitterVisitorContext.createRoot();\n var /** @type {?} */ asts = Array.isArray(ast) ? ast : [ast];\n asts.forEach(function (ast) {\n if (ast instanceof Statement) {\n ast.visitStatement(converter, ctx);\n }\n else if (ast instanceof Expression) {\n ast.visitExpression(converter, ctx);\n }\n else if (ast instanceof Type$1) {\n ast.visitType(converter, ctx);\n }\n else {\n throw new Error(\"Don't know how to print debug info for \" + ast);\n }\n });\n return ctx.toSource();\n}\nvar TypeScriptEmitter = /** @class */ (function () {\n function TypeScriptEmitter() {\n }\n /**\n * @param {?} genFilePath\n * @param {?} stmts\n * @param {?=} preamble\n * @param {?=} emitSourceMaps\n * @param {?=} referenceFilter\n * @return {?}\n */\n TypeScriptEmitter.prototype.emitStatementsAndContext = /**\n * @param {?} genFilePath\n * @param {?} stmts\n * @param {?=} preamble\n * @param {?=} emitSourceMaps\n * @param {?=} referenceFilter\n * @return {?}\n */\n function (genFilePath, stmts, preamble, emitSourceMaps, referenceFilter) {\n if (preamble === void 0) { preamble = ''; }\n if (emitSourceMaps === void 0) { emitSourceMaps = true; }\n var /** @type {?} */ converter = new _TsEmitterVisitor(referenceFilter);\n var /** @type {?} */ ctx = EmitterVisitorContext.createRoot();\n converter.visitAllStatements(stmts, ctx);\n var /** @type {?} */ preambleLines = preamble ? preamble.split('\\n') : [];\n converter.reexports.forEach(function (reexports, exportedModuleName) {\n var /** @type {?} */ reexportsCode = reexports.map(function (reexport) { return reexport.name + \" as \" + reexport.as; }).join(',');\n preambleLines.push(\"export {\" + reexportsCode + \"} from '\" + exportedModuleName + \"';\");\n });\n converter.importsWithPrefixes.forEach(function (prefix, importedModuleName) {\n // Note: can't write the real word for import as it screws up system.js auto detection...\n preambleLines.push(\"imp\" +\n (\"ort * as \" + prefix + \" from '\" + importedModuleName + \"';\"));\n });\n var /** @type {?} */ sm = emitSourceMaps ?\n ctx.toSourceMapGenerator(genFilePath, preambleLines.length).toJsComment() :\n '';\n var /** @type {?} */ lines = preambleLines.concat([ctx.toSource(), sm]);\n if (sm) {\n // always add a newline at the end, as some tools have bugs without it.\n lines.push('');\n }\n ctx.setPreambleLineCount(preambleLines.length);\n return { sourceText: lines.join('\\n'), context: ctx };\n };\n /**\n * @param {?} genFilePath\n * @param {?} stmts\n * @param {?=} preamble\n * @return {?}\n */\n TypeScriptEmitter.prototype.emitStatements = /**\n * @param {?} genFilePath\n * @param {?} stmts\n * @param {?=} preamble\n * @return {?}\n */\n function (genFilePath, stmts, preamble) {\n if (preamble === void 0) { preamble = ''; }\n return this.emitStatementsAndContext(genFilePath, stmts, preamble).sourceText;\n };\n return TypeScriptEmitter;\n}());\nvar _TsEmitterVisitor = /** @class */ (function (_super) {\n __extends(_TsEmitterVisitor, _super);\n function _TsEmitterVisitor(referenceFilter) {\n var _this = _super.call(this, false) || this;\n _this.referenceFilter = referenceFilter;\n _this.typeExpression = 0;\n _this.importsWithPrefixes = new Map();\n _this.reexports = new Map();\n return _this;\n }\n /**\n * @param {?} t\n * @param {?} ctx\n * @param {?=} defaultType\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitType = /**\n * @param {?} t\n * @param {?} ctx\n * @param {?=} defaultType\n * @return {?}\n */\n function (t, ctx, defaultType) {\n if (defaultType === void 0) { defaultType = 'any'; }\n if (t) {\n this.typeExpression++;\n t.visitType(this, ctx);\n this.typeExpression--;\n }\n else {\n ctx.print(null, defaultType);\n }\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitLiteralExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n var /** @type {?} */ value = ast.value;\n if (value == null && ast.type != INFERRED_TYPE) {\n ctx.print(ast, \"(\" + value + \" as any)\");\n return null;\n }\n return _super.prototype.visitLiteralExpr.call(this, ast, ctx);\n };\n // Temporary workaround to support strictNullCheck enabled consumers of ngc emit.\n // In SNC mode, [] have the type never[], so we cast here to any[].\n // TODO: narrow the cast to a more explicit type, or use a pattern that does not\n // start with [].concat. see https://github.com/angular/angular/pull/11846\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitLiteralArrayExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n var /** @type {?} */ result = _super.prototype.visitLiteralArrayExpr.call(this, ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitExternalExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n this._visitIdentifier(ast.value, ast.typeParams, ctx);\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitAssertNotNullExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n var /** @type {?} */ result = _super.prototype.visitAssertNotNullExpr.call(this, ast, ctx);\n ctx.print(ast, '!');\n return result;\n };\n /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitDeclareVarStmt = /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n function (stmt, ctx) {\n if (stmt.hasModifier(StmtModifier.Exported) && stmt.value instanceof ExternalExpr &&\n !stmt.type) {\n // check for a reexport\n var _a = stmt.value.value, name_1 = _a.name, moduleName = _a.moduleName;\n if (moduleName) {\n var /** @type {?} */ reexports = this.reexports.get(moduleName);\n if (!reexports) {\n reexports = [];\n this.reexports.set(moduleName, reexports);\n }\n reexports.push({ name: /** @type {?} */ ((name_1)), as: stmt.name });\n return null;\n }\n }\n if (stmt.hasModifier(StmtModifier.Exported)) {\n ctx.print(stmt, \"export \");\n }\n if (stmt.hasModifier(StmtModifier.Final)) {\n ctx.print(stmt, \"const\");\n }\n else {\n ctx.print(stmt, \"var\");\n }\n ctx.print(stmt, \" \" + stmt.name);\n this._printColonType(stmt.type, ctx);\n ctx.print(stmt, \" = \");\n stmt.value.visitExpression(this, ctx);\n ctx.println(stmt, \";\");\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitCastExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n ctx.print(ast, \"(<\"); /** @type {?} */\n ((ast.type)).visitType(this, ctx);\n ctx.print(ast, \">\");\n ast.value.visitExpression(this, ctx);\n ctx.print(ast, \")\");\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitInstantiateExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n ctx.print(ast, \"new \");\n this.typeExpression++;\n ast.classExpr.visitExpression(this, ctx);\n this.typeExpression--;\n ctx.print(ast, \"(\");\n this.visitAllExpressions(ast.args, ctx, ',');\n ctx.print(ast, \")\");\n return null;\n };\n /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitDeclareClassStmt = /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n function (stmt, ctx) {\n var _this = this;\n ctx.pushClass(stmt);\n if (stmt.hasModifier(StmtModifier.Exported)) {\n ctx.print(stmt, \"export \");\n }\n ctx.print(stmt, \"class \" + stmt.name);\n if (stmt.parent != null) {\n ctx.print(stmt, \" extends \");\n this.typeExpression++;\n stmt.parent.visitExpression(this, ctx);\n this.typeExpression--;\n }\n ctx.println(stmt, \" {\");\n ctx.incIndent();\n stmt.fields.forEach(function (field) { return _this._visitClassField(field, ctx); });\n if (stmt.constructorMethod != null) {\n this._visitClassConstructor(stmt, ctx);\n }\n stmt.getters.forEach(function (getter) { return _this._visitClassGetter(getter, ctx); });\n stmt.methods.forEach(function (method) { return _this._visitClassMethod(method, ctx); });\n ctx.decIndent();\n ctx.println(stmt, \"}\");\n ctx.popClass();\n return null;\n };\n /**\n * @param {?} field\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype._visitClassField = /**\n * @param {?} field\n * @param {?} ctx\n * @return {?}\n */\n function (field, ctx) {\n if (field.hasModifier(StmtModifier.Private)) {\n // comment out as a workaround for #10967\n ctx.print(null, \"/*private*/ \");\n }\n ctx.print(null, field.name);\n this._printColonType(field.type, ctx);\n ctx.println(null, \";\");\n };\n /**\n * @param {?} getter\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype._visitClassGetter = /**\n * @param {?} getter\n * @param {?} ctx\n * @return {?}\n */\n function (getter, ctx) {\n if (getter.hasModifier(StmtModifier.Private)) {\n ctx.print(null, \"private \");\n }\n ctx.print(null, \"get \" + getter.name + \"()\");\n this._printColonType(getter.type, ctx);\n ctx.println(null, \" {\");\n ctx.incIndent();\n this.visitAllStatements(getter.body, ctx);\n ctx.decIndent();\n ctx.println(null, \"}\");\n };\n /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype._visitClassConstructor = /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n function (stmt, ctx) {\n ctx.print(stmt, \"constructor(\");\n this._visitParams(stmt.constructorMethod.params, ctx);\n ctx.println(stmt, \") {\");\n ctx.incIndent();\n this.visitAllStatements(stmt.constructorMethod.body, ctx);\n ctx.decIndent();\n ctx.println(stmt, \"}\");\n };\n /**\n * @param {?} method\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype._visitClassMethod = /**\n * @param {?} method\n * @param {?} ctx\n * @return {?}\n */\n function (method, ctx) {\n if (method.hasModifier(StmtModifier.Private)) {\n ctx.print(null, \"private \");\n }\n ctx.print(null, method.name + \"(\");\n this._visitParams(method.params, ctx);\n ctx.print(null, \")\");\n this._printColonType(method.type, ctx, 'void');\n ctx.println(null, \" {\");\n ctx.incIndent();\n this.visitAllStatements(method.body, ctx);\n ctx.decIndent();\n ctx.println(null, \"}\");\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitFunctionExpr = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n ctx.print(ast, \"(\");\n this._visitParams(ast.params, ctx);\n ctx.print(ast, \")\");\n this._printColonType(ast.type, ctx, 'void');\n ctx.println(ast, \" => {\");\n ctx.incIndent();\n this.visitAllStatements(ast.statements, ctx);\n ctx.decIndent();\n ctx.print(ast, \"}\");\n return null;\n };\n /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitDeclareFunctionStmt = /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n function (stmt, ctx) {\n if (stmt.hasModifier(StmtModifier.Exported)) {\n ctx.print(stmt, \"export \");\n }\n ctx.print(stmt, \"function \" + stmt.name + \"(\");\n this._visitParams(stmt.params, ctx);\n ctx.print(stmt, \")\");\n this._printColonType(stmt.type, ctx, 'void');\n ctx.println(stmt, \" {\");\n ctx.incIndent();\n this.visitAllStatements(stmt.statements, ctx);\n ctx.decIndent();\n ctx.println(stmt, \"}\");\n return null;\n };\n /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitTryCatchStmt = /**\n * @param {?} stmt\n * @param {?} ctx\n * @return {?}\n */\n function (stmt, ctx) {\n ctx.println(stmt, \"try {\");\n ctx.incIndent();\n this.visitAllStatements(stmt.bodyStmts, ctx);\n ctx.decIndent();\n ctx.println(stmt, \"} catch (\" + CATCH_ERROR_VAR$1.name + \") {\");\n ctx.incIndent();\n var /** @type {?} */ catchStmts = [/** @type {?} */ (CATCH_STACK_VAR$1.set(CATCH_ERROR_VAR$1.prop('stack', null)).toDeclStmt(null, [\n StmtModifier.Final\n ]))].concat(stmt.catchStmts);\n this.visitAllStatements(catchStmts, ctx);\n ctx.decIndent();\n ctx.println(stmt, \"}\");\n return null;\n };\n /**\n * @param {?} type\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitBuiltintType = /**\n * @param {?} type\n * @param {?} ctx\n * @return {?}\n */\n function (type, ctx) {\n var /** @type {?} */ typeStr;\n switch (type.name) {\n case BuiltinTypeName.Bool:\n typeStr = 'boolean';\n break;\n case BuiltinTypeName.Dynamic:\n typeStr = 'any';\n break;\n case BuiltinTypeName.Function:\n typeStr = 'Function';\n break;\n case BuiltinTypeName.Number:\n typeStr = 'number';\n break;\n case BuiltinTypeName.Int:\n typeStr = 'number';\n break;\n case BuiltinTypeName.String:\n typeStr = 'string';\n break;\n default:\n throw new Error(\"Unsupported builtin type \" + type.name);\n }\n ctx.print(null, typeStr);\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitExpressionType = /**\n * @param {?} ast\n * @param {?} ctx\n * @return {?}\n */\n function (ast, ctx) {\n ast.value.visitExpression(this, ctx);\n return null;\n };\n /**\n * @param {?} type\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitArrayType = /**\n * @param {?} type\n * @param {?} ctx\n * @return {?}\n */\n function (type, ctx) {\n this.visitType(type.of, ctx);\n ctx.print(null, \"[]\");\n return null;\n };\n /**\n * @param {?} type\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype.visitMapType = /**\n * @param {?} type\n * @param {?} ctx\n * @return {?}\n */\n function (type, ctx) {\n ctx.print(null, \"{[key: string]:\");\n this.visitType(type.valueType, ctx);\n ctx.print(null, \"}\");\n return null;\n };\n /**\n * @param {?} method\n * @return {?}\n */\n _TsEmitterVisitor.prototype.getBuiltinMethodName = /**\n * @param {?} method\n * @return {?}\n */\n function (method) {\n var /** @type {?} */ name;\n switch (method) {\n case BuiltinMethod.ConcatArray:\n name = 'concat';\n break;\n case BuiltinMethod.SubscribeObservable:\n name = 'subscribe';\n break;\n case BuiltinMethod.Bind:\n name = 'bind';\n break;\n default:\n throw new Error(\"Unknown builtin method: \" + method);\n }\n return name;\n };\n /**\n * @param {?} params\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype._visitParams = /**\n * @param {?} params\n * @param {?} ctx\n * @return {?}\n */\n function (params, ctx) {\n var _this = this;\n this.visitAllObjects(function (param) {\n ctx.print(null, param.name);\n _this._printColonType(param.type, ctx);\n }, params, ctx, ',');\n };\n /**\n * @param {?} value\n * @param {?} typeParams\n * @param {?} ctx\n * @return {?}\n */\n _TsEmitterVisitor.prototype._visitIdentifier = /**\n * @param {?} value\n * @param {?} typeParams\n * @param {?} ctx\n * @return {?}\n */\n function (value, typeParams, ctx) {\n var _this = this;\n var name = value.name, moduleName = value.moduleName;\n if (this.referenceFilter && this.referenceFilter(value)) {\n ctx.print(null, '(null as any)');\n return;\n }\n if (moduleName) {\n var /** @type {?} */ prefix = this.importsWithPrefixes.get(moduleName);\n if (prefix == null) {\n prefix = \"i\" + this.importsWithPrefixes.size;\n this.importsWithPrefixes.set(moduleName, prefix);\n }\n ctx.print(null, prefix + \".\");\n }\n ctx.print(null, /** @type {?} */ ((name)));\n if (this.typeExpression > 0) {\n // If we are in a type expression that refers to a generic type then supply\n // the required type parameters. If there were not enough type parameters\n // supplied, supply any as the type. Outside a type expression the reference\n // should not supply type parameters and be treated as a simple value reference\n // to the constructor function itself.\n var /** @type {?} */ suppliedParameters = typeParams || [];\n if (suppliedParameters.length > 0) {\n ctx.print(null, \"<\");\n this.visitAllObjects(function (type) { return type.visitType(_this, ctx); }, /** @type {?} */ ((typeParams)), ctx, ',');\n ctx.print(null, \">\");\n }\n }\n };\n /**\n * @param {?} type\n * @param {?} ctx\n * @param {?=} defaultType\n * @return {?}\n */\n _TsEmitterVisitor.prototype._printColonType = /**\n * @param {?} type\n * @param {?} ctx\n * @param {?=} defaultType\n * @return {?}\n */\n function (type, ctx, defaultType) {\n if (type !== INFERRED_TYPE) {\n ctx.print(null, ':');\n this.visitType(type, ctx, defaultType);\n }\n };\n return _TsEmitterVisitor;\n}(AbstractEmitterVisitor));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Resolve a `Type` for {\\@link Pipe}.\n *\n * This interface can be overridden by the application developer to create custom behavior.\n *\n * See {\\@link Compiler}\n */\nvar PipeResolver = /** @class */ (function () {\n function PipeResolver(_reflector) {\n this._reflector = _reflector;\n }\n /**\n * @param {?} type\n * @return {?}\n */\n PipeResolver.prototype.isPipe = /**\n * @param {?} type\n * @return {?}\n */\n function (type) {\n var /** @type {?} */ typeMetadata = this._reflector.annotations(resolveForwardRef(type));\n return typeMetadata && typeMetadata.some(createPipe.isTypeOf);\n };\n /**\n * Return {@link Pipe} for a given `Type`.\n */\n /**\n * Return {\\@link Pipe} for a given `Type`.\n * @param {?} type\n * @param {?=} throwIfNotFound\n * @return {?}\n */\n PipeResolver.prototype.resolve = /**\n * Return {\\@link Pipe} for a given `Type`.\n * @param {?} type\n * @param {?=} throwIfNotFound\n * @return {?}\n */\n function (type, throwIfNotFound) {\n if (throwIfNotFound === void 0) { throwIfNotFound = true; }\n var /** @type {?} */ metas = this._reflector.annotations(resolveForwardRef(type));\n if (metas) {\n var /** @type {?} */ annotation = findLast(metas, createPipe.isTypeOf);\n if (annotation) {\n return annotation;\n }\n }\n if (throwIfNotFound) {\n throw new Error(\"No Pipe decorator found on \" + stringify(type));\n }\n return null;\n };\n return PipeResolver;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Map from tagName|propertyName SecurityContext. Properties applying to all tags use '*'.\n */\nvar SECURITY_SCHEMA = {};\n/**\n * @param {?} ctx\n * @param {?} specs\n * @return {?}\n */\nfunction registerContext(ctx, specs) {\n for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) {\n var spec = specs_1[_i];\n SECURITY_SCHEMA[spec.toLowerCase()] = ctx;\n }\n}\n// Case is insignificant below, all element and attribute names are lower-cased for lookup.\nregisterContext(SecurityContext.HTML, [\n 'iframe|srcdoc',\n '*|innerHTML',\n '*|outerHTML',\n]);\nregisterContext(SecurityContext.STYLE, ['*|style']);\n// NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.\nregisterContext(SecurityContext.URL, [\n '*|formAction', 'area|href', 'area|ping', 'audio|src', 'a|href',\n 'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'form|action',\n 'img|src', 'img|srcset', 'input|src', 'ins|cite', 'q|cite',\n 'source|src', 'source|srcset', 'track|src', 'video|poster', 'video|src',\n]);\nregisterContext(SecurityContext.RESOURCE_URL, [\n 'applet|code',\n 'applet|codebase',\n 'base|href',\n 'embed|src',\n 'frame|src',\n 'head|profile',\n 'html|manifest',\n 'iframe|src',\n 'link|href',\n 'media|src',\n 'object|codebase',\n 'object|data',\n 'script|src',\n]);\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @abstract\n */\nvar ElementSchemaRegistry = /** @class */ (function () {\n function ElementSchemaRegistry() {\n }\n return ElementSchemaRegistry;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar BOOLEAN = 'boolean';\nvar NUMBER = 'number';\nvar STRING = 'string';\nvar OBJECT = 'object';\n/**\n * This array represents the DOM schema. It encodes inheritance, properties, and events.\n *\n * ## Overview\n *\n * Each line represents one kind of element. The `element_inheritance` and properties are joined\n * using `element_inheritance|properties` syntax.\n *\n * ## Element Inheritance\n *\n * The `element_inheritance` can be further subdivided as `element1,element2,...^parentElement`.\n * Here the individual elements are separated by `,` (commas). Every element in the list\n * has identical properties.\n *\n * An `element` may inherit additional properties from `parentElement` If no `^parentElement` is\n * specified then `\"\"` (blank) element is assumed.\n *\n * NOTE: The blank element inherits from root `[Element]` element, the super element of all\n * elements.\n *\n * NOTE an element prefix such as `:svg:` has no special meaning to the schema.\n *\n * ## Properties\n *\n * Each element has a set of properties separated by `,` (commas). Each property can be prefixed\n * by a special character designating its type:\n *\n * - (no prefix): property is a string.\n * - `*`: property represents an event.\n * - `!`: property is a boolean.\n * - `#`: property is a number.\n * - `%`: property is an object.\n *\n * ## Query\n *\n * The class creates an internal squas representation which allows to easily answer the query of\n * if a given property exist on a given element.\n *\n * NOTE: We don't yet support querying for types or events.\n * NOTE: This schema is auto extracted from `schema_extractor.ts` located in the test folder,\n * see dom_element_schema_registry_spec.ts\n */\nvar SCHEMA = [\n '[Element]|textContent,%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop,slot' +\n ',*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored',\n '[HTMLElement]^[Element]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,outerText,!spellcheck,%style,#tabIndex,title,!translate',\n 'abbr,address,article,aside,b,bdi,bdo,cite,code,dd,dfn,dt,em,figcaption,figure,footer,header,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,outerText,!spellcheck,%style,#tabIndex,title,!translate',\n 'media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,src,%srcObject,#volume',\n ':svg:^[HTMLElement]|*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,%style,#tabIndex',\n ':svg:graphics^:svg:|',\n ':svg:animation^:svg:|*begin,*end,*repeat',\n ':svg:geometry^:svg:|',\n ':svg:componentTransferFunction^:svg:|',\n ':svg:gradient^:svg:|',\n ':svg:textContent^:svg:graphics|',\n ':svg:textPositioning^:svg:textContent|',\n 'a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,rev,search,shape,target,text,type,username',\n 'area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,search,shape,target,username',\n 'audio^media|',\n 'br^[HTMLElement]|clear',\n 'base^[HTMLElement]|href,target',\n 'body^[HTMLElement]|aLink,background,bgColor,link,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink',\n 'button^[HTMLElement]|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value',\n 'canvas^[HTMLElement]|#height,#width',\n 'content^[HTMLElement]|select',\n 'dl^[HTMLElement]|!compact',\n 'datalist^[HTMLElement]|',\n 'details^[HTMLElement]|!open',\n 'dialog^[HTMLElement]|!open,returnValue',\n 'dir^[HTMLElement]|!compact',\n 'div^[HTMLElement]|align',\n 'embed^[HTMLElement]|align,height,name,src,type,width',\n 'fieldset^[HTMLElement]|!disabled,name',\n 'font^[HTMLElement]|color,face,size',\n 'form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target',\n 'frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src',\n 'frameset^[HTMLElement]|cols,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows',\n 'hr^[HTMLElement]|align,color,!noShade,size,width',\n 'head^[HTMLElement]|',\n 'h1,h2,h3,h4,h5,h6^[HTMLElement]|align',\n 'html^[HTMLElement]|version',\n 'iframe^[HTMLElement]|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width',\n 'img^[HTMLElement]|align,alt,border,%crossOrigin,#height,#hspace,!isMap,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width',\n 'input^[HTMLElement]|accept,align,alt,autocapitalize,autocomplete,!autofocus,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width',\n 'li^[HTMLElement]|type,#value',\n 'label^[HTMLElement]|htmlFor',\n 'legend^[HTMLElement]|align',\n 'link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type',\n 'map^[HTMLElement]|name',\n 'marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width',\n 'menu^[HTMLElement]|!compact',\n 'meta^[HTMLElement]|content,httpEquiv,name,scheme',\n 'meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value',\n 'ins,del^[HTMLElement]|cite,dateTime',\n 'ol^[HTMLElement]|!compact,!reversed,#start,type',\n 'object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width',\n 'optgroup^[HTMLElement]|!disabled,label',\n 'option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value',\n 'output^[HTMLElement]|defaultValue,%htmlFor,name,value',\n 'p^[HTMLElement]|align',\n 'param^[HTMLElement]|name,type,value,valueType',\n 'picture^[HTMLElement]|',\n 'pre^[HTMLElement]|#width',\n 'progress^[HTMLElement]|#max,#value',\n 'q,blockquote,cite^[HTMLElement]|',\n 'script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type',\n 'select^[HTMLElement]|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',\n 'shadow^[HTMLElement]|',\n 'slot^[HTMLElement]|name',\n 'source^[HTMLElement]|media,sizes,src,srcset,type',\n 'span^[HTMLElement]|',\n 'style^[HTMLElement]|!disabled,media,type',\n 'caption^[HTMLElement]|align',\n 'th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width',\n 'col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width',\n 'table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width',\n 'tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign',\n 'tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign',\n 'template^[HTMLElement]|',\n 'textarea^[HTMLElement]|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',\n 'title^[HTMLElement]|text',\n 'track^[HTMLElement]|!default,kind,label,src,srclang',\n 'ul^[HTMLElement]|!compact,type',\n 'unknown^[HTMLElement]|',\n 'video^media|#height,poster,#width',\n ':svg:a^:svg:graphics|',\n ':svg:animate^:svg:animation|',\n ':svg:animateMotion^:svg:animation|',\n ':svg:animateTransform^:svg:animation|',\n ':svg:circle^:svg:geometry|',\n ':svg:clipPath^:svg:graphics|',\n ':svg:defs^:svg:graphics|',\n ':svg:desc^:svg:|',\n ':svg:discard^:svg:|',\n ':svg:ellipse^:svg:geometry|',\n ':svg:feBlend^:svg:|',\n ':svg:feColorMatrix^:svg:|',\n ':svg:feComponentTransfer^:svg:|',\n ':svg:feComposite^:svg:|',\n ':svg:feConvolveMatrix^:svg:|',\n ':svg:feDiffuseLighting^:svg:|',\n ':svg:feDisplacementMap^:svg:|',\n ':svg:feDistantLight^:svg:|',\n ':svg:feDropShadow^:svg:|',\n ':svg:feFlood^:svg:|',\n ':svg:feFuncA^:svg:componentTransferFunction|',\n ':svg:feFuncB^:svg:componentTransferFunction|',\n ':svg:feFuncG^:svg:componentTransferFunction|',\n ':svg:feFuncR^:svg:componentTransferFunction|',\n ':svg:feGaussianBlur^:svg:|',\n ':svg:feImage^:svg:|',\n ':svg:feMerge^:svg:|',\n ':svg:feMergeNode^:svg:|',\n ':svg:feMorphology^:svg:|',\n ':svg:feOffset^:svg:|',\n ':svg:fePointLight^:svg:|',\n ':svg:feSpecularLighting^:svg:|',\n ':svg:feSpotLight^:svg:|',\n ':svg:feTile^:svg:|',\n ':svg:feTurbulence^:svg:|',\n ':svg:filter^:svg:|',\n ':svg:foreignObject^:svg:graphics|',\n ':svg:g^:svg:graphics|',\n ':svg:image^:svg:graphics|',\n ':svg:line^:svg:geometry|',\n ':svg:linearGradient^:svg:gradient|',\n ':svg:mpath^:svg:|',\n ':svg:marker^:svg:|',\n ':svg:mask^:svg:|',\n ':svg:metadata^:svg:|',\n ':svg:path^:svg:geometry|',\n ':svg:pattern^:svg:|',\n ':svg:polygon^:svg:geometry|',\n ':svg:polyline^:svg:geometry|',\n ':svg:radialGradient^:svg:gradient|',\n ':svg:rect^:svg:geometry|',\n ':svg:svg^:svg:graphics|#currentScale,#zoomAndPan',\n ':svg:script^:svg:|type',\n ':svg:set^:svg:animation|',\n ':svg:stop^:svg:|',\n ':svg:style^:svg:|!disabled,media,title,type',\n ':svg:switch^:svg:graphics|',\n ':svg:symbol^:svg:|',\n ':svg:tspan^:svg:textPositioning|',\n ':svg:text^:svg:textPositioning|',\n ':svg:textPath^:svg:textContent|',\n ':svg:title^:svg:|',\n ':svg:use^:svg:graphics|',\n ':svg:view^:svg:|#zoomAndPan',\n 'data^[HTMLElement]|value',\n 'keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name',\n 'menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default',\n 'summary^[HTMLElement]|',\n 'time^[HTMLElement]|dateTime',\n ':svg:cursor^:svg:|',\n];\nvar _ATTR_TO_PROP = {\n 'class': 'className',\n 'for': 'htmlFor',\n 'formaction': 'formAction',\n 'innerHtml': 'innerHTML',\n 'readonly': 'readOnly',\n 'tabindex': 'tabIndex',\n};\nvar DomElementSchemaRegistry = /** @class */ (function (_super) {\n __extends(DomElementSchemaRegistry, _super);\n function DomElementSchemaRegistry() {\n var _this = _super.call(this) || this;\n _this._schema = {};\n SCHEMA.forEach(function (encodedType) {\n var /** @type {?} */ type = {};\n var _a = encodedType.split('|'), strType = _a[0], strProperties = _a[1];\n var /** @type {?} */ properties = strProperties.split(',');\n var _b = strType.split('^'), typeNames = _b[0], superName = _b[1];\n typeNames.split(',').forEach(function (tag) { return _this._schema[tag.toLowerCase()] = type; });\n var /** @type {?} */ superType = superName && _this._schema[superName.toLowerCase()];\n if (superType) {\n Object.keys(superType).forEach(function (prop) { type[prop] = superType[prop]; });\n }\n properties.forEach(function (property) {\n if (property.length > 0) {\n switch (property[0]) {\n case '*':\n // We don't yet support events.\n // If ever allowing to bind to events, GO THROUGH A SECURITY REVIEW, allowing events\n // will\n // almost certainly introduce bad XSS vulnerabilities.\n // type[property.substring(1)] = EVENT;\n break;\n case '!':\n type[property.substring(1)] = BOOLEAN;\n break;\n case '#':\n type[property.substring(1)] = NUMBER;\n break;\n case '%':\n type[property.substring(1)] = OBJECT;\n break;\n default:\n type[property] = STRING;\n }\n }\n });\n });\n return _this;\n }\n /**\n * @param {?} tagName\n * @param {?} propName\n * @param {?} schemaMetas\n * @return {?}\n */\n DomElementSchemaRegistry.prototype.hasProperty = /**\n * @param {?} tagName\n * @param {?} propName\n * @param {?} schemaMetas\n * @return {?}\n */\n function (tagName, propName, schemaMetas) {\n if (schemaMetas.some(function (schema) { return schema.name === NO_ERRORS_SCHEMA.name; })) {\n return true;\n }\n if (tagName.indexOf('-') > -1) {\n if (isNgContainer(tagName) || isNgContent(tagName)) {\n return false;\n }\n if (schemaMetas.some(function (schema) { return schema.name === CUSTOM_ELEMENTS_SCHEMA.name; })) {\n // Can't tell now as we don't know which properties a custom element will get\n // once it is instantiated\n return true;\n }\n }\n var /** @type {?} */ elementProperties = this._schema[tagName.toLowerCase()] || this._schema['unknown'];\n return !!elementProperties[propName];\n };\n /**\n * @param {?} tagName\n * @param {?} schemaMetas\n * @return {?}\n */\n DomElementSchemaRegistry.prototype.hasElement = /**\n * @param {?} tagName\n * @param {?} schemaMetas\n * @return {?}\n */\n function (tagName, schemaMetas) {\n if (schemaMetas.some(function (schema) { return schema.name === NO_ERRORS_SCHEMA.name; })) {\n return true;\n }\n if (tagName.indexOf('-') > -1) {\n if (isNgContainer(tagName) || isNgContent(tagName)) {\n return true;\n }\n if (schemaMetas.some(function (schema) { return schema.name === CUSTOM_ELEMENTS_SCHEMA.name; })) {\n // Allow any custom elements\n return true;\n }\n }\n return !!this._schema[tagName.toLowerCase()];\n };\n /**\n * securityContext returns the security context for the given property on the given DOM tag.\n *\n * Tag and property name are statically known and cannot change at runtime, i.e. it is not\n * possible to bind a value into a changing attribute or tag name.\n *\n * The filtering is white list based. All attributes in the schema above are assumed to have the\n * 'NONE' security context, i.e. that they are safe inert string values. Only specific well known\n * attack vectors are assigned their appropriate context.\n */\n /**\n * securityContext returns the security context for the given property on the given DOM tag.\n *\n * Tag and property name are statically known and cannot change at runtime, i.e. it is not\n * possible to bind a value into a changing attribute or tag name.\n *\n * The filtering is white list based. All attributes in the schema above are assumed to have the\n * 'NONE' security context, i.e. that they are safe inert string values. Only specific well known\n * attack vectors are assigned their appropriate context.\n * @param {?} tagName\n * @param {?} propName\n * @param {?} isAttribute\n * @return {?}\n */\n DomElementSchemaRegistry.prototype.securityContext = /**\n * securityContext returns the security context for the given property on the given DOM tag.\n *\n * Tag and property name are statically known and cannot change at runtime, i.e. it is not\n * possible to bind a value into a changing attribute or tag name.\n *\n * The filtering is white list based. All attributes in the schema above are assumed to have the\n * 'NONE' security context, i.e. that they are safe inert string values. Only specific well known\n * attack vectors are assigned their appropriate context.\n * @param {?} tagName\n * @param {?} propName\n * @param {?} isAttribute\n * @return {?}\n */\n function (tagName, propName, isAttribute) {\n if (isAttribute) {\n // NB: For security purposes, use the mapped property name, not the attribute name.\n propName = this.getMappedPropName(propName);\n }\n // Make sure comparisons are case insensitive, so that case differences between attribute and\n // property names do not have a security impact.\n tagName = tagName.toLowerCase();\n propName = propName.toLowerCase();\n var /** @type {?} */ ctx = SECURITY_SCHEMA[tagName + '|' + propName];\n if (ctx) {\n return ctx;\n }\n ctx = SECURITY_SCHEMA['*|' + propName];\n return ctx ? ctx : SecurityContext.NONE;\n };\n /**\n * @param {?} propName\n * @return {?}\n */\n DomElementSchemaRegistry.prototype.getMappedPropName = /**\n * @param {?} propName\n * @return {?}\n */\n function (propName) { return _ATTR_TO_PROP[propName] || propName; };\n /**\n * @return {?}\n */\n DomElementSchemaRegistry.prototype.getDefaultComponentElementName = /**\n * @return {?}\n */\n function () { return 'ng-component'; };\n /**\n * @param {?} name\n * @return {?}\n */\n DomElementSchemaRegistry.prototype.validateProperty = /**\n * @param {?} name\n * @return {?}\n */\n function (name) {\n if (name.toLowerCase().startsWith('on')) {\n var /** @type {?} */ msg = \"Binding to event property '\" + name + \"' is disallowed for security reasons, \" +\n (\"please use (\" + name.slice(2) + \")=...\") +\n (\"\\nIf '\" + name + \"' is a directive input, make sure the directive is imported by the\") +\n \" current module.\";\n return { error: true, msg: msg };\n }\n else {\n return { error: false };\n }\n };\n /**\n * @param {?} name\n * @return {?}\n */\n DomElementSchemaRegistry.prototype.validateAttribute = /**\n * @param {?} name\n * @return {?}\n */\n function (name) {\n if (name.toLowerCase().startsWith('on')) {\n var /** @type {?} */ msg = \"Binding to event attribute '\" + name + \"' is disallowed for security reasons, \" +\n (\"please use (\" + name.slice(2) + \")=...\");\n return { error: true, msg: msg };\n }\n else {\n return { error: false };\n }\n };\n /**\n * @return {?}\n */\n DomElementSchemaRegistry.prototype.allKnownElementNames = /**\n * @return {?}\n */\n function () { return Object.keys(this._schema); };\n /**\n * @param {?} propName\n * @return {?}\n */\n DomElementSchemaRegistry.prototype.normalizeAnimationStyleProperty = /**\n * @param {?} propName\n * @return {?}\n */\n function (propName) {\n return dashCaseToCamelCase(propName);\n };\n /**\n * @param {?} camelCaseProp\n * @param {?} userProvidedProp\n * @param {?} val\n * @return {?}\n */\n DomElementSchemaRegistry.prototype.normalizeAnimationStyleValue = /**\n * @param {?} camelCaseProp\n * @param {?} userProvidedProp\n * @param {?} val\n * @return {?}\n */\n function (camelCaseProp, userProvidedProp, val) {\n var /** @type {?} */ unit = '';\n var /** @type {?} */ strVal = val.toString().trim();\n var /** @type {?} */ errorMsg = /** @type {?} */ ((null));\n if (_isPixelDimensionStyle(camelCaseProp) && val !== 0 && val !== '0') {\n if (typeof val === 'number') {\n unit = 'px';\n }\n else {\n var /** @type {?} */ valAndSuffixMatch = val.match(/^[+-]?[\\d\\.]+([a-z]*)$/);\n if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {\n errorMsg = \"Please provide a CSS unit value for \" + userProvidedProp + \":\" + val;\n }\n }\n }\n return { error: errorMsg, value: strVal + unit };\n };\n return DomElementSchemaRegistry;\n}(ElementSchemaRegistry));\n/**\n * @param {?} prop\n * @return {?}\n */\nfunction _isPixelDimensionStyle(prop) {\n switch (prop) {\n case 'width':\n case 'height':\n case 'minWidth':\n case 'minHeight':\n case 'maxWidth':\n case 'maxHeight':\n case 'left':\n case 'top':\n case 'bottom':\n case 'right':\n case 'fontSize':\n case 'outlineWidth':\n case 'outlineOffset':\n case 'paddingTop':\n case 'paddingLeft':\n case 'paddingBottom':\n case 'paddingRight':\n case 'marginTop':\n case 'marginLeft':\n case 'marginBottom':\n case 'marginRight':\n case 'borderRadius':\n case 'borderWidth':\n case 'borderTopWidth':\n case 'borderLeftWidth':\n case 'borderRightWidth':\n case 'borderBottomWidth':\n case 'textIndent':\n return true;\n default:\n return false;\n }\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * This file is a port of shadowCSS from webcomponents.js to TypeScript.\n *\n * Please make sure to keep to edits in sync with the source file.\n *\n * Source:\n * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js\n *\n * The original file level comment is reproduced below\n */\n/*\n This is a limited shim for ShadowDOM css styling.\n https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles\n\n The intention here is to support only the styling features which can be\n relatively simply implemented. The goal is to allow users to avoid the\n most obvious pitfalls and do so without compromising performance significantly.\n For ShadowDOM styling that's not covered here, a set of best practices\n can be provided that should allow users to accomplish more complex styling.\n\n The following is a list of specific ShadowDOM styling features and a brief\n discussion of the approach used to shim.\n\n Shimmed features:\n\n * :host, :host-context: ShadowDOM allows styling of the shadowRoot's host\n element using the :host rule. To shim this feature, the :host styles are\n reformatted and prefixed with a given scope name and promoted to a\n document level stylesheet.\n For example, given a scope name of .foo, a rule like this:\n\n :host {\n background: red;\n }\n }\n\n becomes:\n\n .foo {\n background: red;\n }\n\n * encapsulation: Styles defined within ShadowDOM, apply only to\n dom inside the ShadowDOM. Polymer uses one of two techniques to implement\n this feature.\n\n By default, rules are prefixed with the host element tag name\n as a descendant selector. This ensures styling does not leak out of the 'top'\n of the element's ShadowDOM. For example,\n\n div {\n font-weight: bold;\n }\n\n becomes:\n\n x-foo div {\n font-weight: bold;\n }\n\n becomes:\n\n\n Alternatively, if WebComponents.ShadowCSS.strictStyling is set to true then\n selectors are scoped by adding an attribute selector suffix to each\n simple selector that contains the host element tag name. Each element\n in the element's ShadowDOM template is also given the scope attribute.\n Thus, these rules match only elements that have the scope attribute.\n For example, given a scope name of x-foo, a rule like this:\n\n div {\n font-weight: bold;\n }\n\n becomes:\n\n div[x-foo] {\n font-weight: bold;\n }\n\n Note that elements that are dynamically added to a scope must have the scope\n selector added to them manually.\n\n * upper/lower bound encapsulation: Styles which are defined outside a\n shadowRoot should not cross the ShadowDOM boundary and should not apply\n inside a shadowRoot.\n\n This styling behavior is not emulated. Some possible ways to do this that\n were rejected due to complexity and/or performance concerns include: (1) reset\n every possible property for every possible selector for a given scope name;\n (2) re-implement css in javascript.\n\n As an alternative, users should make sure to use selectors\n specific to the scope in which they are working.\n\n * ::distributed: This behavior is not emulated. It's often not necessary\n to style the contents of a specific insertion point and instead, descendants\n of the host element can be styled selectively. Users can also create an\n extra node around an insertion point and style that node's contents\n via descendent selectors. For example, with a shadowRoot like this:\n\n \n \n\n could become:\n\n \n
\n \n
\n\n Note the use of @polyfill in the comment above a ShadowDOM specific style\n declaration. This is a directive to the styling shim to use the selector\n in comments in lieu of the next selector when running under polyfill.\n*/\nvar ShadowCss = /** @class */ (function () {\n function ShadowCss() {\n this.strictStyling = true;\n }\n /*\n * Shim some cssText with the given selector. Returns cssText that can\n * be included in the document via WebComponents.ShadowCSS.addCssToDocument(css).\n *\n * When strictStyling is true:\n * - selector is the attribute added to all elements inside the host,\n * - hostSelector is the attribute added to the host itself.\n */\n /**\n * @param {?} cssText\n * @param {?} selector\n * @param {?=} hostSelector\n * @return {?}\n */\n ShadowCss.prototype.shimCssText = /**\n * @param {?} cssText\n * @param {?} selector\n * @param {?=} hostSelector\n * @return {?}\n */\n function (cssText, selector, hostSelector) {\n if (hostSelector === void 0) { hostSelector = ''; }\n var /** @type {?} */ commentsWithHash = extractCommentsWithHash(cssText);\n cssText = stripComments(cssText);\n cssText = this._insertDirectives(cssText);\n var /** @type {?} */ scopedCssText = this._scopeCssText(cssText, selector, hostSelector);\n return [scopedCssText].concat(commentsWithHash).join('\\n');\n };\n /**\n * @param {?} cssText\n * @return {?}\n */\n ShadowCss.prototype._insertDirectives = /**\n * @param {?} cssText\n * @return {?}\n */\n function (cssText) {\n cssText = this._insertPolyfillDirectivesInCssText(cssText);\n return this._insertPolyfillRulesInCssText(cssText);\n };\n /**\n * @param {?} cssText\n * @return {?}\n */\n ShadowCss.prototype._insertPolyfillDirectivesInCssText = /**\n * @param {?} cssText\n * @return {?}\n */\n function (cssText) {\n // Difference with webcomponents.js: does not handle comments\n return cssText.replace(_cssContentNextSelectorRe, function () {\n var m = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n m[_i] = arguments[_i];\n }\n return m[2] + '{';\n });\n };\n /**\n * @param {?} cssText\n * @return {?}\n */\n ShadowCss.prototype._insertPolyfillRulesInCssText = /**\n * @param {?} cssText\n * @return {?}\n */\n function (cssText) {\n // Difference with webcomponents.js: does not handle comments\n return cssText.replace(_cssContentRuleRe, function () {\n var m = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n m[_i] = arguments[_i];\n }\n var /** @type {?} */ rule = m[0].replace(m[1], '').replace(m[2], '');\n return m[4] + rule;\n });\n };\n /**\n * @param {?} cssText\n * @param {?} scopeSelector\n * @param {?} hostSelector\n * @return {?}\n */\n ShadowCss.prototype._scopeCssText = /**\n * @param {?} cssText\n * @param {?} scopeSelector\n * @param {?} hostSelector\n * @return {?}\n */\n function (cssText, scopeSelector, hostSelector) {\n var /** @type {?} */ unscopedRules = this._extractUnscopedRulesFromCssText(cssText);\n // replace :host and :host-context -shadowcsshost and -shadowcsshost respectively\n cssText = this._insertPolyfillHostInCssText(cssText);\n cssText = this._convertColonHost(cssText);\n cssText = this._convertColonHostContext(cssText);\n cssText = this._convertShadowDOMSelectors(cssText);\n if (scopeSelector) {\n cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector);\n }\n cssText = cssText + '\\n' + unscopedRules;\n return cssText.trim();\n };\n /**\n * @param {?} cssText\n * @return {?}\n */\n ShadowCss.prototype._extractUnscopedRulesFromCssText = /**\n * @param {?} cssText\n * @return {?}\n */\n function (cssText) {\n // Difference with webcomponents.js: does not handle comments\n var /** @type {?} */ r = '';\n var /** @type {?} */ m;\n _cssContentUnscopedRuleRe.lastIndex = 0;\n while ((m = _cssContentUnscopedRuleRe.exec(cssText)) !== null) {\n var /** @type {?} */ rule = m[0].replace(m[2], '').replace(m[1], m[4]);\n r += rule + '\\n\\n';\n }\n return r;\n };\n /**\n * @param {?} cssText\n * @return {?}\n */\n ShadowCss.prototype._convertColonHost = /**\n * @param {?} cssText\n * @return {?}\n */\n function (cssText) {\n return this._convertColonRule(cssText, _cssColonHostRe, this._colonHostPartReplacer);\n };\n /**\n * @param {?} cssText\n * @return {?}\n */\n ShadowCss.prototype._convertColonHostContext = /**\n * @param {?} cssText\n * @return {?}\n */\n function (cssText) {\n return this._convertColonRule(cssText, _cssColonHostContextRe, this._colonHostContextPartReplacer);\n };\n /**\n * @param {?} cssText\n * @param {?} regExp\n * @param {?} partReplacer\n * @return {?}\n */\n ShadowCss.prototype._convertColonRule = /**\n * @param {?} cssText\n * @param {?} regExp\n * @param {?} partReplacer\n * @return {?}\n */\n function (cssText, regExp, partReplacer) {\n // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule\n return cssText.replace(regExp, function () {\n var m = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n m[_i] = arguments[_i];\n }\n if (m[2]) {\n var /** @type {?} */ parts = m[2].split(',');\n var /** @type {?} */ r = [];\n for (var /** @type {?} */ i = 0; i < parts.length; i++) {\n var /** @type {?} */ p = parts[i].trim();\n if (!p)\n break;\n r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));\n }\n return r.join(',');\n }\n else {\n return _polyfillHostNoCombinator + m[3];\n }\n });\n };\n /**\n * @param {?} host\n * @param {?} part\n * @param {?} suffix\n * @return {?}\n */\n ShadowCss.prototype._colonHostContextPartReplacer = /**\n * @param {?} host\n * @param {?} part\n * @param {?} suffix\n * @return {?}\n */\n function (host, part, suffix) {\n if (part.indexOf(_polyfillHost) > -1) {\n return this._colonHostPartReplacer(host, part, suffix);\n }\n else {\n return host + part + suffix + ', ' + part + ' ' + host + suffix;\n }\n };\n /**\n * @param {?} host\n * @param {?} part\n * @param {?} suffix\n * @return {?}\n */\n ShadowCss.prototype._colonHostPartReplacer = /**\n * @param {?} host\n * @param {?} part\n * @param {?} suffix\n * @return {?}\n */\n function (host, part, suffix) {\n return host + part.replace(_polyfillHost, '') + suffix;\n };\n /**\n * @param {?} cssText\n * @return {?}\n */\n ShadowCss.prototype._convertShadowDOMSelectors = /**\n * @param {?} cssText\n * @return {?}\n */\n function (cssText) {\n return _shadowDOMSelectorsRe.reduce(function (result, pattern) { return result.replace(pattern, ' '); }, cssText);\n };\n /**\n * @param {?} cssText\n * @param {?} scopeSelector\n * @param {?} hostSelector\n * @return {?}\n */\n ShadowCss.prototype._scopeSelectors = /**\n * @param {?} cssText\n * @param {?} scopeSelector\n * @param {?} hostSelector\n * @return {?}\n */\n function (cssText, scopeSelector, hostSelector) {\n var _this = this;\n return processRules(cssText, function (rule) {\n var /** @type {?} */ selector = rule.selector;\n var /** @type {?} */ content = rule.content;\n if (rule.selector[0] != '@') {\n selector =\n _this._scopeSelector(rule.selector, scopeSelector, hostSelector, _this.strictStyling);\n }\n else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||\n rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) {\n content = _this._scopeSelectors(rule.content, scopeSelector, hostSelector);\n }\n return new CssRule(selector, content);\n });\n };\n /**\n * @param {?} selector\n * @param {?} scopeSelector\n * @param {?} hostSelector\n * @param {?} strict\n * @return {?}\n */\n ShadowCss.prototype._scopeSelector = /**\n * @param {?} selector\n * @param {?} scopeSelector\n * @param {?} hostSelector\n * @param {?} strict\n * @return {?}\n */\n function (selector, scopeSelector, hostSelector, strict) {\n var _this = this;\n return selector.split(',')\n .map(function (part) { return part.trim().split(_shadowDeepSelectors); })\n .map(function (deepParts) {\n var shallowPart = deepParts[0], otherParts = deepParts.slice(1);\n var /** @type {?} */ applyScope = function (shallowPart) {\n if (_this._selectorNeedsScoping(shallowPart, scopeSelector)) {\n return strict ?\n _this._applyStrictSelectorScope(shallowPart, scopeSelector, hostSelector) :\n _this._applySelectorScope(shallowPart, scopeSelector, hostSelector);\n }\n else {\n return shallowPart;\n }\n };\n return [applyScope(shallowPart)].concat(otherParts).join(' ');\n })\n .join(', ');\n };\n /**\n * @param {?} selector\n * @param {?} scopeSelector\n * @return {?}\n */\n ShadowCss.prototype._selectorNeedsScoping = /**\n * @param {?} selector\n * @param {?} scopeSelector\n * @return {?}\n */\n function (selector, scopeSelector) {\n var /** @type {?} */ re = this._makeScopeMatcher(scopeSelector);\n return !re.test(selector);\n };\n /**\n * @param {?} scopeSelector\n * @return {?}\n */\n ShadowCss.prototype._makeScopeMatcher = /**\n * @param {?} scopeSelector\n * @return {?}\n */\n function (scopeSelector) {\n var /** @type {?} */ lre = /\\[/g;\n var /** @type {?} */ rre = /\\]/g;\n scopeSelector = scopeSelector.replace(lre, '\\\\[').replace(rre, '\\\\]');\n return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');\n };\n /**\n * @param {?} selector\n * @param {?} scopeSelector\n * @param {?} hostSelector\n * @return {?}\n */\n ShadowCss.prototype._applySelectorScope = /**\n * @param {?} selector\n * @param {?} scopeSelector\n * @param {?} hostSelector\n * @return {?}\n */\n function (selector, scopeSelector, hostSelector) {\n // Difference from webcomponents.js: scopeSelector could not be an array\n return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector);\n };\n /**\n * @param {?} selector\n * @param {?} scopeSelector\n * @param {?} hostSelector\n * @return {?}\n */\n ShadowCss.prototype._applySimpleSelectorScope = /**\n * @param {?} selector\n * @param {?} scopeSelector\n * @param {?} hostSelector\n * @return {?}\n */\n function (selector, scopeSelector, hostSelector) {\n // In Android browser, the lastIndex is not reset when the regex is used in String.replace()\n _polyfillHostRe.lastIndex = 0;\n if (_polyfillHostRe.test(selector)) {\n var /** @type {?} */ replaceBy_1 = this.strictStyling ? \"[\" + hostSelector + \"]\" : scopeSelector;\n return selector\n .replace(_polyfillHostNoCombinatorRe, function (hnc, selector) {\n return selector.replace(/([^:]*)(:*)(.*)/, function (_, before, colon, after) {\n return before + replaceBy_1 + colon + after;\n });\n })\n .replace(_polyfillHostRe, replaceBy_1 + ' ');\n }\n return scopeSelector + ' ' + selector;\n };\n /**\n * @param {?} selector\n * @param {?} scopeSelector\n * @param {?} hostSelector\n * @return {?}\n */\n ShadowCss.prototype._applyStrictSelectorScope = /**\n * @param {?} selector\n * @param {?} scopeSelector\n * @param {?} hostSelector\n * @return {?}\n */\n function (selector, scopeSelector, hostSelector) {\n var _this = this;\n var /** @type {?} */ isRe = /\\[is=([^\\]]*)\\]/g;\n scopeSelector = scopeSelector.replace(isRe, function (_) {\n var parts = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n parts[_i - 1] = arguments[_i];\n }\n return parts[0];\n });\n var /** @type {?} */ attrName = '[' + scopeSelector + ']';\n var /** @type {?} */ _scopeSelectorPart = function (p) {\n var /** @type {?} */ scopedP = p.trim();\n if (!scopedP) {\n return '';\n }\n if (p.indexOf(_polyfillHostNoCombinator) > -1) {\n scopedP = _this._applySimpleSelectorScope(p, scopeSelector, hostSelector);\n }\n else {\n // remove :host since it should be unnecessary\n var /** @type {?} */ t = p.replace(_polyfillHostRe, '');\n if (t.length > 0) {\n var /** @type {?} */ matches = t.match(/([^:]*)(:*)(.*)/);\n if (matches) {\n scopedP = matches[1] + attrName + matches[2] + matches[3];\n }\n }\n }\n return scopedP;\n };\n var /** @type {?} */ safeContent = new SafeSelector(selector);\n selector = safeContent.content();\n var /** @type {?} */ scopedSelector = '';\n var /** @type {?} */ startIndex = 0;\n var /** @type {?} */ res;\n var /** @type {?} */ sep = /( |>|\\+|~(?!=))\\s*/g;\n // If a selector appears before :host it should not be shimmed as it\n // matches on ancestor elements and not on elements in the host's shadow\n // `:host-context(div)` is transformed to\n // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`\n // the `div` is not part of the component in the 2nd selectors and should not be scoped.\n // Historically `component-tag:host` was matching the component so we also want to preserve\n // this behavior to avoid breaking legacy apps (it should not match).\n // The behavior should be:\n // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)\n // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a\n // `:host-context(tag)`)\n var /** @type {?} */ hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;\n // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present\n var /** @type {?} */ shouldScope = !hasHost;\n while ((res = sep.exec(selector)) !== null) {\n var /** @type {?} */ separator = res[1];\n var /** @type {?} */ part_1 = selector.slice(startIndex, res.index).trim();\n shouldScope = shouldScope || part_1.indexOf(_polyfillHostNoCombinator) > -1;\n var /** @type {?} */ scopedPart = shouldScope ? _scopeSelectorPart(part_1) : part_1;\n scopedSelector += scopedPart + \" \" + separator + \" \";\n startIndex = sep.lastIndex;\n }\n var /** @type {?} */ part = selector.substring(startIndex);\n shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;\n scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;\n // replace the placeholders with their original values\n return safeContent.restore(scopedSelector);\n };\n /**\n * @param {?} selector\n * @return {?}\n */\n ShadowCss.prototype._insertPolyfillHostInCssText = /**\n * @param {?} selector\n * @return {?}\n */\n function (selector) {\n return selector.replace(_colonHostContextRe, _polyfillHostContext)\n .replace(_colonHostRe, _polyfillHost);\n };\n return ShadowCss;\n}());\nvar SafeSelector = /** @class */ (function () {\n function SafeSelector(selector) {\n var _this = this;\n this.placeholders = [];\n this.index = 0;\n // Replaces attribute selectors with placeholders.\n // The WS in [attr=\"va lue\"] would otherwise be interpreted as a selector separator.\n selector = selector.replace(/(\\[[^\\]]*\\])/g, function (_, keep) {\n var /** @type {?} */ replaceBy = \"__ph-\" + _this.index + \"__\";\n _this.placeholders.push(keep);\n _this.index++;\n return replaceBy;\n });\n // Replaces the expression in `:nth-child(2n + 1)` with a placeholder.\n // WS and \"+\" would otherwise be interpreted as selector separators.\n this._content = selector.replace(/(:nth-[-\\w]+)(\\([^)]+\\))/g, function (_, pseudo, exp) {\n var /** @type {?} */ replaceBy = \"__ph-\" + _this.index + \"__\";\n _this.placeholders.push(exp);\n _this.index++;\n return pseudo + replaceBy;\n });\n }\n /**\n * @param {?} content\n * @return {?}\n */\n SafeSelector.prototype.restore = /**\n * @param {?} content\n * @return {?}\n */\n function (content) {\n var _this = this;\n return content.replace(/__ph-(\\d+)__/g, function (ph, index) { return _this.placeholders[+index]; });\n };\n /**\n * @return {?}\n */\n SafeSelector.prototype.content = /**\n * @return {?}\n */\n function () { return this._content; };\n return SafeSelector;\n}());\nvar _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\\s]*?(['\"])(.*?)\\1[;\\s]*}([^{]*?){/gim;\nvar _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\\s]*(['\"])(.*?)\\3)[;\\s]*[^}]*}/gim;\nvar _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\\s]*(['\"])(.*?)\\3)[;\\s]*[^}]*}/gim;\nvar _polyfillHost = '-shadowcsshost';\n// note: :host-context pre-processed to -shadowcsshostcontext.\nvar _polyfillHostContext = '-shadowcsscontext';\nvar _parenSuffix = ')(?:\\\\((' +\n '(?:\\\\([^)(]*\\\\)|[^)(]*)+?' +\n ')\\\\))?([^,{]*)';\nvar _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');\nvar _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');\nvar _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';\nvar _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\\s]*)/;\nvar _shadowDOMSelectorsRe = [\n /::shadow/g,\n /::content/g,\n /\\/shadow-deep\\//g,\n /\\/shadow\\//g,\n];\n// The deep combinator is deprecated in the CSS spec\n// Support for `>>>`, `deep`, `::ng-deep` is then also deprecated and will be removed in the future.\n// see https://github.com/angular/angular/pull/17677\nvar _shadowDeepSelectors = /(?:>>>)|(?:\\/deep\\/)|(?:::ng-deep)/g;\nvar _selectorReSuffix = '([>\\\\s~+\\[.,{:][\\\\s\\\\S]*)?$';\nvar _polyfillHostRe = /-shadowcsshost/gim;\nvar _colonHostRe = /:host/gim;\nvar _colonHostContextRe = /:host-context/gim;\nvar _commentRe = /\\/\\*\\s*[\\s\\S]*?\\*\\//g;\n/**\n * @param {?} input\n * @return {?}\n */\nfunction stripComments(input) {\n return input.replace(_commentRe, '');\n}\nvar _commentWithHashRe = /\\/\\*\\s*#\\s*source(Mapping)?URL=[\\s\\S]+?\\*\\//g;\n/**\n * @param {?} input\n * @return {?}\n */\nfunction extractCommentsWithHash(input) {\n return input.match(_commentWithHashRe) || [];\n}\nvar _ruleRe = /(\\s*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))/g;\nvar _curlyRe = /([{}])/g;\nvar OPEN_CURLY = '{';\nvar CLOSE_CURLY = '}';\nvar BLOCK_PLACEHOLDER = '%BLOCK%';\nvar CssRule = /** @class */ (function () {\n function CssRule(selector, content) {\n this.selector = selector;\n this.content = content;\n }\n return CssRule;\n}());\n/**\n * @param {?} input\n * @param {?} ruleCallback\n * @return {?}\n */\nfunction processRules(input, ruleCallback) {\n var /** @type {?} */ inputWithEscapedBlocks = escapeBlocks(input);\n var /** @type {?} */ nextBlockIndex = 0;\n return inputWithEscapedBlocks.escapedString.replace(_ruleRe, function () {\n var m = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n m[_i] = arguments[_i];\n }\n var /** @type {?} */ selector = m[2];\n var /** @type {?} */ content = '';\n var /** @type {?} */ suffix = m[4];\n var /** @type {?} */ contentPrefix = '';\n if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {\n content = inputWithEscapedBlocks.blocks[nextBlockIndex++];\n suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);\n contentPrefix = '{';\n }\n var /** @type {?} */ rule = ruleCallback(new CssRule(selector, content));\n return \"\" + m[1] + rule.selector + m[3] + contentPrefix + rule.content + suffix;\n });\n}\nvar StringWithEscapedBlocks = /** @class */ (function () {\n function StringWithEscapedBlocks(escapedString, blocks) {\n this.escapedString = escapedString;\n this.blocks = blocks;\n }\n return StringWithEscapedBlocks;\n}());\n/**\n * @param {?} input\n * @return {?}\n */\nfunction escapeBlocks(input) {\n var /** @type {?} */ inputParts = input.split(_curlyRe);\n var /** @type {?} */ resultParts = [];\n var /** @type {?} */ escapedBlocks = [];\n var /** @type {?} */ bracketCount = 0;\n var /** @type {?} */ currentBlockParts = [];\n for (var /** @type {?} */ partIndex = 0; partIndex < inputParts.length; partIndex++) {\n var /** @type {?} */ part = inputParts[partIndex];\n if (part == CLOSE_CURLY) {\n bracketCount--;\n }\n if (bracketCount > 0) {\n currentBlockParts.push(part);\n }\n else {\n if (currentBlockParts.length > 0) {\n escapedBlocks.push(currentBlockParts.join(''));\n resultParts.push(BLOCK_PLACEHOLDER);\n currentBlockParts = [];\n }\n resultParts.push(part);\n }\n if (part == OPEN_CURLY) {\n bracketCount++;\n }\n }\n if (currentBlockParts.length > 0) {\n escapedBlocks.push(currentBlockParts.join(''));\n resultParts.push(BLOCK_PLACEHOLDER);\n }\n return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar COMPONENT_VARIABLE = '%COMP%';\nvar HOST_ATTR = \"_nghost-\" + COMPONENT_VARIABLE;\nvar CONTENT_ATTR = \"_ngcontent-\" + COMPONENT_VARIABLE;\nvar StylesCompileDependency = /** @class */ (function () {\n function StylesCompileDependency(name, moduleUrl, setValue) {\n this.name = name;\n this.moduleUrl = moduleUrl;\n this.setValue = setValue;\n }\n return StylesCompileDependency;\n}());\nvar CompiledStylesheet = /** @class */ (function () {\n function CompiledStylesheet(outputCtx, stylesVar, dependencies, isShimmed, meta) {\n this.outputCtx = outputCtx;\n this.stylesVar = stylesVar;\n this.dependencies = dependencies;\n this.isShimmed = isShimmed;\n this.meta = meta;\n }\n return CompiledStylesheet;\n}());\nvar StyleCompiler = /** @class */ (function () {\n function StyleCompiler(_urlResolver) {\n this._urlResolver = _urlResolver;\n this._shadowCss = new ShadowCss();\n }\n /**\n * @param {?} outputCtx\n * @param {?} comp\n * @return {?}\n */\n StyleCompiler.prototype.compileComponent = /**\n * @param {?} outputCtx\n * @param {?} comp\n * @return {?}\n */\n function (outputCtx, comp) {\n var /** @type {?} */ template = /** @type {?} */ ((comp.template));\n return this._compileStyles(outputCtx, comp, new CompileStylesheetMetadata({\n styles: template.styles,\n styleUrls: template.styleUrls,\n moduleUrl: identifierModuleUrl(comp.type)\n }), this.needsStyleShim(comp), true);\n };\n /**\n * @param {?} outputCtx\n * @param {?} comp\n * @param {?} stylesheet\n * @param {?=} shim\n * @return {?}\n */\n StyleCompiler.prototype.compileStyles = /**\n * @param {?} outputCtx\n * @param {?} comp\n * @param {?} stylesheet\n * @param {?=} shim\n * @return {?}\n */\n function (outputCtx, comp, stylesheet, shim) {\n if (shim === void 0) { shim = this.needsStyleShim(comp); }\n return this._compileStyles(outputCtx, comp, stylesheet, shim, false);\n };\n /**\n * @param {?} comp\n * @return {?}\n */\n StyleCompiler.prototype.needsStyleShim = /**\n * @param {?} comp\n * @return {?}\n */\n function (comp) {\n return /** @type {?} */ ((comp.template)).encapsulation === ViewEncapsulation.Emulated;\n };\n /**\n * @param {?} outputCtx\n * @param {?} comp\n * @param {?} stylesheet\n * @param {?} shim\n * @param {?} isComponentStylesheet\n * @return {?}\n */\n StyleCompiler.prototype._compileStyles = /**\n * @param {?} outputCtx\n * @param {?} comp\n * @param {?} stylesheet\n * @param {?} shim\n * @param {?} isComponentStylesheet\n * @return {?}\n */\n function (outputCtx, comp, stylesheet, shim, isComponentStylesheet) {\n var _this = this;\n var /** @type {?} */ styleExpressions = stylesheet.styles.map(function (plainStyle) { return literal(_this._shimIfNeeded(plainStyle, shim)); });\n var /** @type {?} */ dependencies = [];\n stylesheet.styleUrls.forEach(function (styleUrl) {\n var /** @type {?} */ exprIndex = styleExpressions.length;\n // Note: This placeholder will be filled later.\n styleExpressions.push(/** @type {?} */ ((null)));\n dependencies.push(new StylesCompileDependency(getStylesVarName(null), styleUrl, function (value) { return styleExpressions[exprIndex] = outputCtx.importExpr(value); }));\n });\n // styles variable contains plain strings and arrays of other styles arrays (recursive),\n // so we set its type to dynamic.\n var /** @type {?} */ stylesVar = getStylesVarName(isComponentStylesheet ? comp : null);\n var /** @type {?} */ stmt = variable(stylesVar)\n .set(literalArr(styleExpressions, new ArrayType(DYNAMIC_TYPE, [TypeModifier.Const])))\n .toDeclStmt(null, isComponentStylesheet ? [StmtModifier.Final] : [\n StmtModifier.Final, StmtModifier.Exported\n ]);\n outputCtx.statements.push(stmt);\n return new CompiledStylesheet(outputCtx, stylesVar, dependencies, shim, stylesheet);\n };\n /**\n * @param {?} style\n * @param {?} shim\n * @return {?}\n */\n StyleCompiler.prototype._shimIfNeeded = /**\n * @param {?} style\n * @param {?} shim\n * @return {?}\n */\n function (style, shim) {\n return shim ? this._shadowCss.shimCssText(style, CONTENT_ATTR, HOST_ATTR) : style;\n };\n return StyleCompiler;\n}());\n/**\n * @param {?} component\n * @return {?}\n */\nfunction getStylesVarName(component) {\n var /** @type {?} */ result = \"styles\";\n if (component) {\n result += \"_\" + identifierName(component.type);\n }\n return result;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar PRESERVE_WS_ATTR_NAME = 'ngPreserveWhitespaces';\nvar SKIP_WS_TRIM_TAGS = new Set(['pre', 'template', 'textarea', 'script', 'style']);\n// Equivalent to \\s with \\u00a0 (non-breaking space) excluded.\n// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\nvar WS_CHARS = ' \\f\\n\\r\\t\\v\\u1680\\u180e\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff';\nvar NO_WS_REGEXP = new RegExp(\"[^\" + WS_CHARS + \"]\");\nvar WS_REPLACE_REGEXP = new RegExp(\"[\" + WS_CHARS + \"]{2,}\", 'g');\n/**\n * @param {?} attrs\n * @return {?}\n */\nfunction hasPreserveWhitespacesAttr(attrs) {\n return attrs.some(function (attr) { return attr.name === PRESERVE_WS_ATTR_NAME; });\n}\n/**\n * Angular Dart introduced &ngsp; as a placeholder for non-removable space, see:\n * https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/_tests/test/compiler/preserve_whitespace_test.dart#L25-L32\n * In Angular Dart &ngsp; is converted to the 0xE500 PUA (Private Use Areas) unicode character\n * and later on replaced by a space. We are re-implementing the same idea here.\n * @param {?} value\n * @return {?}\n */\nfunction replaceNgsp(value) {\n // lexer is replacing the &ngsp; pseudo-entity with NGSP_UNICODE\n return value.replace(new RegExp(NGSP_UNICODE, 'g'), ' ');\n}\n/**\n * This visitor can walk HTML parse tree and remove / trim text nodes using the following rules:\n * - consider spaces, tabs and new lines as whitespace characters;\n * - drop text nodes consisting of whitespace characters only;\n * - for all other text nodes replace consecutive whitespace characters with one space;\n * - convert &ngsp; pseudo-entity to a single space;\n *\n * Removal and trimming of whitespaces have positive performance impact (less code to generate\n * while compiling templates, faster view creation). At the same time it can be \"destructive\"\n * in some cases (whitespaces can influence layout). Because of the potential of breaking layout\n * this visitor is not activated by default in Angular 5 and people need to explicitly opt-in for\n * whitespace removal. The default option for whitespace removal will be revisited in Angular 6\n * and might be changed to \"on\" by default.\n */\nvar WhitespaceVisitor = /** @class */ (function () {\n function WhitespaceVisitor() {\n }\n /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n WhitespaceVisitor.prototype.visitElement = /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n function (element, context) {\n if (SKIP_WS_TRIM_TAGS.has(element.name) || hasPreserveWhitespacesAttr(element.attrs)) {\n // don't descent into elements where we need to preserve whitespaces\n // but still visit all attributes to eliminate one used as a market to preserve WS\n return new Element(element.name, visitAll(this, element.attrs), element.children, element.sourceSpan, element.startSourceSpan, element.endSourceSpan);\n }\n return new Element(element.name, element.attrs, visitAll(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan);\n };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n WhitespaceVisitor.prototype.visitAttribute = /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n function (attribute, context) {\n return attribute.name !== PRESERVE_WS_ATTR_NAME ? attribute : null;\n };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n WhitespaceVisitor.prototype.visitText = /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n function (text, context) {\n var /** @type {?} */ isNotBlank = text.value.match(NO_WS_REGEXP);\n if (isNotBlank) {\n return new Text(replaceNgsp(text.value).replace(WS_REPLACE_REGEXP, ' '), text.sourceSpan);\n }\n return null;\n };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n WhitespaceVisitor.prototype.visitComment = /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n function (comment, context) { return comment; };\n /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n WhitespaceVisitor.prototype.visitExpansion = /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n function (expansion, context) { return expansion; };\n /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n WhitespaceVisitor.prototype.visitExpansionCase = /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n function (expansionCase, context) { return expansionCase; };\n return WhitespaceVisitor;\n}());\n/**\n * @param {?} htmlAstWithErrors\n * @return {?}\n */\nfunction removeWhitespaces(htmlAstWithErrors) {\n return new ParseTreeResult(visitAll(new WhitespaceVisitor(), htmlAstWithErrors.rootNodes), htmlAstWithErrors.errors);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n// http://cldr.unicode.org/index/cldr-spec/plural-rules\nvar PLURAL_CASES = ['zero', 'one', 'two', 'few', 'many', 'other'];\n/**\n * Expands special forms into elements.\n *\n * For example,\n *\n * ```\n * { messages.length, plural,\n * =0 {zero}\n * =1 {one}\n * other {more than one}\n * }\n * ```\n *\n * will be expanded into\n *\n * ```\n * \n * zero\n * one\n * more than one\n * \n * ```\n * @param {?} nodes\n * @return {?}\n */\nfunction expandNodes(nodes) {\n var /** @type {?} */ expander = new _Expander();\n return new ExpansionResult(visitAll(expander, nodes), expander.isExpanded, expander.errors);\n}\nvar ExpansionResult = /** @class */ (function () {\n function ExpansionResult(nodes, expanded, errors) {\n this.nodes = nodes;\n this.expanded = expanded;\n this.errors = errors;\n }\n return ExpansionResult;\n}());\nvar ExpansionError = /** @class */ (function (_super) {\n __extends(ExpansionError, _super);\n function ExpansionError(span, errorMsg) {\n return _super.call(this, span, errorMsg) || this;\n }\n return ExpansionError;\n}(ParseError));\n/**\n * Expand expansion forms (plural, select) to directives\n *\n * \\@internal\n */\nvar _Expander = /** @class */ (function () {\n function _Expander() {\n this.isExpanded = false;\n this.errors = [];\n }\n /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n _Expander.prototype.visitElement = /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n function (element, context) {\n return new Element(element.name, element.attrs, visitAll(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan);\n };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n _Expander.prototype.visitAttribute = /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n function (attribute, context) { return attribute; };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n _Expander.prototype.visitText = /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n function (text, context) { return text; };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n _Expander.prototype.visitComment = /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n function (comment, context) { return comment; };\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n _Expander.prototype.visitExpansion = /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n function (icu, context) {\n this.isExpanded = true;\n return icu.type == 'plural' ? _expandPluralForm(icu, this.errors) :\n _expandDefaultForm(icu, this.errors);\n };\n /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n _Expander.prototype.visitExpansionCase = /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n function (icuCase, context) {\n throw new Error('Should not be reached');\n };\n return _Expander;\n}());\n/**\n * @param {?} ast\n * @param {?} errors\n * @return {?}\n */\nfunction _expandPluralForm(ast, errors) {\n var /** @type {?} */ children = ast.cases.map(function (c) {\n if (PLURAL_CASES.indexOf(c.value) == -1 && !c.value.match(/^=\\d+$/)) {\n errors.push(new ExpansionError(c.valueSourceSpan, \"Plural cases should be \\\"=\\\" or one of \" + PLURAL_CASES.join(\", \")));\n }\n var /** @type {?} */ expansionResult = expandNodes(c.expression);\n errors.push.apply(errors, expansionResult.errors);\n return new Element(\"ng-template\", [new Attribute$1('ngPluralCase', \"\" + c.value, c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n });\n var /** @type {?} */ switchAttr = new Attribute$1('[ngPlural]', ast.switchValue, ast.switchValueSourceSpan);\n return new Element('ng-container', [switchAttr], children, ast.sourceSpan, ast.sourceSpan, ast.sourceSpan);\n}\n/**\n * @param {?} ast\n * @param {?} errors\n * @return {?}\n */\nfunction _expandDefaultForm(ast, errors) {\n var /** @type {?} */ children = ast.cases.map(function (c) {\n var /** @type {?} */ expansionResult = expandNodes(c.expression);\n errors.push.apply(errors, expansionResult.errors);\n if (c.value === 'other') {\n // other is the default case when no values match\n return new Element(\"ng-template\", [new Attribute$1('ngSwitchDefault', '', c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n }\n return new Element(\"ng-template\", [new Attribute$1('ngSwitchCase', \"\" + c.value, c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n });\n var /** @type {?} */ switchAttr = new Attribute$1('[ngSwitch]', ast.switchValue, ast.switchValueSourceSpan);\n return new Element('ng-container', [switchAttr], children, ast.sourceSpan, ast.sourceSpan, ast.sourceSpan);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar PROPERTY_PARTS_SEPARATOR = '.';\nvar ATTRIBUTE_PREFIX = 'attr';\nvar CLASS_PREFIX = 'class';\nvar STYLE_PREFIX = 'style';\nvar ANIMATE_PROP_PREFIX = 'animate-';\n/** @enum {number} */\nvar BoundPropertyType = {\n DEFAULT: 0,\n LITERAL_ATTR: 1,\n ANIMATION: 2,\n};\nBoundPropertyType[BoundPropertyType.DEFAULT] = \"DEFAULT\";\nBoundPropertyType[BoundPropertyType.LITERAL_ATTR] = \"LITERAL_ATTR\";\nBoundPropertyType[BoundPropertyType.ANIMATION] = \"ANIMATION\";\n/**\n * Represents a parsed property.\n */\nvar BoundProperty = /** @class */ (function () {\n function BoundProperty(name, expression, type, sourceSpan) {\n this.name = name;\n this.expression = expression;\n this.type = type;\n this.sourceSpan = sourceSpan;\n this.isLiteral = this.type === BoundPropertyType.LITERAL_ATTR;\n this.isAnimation = this.type === BoundPropertyType.ANIMATION;\n }\n return BoundProperty;\n}());\n/**\n * Parses bindings in templates and in the directive host area.\n */\nvar BindingParser = /** @class */ (function () {\n function BindingParser(_exprParser, _interpolationConfig, _schemaRegistry, pipes, _targetErrors) {\n var _this = this;\n this._exprParser = _exprParser;\n this._interpolationConfig = _interpolationConfig;\n this._schemaRegistry = _schemaRegistry;\n this._targetErrors = _targetErrors;\n this.pipesByName = new Map();\n this._usedPipes = new Map();\n pipes.forEach(function (pipe) { return _this.pipesByName.set(pipe.name, pipe); });\n }\n /**\n * @return {?}\n */\n BindingParser.prototype.getUsedPipes = /**\n * @return {?}\n */\n function () { return Array.from(this._usedPipes.values()); };\n /**\n * @param {?} dirMeta\n * @param {?} elementSelector\n * @param {?} sourceSpan\n * @return {?}\n */\n BindingParser.prototype.createDirectiveHostPropertyAsts = /**\n * @param {?} dirMeta\n * @param {?} elementSelector\n * @param {?} sourceSpan\n * @return {?}\n */\n function (dirMeta, elementSelector, sourceSpan) {\n var _this = this;\n if (dirMeta.hostProperties) {\n var /** @type {?} */ boundProps_1 = [];\n Object.keys(dirMeta.hostProperties).forEach(function (propName) {\n var /** @type {?} */ expression = dirMeta.hostProperties[propName];\n if (typeof expression === 'string') {\n _this.parsePropertyBinding(propName, expression, true, sourceSpan, [], boundProps_1);\n }\n else {\n _this._reportError(\"Value of the host property binding \\\"\" + propName + \"\\\" needs to be a string representing an expression but got \\\"\" + expression + \"\\\" (\" + typeof expression + \")\", sourceSpan);\n }\n });\n return boundProps_1.map(function (prop) { return _this.createElementPropertyAst(elementSelector, prop); });\n }\n return null;\n };\n /**\n * @param {?} dirMeta\n * @param {?} sourceSpan\n * @return {?}\n */\n BindingParser.prototype.createDirectiveHostEventAsts = /**\n * @param {?} dirMeta\n * @param {?} sourceSpan\n * @return {?}\n */\n function (dirMeta, sourceSpan) {\n var _this = this;\n if (dirMeta.hostListeners) {\n var /** @type {?} */ targetEventAsts_1 = [];\n Object.keys(dirMeta.hostListeners).forEach(function (propName) {\n var /** @type {?} */ expression = dirMeta.hostListeners[propName];\n if (typeof expression === 'string') {\n _this.parseEvent(propName, expression, sourceSpan, [], targetEventAsts_1);\n }\n else {\n _this._reportError(\"Value of the host listener \\\"\" + propName + \"\\\" needs to be a string representing an expression but got \\\"\" + expression + \"\\\" (\" + typeof expression + \")\", sourceSpan);\n }\n });\n return targetEventAsts_1;\n }\n return null;\n };\n /**\n * @param {?} value\n * @param {?} sourceSpan\n * @return {?}\n */\n BindingParser.prototype.parseInterpolation = /**\n * @param {?} value\n * @param {?} sourceSpan\n * @return {?}\n */\n function (value, sourceSpan) {\n var /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n try {\n var /** @type {?} */ ast = /** @type {?} */ ((this._exprParser.parseInterpolation(value, sourceInfo, this._interpolationConfig)));\n if (ast)\n this._reportExpressionParserErrors(ast.errors, sourceSpan);\n this._checkPipes(ast, sourceSpan);\n return ast;\n }\n catch (/** @type {?} */ e) {\n this._reportError(\"\" + e, sourceSpan);\n return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);\n }\n };\n /**\n * @param {?} prefixToken\n * @param {?} value\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @param {?} targetVars\n * @return {?}\n */\n BindingParser.prototype.parseInlineTemplateBinding = /**\n * @param {?} prefixToken\n * @param {?} value\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @param {?} targetVars\n * @return {?}\n */\n function (prefixToken, value, sourceSpan, targetMatchableAttrs, targetProps, targetVars) {\n var /** @type {?} */ bindings = this._parseTemplateBindings(prefixToken, value, sourceSpan);\n for (var /** @type {?} */ i = 0; i < bindings.length; i++) {\n var /** @type {?} */ binding = bindings[i];\n if (binding.keyIsVar) {\n targetVars.push(new VariableAst(binding.key, binding.name, sourceSpan));\n }\n else if (binding.expression) {\n this._parsePropertyAst(binding.key, binding.expression, sourceSpan, targetMatchableAttrs, targetProps);\n }\n else {\n targetMatchableAttrs.push([binding.key, '']);\n this.parseLiteralAttr(binding.key, null, sourceSpan, targetMatchableAttrs, targetProps);\n }\n }\n };\n /**\n * @param {?} prefixToken\n * @param {?} value\n * @param {?} sourceSpan\n * @return {?}\n */\n BindingParser.prototype._parseTemplateBindings = /**\n * @param {?} prefixToken\n * @param {?} value\n * @param {?} sourceSpan\n * @return {?}\n */\n function (prefixToken, value, sourceSpan) {\n var _this = this;\n var /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n try {\n var /** @type {?} */ bindingsResult = this._exprParser.parseTemplateBindings(prefixToken, value, sourceInfo);\n this._reportExpressionParserErrors(bindingsResult.errors, sourceSpan);\n bindingsResult.templateBindings.forEach(function (binding) {\n if (binding.expression) {\n _this._checkPipes(binding.expression, sourceSpan);\n }\n });\n bindingsResult.warnings.forEach(function (warning) { _this._reportError(warning, sourceSpan, ParseErrorLevel.WARNING); });\n return bindingsResult.templateBindings;\n }\n catch (/** @type {?} */ e) {\n this._reportError(\"\" + e, sourceSpan);\n return [];\n }\n };\n /**\n * @param {?} name\n * @param {?} value\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n BindingParser.prototype.parseLiteralAttr = /**\n * @param {?} name\n * @param {?} value\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n function (name, value, sourceSpan, targetMatchableAttrs, targetProps) {\n if (_isAnimationLabel(name)) {\n name = name.substring(1);\n if (value) {\n this._reportError(\"Assigning animation triggers via @prop=\\\"exp\\\" attributes with an expression is invalid.\" +\n \" Use property bindings (e.g. [@prop]=\\\"exp\\\") or use an attribute without a value (e.g. @prop) instead.\", sourceSpan, ParseErrorLevel.ERROR);\n }\n this._parseAnimation(name, value, sourceSpan, targetMatchableAttrs, targetProps);\n }\n else {\n targetProps.push(new BoundProperty(name, this._exprParser.wrapLiteralPrimitive(value, ''), BoundPropertyType.LITERAL_ATTR, sourceSpan));\n }\n };\n /**\n * @param {?} name\n * @param {?} expression\n * @param {?} isHost\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n BindingParser.prototype.parsePropertyBinding = /**\n * @param {?} name\n * @param {?} expression\n * @param {?} isHost\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n function (name, expression, isHost, sourceSpan, targetMatchableAttrs, targetProps) {\n var /** @type {?} */ isAnimationProp = false;\n if (name.startsWith(ANIMATE_PROP_PREFIX)) {\n isAnimationProp = true;\n name = name.substring(ANIMATE_PROP_PREFIX.length);\n }\n else if (_isAnimationLabel(name)) {\n isAnimationProp = true;\n name = name.substring(1);\n }\n if (isAnimationProp) {\n this._parseAnimation(name, expression, sourceSpan, targetMatchableAttrs, targetProps);\n }\n else {\n this._parsePropertyAst(name, this._parseBinding(expression, isHost, sourceSpan), sourceSpan, targetMatchableAttrs, targetProps);\n }\n };\n /**\n * @param {?} name\n * @param {?} value\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n BindingParser.prototype.parsePropertyInterpolation = /**\n * @param {?} name\n * @param {?} value\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n function (name, value, sourceSpan, targetMatchableAttrs, targetProps) {\n var /** @type {?} */ expr = this.parseInterpolation(value, sourceSpan);\n if (expr) {\n this._parsePropertyAst(name, expr, sourceSpan, targetMatchableAttrs, targetProps);\n return true;\n }\n return false;\n };\n /**\n * @param {?} name\n * @param {?} ast\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n BindingParser.prototype._parsePropertyAst = /**\n * @param {?} name\n * @param {?} ast\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n function (name, ast, sourceSpan, targetMatchableAttrs, targetProps) {\n targetMatchableAttrs.push([name, /** @type {?} */ ((ast.source))]);\n targetProps.push(new BoundProperty(name, ast, BoundPropertyType.DEFAULT, sourceSpan));\n };\n /**\n * @param {?} name\n * @param {?} expression\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n BindingParser.prototype._parseAnimation = /**\n * @param {?} name\n * @param {?} expression\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n function (name, expression, sourceSpan, targetMatchableAttrs, targetProps) {\n // This will occur when a @trigger is not paired with an expression.\n // For animations it is valid to not have an expression since */void\n // states will be applied by angular when the element is attached/detached\n var /** @type {?} */ ast = this._parseBinding(expression || 'undefined', false, sourceSpan);\n targetMatchableAttrs.push([name, /** @type {?} */ ((ast.source))]);\n targetProps.push(new BoundProperty(name, ast, BoundPropertyType.ANIMATION, sourceSpan));\n };\n /**\n * @param {?} value\n * @param {?} isHostBinding\n * @param {?} sourceSpan\n * @return {?}\n */\n BindingParser.prototype._parseBinding = /**\n * @param {?} value\n * @param {?} isHostBinding\n * @param {?} sourceSpan\n * @return {?}\n */\n function (value, isHostBinding, sourceSpan) {\n var /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n try {\n var /** @type {?} */ ast = isHostBinding ?\n this._exprParser.parseSimpleBinding(value, sourceInfo, this._interpolationConfig) :\n this._exprParser.parseBinding(value, sourceInfo, this._interpolationConfig);\n if (ast)\n this._reportExpressionParserErrors(ast.errors, sourceSpan);\n this._checkPipes(ast, sourceSpan);\n return ast;\n }\n catch (/** @type {?} */ e) {\n this._reportError(\"\" + e, sourceSpan);\n return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);\n }\n };\n /**\n * @param {?} elementSelector\n * @param {?} boundProp\n * @return {?}\n */\n BindingParser.prototype.createElementPropertyAst = /**\n * @param {?} elementSelector\n * @param {?} boundProp\n * @return {?}\n */\n function (elementSelector, boundProp) {\n if (boundProp.isAnimation) {\n return new BoundElementPropertyAst(boundProp.name, PropertyBindingType.Animation, SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan);\n }\n var /** @type {?} */ unit = null;\n var /** @type {?} */ bindingType = /** @type {?} */ ((undefined));\n var /** @type {?} */ boundPropertyName = null;\n var /** @type {?} */ parts = boundProp.name.split(PROPERTY_PARTS_SEPARATOR);\n var /** @type {?} */ securityContexts = /** @type {?} */ ((undefined));\n // Check check for special cases (prefix style, attr, class)\n if (parts.length > 1) {\n if (parts[0] == ATTRIBUTE_PREFIX) {\n boundPropertyName = parts[1];\n this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, true);\n securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, boundPropertyName, true);\n var /** @type {?} */ nsSeparatorIdx = boundPropertyName.indexOf(':');\n if (nsSeparatorIdx > -1) {\n var /** @type {?} */ ns = boundPropertyName.substring(0, nsSeparatorIdx);\n var /** @type {?} */ name_1 = boundPropertyName.substring(nsSeparatorIdx + 1);\n boundPropertyName = mergeNsAndName(ns, name_1);\n }\n bindingType = PropertyBindingType.Attribute;\n }\n else if (parts[0] == CLASS_PREFIX) {\n boundPropertyName = parts[1];\n bindingType = PropertyBindingType.Class;\n securityContexts = [SecurityContext.NONE];\n }\n else if (parts[0] == STYLE_PREFIX) {\n unit = parts.length > 2 ? parts[2] : null;\n boundPropertyName = parts[1];\n bindingType = PropertyBindingType.Style;\n securityContexts = [SecurityContext.STYLE];\n }\n }\n // If not a special case, use the full property name\n if (boundPropertyName === null) {\n boundPropertyName = this._schemaRegistry.getMappedPropName(boundProp.name);\n securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, boundPropertyName, false);\n bindingType = PropertyBindingType.Property;\n this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, false);\n }\n return new BoundElementPropertyAst(boundPropertyName, bindingType, securityContexts[0], boundProp.expression, unit, boundProp.sourceSpan);\n };\n /**\n * @param {?} name\n * @param {?} expression\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetEvents\n * @return {?}\n */\n BindingParser.prototype.parseEvent = /**\n * @param {?} name\n * @param {?} expression\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetEvents\n * @return {?}\n */\n function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {\n if (_isAnimationLabel(name)) {\n name = name.substr(1);\n this._parseAnimationEvent(name, expression, sourceSpan, targetEvents);\n }\n else {\n this._parseEvent(name, expression, sourceSpan, targetMatchableAttrs, targetEvents);\n }\n };\n /**\n * @param {?} name\n * @param {?} expression\n * @param {?} sourceSpan\n * @param {?} targetEvents\n * @return {?}\n */\n BindingParser.prototype._parseAnimationEvent = /**\n * @param {?} name\n * @param {?} expression\n * @param {?} sourceSpan\n * @param {?} targetEvents\n * @return {?}\n */\n function (name, expression, sourceSpan, targetEvents) {\n var /** @type {?} */ matches = splitAtPeriod(name, [name, '']);\n var /** @type {?} */ eventName = matches[0];\n var /** @type {?} */ phase = matches[1].toLowerCase();\n if (phase) {\n switch (phase) {\n case 'start':\n case 'done':\n var /** @type {?} */ ast = this._parseAction(expression, sourceSpan);\n targetEvents.push(new BoundEventAst(eventName, null, phase, ast, sourceSpan));\n break;\n default:\n this._reportError(\"The provided animation output phase value \\\"\" + phase + \"\\\" for \\\"@\" + eventName + \"\\\" is not supported (use start or done)\", sourceSpan);\n break;\n }\n }\n else {\n this._reportError(\"The animation trigger output event (@\" + eventName + \") is missing its phase value name (start or done are currently supported)\", sourceSpan);\n }\n };\n /**\n * @param {?} name\n * @param {?} expression\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetEvents\n * @return {?}\n */\n BindingParser.prototype._parseEvent = /**\n * @param {?} name\n * @param {?} expression\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetEvents\n * @return {?}\n */\n function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {\n // long format: 'target: eventName'\n var _a = splitAtColon(name, [/** @type {?} */ ((null)), name]), target = _a[0], eventName = _a[1];\n var /** @type {?} */ ast = this._parseAction(expression, sourceSpan);\n targetMatchableAttrs.push([/** @type {?} */ ((name)), /** @type {?} */ ((ast.source))]);\n targetEvents.push(new BoundEventAst(eventName, target, null, ast, sourceSpan));\n // Don't detect directives for event names for now,\n // so don't add the event name to the matchableAttrs\n };\n /**\n * @param {?} value\n * @param {?} sourceSpan\n * @return {?}\n */\n BindingParser.prototype._parseAction = /**\n * @param {?} value\n * @param {?} sourceSpan\n * @return {?}\n */\n function (value, sourceSpan) {\n var /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n try {\n var /** @type {?} */ ast = this._exprParser.parseAction(value, sourceInfo, this._interpolationConfig);\n if (ast) {\n this._reportExpressionParserErrors(ast.errors, sourceSpan);\n }\n if (!ast || ast.ast instanceof EmptyExpr) {\n this._reportError(\"Empty expressions are not allowed\", sourceSpan);\n return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);\n }\n this._checkPipes(ast, sourceSpan);\n return ast;\n }\n catch (/** @type {?} */ e) {\n this._reportError(\"\" + e, sourceSpan);\n return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);\n }\n };\n /**\n * @param {?} message\n * @param {?} sourceSpan\n * @param {?=} level\n * @return {?}\n */\n BindingParser.prototype._reportError = /**\n * @param {?} message\n * @param {?} sourceSpan\n * @param {?=} level\n * @return {?}\n */\n function (message, sourceSpan, level) {\n if (level === void 0) { level = ParseErrorLevel.ERROR; }\n this._targetErrors.push(new ParseError(sourceSpan, message, level));\n };\n /**\n * @param {?} errors\n * @param {?} sourceSpan\n * @return {?}\n */\n BindingParser.prototype._reportExpressionParserErrors = /**\n * @param {?} errors\n * @param {?} sourceSpan\n * @return {?}\n */\n function (errors, sourceSpan) {\n for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) {\n var error = errors_1[_i];\n this._reportError(error.message, sourceSpan);\n }\n };\n /**\n * @param {?} ast\n * @param {?} sourceSpan\n * @return {?}\n */\n BindingParser.prototype._checkPipes = /**\n * @param {?} ast\n * @param {?} sourceSpan\n * @return {?}\n */\n function (ast, sourceSpan) {\n var _this = this;\n if (ast) {\n var /** @type {?} */ collector = new PipeCollector();\n ast.visit(collector);\n collector.pipes.forEach(function (ast, pipeName) {\n var /** @type {?} */ pipeMeta = _this.pipesByName.get(pipeName);\n if (!pipeMeta) {\n _this._reportError(\"The pipe '\" + pipeName + \"' could not be found\", new ParseSourceSpan(sourceSpan.start.moveBy(ast.span.start), sourceSpan.start.moveBy(ast.span.end)));\n }\n else {\n _this._usedPipes.set(pipeName, pipeMeta);\n }\n });\n }\n };\n /**\n * @param {?} propName the name of the property / attribute\n * @param {?} sourceSpan\n * @param {?} isAttr true when binding to an attribute\n * @return {?}\n */\n BindingParser.prototype._validatePropertyOrAttributeName = /**\n * @param {?} propName the name of the property / attribute\n * @param {?} sourceSpan\n * @param {?} isAttr true when binding to an attribute\n * @return {?}\n */\n function (propName, sourceSpan, isAttr) {\n var /** @type {?} */ report = isAttr ? this._schemaRegistry.validateAttribute(propName) :\n this._schemaRegistry.validateProperty(propName);\n if (report.error) {\n this._reportError(/** @type {?} */ ((report.msg)), sourceSpan, ParseErrorLevel.ERROR);\n }\n };\n return BindingParser;\n}());\nvar PipeCollector = /** @class */ (function (_super) {\n __extends(PipeCollector, _super);\n function PipeCollector() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.pipes = new Map();\n return _this;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n PipeCollector.prototype.visitPipe = /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n function (ast, context) {\n this.pipes.set(ast.name, ast);\n ast.exp.visit(this);\n this.visitAll(ast.args, context);\n return null;\n };\n return PipeCollector;\n}(RecursiveAstVisitor));\n/**\n * @param {?} name\n * @return {?}\n */\nfunction _isAnimationLabel(name) {\n return name[0] == '@';\n}\n/**\n * @param {?} registry\n * @param {?} selector\n * @param {?} propName\n * @param {?} isAttribute\n * @return {?}\n */\nfunction calcPossibleSecurityContexts(registry, selector, propName, isAttribute) {\n var /** @type {?} */ ctxs = [];\n CssSelector.parse(selector).forEach(function (selector) {\n var /** @type {?} */ elementNames = selector.element ? [selector.element] : registry.allKnownElementNames();\n var /** @type {?} */ notElementNames = new Set(selector.notSelectors.filter(function (selector) { return selector.isElementSelector(); })\n .map(function (selector) { return selector.element; }));\n var /** @type {?} */ possibleElementNames = elementNames.filter(function (elementName) { return !notElementNames.has(elementName); });\n ctxs.push.apply(ctxs, possibleElementNames.map(function (elementName) { return registry.securityContext(elementName, propName, isAttribute); }));\n });\n return ctxs.length === 0 ? [SecurityContext.NONE] : Array.from(new Set(ctxs)).sort();\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.+))|\\[\\(([^\\)]+)\\)\\]|\\[([^\\]]+)\\]|\\(([^\\)]+)\\))$/;\n// Group 1 = \"bind-\"\nvar KW_BIND_IDX = 1;\n// Group 2 = \"let-\"\nvar KW_LET_IDX = 2;\n// Group 3 = \"ref-/#\"\nvar KW_REF_IDX = 3;\n// Group 4 = \"on-\"\nvar KW_ON_IDX = 4;\n// Group 5 = \"bindon-\"\nvar KW_BINDON_IDX = 5;\n// Group 6 = \"@\"\nvar KW_AT_IDX = 6;\n// Group 7 = the identifier after \"bind-\", \"let-\", \"ref-/#\", \"on-\", \"bindon-\" or \"@\"\nvar IDENT_KW_IDX = 7;\n// Group 8 = identifier inside [()]\nvar IDENT_BANANA_BOX_IDX = 8;\n// Group 9 = identifier inside []\nvar IDENT_PROPERTY_IDX = 9;\n// Group 10 = identifier inside ()\nvar IDENT_EVENT_IDX = 10;\n// deprecated in 4.x\nvar TEMPLATE_ELEMENT = 'template';\n// deprecated in 4.x\nvar TEMPLATE_ATTR = 'template';\nvar TEMPLATE_ATTR_PREFIX = '*';\nvar CLASS_ATTR = 'class';\nvar TEXT_CSS_SELECTOR = CssSelector.parse('*')[0];\nvar TEMPLATE_ELEMENT_DEPRECATION_WARNING = 'The element is deprecated. Use instead';\nvar TEMPLATE_ATTR_DEPRECATION_WARNING = 'The template attribute is deprecated. Use an ng-template element instead.';\nvar warningCounts = {};\n/**\n * @param {?} warnings\n * @return {?}\n */\nfunction warnOnlyOnce(warnings) {\n return function (error) {\n if (warnings.indexOf(error.msg) !== -1) {\n warningCounts[error.msg] = (warningCounts[error.msg] || 0) + 1;\n return warningCounts[error.msg] <= 1;\n }\n return true;\n };\n}\nvar TemplateParseError = /** @class */ (function (_super) {\n __extends(TemplateParseError, _super);\n function TemplateParseError(message, span, level) {\n return _super.call(this, span, message, level) || this;\n }\n return TemplateParseError;\n}(ParseError));\nvar TemplateParseResult = /** @class */ (function () {\n function TemplateParseResult(templateAst, usedPipes, errors) {\n this.templateAst = templateAst;\n this.usedPipes = usedPipes;\n this.errors = errors;\n }\n return TemplateParseResult;\n}());\nvar TemplateParser = /** @class */ (function () {\n function TemplateParser(_config, _reflector, _exprParser, _schemaRegistry, _htmlParser, _console, transforms) {\n this._config = _config;\n this._reflector = _reflector;\n this._exprParser = _exprParser;\n this._schemaRegistry = _schemaRegistry;\n this._htmlParser = _htmlParser;\n this._console = _console;\n this.transforms = transforms;\n }\n /**\n * @param {?} component\n * @param {?} template\n * @param {?} directives\n * @param {?} pipes\n * @param {?} schemas\n * @param {?} templateUrl\n * @param {?} preserveWhitespaces\n * @return {?}\n */\n TemplateParser.prototype.parse = /**\n * @param {?} component\n * @param {?} template\n * @param {?} directives\n * @param {?} pipes\n * @param {?} schemas\n * @param {?} templateUrl\n * @param {?} preserveWhitespaces\n * @return {?}\n */\n function (component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces) {\n var /** @type {?} */ result = this.tryParse(component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces);\n var /** @type {?} */ warnings = /** @type {?} */ ((result.errors)).filter(function (error) { return error.level === ParseErrorLevel.WARNING; }).filter(warnOnlyOnce([TEMPLATE_ATTR_DEPRECATION_WARNING, TEMPLATE_ELEMENT_DEPRECATION_WARNING]));\n var /** @type {?} */ errors = /** @type {?} */ ((result.errors)).filter(function (error) { return error.level === ParseErrorLevel.ERROR; });\n if (warnings.length > 0) {\n this._console.warn(\"Template parse warnings:\\n\" + warnings.join('\\n'));\n }\n if (errors.length > 0) {\n var /** @type {?} */ errorString = errors.join('\\n');\n throw syntaxError(\"Template parse errors:\\n\" + errorString, errors);\n }\n return { template: /** @type {?} */ ((result.templateAst)), pipes: /** @type {?} */ ((result.usedPipes)) };\n };\n /**\n * @param {?} component\n * @param {?} template\n * @param {?} directives\n * @param {?} pipes\n * @param {?} schemas\n * @param {?} templateUrl\n * @param {?} preserveWhitespaces\n * @return {?}\n */\n TemplateParser.prototype.tryParse = /**\n * @param {?} component\n * @param {?} template\n * @param {?} directives\n * @param {?} pipes\n * @param {?} schemas\n * @param {?} templateUrl\n * @param {?} preserveWhitespaces\n * @return {?}\n */\n function (component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces) {\n var /** @type {?} */ htmlParseResult = typeof template === 'string' ? /** @type {?} */ ((this._htmlParser)).parse(template, templateUrl, true, this.getInterpolationConfig(component)) :\n template;\n if (!preserveWhitespaces) {\n htmlParseResult = removeWhitespaces(htmlParseResult);\n }\n return this.tryParseHtml(this.expandHtml(htmlParseResult), component, directives, pipes, schemas);\n };\n /**\n * @param {?} htmlAstWithErrors\n * @param {?} component\n * @param {?} directives\n * @param {?} pipes\n * @param {?} schemas\n * @return {?}\n */\n TemplateParser.prototype.tryParseHtml = /**\n * @param {?} htmlAstWithErrors\n * @param {?} component\n * @param {?} directives\n * @param {?} pipes\n * @param {?} schemas\n * @return {?}\n */\n function (htmlAstWithErrors, component, directives, pipes, schemas) {\n var /** @type {?} */ result;\n var /** @type {?} */ errors = htmlAstWithErrors.errors;\n var /** @type {?} */ usedPipes = [];\n if (htmlAstWithErrors.rootNodes.length > 0) {\n var /** @type {?} */ uniqDirectives = removeSummaryDuplicates(directives);\n var /** @type {?} */ uniqPipes = removeSummaryDuplicates(pipes);\n var /** @type {?} */ providerViewContext = new ProviderViewContext(this._reflector, component);\n var /** @type {?} */ interpolationConfig = /** @type {?} */ ((undefined));\n if (component.template && component.template.interpolation) {\n interpolationConfig = {\n start: component.template.interpolation[0],\n end: component.template.interpolation[1]\n };\n }\n var /** @type {?} */ bindingParser = new BindingParser(this._exprParser, /** @type {?} */ ((interpolationConfig)), this._schemaRegistry, uniqPipes, errors);\n var /** @type {?} */ parseVisitor = new TemplateParseVisitor(this._reflector, this._config, providerViewContext, uniqDirectives, bindingParser, this._schemaRegistry, schemas, errors);\n result = visitAll(parseVisitor, htmlAstWithErrors.rootNodes, EMPTY_ELEMENT_CONTEXT);\n errors.push.apply(errors, providerViewContext.errors);\n usedPipes.push.apply(usedPipes, bindingParser.getUsedPipes());\n }\n else {\n result = [];\n }\n this._assertNoReferenceDuplicationOnTemplate(result, errors);\n if (errors.length > 0) {\n return new TemplateParseResult(result, usedPipes, errors);\n }\n if (this.transforms) {\n this.transforms.forEach(function (transform) { result = templateVisitAll(transform, result); });\n }\n return new TemplateParseResult(result, usedPipes, errors);\n };\n /**\n * @param {?} htmlAstWithErrors\n * @param {?=} forced\n * @return {?}\n */\n TemplateParser.prototype.expandHtml = /**\n * @param {?} htmlAstWithErrors\n * @param {?=} forced\n * @return {?}\n */\n function (htmlAstWithErrors, forced) {\n if (forced === void 0) { forced = false; }\n var /** @type {?} */ errors = htmlAstWithErrors.errors;\n if (errors.length == 0 || forced) {\n // Transform ICU messages to angular directives\n var /** @type {?} */ expandedHtmlAst = expandNodes(htmlAstWithErrors.rootNodes);\n errors.push.apply(errors, expandedHtmlAst.errors);\n htmlAstWithErrors = new ParseTreeResult(expandedHtmlAst.nodes, errors);\n }\n return htmlAstWithErrors;\n };\n /**\n * @param {?} component\n * @return {?}\n */\n TemplateParser.prototype.getInterpolationConfig = /**\n * @param {?} component\n * @return {?}\n */\n function (component) {\n if (component.template) {\n return InterpolationConfig.fromArray(component.template.interpolation);\n }\n return undefined;\n };\n /** @internal */\n /**\n * \\@internal\n * @param {?} result\n * @param {?} errors\n * @return {?}\n */\n TemplateParser.prototype._assertNoReferenceDuplicationOnTemplate = /**\n * \\@internal\n * @param {?} result\n * @param {?} errors\n * @return {?}\n */\n function (result, errors) {\n var /** @type {?} */ existingReferences = [];\n result.filter(function (element) { return !!(/** @type {?} */ (element)).references; })\n .forEach(function (element) {\n return (/** @type {?} */ (element)).references.forEach(function (reference) {\n var /** @type {?} */ name = reference.name;\n if (existingReferences.indexOf(name) < 0) {\n existingReferences.push(name);\n }\n else {\n var /** @type {?} */ error = new TemplateParseError(\"Reference \\\"#\" + name + \"\\\" is defined several times\", reference.sourceSpan, ParseErrorLevel.ERROR);\n errors.push(error);\n }\n });\n });\n };\n return TemplateParser;\n}());\nvar TemplateParseVisitor = /** @class */ (function () {\n function TemplateParseVisitor(reflector, config, providerViewContext, directives, _bindingParser, _schemaRegistry, _schemas, _targetErrors) {\n var _this = this;\n this.reflector = reflector;\n this.config = config;\n this.providerViewContext = providerViewContext;\n this._bindingParser = _bindingParser;\n this._schemaRegistry = _schemaRegistry;\n this._schemas = _schemas;\n this._targetErrors = _targetErrors;\n this.selectorMatcher = new SelectorMatcher();\n this.directivesIndex = new Map();\n this.ngContentCount = 0;\n // Note: queries start with id 1 so we can use the number in a Bloom filter!\n this.contentQueryStartId = providerViewContext.component.viewQueries.length + 1;\n directives.forEach(function (directive, index) {\n var /** @type {?} */ selector = CssSelector.parse(/** @type {?} */ ((directive.selector)));\n _this.selectorMatcher.addSelectables(selector, directive);\n _this.directivesIndex.set(directive, index);\n });\n }\n /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n TemplateParseVisitor.prototype.visitExpansion = /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n function (expansion, context) { return null; };\n /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n TemplateParseVisitor.prototype.visitExpansionCase = /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n function (expansionCase, context) { return null; };\n /**\n * @param {?} text\n * @param {?} parent\n * @return {?}\n */\n TemplateParseVisitor.prototype.visitText = /**\n * @param {?} text\n * @param {?} parent\n * @return {?}\n */\n function (text, parent) {\n var /** @type {?} */ ngContentIndex = /** @type {?} */ ((parent.findNgContentIndex(TEXT_CSS_SELECTOR)));\n var /** @type {?} */ valueNoNgsp = replaceNgsp(text.value);\n var /** @type {?} */ expr = this._bindingParser.parseInterpolation(valueNoNgsp, /** @type {?} */ ((text.sourceSpan)));\n return expr ? new BoundTextAst(expr, ngContentIndex, /** @type {?} */ ((text.sourceSpan))) :\n new TextAst(valueNoNgsp, ngContentIndex, /** @type {?} */ ((text.sourceSpan)));\n };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n TemplateParseVisitor.prototype.visitAttribute = /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n function (attribute, context) {\n return new AttrAst(attribute.name, attribute.value, attribute.sourceSpan);\n };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n TemplateParseVisitor.prototype.visitComment = /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n function (comment, context) { return null; };\n /**\n * @param {?} element\n * @param {?} parent\n * @return {?}\n */\n TemplateParseVisitor.prototype.visitElement = /**\n * @param {?} element\n * @param {?} parent\n * @return {?}\n */\n function (element, parent) {\n var _this = this;\n var /** @type {?} */ queryStartIndex = this.contentQueryStartId;\n var /** @type {?} */ nodeName = element.name;\n var /** @type {?} */ preparsedElement = preparseElement(element);\n if (preparsedElement.type === PreparsedElementType.SCRIPT ||\n preparsedElement.type === PreparsedElementType.STYLE) {\n // Skipping