Kargi-Sitesi/.angular/cache/18.2.11/babel-webpack/199ccf9084244a4e530f5cd5c67f9185907e3b31f89a7c38eac2ce67aeb40f9e.json

1 line
No EOL
4 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"ast":null,"code":"/**\n * @license Angular v18.2.10\n * (c) 2010-2024 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport { SIGNAL_NODE as SIGNAL_NODE$1, signalSetFn as signalSetFn$1, producerAccessed as producerAccessed$1, SIGNAL as SIGNAL$1, getActiveConsumer as getActiveConsumer$1, setActiveConsumer as setActiveConsumer$1, consumerDestroy as consumerDestroy$1, REACTIVE_NODE as REACTIVE_NODE$1, consumerBeforeComputation as consumerBeforeComputation$1, consumerAfterComputation as consumerAfterComputation$1, consumerPollProducersForChange as consumerPollProducersForChange$1, createSignal as createSignal$1, signalUpdateFn as signalUpdateFn$1, createComputed as createComputed$1, setThrowInvalidWriteToSignalError as setThrowInvalidWriteToSignalError$1, createWatch as createWatch$1 } from '@angular/core/primitives/signals';\nexport { SIGNAL as ɵSIGNAL } from '@angular/core/primitives/signals';\nimport { BehaviorSubject, Subject, Subscription } from 'rxjs';\nimport { map, first } from 'rxjs/operators';\nimport { Attribute as Attribute$1, EventContract, EventContractContainer, getAppScopedQueuedEventInfos, clearAppScopedEarlyEventContract, EventDispatcher, registerDispatcher, isEarlyEventType, isCaptureEventType } from '@angular/core/primitives/event-dispatch';\n\n/**\n * Base URL for the error details page.\n *\n * Keep this constant in sync across:\n * - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts\n * - packages/core/src/error_details_base_url.ts\n */\nconst ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.dev/errors';\n/**\n * URL for the XSS security documentation.\n */\nconst XSS_SECURITY_URL = 'https://g.co/ng/security#xss';\n\n/**\n * Class that represents a runtime error.\n * Formats and outputs the error message in a consistent way.\n *\n * Example:\n * ```\n * throw new RuntimeError(\n * RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED,\n * ngDevMode && 'Injector has already been destroyed.');\n * ```\n *\n * Note: the `message` argument contains a descriptive error message as a string in development\n * mode (when the `ngDevMode` is defined). In production mode (after tree-shaking pass), the\n * `message` argument becomes `false`, thus we account for it in the typings and the runtime\n * logic.\n */\nclass RuntimeError extends Error {\n constructor(code, message) {\n super(formatRuntimeError(code, message));\n this.code = code;\n }\n}\n/**\n * Called to format a runtime error.\n * See additional info on the `message` argument type in the `RuntimeError` class description.\n */\nfunction formatRuntimeError(code, message) {\n // Error code might be a negative number, which is a special marker that instructs the logic to\n // generate a link to the error details page on angular.io.\n // We also prepend `0` to non-compile-time errors.\n const fullCode = `NG0${Math.abs(code)}`;\n let errorMessage = `${fullCode}${message ? ': ' + message : ''}`;\n if (ngDevMode && code < 0) {\n const addPeriodSeparator = !errorMessage.match(/[.,;!?\\n]$/);\n const separator = addPeriodSeparator ? '.' : '';\n errorMessage = `${errorMessage}${separator} Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`;\n }\n return errorMessage;\n}\nconst REQUIRED_UNSET_VALUE = /* @__PURE__ */Symbol('InputSignalNode#UNSET');\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst INPUT_SIGNAL_NODE = /* @__PURE__ */(() => {\n return {\n ...SIGNAL_NODE$1,\n transformFn: undefined,\n applyValueToInputSignal(node, value) {\n signalSetFn$1(node, value);\n }\n };\n})();\nconst ɵINPUT_SIGNAL_BRAND_READ_TYPE = /* @__PURE__ */Symbol();\nconst ɵINPUT_SIGNAL_BRAND_WRITE_TYPE = /* @__PURE__ */Symbol();\n/**\n * Creates an input signal.\n *\n * @param initialValue The initial value.\n * Can be set to {@link REQUIRED_UNSET_VALUE} for required inputs.\n * @param options Additional options for the input. e.g. a transform, or an alias.\n */\nfunction createInputSignal(initialValue, options) {\n const node = Object.create(INPUT_SIGNAL_NODE);\n node.value = initialValue;\n // Perf note: Always set `transformFn` here to ensure that `node` always\n // has the same v8 class shape, allowing monomorphic reads on input signals.\n node.transformFn = options?.transform;\n function inputValueFn() {\n // Record that someone looked at this signal.\n producerAccessed$1(node);\n if (node.value === REQUIRED_UNSET_VALUE) {\n throw new RuntimeError(-950 /* RuntimeErrorCode.REQUIRED_INPUT_NO_VALUE */, ngDevMode && 'Input is required but no value is available yet.');\n }\n return node.value;\n }\n inputValueFn[SIGNAL$1] = node;\n if (ngDevMode) {\n inputValueFn.toString = () => `[Input Signal: ${inputValueFn()}]`;\n }\n return inputValueFn;\n}\n\n/**\n * Convince closure compiler that the wrapped function has no side-effects.\n *\n * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to\n * allow us to execute a function but have closure compiler mark the call as no-side-effects.\n * It is important that the return value for the `noSideEffects` function be assigned\n * to something which is retained otherwise the call to `noSideEffects` will be removed by closure\n * compiler.\n */\nfunction noSideEffects(fn) {\n return {\n toString: fn\n }.toString();\n}\nconst ANNOTATIONS = '__annotations__';\nconst PARAMETERS = '__parameters__';\nconst PROP_METADATA = '__prop__metadata__';\n/**\n * @suppress {globalThis}\n */\nfunction makeDecorator(name, props, parentClass, additionalProcessing, typeFn) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function DecoratorFactory(...args) {\n if (this instanceof DecoratorFactory) {\n metaCtor.call(this, ...args);\n return this;\n }\n const annotationInstance = new DecoratorFactory(...args);\n return function TypeDecorator(cls) {\n if (typeFn) typeFn(cls, ...args);\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const annotations = cls.hasOwnProperty(ANNOTATIONS) ? cls[ANNOTATIONS] : Object.defineProperty(cls, ANNOTATIONS, {\n value: []\n })[ANNOTATIONS];\n annotations.push(annotationInstance);\n if (additionalProcessing) additionalProcessing(cls);\n return cls;\n };\n }\n if (parentClass) {\n DecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n DecoratorFactory.prototype.ngMetadataName = name;\n DecoratorFactory.annotationCls = DecoratorFactory;\n return DecoratorFactory;\n });\n}\nfunction makeMetadataCtor(props) {\n return function ctor(...args) {\n if (props) {\n const values = props(...args);\n for (const propName in values) {\n this[propName] = values[propName];\n }\n }\n };\n}\nfunction makeParamDecorator(name, props, parentClass) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function ParamDecoratorFactory(...args) {\n if (this instanceof ParamDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const annotationInstance = new ParamDecoratorFactory(...args);\n ParamDecorator.annotation = annotationInstance;\n return ParamDecorator;\n function ParamDecorator(cls, unusedKey, index) {\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const parameters = cls.hasOwnProperty(PARAMETERS) ? cls[PARAMETERS] : Object.defineProperty(cls, PARAMETERS, {\n value: []\n })[PARAMETERS];\n // there might be gaps if some in between parameters do not have annotations.\n // we pad with nulls.\n while (parameters.length <= index) {\n parameters.push(null);\n }\n (parameters[index] = parameters[index] || []).push(annotationInstance);\n return cls;\n }\n }\n if (parentClass) {\n ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n ParamDecoratorFactory.prototype.ngMetadataName = name;\n ParamDecoratorFactory.annotationCls = ParamDecoratorFactory;\n return ParamDecoratorFactory;\n });\n}\nfunction makePropDecorator(name, props, parentClass, additionalProcessing) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function PropDecoratorFactory(...args) {\n if (this instanceof PropDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const decoratorInstance = new PropDecoratorFactory(...args);\n function PropDecorator(target, name) {\n // target is undefined with standard decorators. This case is not supported and will throw\n // if this decorator is used in JIT mode with standard decorators.\n if (target === undefined) {\n throw new Error('Standard Angular field decorators are not supported in JIT mode.');\n }\n const constructor = target.constructor;\n // Use of Object.defineProperty is important because it creates a non-enumerable property\n // which prevents the property from being copied during subclassing.\n const meta = constructor.hasOwnProperty(PROP_METADATA) ? constructor[PROP_METADATA] : Object.defineProperty(constructor, PROP_METADATA, {\n value: {}\n })[PROP_METADATA];\n meta[name] = meta.hasOwnProperty(name) && meta[name] || [];\n meta[name].unshift(decoratorInstance);\n if (additionalProcessing) additionalProcessing(target, name, ...args);\n }\n return PropDecorator;\n }\n if (parentClass) {\n PropDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n PropDecoratorFactory.prototype.ngMetadataName = name;\n PropDecoratorFactory.annotationCls = PropDecoratorFactory;\n return PropDecoratorFactory;\n });\n}\nconst _global = globalThis;\nfunction ngDevModeResetPerfCounters() {\n const locationString = typeof location !== 'undefined' ? location.toString() : '';\n const newCounters = {\n namedConstructors: locationString.indexOf('ngDevMode=namedConstructors') != -1,\n firstCreatePass: 0,\n tNode: 0,\n tView: 0,\n rendererCreateTextNode: 0,\n rendererSetText: 0,\n rendererCreateElement: 0,\n rendererAddEventListener: 0,\n rendererSetAttribute: 0,\n rendererRemoveAttribute: 0,\n rendererSetProperty: 0,\n rendererSetClassName: 0,\n rendererAddClass: 0,\n rendererRemoveClass: 0,\n rendererSetStyle: 0,\n rendererRemoveStyle: 0,\n rendererDestroy: 0,\n rendererDestroyNode: 0,\n rendererMoveNode: 0,\n rendererRemoveNode: 0,\n rendererAppendChild: 0,\n rendererInsertBefore: 0,\n rendererCreateComment: 0,\n hydratedNodes: 0,\n hydratedComponents: 0,\n dehydratedViewsRemoved: 0,\n dehydratedViewsCleanupRuns: 0,\n componentsSkippedHydration: 0\n };\n // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.\n const allowNgDevModeTrue = locationString.indexOf('ngDevMode=false') === -1;\n if (!allowNgDevModeTrue) {\n _global['ngDevMode'] = false;\n } else {\n if (typeof _global['ngDevMode'] !== 'object') {\n _global['ngDevMode'] = {};\n }\n Object.assign(_global['ngDevMode'], newCounters);\n }\n return newCounters;\n}\n/**\n * This function checks to see if the `ngDevMode` has been set. If yes,\n * then we honor it, otherwise we default to dev mode with additional checks.\n *\n * The idea is that unless we are doing production build where we explicitly\n * set `ngDevMode == false` we should be helping the developer by providing\n * as much early warning and errors as possible.\n *\n * `ɵɵdefineComponent` is guaranteed to have been called before any component template functions\n * (and thus Ivy instructions), so a single initialization there is sufficient to ensure ngDevMode\n * is defined for the entire instruction set.\n *\n * When checking `ngDevMode` on toplevel, always init it before referencing it\n * (e.g. `((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode())`), otherwise you can\n * get a `ReferenceError` like in https://github.com/angular/angular/issues/31595.\n *\n * Details on possible values for `ngDevMode` can be found on its docstring.\n *\n * NOTE:\n * - changes to the `ngDevMode` name must be synced with `compiler-cli/src/tooling.ts`.\n */\nfunction initNgDevMode() {\n // The below checks are to ensure that calling `initNgDevMode` multiple times does not\n // reset the counters.\n // If the `ngDevMode` is not an object, then it means we have not created the perf counters\n // yet.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (typeof ngDevMode !== 'object' || Object.keys(ngDevMode).length === 0) {\n ngDevModeResetPerfCounters();\n }\n return typeof ngDevMode !== 'undefined' && !!ngDevMode;\n }\n return false;\n}\nfunction getClosureSafeProperty(objWithPropertyToExtract) {\n for (let key in objWithPropertyToExtract) {\n if (objWithPropertyToExtract[key] === getClosureSafeProperty) {\n return key;\n }\n }\n throw Error('Could not find renamed property on target object.');\n}\n/**\n * Sets properties on a target object from a source object, but only if\n * the property doesn't already exist on the target object.\n * @param target The target to set properties on\n * @param source The source of the property keys and values to set\n */\nfunction fillProperties(target, source) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}\nfunction stringify(token) {\n if (typeof token === 'string') {\n return token;\n }\n if (Array.isArray(token)) {\n return '[' + token.map(stringify).join(', ') + ']';\n }\n if (token == null) {\n return '' + token;\n }\n if (token.overriddenName) {\n return `${token.overriddenName}`;\n }\n if (token.name) {\n return `${token.name}`;\n }\n const res = token.toString();\n if (res == null) {\n return '' + res;\n }\n const newLineIndex = res.indexOf('\\n');\n return newLineIndex === -1 ? res : res.substring(0, newLineIndex);\n}\n/**\n * Concatenates two strings with separator, allocating new strings only when necessary.\n *\n * @param before before string.\n * @param separator separator string.\n * @param after after string.\n * @returns concatenated string.\n */\nfunction concatStringsWithSpace(before, after) {\n return before == null || before === '' ? after === null ? '' : after : after == null || after === '' ? before : before + ' ' + after;\n}\n/**\n * Ellipses the string in the middle when longer than the max length\n *\n * @param string\n * @param maxLength of the output string\n * @returns ellipsed string with ... in the middle\n */\nfunction truncateMiddle(str, maxLength = 100) {\n if (!str || maxLength < 1 || str.length <= maxLength) return str;\n if (maxLength == 1) return str.substring(0, 1) + '...';\n const halfLimit = Math.round(maxLength / 2);\n return str.substring(0, halfLimit) + '...' + str.substring(str.length - halfLimit);\n}\nconst __forward_ref__ = getClosureSafeProperty({\n __forward_ref__: getClosureSafeProperty\n});\n/**\n * Allows to refer to references which are not yet defined.\n *\n * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of\n * DI is declared, but not yet defined. It is also used when the `token` which we use when creating\n * a query is not yet defined.\n *\n * `forwardRef` is also used to break circularities in standalone components imports.\n *\n * @usageNotes\n * ### Circular dependency example\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}\n *\n * ### Circular standalone reference import example\n * ```ts\n * @Component({\n * standalone: true,\n * imports: [ChildComponent],\n * selector: 'app-parent',\n * template: `<app-child [hideParent]=\"hideParent\"></app-child>`,\n * })\n * export class ParentComponent {\n * @Input() hideParent: boolean;\n * }\n *\n *\n * @Component({\n * standalone: true,\n * imports: [CommonModule, forwardRef(() => ParentComponent)],\n * selector: 'app-child',\n * template: `<app-parent *ngIf=\"!hideParent\"></app-parent>`,\n * })\n * export class ChildComponent {\n * @Input() hideParent: boolean;\n * }\n * ```\n *\n * @publicApi\n */\nfunction forwardRef(forwardRefFn) {\n forwardRefFn.__forward_ref__ = forwardRef;\n forwardRefFn.toString = function () {\n return stringify(this());\n };\n return forwardRefFn;\n}\n/**\n * Lazily retrieves the reference value from a forwardRef.\n *\n * Acts as the identity function when given a non-forward-ref value.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}\n *\n * @see {@link forwardRef}\n * @publicApi\n */\nfunction resolveForwardRef(type) {\n return isForwardRef(type) ? type() : type;\n}\n/** Checks whether a function is wrapped by a `forwardRef`. */\nfunction isForwardRef(fn) {\n return typeof fn === 'function' && fn.hasOwnProperty(__forward_ref__) && fn.__forward_ref__ === forwardRef;\n}\n\n// The functions in this file verify that the assumptions we are making\nfunction assertNumber(actual, msg) {\n if (!(typeof actual === 'number')) {\n throwError(msg, typeof actual, 'number', '===');\n }\n}\nfunction assertNumberInRange(actual, minInclusive, maxInclusive) {\n assertNumber(actual, 'Expected a number');\n assertLessThanOrEqual(actual, maxInclusive, 'Expected number to be less than or equal to');\n assertGreaterThanOrEqual(actual, minInclusive, 'Expected number to be greater than or equal to');\n}\nfunction assertString(actual, msg) {\n if (!(typeof actual === 'string')) {\n throwError(msg, actual === null ? 'null' : typeof actual, 'string', '===');\n }\n}\nfunction assertFunction(actual, msg) {\n if (!(typeof actual === 'function')) {\n throwError(msg, actual === null ? 'null' : typeof actual, 'function', '===');\n }\n}\nfunction assertEqual(actual, expected, msg) {\n if (!(actual == expected)) {\n throwError(msg, actual, expected, '==');\n }\n}\nfunction assertNotEqual(actual, expected, msg) {\n if (!(actual != expected)) {\n throwError(msg, actual, expected, '!=');\n }\n}\nfunction assertSame(actual, expected, msg) {\n if (!(actual === expected)) {\n throwError(msg, actual, expected, '===');\n }\n}\nfunction assertNotSame(actual, expected, msg) {\n if (!(actual !== expected)) {\n throwError(msg, actual, expected, '!==');\n }\n}\nfunction assertLessThan(actual, expected, msg) {\n if (!(actual < expected)) {\n throwError(msg, actual, expected, '<');\n }\n}\nfunction assertLessThanOrEqual(actual, expected, msg) {\n if (!(actual <= expected)) {\n throwError(msg, actual, expected, '<=');\n }\n}\nfunction assertGreaterThan(actual, expected, msg) {\n if (!(actual > expected)) {\n throwError(msg, actual, expected, '>');\n }\n}\nfunction assertGreaterThanOrEqual(actual, expected, msg) {\n if (!(actual >= expected)) {\n throwError(msg, actual, expected, '>=');\n }\n}\nfunction assertNotDefined(actual, msg) {\n if (actual != null) {\n throwError(msg, actual, null, '==');\n }\n}\nfunction assertDefined(actual, msg) {\n if (actual == null) {\n throwError(msg, actual, null, '!=');\n }\n}\nfunction throwError(msg, actual, expected, comparison) {\n throw new Error(`ASSERTION ERROR: ${msg}` + (comparison == null ? '' : ` [Expected=> ${expected} ${comparison} ${actual} <=Actual]`));\n}\nfunction assertDomNode(node) {\n if (!(node instanceof Node)) {\n throwError(`The provided value must be an instance of a DOM Node but got ${stringify(node)}`);\n }\n}\nfunction assertElement(node) {\n if (!(node instanceof Element)) {\n throwError(`The provided value must be an element but got ${stringify(node)}`);\n }\n}\nfunction assertIndexInRange(arr, index) {\n assertDefined(arr, 'Array must be defined.');\n const maxLen = arr.length;\n if (index < 0 || index >= maxLen) {\n throwError(`Index expected to be less than ${maxLen} but got ${index}`);\n }\n}\nfunction assertOneOf(value, ...validValues) {\n if (validValues.indexOf(value) !== -1) return true;\n throwError(`Expected value to be one of ${JSON.stringify(validValues)} but was ${JSON.stringify(value)}.`);\n}\nfunction assertNotReactive(fn) {\n if (getActiveConsumer$1() !== null) {\n throwError(`${fn}() should never be called in a reactive context.`);\n }\n}\n\n/**\n * Construct an injectable definition which defines how a token will be constructed by the DI\n * system, and in which injectors (if any) it will be available.\n *\n * This should be assigned to a static `ɵprov` field on a type, which will then be an\n * `InjectableType`.\n *\n * Options:\n * * `providedIn` determines which injectors will include the injectable, by either associating it\n * with an `@NgModule` or other `InjectorType`, or by specifying that this injectable should be\n * provided in the `'root'` injector, which will be the application-level injector in most apps.\n * * `factory` gives the zero argument function which will create an instance of the injectable.\n * The factory can call [`inject`](api/core/inject) to access the `Injector` and request injection\n * of dependencies.\n *\n * @codeGenApi\n * @publicApi This instruction has been emitted by ViewEngine for some time and is deployed to npm.\n */\nfunction ɵɵdefineInjectable(opts) {\n return {\n token: opts.token,\n providedIn: opts.providedIn || null,\n factory: opts.factory,\n value: undefined\n };\n}\n/**\n * @deprecated in v8, delete after v10. This API should be used only by generated code, and that\n * code should now use ɵɵdefineInjectable instead.\n * @publicApi\n */\nconst defineInjectable = ɵɵdefineInjectable;\n/**\n * Construct an `InjectorDef` which configures an injector.\n *\n * This should be assigned to a static injector def (`ɵinj`) field on a type, which will then be an\n * `InjectorType`.\n *\n * Options:\n *\n * * `providers`: an optional array of providers to add to the injector. Each provider must\n * either have a factory or point to a type which has a `ɵprov` static property (the\n * type must be an `InjectableType`).\n * * `imports`: an optional array of imports of other `InjectorType`s or `InjectorTypeWithModule`s\n * whose providers will also be added to the injector. Locally provided types will override\n * providers from imports.\n *\n * @codeGenApi\n */\nfunction ɵɵdefineInjector(options) {\n return {\n providers: options.providers || [],\n imports: options.imports || []\n };\n}\n/**\n * Read the injectable def (`ɵprov`) for `type` in a way which is immune to accidentally reading\n * inherited value.\n *\n * @param type A type which may have its own (non-inherited) `ɵprov`.\n */\nfunction getInjectableDef(type) {\n return getOwnDefinition(type, NG_PROV_DEF) || getOwnDefinition(type, NG_INJECTABLE_DEF);\n}\nfunction isInjectable(type) {\n return getInjectableDef(type) !== null;\n}\n/**\n * Return definition only if it is defined directly on `type` and is not inherited from a base\n * class of `type`.\n */\nfunction getOwnDefinition(type, field) {\n return type.hasOwnProperty(field) ? type[field] : null;\n}\n/**\n * Read the injectable def (`ɵprov`) for `type` or read the `ɵprov` from one of its ancestors.\n *\n * @param type A type which may have `ɵprov`, via inheritance.\n *\n * @deprecated Will be removed in a future version of Angular, where an error will occur in the\n * scenario if we find the `ɵprov` on an ancestor only.\n */\nfunction getInheritedInjectableDef(type) {\n const def = type && (type[NG_PROV_DEF] || type[NG_INJECTABLE_DEF]);\n if (def) {\n ngDevMode && console.warn(`DEPRECATED: DI is instantiating a token \"${type.name}\" that inherits its @Injectable decorator but does not provide one itself.\\n` + `This will become an error in a future version of Angular. Please add @Injectable() to the \"${type.name}\" class.`);\n return def;\n } else {\n return null;\n }\n}\n/**\n * Read the injector def type in a way which is immune to accidentally reading inherited value.\n *\n * @param type type which may have an injector def (`ɵinj`)\n */\nfunction getInjectorDef(type) {\n return type && (type.hasOwnProperty(NG_INJ_DEF) || type.hasOwnProperty(NG_INJECTOR_DEF)) ? type[NG_INJ_DEF] : null;\n}\nconst NG_PROV_DEF = getClosureSafeProperty({\n ɵprov: getClosureSafeProperty\n});\nconst NG_INJ_DEF = getClosureSafeProperty({\n ɵinj: getClosureSafeProperty\n});\n// We need to keep these around so we can read off old defs if new defs are unavailable\nconst NG_INJECTABLE_DEF = getClosureSafeProperty({\n ngInjectableDef: getClosureSafeProperty\n});\nconst NG_INJECTOR_DEF = getClosureSafeProperty({\n ngInjectorDef: getClosureSafeProperty\n});\n\n/**\n * Creates a token that can be used in a DI Provider.\n *\n * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a\n * runtime representation) such as when injecting an interface, callable type, array or\n * parameterized type.\n *\n * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by\n * the `Injector`. This provides an additional level of type safety.\n *\n * <div class=\"alert is-helpful\">\n *\n * **Important Note**: Ensure that you use the same instance of the `InjectionToken` in both the\n * provider and the injection call. Creating a new instance of `InjectionToken` in different places,\n * even with the same description, will be treated as different tokens by Angular's DI system,\n * leading to a `NullInjectorError`.\n *\n * </div>\n *\n * <code-example format=\"typescript\" language=\"typescript\" path=\"injection-token/src/main.ts\"\n * region=\"InjectionToken\"></code-example>\n *\n * When creating an `InjectionToken`, you can optionally specify a factory function which returns\n * (possibly by creating) a default value of the parameterized type `T`. This sets up the\n * `InjectionToken` using this factory as a provider as if it was defined explicitly in the\n * application's root injector. If the factory function, which takes zero arguments, needs to inject\n * dependencies, it can do so using the [`inject`](api/core/inject) function.\n * As you can see in the Tree-shakable InjectionToken example below.\n *\n * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which\n * overrides the above behavior and marks the token as belonging to a particular `@NgModule` (note:\n * this option is now deprecated). As mentioned above, `'root'` is the default value for\n * `providedIn`.\n *\n * The `providedIn: NgModule` and `providedIn: 'any'` options are deprecated.\n *\n * @usageNotes\n * ### Basic Examples\n *\n * ### Plain InjectionToken\n *\n * {@example core/di/ts/injector_spec.ts region='InjectionToken'}\n *\n * ### Tree-shakable InjectionToken\n *\n * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}\n *\n * @publicApi\n */\nclass InjectionToken {\n /**\n * @param _desc Description for the token,\n * used only for debugging purposes,\n * it should but does not need to be unique\n * @param options Options for the token's usage, as described above\n */\n constructor(_desc, options) {\n this._desc = _desc;\n /** @internal */\n this.ngMetadataName = 'InjectionToken';\n this.ɵprov = undefined;\n if (typeof options == 'number') {\n (typeof ngDevMode === 'undefined' || ngDevMode) && assertLessThan(options, 0, 'Only negative numbers are supported here');\n // This is a special hack to assign __NG_ELEMENT_ID__ to this instance.\n // See `InjectorMarkers`\n this.__NG_ELEMENT_ID__ = options;\n } else if (options !== undefined) {\n this.ɵprov = ɵɵdefineInjectable({\n token: this,\n providedIn: options.providedIn || 'root',\n factory: options.factory\n });\n }\n }\n /**\n * @internal\n */\n get multi() {\n return this;\n }\n toString() {\n return `InjectionToken ${this._desc}`;\n }\n}\nlet _injectorProfilerContext;\nfunction getInjectorProfilerContext() {\n !ngDevMode && throwError('getInjectorProfilerContext should never be called in production mode');\n return _injectorProfilerContext;\n}\nfunction setInjectorProfilerContext(context) {\n !ngDevMode && throwError('setInjectorProfilerContext should never be called in production mode');\n const previous = _injectorProfilerContext;\n _injectorProfilerContext = context;\n return previous;\n}\nlet injectorProfilerCallback = null;\n/**\n * Sets the callback function which will be invoked during certain DI events within the\n * runtime (for example: injecting services, creating injectable instances, configuring providers)\n *\n * Warning: this function is *INTERNAL* and should not be relied upon in application's code.\n * The contract of the function might be changed in any release and/or the function can be removed\n * completely.\n *\n * @param profiler function provided by the caller or null value to disable profiling.\n */\nconst setInjectorProfiler = injectorProfiler => {\n !ngDevMode && throwError('setInjectorProfiler should never be called in production mode');\n injectorProfilerCallback = injectorProfiler;\n};\n/**\n * Injector profiler function which emits on DI events executed by the runtime.\n *\n * @param event InjectorProfilerEvent corresponding to the DI event being emitted\n */\nfunction injectorProfiler(event) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n if (injectorProfilerCallback != null /* both `null` and `undefined` */) {\n injectorProfilerCallback(event);\n }\n}\n/**\n * Emits an InjectorProfilerEventType.ProviderConfigured to the injector profiler. The data in the\n * emitted event includes the raw provider, as well as the token that provider is providing.\n *\n * @param eventProvider A provider object\n */\nfunction emitProviderConfiguredEvent(eventProvider, isViewProvider = false) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n let token;\n // if the provider is a TypeProvider (typeof provider is function) then the token is the\n // provider itself\n if (typeof eventProvider === 'function') {\n token = eventProvider;\n }\n // if the provider is an injection token, then the token is the injection token.\n else if (eventProvider instanceof InjectionToken) {\n token = eventProvider;\n }\n // in all other cases we can access the token via the `provide` property of the provider\n else {\n token = resolveForwardRef(eventProvider.provide);\n }\n let provider = eventProvider;\n // Injection tokens may define their own default provider which gets attached to the token itself\n // as `ɵprov`. In this case, we want to emit the provider that is attached to the token, not the\n // token itself.\n if (eventProvider instanceof InjectionToken) {\n provider = eventProvider.ɵprov || eventProvider;\n }\n injectorProfiler({\n type: 2 /* InjectorProfilerEventType.ProviderConfigured */,\n context: getInjectorProfilerContext(),\n providerRecord: {\n token,\n provider,\n isViewProvider\n }\n });\n}\n/**\n * Emits an event to the injector profiler with the instance that was created. Note that\n * the injector associated with this emission can be accessed by using getDebugInjectContext()\n *\n * @param instance an object created by an injector\n */\nfunction emitInstanceCreatedByInjectorEvent(instance) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n injectorProfiler({\n type: 1 /* InjectorProfilerEventType.InstanceCreatedByInjector */,\n context: getInjectorProfilerContext(),\n instance: {\n value: instance\n }\n });\n}\n/**\n * @param token DI token associated with injected service\n * @param value the instance of the injected service (i.e the result of `inject(token)`)\n * @param flags the flags that the token was injected with\n */\nfunction emitInjectEvent(token, value, flags) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n injectorProfiler({\n type: 0 /* InjectorProfilerEventType.Inject */,\n context: getInjectorProfilerContext(),\n service: {\n token,\n value,\n flags\n }\n });\n}\nfunction runInInjectorProfilerContext(injector, token, callback) {\n !ngDevMode && throwError('runInInjectorProfilerContext should never be called in production mode');\n const prevInjectContext = setInjectorProfilerContext({\n injector,\n token\n });\n try {\n callback();\n } finally {\n setInjectorProfilerContext(prevInjectContext);\n }\n}\nfunction isEnvironmentProviders(value) {\n return value && !!value.ɵproviders;\n}\nconst NG_COMP_DEF = getClosureSafeProperty({\n ɵcmp: getClosureSafeProperty\n});\nconst NG_DIR_DEF = getClosureSafeProperty({\n ɵdir: getClosureSafeProperty\n});\nconst NG_PIPE_DEF = getClosureSafeProperty({\n ɵpipe: getClosureSafeProperty\n});\nconst NG_MOD_DEF = getClosureSafeProperty({\n ɵmod: getClosureSafeProperty\n});\nconst NG_FACTORY_DEF = getClosureSafeProperty({\n ɵfac: getClosureSafeProperty\n});\n/**\n * If a directive is diPublic, bloomAdd sets a property on the type with this constant as\n * the key and the directive's unique ID as the value. This allows us to map directives to their\n * bloom filter bit for DI.\n */\n// TODO(misko): This is wrong. The NG_ELEMENT_ID should never be minified.\nconst NG_ELEMENT_ID = getClosureSafeProperty({\n __NG_ELEMENT_ID__: getClosureSafeProperty\n});\n/**\n * The `NG_ENV_ID` field on a DI token indicates special processing in the `EnvironmentInjector`:\n * getting such tokens from the `EnvironmentInjector` will bypass the standard DI resolution\n * strategy and instead will return implementation produced by the `NG_ENV_ID` factory function.\n *\n * This particular retrieval of DI tokens is mostly done to eliminate circular dependencies and\n * improve tree-shaking.\n */\nconst NG_ENV_ID = getClosureSafeProperty({\n __NG_ENV_ID__: getClosureSafeProperty\n});\n\n/**\n * Used for stringify render output in Ivy.\n * Important! This function is very performance-sensitive and we should\n * be extra careful not to introduce megamorphic reads in it.\n * Check `core/test/render3/perf/render_stringify` for benchmarks and alternate implementations.\n */\nfunction renderStringify(value) {\n if (typeof value === 'string') return value;\n if (value == null) return '';\n // Use `String` so that it invokes the `toString` method of the value. Note that this\n // appears to be faster than calling `value.toString` (see `render_stringify` benchmark).\n return String(value);\n}\n/**\n * Used to stringify a value so that it can be displayed in an error message.\n *\n * Important! This function contains a megamorphic read and should only be\n * used for error messages.\n */\nfunction stringifyForError(value) {\n if (typeof value === 'function') return value.name || value.toString();\n if (typeof value === 'object' && value != null && typeof value.type === 'function') {\n return value.type.name || value.type.toString();\n }\n return renderStringify(value);\n}\n/**\n * Used to stringify a `Type` and including the file path and line number in which it is defined, if\n * possible, for better debugging experience.\n *\n * Important! This function contains a megamorphic read and should only be used for error messages.\n */\nfunction debugStringifyTypeForError(type) {\n // TODO(pmvald): Do some refactoring so that we can use getComponentDef here without creating\n // circular deps.\n let componentDef = type[NG_COMP_DEF] || null;\n if (componentDef !== null && componentDef.debugInfo) {\n return stringifyTypeFromDebugInfo(componentDef.debugInfo);\n }\n return stringifyForError(type);\n}\n// TODO(pmvald): Do some refactoring so that we can use the type ClassDebugInfo for the param\n// debugInfo here without creating circular deps.\nfunction stringifyTypeFromDebugInfo(debugInfo) {\n if (!debugInfo.filePath || !debugInfo.lineNumber) {\n return debugInfo.className;\n } else {\n return `${debugInfo.className} (at ${debugInfo.filePath}:${debugInfo.lineNumber})`;\n }\n}\n\n/** Called when directives inject each other (creating a circular dependency) */\nfunction throwCyclicDependencyError(token, path) {\n const depPath = path ? `. Dependency path: ${path.join(' > ')} > ${token}` : '';\n throw new RuntimeError(-200 /* RuntimeErrorCode.CYCLIC_DI_DEPENDENCY */, ngDevMode ? `Circular dependency in DI detected for ${token}${depPath}` : token);\n}\nfunction throwMixedMultiProviderError() {\n throw new Error(`Cannot mix multi providers and regular providers`);\n}\nfunction throwInvalidProviderError(ngModuleType, providers, provider) {\n if (ngModuleType && providers) {\n const providerDetail = providers.map(v => v == provider ? '?' + provider + '?' : '...');\n throw new Error(`Invalid provider for the NgModule '${stringify(ngModuleType)}' - only instances of Provider and Type are allowed, got: [${providerDetail.join(', ')}]`);\n } else if (isEnvironmentProviders(provider)) {\n if (provider.ɵfromNgModule) {\n throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, `Invalid providers from 'importProvidersFrom' present in a non-environment injector. 'importProvidersFrom' can't be used for component providers.`);\n } else {\n throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, `Invalid providers present in a non-environment injector. 'EnvironmentProviders' can't be used for component providers.`);\n }\n } else {\n throw new Error('Invalid provider');\n }\n}\n/** Throws an error when a token is not found in DI. */\nfunction throwProviderNotFoundError(token, injectorName) {\n const errorMessage = ngDevMode && `No provider for ${stringifyForError(token)} found${injectorName ? ` in ${injectorName}` : ''}`;\n throw new RuntimeError(-201 /* RuntimeErrorCode.PROVIDER_NOT_FOUND */, errorMessage);\n}\n\n/**\n * Injection flags for DI.\n *\n * @publicApi\n * @deprecated use an options object for [`inject`](api/core/inject) instead.\n */\nvar InjectFlags;\n(function (InjectFlags) {\n // TODO(alxhub): make this 'const' (and remove `InternalInjectFlags` enum) when ngc no longer\n // writes exports of it into ngfactory files.\n /** Check self and check parent injector if needed */\n InjectFlags[InjectFlags[\"Default\"] = 0] = \"Default\";\n /**\n * Specifies that an injector should retrieve a dependency from any injector until reaching the\n * host element of the current component. (Only used with Element Injector)\n */\n InjectFlags[InjectFlags[\"Host\"] = 1] = \"Host\";\n /** Don't ascend to ancestors of the node requesting injection. */\n InjectFlags[InjectFlags[\"Self\"] = 2] = \"Self\";\n /** Skip the node that is requesting injection. */\n InjectFlags[InjectFlags[\"SkipSelf\"] = 4] = \"SkipSelf\";\n /** Inject `defaultValue` instead if token not found. */\n InjectFlags[InjectFlags[\"Optional\"] = 8] = \"Optional\";\n})(InjectFlags || (InjectFlags = {}));\n\n/**\n * Current implementation of inject.\n *\n * By default, it is `injectInjectorOnly`, which makes it `Injector`-only aware. It can be changed\n * to `directiveInject`, which brings in the `NodeInjector` system of ivy. It is designed this\n * way for two reasons:\n * 1. `Injector` should not depend on ivy logic.\n * 2. To maintain tree shake-ability we don't want to bring in unnecessary code.\n */\nlet _injectImplementation;\nfunction getInjectImplementation() {\n return _injectImplementation;\n}\n/**\n * Sets the current inject implementation.\n */\nfunction setInjectImplementation(impl) {\n const previous = _injectImplementation;\n _injectImplementation = impl;\n return previous;\n}\n/**\n * Injects `root` tokens in limp mode.\n *\n * If no injector exists, we can still inject tree-shakable providers which have `providedIn` set to\n * `\"root\"`. This is known as the limp mode injection. In such case the value is stored in the\n * injectable definition.\n */\nfunction injectRootLimpMode(token, notFoundValue, flags) {\n const injectableDef = getInjectableDef(token);\n if (injectableDef && injectableDef.providedIn == 'root') {\n return injectableDef.value === undefined ? injectableDef.value = injectableDef.factory() : injectableDef.value;\n }\n if (flags & InjectFlags.Optional) return null;\n if (notFoundValue !== undefined) return notFoundValue;\n throwProviderNotFoundError(token, 'Injector');\n}\n/**\n * Assert that `_injectImplementation` is not `fn`.\n *\n * This is useful, to prevent infinite recursion.\n *\n * @param fn Function which it should not equal to\n */\nfunction assertInjectImplementationNotEqual(fn) {\n ngDevMode && assertNotEqual(_injectImplementation, fn, 'Calling ɵɵinject would cause infinite recursion');\n}\nconst _THROW_IF_NOT_FOUND = {};\nconst THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;\n/*\n * Name of a property (that we patch onto DI decorator), which is used as an annotation of which\n * InjectFlag this decorator represents. This allows to avoid direct references to the DI decorators\n * in the code, thus making them tree-shakable.\n */\nconst DI_DECORATOR_FLAG = '__NG_DI_FLAG__';\nconst NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';\nconst NG_TOKEN_PATH = 'ngTokenPath';\nconst NEW_LINE = /\\n/gm;\nconst NO_NEW_LINE = 'ɵ';\nconst SOURCE = '__source';\n/**\n * Current injector value used by `inject`.\n * - `undefined`: it is an error to call `inject`\n * - `null`: `inject` can be called but there is no injector (limp-mode).\n * - Injector instance: Use the injector for resolution.\n */\nlet _currentInjector = undefined;\nfunction getCurrentInjector() {\n return _currentInjector;\n}\nfunction setCurrentInjector(injector) {\n const former = _currentInjector;\n _currentInjector = injector;\n return former;\n}\nfunction injectInjectorOnly(token, flags = InjectFlags.Default) {\n if (_currentInjector === undefined) {\n throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode && `inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \\`runInInjectionContext\\`.`);\n } else if (_currentInjector === null) {\n return injectRootLimpMode(token, undefined, flags);\n } else {\n const value = _currentInjector.get(token, flags & InjectFlags.Optional ? null : undefined, flags);\n ngDevMode && emitInjectEvent(token, value, flags);\n return value;\n }\n}\nfunction ɵɵinject(token, flags = InjectFlags.Default) {\n return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags);\n}\n/**\n * Throws an error indicating that a factory function could not be generated by the compiler for a\n * particular class.\n *\n * The name of the class is not mentioned here, but will be in the generated factory function name\n * and thus in the stack trace.\n *\n * @codeGenApi\n */\nfunction ɵɵinvalidFactoryDep(index) {\n throw new RuntimeError(202 /* RuntimeErrorCode.INVALID_FACTORY_DEPENDENCY */, ngDevMode && `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.\nThis can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.\n\nPlease check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`);\n}\n/**\n * Injects a token from the currently active injector.\n * `inject` is only supported in an [injection context](guide/di/dependency-injection-context). It\n * can be used during:\n * - Construction (via the `constructor`) of a class being instantiated by the DI system, such\n * as an `@Injectable` or `@Component`.\n * - In the initializer for fields of such classes.\n * - In the factory function specified for `useFactory` of a `Provider` or an `@Injectable`.\n * - In the `factory` function specified for an `InjectionToken`.\n * - In a stackframe of a function call in a DI context\n *\n * @param token A token that represents a dependency that should be injected.\n * @param flags Optional flags that control how injection is executed.\n * The flags correspond to injection strategies that can be specified with\n * parameter decorators `@Host`, `@Self`, `@SkipSelf`, and `@Optional`.\n * @returns the injected value if operation is successful, `null` otherwise.\n * @throws if called outside of a supported context.\n *\n * @usageNotes\n * In practice the `inject()` calls are allowed in a constructor, a constructor parameter and a\n * field initializer:\n *\n * ```typescript\n * @Injectable({providedIn: 'root'})\n * export class Car {\n * radio: Radio|undefined;\n * // OK: field initializer\n * spareTyre = inject(Tyre);\n *\n * constructor() {\n * // OK: constructor body\n * this.radio = inject(Radio);\n * }\n * }\n * ```\n *\n * It is also legal to call `inject` from a provider's factory:\n *\n * ```typescript\n * providers: [\n * {provide: Car, useFactory: () => {\n * // OK: a class factory\n * const engine = inject(Engine);\n * return new Car(engine);\n * }}\n * ]\n * ```\n *\n * Calls to the `inject()` function outside of the class creation context will result in error. Most\n * notably, calls to `inject()` are disallowed after a class instance was created, in methods\n * (including lifecycle hooks):\n *\n * ```typescript\n * @Component({ ... })\n * export class CarComponent {\n * ngOnInit() {\n * // ERROR: too late, the component instance was already created\n * const engine = inject(Engine);\n * engine.start();\n * }\n * }\n * ```\n *\n * @publicApi\n */\nfunction inject(token, flags = InjectFlags.Default) {\n // The `as any` here _shouldn't_ be necessary, but without it JSCompiler\n // throws a disambiguation error due to the multiple signatures.\n return ɵɵinject(token, convertToBitFlags(flags));\n}\n// Converts object-based DI flags (`InjectOptions`) to bit flags (`InjectFlags`).\nfunction convertToBitFlags(flags) {\n if (typeof flags === 'undefined' || typeof flags === 'number') {\n return flags;\n }\n // While TypeScript doesn't accept it without a cast, bitwise OR with false-y values in\n // JavaScript is a no-op. We can use that for a very codesize-efficient conversion from\n // `InjectOptions` to `InjectFlags`.\n return 0 /* InternalInjectFlags.Default */ | (\n // comment to force a line break in the formatter\n flags.optional && 8 /* InternalInjectFlags.Optional */) | (flags.host && 1 /* InternalInjectFlags.Host */) | (flags.self && 2 /* InternalInjectFlags.Self */) | (flags.skipSelf && 4 /* InternalInjectFlags.SkipSelf */);\n}\nfunction injectArgs(types) {\n const args = [];\n for (let i = 0; i < types.length; i++) {\n const arg = resolveForwardRef(types[i]);\n if (Array.isArray(arg)) {\n if (arg.length === 0) {\n throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode && 'Arguments array must have arguments.');\n }\n let type = undefined;\n let flags = InjectFlags.Default;\n for (let j = 0; j < arg.length; j++) {\n const meta = arg[j];\n const flag = getInjectFlag(meta);\n if (typeof flag === 'number') {\n // Special case when we handle @Inject decorator.\n if (flag === -1 /* DecoratorFlags.Inject */) {\n type = meta.token;\n } else {\n flags |= flag;\n }\n } else {\n type = meta;\n }\n }\n args.push(ɵɵinject(type, flags));\n } else {\n args.push(ɵɵinject(arg));\n }\n }\n return args;\n}\n/**\n * Attaches a given InjectFlag to a given decorator using monkey-patching.\n * Since DI decorators can be used in providers `deps` array (when provider is configured using\n * `useFactory`) without initialization (e.g. `Host`) and as an instance (e.g. `new Host()`), we\n * attach the flag to make it available both as a static property and as a field on decorator\n * instance.\n *\n * @param decorator Provided DI decorator.\n * @param flag InjectFlag that should be applied.\n */\nfunction attachInjectFlag(decorator, flag) {\n decorator[DI_DECORATOR_FLAG] = flag;\n decorator.prototype[DI_DECORATOR_FLAG] = flag;\n return decorator;\n}\n/**\n * Reads monkey-patched property that contains InjectFlag attached to a decorator.\n *\n * @param token Token that may contain monkey-patched DI flags property.\n */\nfunction getInjectFlag(token) {\n return token[DI_DECORATOR_FLAG];\n}\nfunction catchInjectorError(e, token, injectorErrorName, source) {\n const tokenPath = e[NG_TEMP_TOKEN_PATH];\n if (token[SOURCE]) {\n tokenPath.unshift(token[SOURCE]);\n }\n e.message = formatError('\\n' + e.message, tokenPath, injectorErrorName, source);\n e[NG_TOKEN_PATH] = tokenPath;\n e[NG_TEMP_TOKEN_PATH] = null;\n throw e;\n}\nfunction formatError(text, obj, injectorErrorName, source = null) {\n text = text && text.charAt(0) === '\\n' && text.charAt(1) == NO_NEW_LINE ? text.slice(2) : text;\n let context = stringify(obj);\n if (Array.isArray(obj)) {\n context = obj.map(stringify).join(' -> ');\n } else if (typeof obj === 'object') {\n let parts = [];\n for (let key in obj) {\n if (obj.hasOwnProperty(key)) {\n let value = obj[key];\n parts.push(key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));\n }\n }\n context = `{${parts.join(', ')}}`;\n }\n return `${injectorErrorName}${source ? '(' + source + ')' : ''}[${context}]: ${text.replace(NEW_LINE, '\\n ')}`;\n}\n\n/**\n * Inject decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Inject = attachInjectFlag(\n// Disable tslint because `DecoratorFlags` is a const enum which gets inlined.\nmakeParamDecorator('Inject', token => ({\n token\n})), -1 /* DecoratorFlags.Inject */);\n/**\n * Optional decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Optional =\n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('Optional'), 8 /* InternalInjectFlags.Optional */);\n/**\n * Self decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Self =\n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('Self'), 2 /* InternalInjectFlags.Self */);\n/**\n * `SkipSelf` decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst SkipSelf =\n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('SkipSelf'), 4 /* InternalInjectFlags.SkipSelf */);\n/**\n * Host decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Host =\n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('Host'), 1 /* InternalInjectFlags.Host */);\nfunction getFactoryDef(type, throwNotFound) {\n const hasFactoryDef = type.hasOwnProperty(NG_FACTORY_DEF);\n if (!hasFactoryDef && throwNotFound === true && ngDevMode) {\n throw new Error(`Type ${stringify(type)} does not have 'ɵfac' property.`);\n }\n return hasFactoryDef ? type[NG_FACTORY_DEF] : null;\n}\n\n/**\n * Determines if the contents of two arrays is identical\n *\n * @param a first array\n * @param b second array\n * @param identityAccessor Optional function for extracting stable object identity from a value in\n * the array.\n */\nfunction arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n let valueA = a[i];\n let valueB = b[i];\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n if (valueB !== valueA) {\n return false;\n }\n }\n return true;\n}\n/**\n * Flattens an array.\n */\nfunction flatten(list) {\n return list.flat(Number.POSITIVE_INFINITY);\n}\nfunction deepForEach(input, fn) {\n input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));\n}\nfunction addToArray(arr, index, value) {\n // perf: array.push is faster than array.splice!\n if (index >= arr.length) {\n arr.push(value);\n } else {\n arr.splice(index, 0, value);\n }\n}\nfunction removeFromArray(arr, index) {\n // perf: array.pop is faster than array.splice!\n if (index >= arr.length - 1) {\n return arr.pop();\n } else {\n return arr.splice(index, 1)[0];\n }\n}\nfunction newArray(size, value) {\n const list = [];\n for (let i = 0; i < size; i++) {\n list.push(value);\n }\n return list;\n}\n/**\n * Remove item from array (Same as `Array.splice()` but faster.)\n *\n * `Array.splice()` is not as fast because it has to allocate an array for the elements which were\n * removed. This causes memory pressure and slows down code when most of the time we don't\n * care about the deleted items array.\n *\n * https://jsperf.com/fast-array-splice (About 20x faster)\n *\n * @param array Array to splice\n * @param index Index of element in array to remove.\n * @param count Number of items to remove.\n */\nfunction arraySplice(array, index, count) {\n const length = array.length - count;\n while (index < length) {\n array[index] = array[index + count];\n index++;\n }\n while (count--) {\n array.pop(); // shrink the array\n }\n}\n/**\n * Same as `Array.splice(index, 0, value)` but faster.\n *\n * `Array.splice()` is not fast because it has to allocate an array for the elements which were\n * removed. This causes memory pressure and slows down code when most of the time we don't\n * care about the deleted items array.\n *\n * @param array Array to splice.\n * @param index Index in array where the `value` should be added.\n * @param value Value to add to array.\n */\nfunction arrayInsert(array, index, value) {\n ngDevMode && assertLessThanOrEqual(index, array.length, \"Can't insert past array end.\");\n let end = array.length;\n while (end > index) {\n const previousEnd = end - 1;\n array[end] = array[previousEnd];\n end = previousEnd;\n }\n array[index] = value;\n}\n/**\n * Same as `Array.splice2(index, 0, value1, value2)` but faster.\n *\n * `Array.splice()` is not fast because it has to allocate an array for the elements which were\n * removed. This causes memory pressure and slows down code when most of the time we don't\n * care about the deleted items array.\n *\n * @param array Array to splice.\n * @param index Index in array where the `value` should be added.\n * @param value1 Value to add to array.\n * @param value2 Value to add to array.\n */\nfunction arrayInsert2(array, index, value1, value2) {\n ngDevMode && assertLessThanOrEqual(index, array.length, \"Can't insert past array end.\");\n let end = array.length;\n if (end == index) {\n // inserting at the end.\n array.push(value1, value2);\n } else if (end === 1) {\n // corner case when we have less items in array than we have items to insert.\n array.push(value2, array[0]);\n array[0] = value1;\n } else {\n end--;\n array.push(array[end - 1], array[end]);\n while (end > index) {\n const previousEnd = end - 2;\n array[end] = array[previousEnd];\n end--;\n }\n array[index] = value1;\n array[index + 1] = value2;\n }\n}\n/**\n * Get an index of an `value` in a sorted `array`.\n *\n * NOTE:\n * - This uses binary search algorithm for fast removals.\n *\n * @param array A sorted array to binary search.\n * @param value The value to look for.\n * @returns index of the value.\n * - positive index if value found.\n * - negative index if value not found. (`~index` to get the value where it should have been\n * located)\n */\nfunction arrayIndexOfSorted(array, value) {\n return _arrayIndexOfSorted(array, value, 0);\n}\n/**\n * Set a `value` for a `key`.\n *\n * @param keyValueArray to modify.\n * @param key The key to locate or create.\n * @param value The value to set for a `key`.\n * @returns index (always even) of where the value vas set.\n */\nfunction keyValueArraySet(keyValueArray, key, value) {\n let index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it set it.\n keyValueArray[index | 1] = value;\n } else {\n index = ~index;\n arrayInsert2(keyValueArray, index, key, value);\n }\n return index;\n}\n/**\n * Retrieve a `value` for a `key` (on `undefined` if not found.)\n *\n * @param keyValueArray to search.\n * @param key The key to locate.\n * @return The `value` stored at the `key` location or `undefined if not found.\n */\nfunction keyValueArrayGet(keyValueArray, key) {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1];\n }\n return undefined;\n}\n/**\n * Retrieve a `key` index value in the array or `-1` if not found.\n *\n * @param keyValueArray to search.\n * @param key The key to locate.\n * @returns index of where the key is (or should have been.)\n * - positive (even) index if key found.\n * - negative index if key not found. (`~index` (even) to get the index where it should have\n * been inserted.)\n */\nfunction keyValueArrayIndexOf(keyValueArray, key) {\n return _arrayIndexOfSorted(keyValueArray, key, 1);\n}\n/**\n * Delete a `key` (and `value`) from the `KeyValueArray`.\n *\n * @param keyValueArray to modify.\n * @param key The key to locate or delete (if exist).\n * @returns index of where the key was (or should have been.)\n * - positive (even) index if key found and deleted.\n * - negative index if key not found. (`~index` (even) to get the index where it should have\n * been.)\n */\nfunction keyValueArrayDelete(keyValueArray, key) {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it remove it.\n arraySplice(keyValueArray, index, 2);\n }\n return index;\n}\n/**\n * INTERNAL: Get an index of an `value` in a sorted `array` by grouping search by `shift`.\n *\n * NOTE:\n * - This uses binary search algorithm for fast removals.\n *\n * @param array A sorted array to binary search.\n * @param value The value to look for.\n * @param shift grouping shift.\n * - `0` means look at every location\n * - `1` means only look at every other (even) location (the odd locations are to be ignored as\n * they are values.)\n * @returns index of the value.\n * - positive index if value found.\n * - negative index if value not found. (`~index` to get the value where it should have been\n * inserted)\n */\nfunction _arrayIndexOfSorted(array, value, shift) {\n ngDevMode && assertEqual(Array.isArray(array), true, 'Expecting an array');\n let start = 0;\n let end = array.length >> shift;\n while (end !== start) {\n const middle = start + (end - start >> 1); // find the middle.\n const current = array[middle << shift];\n if (value === current) {\n return middle << shift;\n } else if (current > value) {\n end = middle;\n } else {\n start = middle + 1; // We already searched middle so make it non-inclusive by adding 1\n }\n }\n return ~(end << shift);\n}\n\n/**\n * This file contains reuseable \"empty\" symbols that can be used as default return values\n * in different parts of the rendering code. Because the same symbols are returned, this\n * allows for identity checks against these values to be consistently used by the framework\n * code.\n */\nconst EMPTY_OBJ = {};\nconst EMPTY_ARRAY = [];\n// freezing the values prevents any code from accidentally inserting new values in\nif ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) {\n // These property accesses can be ignored because ngDevMode will be set to false\n // when optimizing code and the whole if statement will be dropped.\n // tslint:disable-next-line:no-toplevel-property-access\n Object.freeze(EMPTY_OBJ);\n // tslint:disable-next-line:no-toplevel-property-access\n Object.freeze(EMPTY_ARRAY);\n}\n\n/**\n * A multi-provider token for initialization functions that will run upon construction of an\n * environment injector.\n *\n * Note: As opposed to the `APP_INITIALIZER` token, the `ENVIRONMENT_INITIALIZER` functions are not awaited,\n * hence they should not be `async`.\n *\n * @publicApi\n */\nconst ENVIRONMENT_INITIALIZER = new InjectionToken(ngDevMode ? 'ENVIRONMENT_INITIALIZER' : '');\n\n/**\n * An InjectionToken that gets the current `Injector` for `createInjector()`-style injectors.\n *\n * Requesting this token instead of `Injector` allows `StaticInjector` to be tree-shaken from a\n * project.\n *\n * @publicApi\n */\nconst INJECTOR$1 = new InjectionToken(ngDevMode ? 'INJECTOR' : '',\n// Disable tslint because this is const enum which gets inlined not top level prop access.\n// tslint:disable-next-line: no-toplevel-property-access\n-1 /* InjectorMarkers.Injector */);\nconst INJECTOR_DEF_TYPES = new InjectionToken(ngDevMode ? 'INJECTOR_DEF_TYPES' : '');\nclass NullInjector {\n get(token, notFoundValue = THROW_IF_NOT_FOUND) {\n if (notFoundValue === THROW_IF_NOT_FOUND) {\n const error = new Error(`NullInjectorError: No provider for ${stringify(token)}!`);\n error.name = 'NullInjectorError';\n throw error;\n }\n return notFoundValue;\n }\n}\n\n/**\n * The strategy that the default change detector uses to detect changes.\n * When set, takes effect the next time change detection is triggered.\n *\n * @see [Change detection usage](/api/core/ChangeDetectorRef?tab=usage-notes)\n * @see [Skipping component subtrees](/best-practices/skipping-subtrees)\n *\n * @publicApi\n */\nvar ChangeDetectionStrategy;\n(function (ChangeDetectionStrategy) {\n /**\n * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated\n * until reactivated by setting the strategy to `Default` (`CheckAlways`).\n * Change detection can still be explicitly invoked.\n * This strategy applies to all child directives and cannot be overridden.\n */\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"OnPush\"] = 0] = \"OnPush\";\n /**\n * Use the default `CheckAlways` strategy, in which change detection is automatic until\n * explicitly deactivated.\n */\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"Default\"] = 1] = \"Default\";\n})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));\n\n/**\n * Defines the CSS styles encapsulation policies for the {@link Component} decorator's\n * `encapsulation` option.\n *\n * See {@link Component#encapsulation encapsulation}.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/ts/metadata/encapsulation.ts region='longform'}\n *\n * @publicApi\n */\nvar ViewEncapsulation$1;\n(function (ViewEncapsulation) {\n // TODO: consider making `ViewEncapsulation` a `const enum` instead. See\n // https://github.com/angular/angular/issues/44119 for additional information.\n /**\n * Emulates a native Shadow DOM encapsulation behavior by adding a specific attribute to the\n * component's host element and applying the same attribute to all the CSS selectors provided\n * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls}.\n *\n * This is the default option.\n */\n ViewEncapsulation[ViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n /**\n * Doesn't provide any sort of CSS style encapsulation, meaning that all the styles provided\n * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls} are applicable\n * to any HTML element of the application regardless of their host Component.\n */\n ViewEncapsulation[ViewEncapsulation[\"None\"] = 2] = \"None\";\n /**\n * Uses the browser's native Shadow DOM API to encapsulate CSS styles, meaning that it creates\n * a ShadowRoot for the component's host element which is then used to encapsulate\n * all the Component's styling.\n */\n ViewEncapsulation[ViewEncapsulation[\"ShadowDom\"] = 3] = \"ShadowDom\";\n})(ViewEncapsulation$1 || (ViewEncapsulation$1 = {}));\n\n/** Flags describing an input for a directive. */\nvar InputFlags;\n(function (InputFlags) {\n InputFlags[InputFlags[\"None\"] = 0] = \"None\";\n InputFlags[InputFlags[\"SignalBased\"] = 1] = \"SignalBased\";\n InputFlags[InputFlags[\"HasDecoratorInputTransform\"] = 2] = \"HasDecoratorInputTransform\";\n})(InputFlags || (InputFlags = {}));\n\n/**\n * Returns an index of `classToSearch` in `className` taking token boundaries into account.\n *\n * `classIndexOf('AB A', 'A', 0)` will be 3 (not 0 since `AB!==A`)\n *\n * @param className A string containing classes (whitespace separated)\n * @param classToSearch A class name to locate\n * @param startingIndex Starting location of search\n * @returns an index of the located class (or -1 if not found)\n */\nfunction classIndexOf(className, classToSearch, startingIndex) {\n ngDevMode && assertNotEqual(classToSearch, '', 'can not look for \"\" string.');\n let end = className.length;\n while (true) {\n const foundIndex = className.indexOf(classToSearch, startingIndex);\n if (foundIndex === -1) return foundIndex;\n if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= 32 /* CharCode.SPACE */) {\n // Ensure that it has leading whitespace\n const length = classToSearch.length;\n if (foundIndex + length === end || className.charCodeAt(foundIndex + length) <= 32 /* CharCode.SPACE */) {\n // Ensure that it has trailing whitespace\n return foundIndex;\n }\n }\n // False positive, keep searching from where we left off.\n startingIndex = foundIndex + 1;\n }\n}\n\n/**\n * Assigns all attribute values to the provided element via the inferred renderer.\n *\n * This function accepts two forms of attribute entries:\n *\n * default: (key, value):\n * attrs = [key1, value1, key2, value2]\n *\n * namespaced: (NAMESPACE_MARKER, uri, name, value)\n * attrs = [NAMESPACE_MARKER, uri, name, value, NAMESPACE_MARKER, uri, name, value]\n *\n * The `attrs` array can contain a mix of both the default and namespaced entries.\n * The \"default\" values are set without a marker, but if the function comes across\n * a marker value then it will attempt to set a namespaced value. If the marker is\n * not of a namespaced value then the function will quit and return the index value\n * where it stopped during the iteration of the attrs array.\n *\n * See [AttributeMarker] to understand what the namespace marker value is.\n *\n * Note that this instruction does not support assigning style and class values to\n * an element. See `elementStart` and `elementHostAttrs` to learn how styling values\n * are applied to an element.\n * @param renderer The renderer to be used\n * @param native The element that the attributes will be assigned to\n * @param attrs The attribute array of values that will be assigned to the element\n * @returns the index value that was last accessed in the attributes array\n */\nfunction setUpAttributes(renderer, native, attrs) {\n let i = 0;\n while (i < attrs.length) {\n const value = attrs[i];\n if (typeof value === 'number') {\n // only namespaces are supported. Other value types (such as style/class\n // entries) are not supported in this function.\n if (value !== 0 /* AttributeMarker.NamespaceURI */) {\n break;\n }\n // we just landed on the marker value ... therefore\n // we should skip to the next entry\n i++;\n const namespaceURI = attrs[i++];\n const attrName = attrs[i++];\n const attrVal = attrs[i++];\n ngDevMode && ngDevMode.rendererSetAttribute++;\n renderer.setAttribute(native, attrName, attrVal, namespaceURI);\n } else {\n // attrName is string;\n const attrName = value;\n const attrVal = attrs[++i];\n // Standard attributes\n ngDevMode && ngDevMode.rendererSetAttribute++;\n if (isAnimationProp(attrName)) {\n renderer.setProperty(native, attrName, attrVal);\n } else {\n renderer.setAttribute(native, attrName, attrVal);\n }\n i++;\n }\n }\n // another piece of code may iterate over the same attributes array. Therefore\n // it may be helpful to return the exact spot where the attributes array exited\n // whether by running into an unsupported marker or if all the static values were\n // iterated over.\n return i;\n}\n/**\n * Test whether the given value is a marker that indicates that the following\n * attribute values in a `TAttributes` array are only the names of attributes,\n * and not name-value pairs.\n * @param marker The attribute marker to test.\n * @returns true if the marker is a \"name-only\" marker (e.g. `Bindings`, `Template` or `I18n`).\n */\nfunction isNameOnlyAttributeMarker(marker) {\n return marker === 3 /* AttributeMarker.Bindings */ || marker === 4 /* AttributeMarker.Template */ || marker === 6 /* AttributeMarker.I18n */;\n}\nfunction isAnimationProp(name) {\n // Perf note: accessing charCodeAt to check for the first character of a string is faster as\n // compared to accessing a character at index 0 (ex. name[0]). The main reason for this is that\n // charCodeAt doesn't allocate memory to return a substring.\n return name.charCodeAt(0) === 64 /* CharCode.AT_SIGN */;\n}\n/**\n * Merges `src` `TAttributes` into `dst` `TAttributes` removing any duplicates in the process.\n *\n * This merge function keeps the order of attrs same.\n *\n * @param dst Location of where the merged `TAttributes` should end up.\n * @param src `TAttributes` which should be appended to `dst`\n */\nfunction mergeHostAttrs(dst, src) {\n if (src === null || src.length === 0) {\n // do nothing\n } else if (dst === null || dst.length === 0) {\n // We have source, but dst is empty, just make a copy.\n dst = src.slice();\n } else {\n let srcMarker = -1 /* AttributeMarker.ImplicitAttributes */;\n for (let i = 0; i < src.length; i++) {\n const item = src[i];\n if (typeof item === 'number') {\n srcMarker = item;\n } else {\n if (srcMarker === 0 /* AttributeMarker.NamespaceURI */) {\n // Case where we need to consume `key1`, `key2`, `value` items.\n } else if (srcMarker === -1 /* AttributeMarker.ImplicitAttributes */ || srcMarker === 2 /* AttributeMarker.Styles */) {\n // Case where we have to consume `key1` and `value` only.\n mergeHostAttribute(dst, srcMarker, item, null, src[++i]);\n } else {\n // Case where we have to consume `key1` only.\n mergeHostAttribute(dst, srcMarker, item, null, null);\n }\n }\n }\n }\n return dst;\n}\n/**\n * Append `key`/`value` to existing `TAttributes` taking region marker and duplicates into account.\n *\n * @param dst `TAttributes` to append to.\n * @param marker Region where the `key`/`value` should be added.\n * @param key1 Key to add to `TAttributes`\n * @param key2 Key to add to `TAttributes` (in case of `AttributeMarker.NamespaceURI`)\n * @param value Value to add or to overwrite to `TAttributes` Only used if `marker` is not Class.\n */\nfunction mergeHostAttribute(dst, marker, key1, key2, value) {\n let i = 0;\n // Assume that new markers will be inserted at the end.\n let markerInsertPosition = dst.length;\n // scan until correct type.\n if (marker === -1 /* AttributeMarker.ImplicitAttributes */) {\n markerInsertPosition = -1;\n } else {\n while (i < dst.length) {\n const dstValue = dst[i++];\n if (typeof dstValue === 'number') {\n if (dstValue === marker) {\n markerInsertPosition = -1;\n break;\n } else if (dstValue > marker) {\n // We need to save this as we want the markers to be inserted in specific order.\n markerInsertPosition = i - 1;\n break;\n }\n }\n }\n }\n // search until you find place of insertion\n while (i < dst.length) {\n const item = dst[i];\n if (typeof item === 'number') {\n // since `i` started as the index after the marker, we did not find it if we are at the next\n // marker\n break;\n } else if (item === key1) {\n // We already have same token\n if (key2 === null) {\n if (value !== null) {\n dst[i + 1] = value;\n }\n return;\n } else if (key2 === dst[i + 1]) {\n dst[i + 2] = value;\n return;\n }\n }\n // Increment counter.\n i++;\n if (key2 !== null) i++;\n if (value !== null) i++;\n }\n // insert at location.\n if (markerInsertPosition !== -1) {\n dst.splice(markerInsertPosition, 0, marker);\n i = markerInsertPosition + 1;\n }\n dst.splice(i++, 0, key1);\n if (key2 !== null) {\n dst.splice(i++, 0, key2);\n }\n if (value !== null) {\n dst.splice(i++, 0, value);\n }\n}\nconst NG_TEMPLATE_SELECTOR = 'ng-template';\n/**\n * Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)\n *\n * @param tNode static data of the node to match\n * @param attrs `TAttributes` to search through.\n * @param cssClassToMatch class to match (lowercase)\n * @param isProjectionMode Whether or not class matching should look into the attribute `class` in\n * addition to the `AttributeMarker.Classes`.\n */\nfunction isCssClassMatching(tNode, attrs, cssClassToMatch, isProjectionMode) {\n ngDevMode && assertEqual(cssClassToMatch, cssClassToMatch.toLowerCase(), 'Class name expected to be lowercase.');\n let i = 0;\n if (isProjectionMode) {\n for (; i < attrs.length && typeof attrs[i] === 'string'; i += 2) {\n // Search for an implicit `class` attribute and check if its value matches `cssClassToMatch`.\n if (attrs[i] === 'class' && classIndexOf(attrs[i + 1].toLowerCase(), cssClassToMatch, 0) !== -1) {\n return true;\n }\n }\n } else if (isInlineTemplate(tNode)) {\n // Matching directives (i.e. when not matching for projection mode) should not consider the\n // class bindings that are present on inline templates, as those class bindings only target\n // the root node of the template, not the template itself.\n return false;\n }\n // Resume the search for classes after the `Classes` marker.\n i = attrs.indexOf(1 /* AttributeMarker.Classes */, i);\n if (i > -1) {\n // We found the classes section. Start searching for the class.\n let item;\n while (++i < attrs.length && typeof (item = attrs[i]) === 'string') {\n if (item.toLowerCase() === cssClassToMatch) {\n return true;\n }\n }\n }\n return false;\n}\n/**\n * Checks whether the `tNode` represents an inline template (e.g. `*ngFor`).\n *\n * @param tNode current TNode\n */\nfunction isInlineTemplate(tNode) {\n return tNode.type === 4 /* TNodeType.Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n}\n/**\n * Function that checks whether a given tNode matches tag-based selector and has a valid type.\n *\n * Matching can be performed in 2 modes: projection mode (when we project nodes) and regular\n * directive matching mode:\n * - in the \"directive matching\" mode we do _not_ take TContainer's tagName into account if it is\n * different from NG_TEMPLATE_SELECTOR (value different from NG_TEMPLATE_SELECTOR indicates that a\n * tag name was extracted from * syntax so we would match the same directive twice);\n * - in the \"projection\" mode, we use a tag name potentially extracted from the * syntax processing\n * (applicable to TNodeType.Container only).\n */\nfunction hasTagAndTypeMatch(tNode, currentSelector, isProjectionMode) {\n const tagNameToCompare = tNode.type === 4 /* TNodeType.Container */ && !isProjectionMode ? NG_TEMPLATE_SELECTOR : tNode.value;\n return currentSelector === tagNameToCompare;\n}\n/**\n * A utility function to match an Ivy node static data against a simple CSS selector\n *\n * @param tNode static data of the node to match\n * @param selector The selector to try matching against the node.\n * @param isProjectionMode if `true` we are matching for content projection, otherwise we are doing\n * directive matching.\n * @returns true if node matches the selector.\n */\nfunction isNodeMatchingSelector(tNode, selector, isProjectionMode) {\n ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');\n let mode = 4 /* SelectorFlags.ELEMENT */;\n const nodeAttrs = tNode.attrs;\n // Find the index of first attribute that has no value, only a name.\n const nameOnlyMarkerIdx = nodeAttrs !== null ? getNameOnlyMarkerIndex(nodeAttrs) : 0;\n // When processing \":not\" selectors, we skip to the next \":not\" if the\n // current one doesn't match\n let skipToNextSelector = false;\n for (let i = 0; i < selector.length; i++) {\n const current = selector[i];\n if (typeof current === 'number') {\n // If we finish processing a :not selector and it hasn't failed, return false\n if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) {\n return false;\n }\n // If we are skipping to the next :not() and this mode flag is positive,\n // it's a part of the current :not() selector, and we should keep skipping\n if (skipToNextSelector && isPositive(current)) continue;\n skipToNextSelector = false;\n mode = current | mode & 1 /* SelectorFlags.NOT */;\n continue;\n }\n if (skipToNextSelector) continue;\n if (mode & 4 /* SelectorFlags.ELEMENT */) {\n mode = 2 /* SelectorFlags.ATTRIBUTE */ | mode & 1 /* SelectorFlags.NOT */;\n if (current !== '' && !hasTagAndTypeMatch(tNode, current, isProjectionMode) || current === '' && selector.length === 1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n } else if (mode & 8 /* SelectorFlags.CLASS */) {\n if (nodeAttrs === null || !isCssClassMatching(tNode, nodeAttrs, current, isProjectionMode)) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n } else {\n const selectorAttrValue = selector[++i];\n const attrIndexInNode = findAttrIndexInNode(current, nodeAttrs, isInlineTemplate(tNode), isProjectionMode);\n if (attrIndexInNode === -1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n continue;\n }\n if (selectorAttrValue !== '') {\n let nodeAttrValue;\n if (attrIndexInNode > nameOnlyMarkerIdx) {\n nodeAttrValue = '';\n } else {\n ngDevMode && assertNotEqual(nodeAttrs[attrIndexInNode], 0 /* AttributeMarker.NamespaceURI */, 'We do not match directives on namespaced attributes');\n // we lowercase the attribute value to be able to match\n // selectors without case-sensitivity\n // (selectors are already in lowercase when generated)\n nodeAttrValue = nodeAttrs[attrIndexInNode + 1].toLowerCase();\n }\n if (mode & 2 /* SelectorFlags.ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n }\n }\n }\n return isPositive(mode) || skipToNextSelector;\n}\nfunction isPositive(mode) {\n return (mode & 1 /* SelectorFlags.NOT */) === 0;\n}\n/**\n * Examines the attribute's definition array for a node to find the index of the\n * attribute that matches the given `name`.\n *\n * NOTE: This will not match namespaced attributes.\n *\n * Attribute matching depends upon `isInlineTemplate` and `isProjectionMode`.\n * The following table summarizes which types of attributes we attempt to match:\n *\n * ===========================================================================================================\n * Modes | Normal Attributes | Bindings Attributes | Template Attributes | I18n\n * Attributes\n * ===========================================================================================================\n * Inline + Projection | YES | YES | NO | YES\n * -----------------------------------------------------------------------------------------------------------\n * Inline + Directive | NO | NO | YES | NO\n * -----------------------------------------------------------------------------------------------------------\n * Non-inline + Projection | YES | YES | NO | YES\n * -----------------------------------------------------------------------------------------------------------\n * Non-inline + Directive | YES | YES | NO | YES\n * ===========================================================================================================\n *\n * @param name the name of the attribute to find\n * @param attrs the attribute array to examine\n * @param isInlineTemplate true if the node being matched is an inline template (e.g. `*ngFor`)\n * rather than a manually expanded template node (e.g `<ng-template>`).\n * @param isProjectionMode true if we are matching against content projection otherwise we are\n * matching against directives.\n */\nfunction findAttrIndexInNode(name, attrs, isInlineTemplate, isProjectionMode) {\n if (attrs === null) return -1;\n let i = 0;\n if (isProjectionMode || !isInlineTemplate) {\n let bindingsMode = false;\n while (i < attrs.length) {\n const maybeAttrName = attrs[i];\n if (maybeAttrName === name) {\n return i;\n } else if (maybeAttrName === 3 /* AttributeMarker.Bindings */ || maybeAttrName === 6 /* AttributeMarker.I18n */) {\n bindingsMode = true;\n } else if (maybeAttrName === 1 /* AttributeMarker.Classes */ || maybeAttrName === 2 /* AttributeMarker.Styles */) {\n let value = attrs[++i];\n // We should skip classes here because we have a separate mechanism for\n // matching classes in projection mode.\n while (typeof value === 'string') {\n value = attrs[++i];\n }\n continue;\n } else if (maybeAttrName === 4 /* AttributeMarker.Template */) {\n // We do not care about Template attributes in this scenario.\n break;\n } else if (maybeAttrName === 0 /* AttributeMarker.NamespaceURI */) {\n // Skip the whole namespaced attribute and value. This is by design.\n i += 4;\n continue;\n }\n // In binding mode there are only names, rather than name-value pairs.\n i += bindingsMode ? 1 : 2;\n }\n // We did not match the attribute\n return -1;\n } else {\n return matchTemplateAttribute(attrs, name);\n }\n}\nfunction isNodeMatchingSelectorList(tNode, selector, isProjectionMode = false) {\n for (let i = 0; i < selector.length; i++) {\n if (isNodeMatchingSelector(tNode, selector[i], isProjectionMode)) {\n return true;\n }\n }\n return false;\n}\nfunction getProjectAsAttrValue(tNode) {\n const nodeAttrs = tNode.attrs;\n if (nodeAttrs != null) {\n const ngProjectAsAttrIdx = nodeAttrs.indexOf(5 /* AttributeMarker.ProjectAs */);\n // only check for ngProjectAs in attribute names, don't accidentally match attribute's value\n // (attribute names are stored at even indexes)\n if ((ngProjectAsAttrIdx & 1) === 0) {\n return nodeAttrs[ngProjectAsAttrIdx + 1];\n }\n }\n return null;\n}\nfunction getNameOnlyMarkerIndex(nodeAttrs) {\n for (let i = 0; i < nodeAttrs.length; i++) {\n const nodeAttr = nodeAttrs[i];\n if (isNameOnlyAttributeMarker(nodeAttr)) {\n return i;\n }\n }\n return nodeAttrs.length;\n}\nfunction matchTemplateAttribute(attrs, name) {\n let i = attrs.indexOf(4 /* AttributeMarker.Template */);\n if (i > -1) {\n i++;\n while (i < attrs.length) {\n const attr = attrs[i];\n // Return in case we checked all template attrs and are switching to the next section in the\n // attrs array (that starts with a number that represents an attribute marker).\n if (typeof attr === 'number') return -1;\n if (attr === name) return i;\n i++;\n }\n }\n return -1;\n}\n/**\n * Checks whether a selector is inside a CssSelectorList\n * @param selector Selector to be checked.\n * @param list List in which to look for the selector.\n */\nfunction isSelectorInSelectorList(selector, list) {\n selectorListLoop: for (let i = 0; i < list.length; i++) {\n const currentSelectorInList = list[i];\n if (selector.length !== currentSelectorInList.length) {\n continue;\n }\n for (let j = 0; j < selector.length; j++) {\n if (selector[j] !== currentSelectorInList[j]) {\n continue selectorListLoop;\n }\n }\n return true;\n }\n return false;\n}\nfunction maybeWrapInNotSelector(isNegativeMode, chunk) {\n return isNegativeMode ? ':not(' + chunk.trim() + ')' : chunk;\n}\nfunction stringifyCSSSelector(selector) {\n let result = selector[0];\n let i = 1;\n let mode = 2 /* SelectorFlags.ATTRIBUTE */;\n let currentChunk = '';\n let isNegativeMode = false;\n while (i < selector.length) {\n let valueOrMarker = selector[i];\n if (typeof valueOrMarker === 'string') {\n if (mode & 2 /* SelectorFlags.ATTRIBUTE */) {\n const attrValue = selector[++i];\n currentChunk += '[' + valueOrMarker + (attrValue.length > 0 ? '=\"' + attrValue + '\"' : '') + ']';\n } else if (mode & 8 /* SelectorFlags.CLASS */) {\n currentChunk += '.' + valueOrMarker;\n } else if (mode & 4 /* SelectorFlags.ELEMENT */) {\n currentChunk += ' ' + valueOrMarker;\n }\n } else {\n //\n // Append current chunk to the final result in case we come across SelectorFlag, which\n // indicates that the previous section of a selector is over. We need to accumulate content\n // between flags to make sure we wrap the chunk later in :not() selector if needed, e.g.\n // ```\n // ['', Flags.CLASS, '.classA', Flags.CLASS | Flags.NOT, '.classB', '.classC']\n // ```\n // should be transformed to `.classA :not(.classB .classC)`.\n //\n // Note: for negative selector part, we accumulate content between flags until we find the\n // next negative flag. This is needed to support a case where `:not()` rule contains more than\n // one chunk, e.g. the following selector:\n // ```\n // ['', Flags.ELEMENT | Flags.NOT, 'p', Flags.CLASS, 'foo', Flags.CLASS | Flags.NOT, 'bar']\n // ```\n // should be stringified to `:not(p.foo) :not(.bar)`\n //\n if (currentChunk !== '' && !isPositive(valueOrMarker)) {\n result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n currentChunk = '';\n }\n mode = valueOrMarker;\n // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative\n // mode is maintained for remaining chunks of a selector.\n isNegativeMode = isNegativeMode || !isPositive(mode);\n }\n i++;\n }\n if (currentChunk !== '') {\n result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n }\n return result;\n}\n/**\n * Generates string representation of CSS selector in parsed form.\n *\n * ComponentDef and DirectiveDef are generated with the selector in parsed form to avoid doing\n * additional parsing at runtime (for example, for directive matching). However in some cases (for\n * example, while bootstrapping a component), a string version of the selector is required to query\n * for the host element on the page. This function takes the parsed form of a selector and returns\n * its string representation.\n *\n * @param selectorList selector in parsed form\n * @returns string representation of a given selector\n */\nfunction stringifyCSSSelectorList(selectorList) {\n return selectorList.map(stringifyCSSSelector).join(',');\n}\n/**\n * Extracts attributes and classes information from a given CSS selector.\n *\n * This function is used while creating a component dynamically. In this case, the host element\n * (that is created dynamically) should contain attributes and classes specified in component's CSS\n * selector.\n *\n * @param selector CSS selector in parsed form (in a form of array)\n * @returns object with `attrs` and `classes` fields that contain extracted information\n */\nfunction extractAttrsAndClassesFromSelector(selector) {\n const attrs = [];\n const classes = [];\n let i = 1;\n let mode = 2 /* SelectorFlags.ATTRIBUTE */;\n while (i < selector.length) {\n let valueOrMarker = selector[i];\n if (typeof valueOrMarker === 'string') {\n if (mode === 2 /* SelectorFlags.ATTRIBUTE */) {\n if (valueOrMarker !== '') {\n attrs.push(valueOrMarker, selector[++i]);\n }\n } else if (mode === 8 /* SelectorFlags.CLASS */) {\n classes.push(valueOrMarker);\n }\n } else {\n // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative\n // mode is maintained for remaining chunks of a selector. Since attributes and classes are\n // extracted only for \"positive\" part of the selector, we can stop here.\n if (!isPositive(mode)) break;\n mode = valueOrMarker;\n }\n i++;\n }\n return {\n attrs,\n classes\n };\n}\n\n/**\n * Create a component definition object.\n *\n *\n * # Example\n * ```\n * class MyComponent {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ɵcmp = defineComponent({\n * ...\n * });\n * }\n * ```\n * @codeGenApi\n */\nfunction ɵɵdefineComponent(componentDefinition) {\n return noSideEffects(() => {\n // Initialize ngDevMode. This must be the first statement in ɵɵdefineComponent.\n // See the `initNgDevMode` docstring for more information.\n (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();\n const baseDef = getNgDirectiveDef(componentDefinition);\n const def = {\n ...baseDef,\n decls: componentDefinition.decls,\n vars: componentDefinition.vars,\n template: componentDefinition.template,\n consts: componentDefinition.consts || null,\n ngContentSelectors: componentDefinition.ngContentSelectors,\n onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,\n directiveDefs: null,\n // assigned in noSideEffects\n pipeDefs: null,\n // assigned in noSideEffects\n dependencies: baseDef.standalone && componentDefinition.dependencies || null,\n getStandaloneInjector: null,\n signals: componentDefinition.signals ?? false,\n data: componentDefinition.data || {},\n encapsulation: componentDefinition.encapsulation || ViewEncapsulation$1.Emulated,\n styles: componentDefinition.styles || EMPTY_ARRAY,\n _: null,\n schemas: componentDefinition.schemas || null,\n tView: null,\n id: ''\n };\n initFeatures(def);\n const dependencies = componentDefinition.dependencies;\n def.directiveDefs = extractDefListOrFactory(dependencies, /* pipeDef */false);\n def.pipeDefs = extractDefListOrFactory(dependencies, /* pipeDef */true);\n def.id = getComponentId(def);\n return def;\n });\n}\nfunction extractDirectiveDef(type) {\n return getComponentDef(type) || getDirectiveDef(type);\n}\nfunction nonNull(value) {\n return value !== null;\n}\n/**\n * @codeGenApi\n */\nfunction ɵɵdefineNgModule(def) {\n return noSideEffects(() => {\n const res = {\n type: def.type,\n bootstrap: def.bootstrap || EMPTY_ARRAY,\n declarations: def.declarations || EMPTY_ARRAY,\n imports: def.imports || EMPTY_ARRAY,\n exports: def.exports || EMPTY_ARRAY,\n transitiveCompileScopes: null,\n schemas: def.schemas || null,\n id: def.id || null\n };\n return res;\n });\n}\nfunction parseAndConvertBindingsForDefinition(obj, declaredInputs) {\n if (obj == null) return EMPTY_OBJ;\n const newLookup = {};\n for (const minifiedKey in obj) {\n if (obj.hasOwnProperty(minifiedKey)) {\n const value = obj[minifiedKey];\n let publicName;\n let declaredName;\n let inputFlags = InputFlags.None;\n if (Array.isArray(value)) {\n inputFlags = value[0];\n publicName = value[1];\n declaredName = value[2] ?? publicName; // declared name might not be set to save bytes.\n } else {\n publicName = value;\n declaredName = value;\n }\n // For inputs, capture the declared name, or if some flags are set.\n if (declaredInputs) {\n // Perf note: An array is only allocated for the input if there are flags.\n newLookup[publicName] = inputFlags !== InputFlags.None ? [minifiedKey, inputFlags] : minifiedKey;\n declaredInputs[publicName] = declaredName;\n } else {\n newLookup[publicName] = minifiedKey;\n }\n }\n }\n return newLookup;\n}\n/**\n * Create a directive definition object.\n *\n * # Example\n * ```ts\n * class MyDirective {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ɵdir = ɵɵdefineDirective({\n * ...\n * });\n * }\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵdefineDirective(directiveDefinition) {\n return noSideEffects(() => {\n const def = getNgDirectiveDef(directiveDefinition);\n initFeatures(def);\n return def;\n });\n}\n/**\n * Create a pipe definition object.\n *\n * # Example\n * ```\n * class MyPipe implements PipeTransform {\n * // Generated by Angular Template Compiler\n * static ɵpipe = definePipe({\n * ...\n * });\n * }\n * ```\n * @param pipeDef Pipe definition generated by the compiler\n *\n * @codeGenApi\n */\nfunction ɵɵdefinePipe(pipeDef) {\n return {\n type: pipeDef.type,\n name: pipeDef.name,\n factory: null,\n pure: pipeDef.pure !== false,\n standalone: pipeDef.standalone === true,\n onDestroy: pipeDef.type.prototype.ngOnDestroy || null\n };\n}\n/**\n * The following getter methods retrieve the definition from the type. Currently the retrieval\n * honors inheritance, but in the future we may change the rule to require that definitions are\n * explicit. This would require some sort of migration strategy.\n */\nfunction getComponentDef(type) {\n return type[NG_COMP_DEF] || null;\n}\nfunction getDirectiveDef(type) {\n return type[NG_DIR_DEF] || null;\n}\nfunction getPipeDef$1(type) {\n return type[NG_PIPE_DEF] || null;\n}\n/**\n * Checks whether a given Component, Directive or Pipe is marked as standalone.\n * This will return false if passed anything other than a Component, Directive, or Pipe class\n * See [this guide](guide/components/importing) for additional information:\n *\n * @param type A reference to a Component, Directive or Pipe.\n * @publicApi\n */\nfunction isStandalone(type) {\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);\n return def !== null ? def.standalone : false;\n}\nfunction getNgModuleDef(type, throwNotFound) {\n const ngModuleDef = type[NG_MOD_DEF] || null;\n if (!ngModuleDef && throwNotFound === true) {\n throw new Error(`Type ${stringify(type)} does not have 'ɵmod' property.`);\n }\n return ngModuleDef;\n}\nfunction getNgDirectiveDef(directiveDefinition) {\n const declaredInputs = {};\n return {\n type: directiveDefinition.type,\n providersResolver: null,\n factory: null,\n hostBindings: directiveDefinition.hostBindings || null,\n hostVars: directiveDefinition.hostVars || 0,\n hostAttrs: directiveDefinition.hostAttrs || null,\n contentQueries: directiveDefinition.contentQueries || null,\n declaredInputs: declaredInputs,\n inputTransforms: null,\n inputConfig: directiveDefinition.inputs || EMPTY_OBJ,\n exportAs: directiveDefinition.exportAs || null,\n standalone: directiveDefinition.standalone === true,\n signals: directiveDefinition.signals === true,\n selectors: directiveDefinition.selectors || EMPTY_ARRAY,\n viewQuery: directiveDefinition.viewQuery || null,\n features: directiveDefinition.features || null,\n setInput: null,\n findHostDirectiveDefs: null,\n hostDirectives: null,\n inputs: parseAndConvertBindingsForDefinition(directiveDefinition.inputs, declaredInputs),\n outputs: parseAndConvertBindingsForDefinition(directiveDefinition.outputs),\n debugInfo: null\n };\n}\nfunction initFeatures(definition) {\n definition.features?.forEach(fn => fn(definition));\n}\nfunction extractDefListOrFactory(dependencies, pipeDef) {\n if (!dependencies) {\n return null;\n }\n const defExtractor = pipeDef ? getPipeDef$1 : extractDirectiveDef;\n return () => (typeof dependencies === 'function' ? dependencies() : dependencies).map(dep => defExtractor(dep)).filter(nonNull);\n}\n/**\n * A map that contains the generated component IDs and type.\n */\nconst GENERATED_COMP_IDS = new Map();\n/**\n * A method can returns a component ID from the component definition using a variant of DJB2 hash\n * algorithm.\n */\nfunction getComponentId(componentDef) {\n let hash = 0;\n // We cannot rely solely on the component selector as the same selector can be used in different\n // modules.\n //\n // `componentDef.style` is not used, due to it causing inconsistencies. Ex: when server\n // component styles has no sourcemaps and browsers do.\n //\n // Example:\n // https://github.com/angular/components/blob/d9f82c8f95309e77a6d82fd574c65871e91354c2/src/material/core/option/option.ts#L248\n // https://github.com/angular/components/blob/285f46dc2b4c5b127d356cb7c4714b221f03ce50/src/material/legacy-core/option/option.ts#L32\n const hashSelectors = [componentDef.selectors, componentDef.ngContentSelectors, componentDef.hostVars, componentDef.hostAttrs, componentDef.consts, componentDef.vars, componentDef.decls, componentDef.encapsulation, componentDef.standalone, componentDef.signals, componentDef.exportAs, JSON.stringify(componentDef.inputs), JSON.stringify(componentDef.outputs),\n // We cannot use 'componentDef.type.name' as the name of the symbol will change and will not\n // match in the server and browser bundles.\n Object.getOwnPropertyNames(componentDef.type.prototype), !!componentDef.contentQueries, !!componentDef.viewQuery].join('|');\n for (const char of hashSelectors) {\n hash = Math.imul(31, hash) + char.charCodeAt(0) << 0;\n }\n // Force positive number hash.\n // 2147483647 = equivalent of Integer.MAX_VALUE.\n hash += 2147483647 + 1;\n const compId = 'c' + hash;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (GENERATED_COMP_IDS.has(compId)) {\n const previousCompDefType = GENERATED_COMP_IDS.get(compId);\n if (previousCompDefType !== componentDef.type) {\n console.warn(formatRuntimeError(-912 /* RuntimeErrorCode.COMPONENT_ID_COLLISION */, `Component ID generation collision detected. Components '${previousCompDefType.name}' and '${componentDef.type.name}' with selector '${stringifyCSSSelectorList(componentDef.selectors)}' generated the same component ID. To fix this, you can change the selector of one of those components or add an extra host attribute to force a different ID.`));\n }\n } else {\n GENERATED_COMP_IDS.set(compId, componentDef.type);\n }\n }\n return compId;\n}\n\n/**\n * Wrap an array of `Provider`s into `EnvironmentProviders`, preventing them from being accidentally\n * referenced in `@Component` in a component injector.\n */\nfunction makeEnvironmentProviders(providers) {\n return {\n ɵproviders: providers\n };\n}\n/**\n * Collects providers from all NgModules and standalone components, including transitively imported\n * ones.\n *\n * Providers extracted via `importProvidersFrom` are only usable in an application injector or\n * another environment injector (such as a route injector). They should not be used in component\n * providers.\n *\n * More information about standalone components can be found in [this\n * guide](guide/components/importing).\n *\n * @usageNotes\n * The results of the `importProvidersFrom` call can be used in the `bootstrapApplication` call:\n *\n * ```typescript\n * await bootstrapApplication(RootComponent, {\n * providers: [\n * importProvidersFrom(NgModuleOne, NgModuleTwo)\n * ]\n * });\n * ```\n *\n * You can also use the `importProvidersFrom` results in the `providers` field of a route, when a\n * standalone component is used:\n *\n * ```typescript\n * export const ROUTES: Route[] = [\n * {\n * path: 'foo',\n * providers: [\n * importProvidersFrom(NgModuleOne, NgModuleTwo)\n * ],\n * component: YourStandaloneComponent\n * }\n * ];\n * ```\n *\n * @returns Collected providers from the specified list of types.\n * @publicApi\n */\nfunction importProvidersFrom(...sources) {\n return {\n ɵproviders: internalImportProvidersFrom(true, sources),\n ɵfromNgModule: true\n };\n}\nfunction internalImportProvidersFrom(checkForStandaloneCmp, ...sources) {\n const providersOut = [];\n const dedup = new Set(); // already seen types\n let injectorTypesWithProviders;\n const collectProviders = provider => {\n providersOut.push(provider);\n };\n deepForEach(sources, source => {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && checkForStandaloneCmp) {\n const cmpDef = getComponentDef(source);\n if (cmpDef?.standalone) {\n throw new RuntimeError(800 /* RuntimeErrorCode.IMPORT_PROVIDERS_FROM_STANDALONE */, `Importing providers supports NgModule or ModuleWithProviders but got a standalone component \"${stringifyForError(source)}\"`);\n }\n }\n // Narrow `source` to access the internal type analogue for `ModuleWithProviders`.\n const internalSource = source;\n if (walkProviderTree(internalSource, collectProviders, [], dedup)) {\n injectorTypesWithProviders ||= [];\n injectorTypesWithProviders.push(internalSource);\n }\n });\n // Collect all providers from `ModuleWithProviders` types.\n if (injectorTypesWithProviders !== undefined) {\n processInjectorTypesWithProviders(injectorTypesWithProviders, collectProviders);\n }\n return providersOut;\n}\n/**\n * Collects all providers from the list of `ModuleWithProviders` and appends them to the provided\n * array.\n */\nfunction processInjectorTypesWithProviders(typesWithProviders, visitor) {\n for (let i = 0; i < typesWithProviders.length; i++) {\n const {\n ngModule,\n providers\n } = typesWithProviders[i];\n deepForEachProvider(providers, provider => {\n ngDevMode && validateProvider(provider, providers || EMPTY_ARRAY, ngModule);\n visitor(provider, ngModule);\n });\n }\n}\n/**\n * The logic visits an `InjectorType`, an `InjectorTypeWithProviders`, or a standalone\n * `ComponentType`, and all of its transitive providers and collects providers.\n *\n * If an `InjectorTypeWithProviders` that declares providers besides the type is specified,\n * the function will return \"true\" to indicate that the providers of the type definition need\n * to be processed. This allows us to process providers of injector types after all imports of\n * an injector definition are processed. (following View Engine semantics: see FW-1349)\n */\nfunction walkProviderTree(container, visitor, parents, dedup) {\n container = resolveForwardRef(container);\n if (!container) return false;\n // The actual type which had the definition. Usually `container`, but may be an unwrapped type\n // from `InjectorTypeWithProviders`.\n let defType = null;\n let injDef = getInjectorDef(container);\n const cmpDef = !injDef && getComponentDef(container);\n if (!injDef && !cmpDef) {\n // `container` is not an injector type or a component type. It might be:\n // * An `InjectorTypeWithProviders` that wraps an injector type.\n // * A standalone directive or pipe that got pulled in from a standalone component's\n // dependencies.\n // Try to unwrap it as an `InjectorTypeWithProviders` first.\n const ngModule = container.ngModule;\n injDef = getInjectorDef(ngModule);\n if (injDef) {\n defType = ngModule;\n } else {\n // Not a component or injector type, so ignore it.\n return false;\n }\n } else if (cmpDef && !cmpDef.standalone) {\n return false;\n } else {\n defType = container;\n }\n // Check for circular dependencies.\n if (ngDevMode && parents.indexOf(defType) !== -1) {\n const defName = stringify(defType);\n const path = parents.map(stringify);\n throwCyclicDependencyError(defName, path);\n }\n // Check for multiple imports of the same module\n const isDuplicate = dedup.has(defType);\n if (cmpDef) {\n if (isDuplicate) {\n // This component definition has already been processed.\n return false;\n }\n dedup.add(defType);\n if (cmpDef.dependencies) {\n const deps = typeof cmpDef.dependencies === 'function' ? cmpDef.dependencies() : cmpDef.dependencies;\n for (const dep of deps) {\n walkProviderTree(dep, visitor, parents, dedup);\n }\n }\n } else if (injDef) {\n // First, include providers from any imports.\n if (injDef.imports != null && !isDuplicate) {\n // Before processing defType's imports, add it to the set of parents. This way, if it ends\n // up deeply importing itself, this can be detected.\n ngDevMode && parents.push(defType);\n // Add it to the set of dedups. This way we can detect multiple imports of the same module\n dedup.add(defType);\n let importTypesWithProviders;\n try {\n deepForEach(injDef.imports, imported => {\n if (walkProviderTree(imported, visitor, parents, dedup)) {\n importTypesWithProviders ||= [];\n // If the processed import is an injector type with providers, we store it in the\n // list of import types with providers, so that we can process those afterwards.\n importTypesWithProviders.push(imported);\n }\n });\n } finally {\n // Remove it from the parents set when finished.\n ngDevMode && parents.pop();\n }\n // Imports which are declared with providers (TypeWithProviders) need to be processed\n // after all imported modules are processed. This is similar to how View Engine\n // processes/merges module imports in the metadata resolver. See: FW-1349.\n if (importTypesWithProviders !== undefined) {\n processInjectorTypesWithProviders(importTypesWithProviders, visitor);\n }\n }\n if (!isDuplicate) {\n // Track the InjectorType and add a provider for it.\n // It's important that this is done after the def's imports.\n const factory = getFactoryDef(defType) || (() => new defType());\n // Append extra providers to make more info available for consumers (to retrieve an injector\n // type), as well as internally (to calculate an injection scope correctly and eagerly\n // instantiate a `defType` when an injector is created).\n // Provider to create `defType` using its factory.\n visitor({\n provide: defType,\n useFactory: factory,\n deps: EMPTY_ARRAY\n }, defType);\n // Make this `defType` available to an internal logic that calculates injector scope.\n visitor({\n provide: INJECTOR_DEF_TYPES,\n useValue: defType,\n multi: true\n }, defType);\n // Provider to eagerly instantiate `defType` via `INJECTOR_INITIALIZER`.\n visitor({\n provide: ENVIRONMENT_INITIALIZER,\n useValue: () => ɵɵinject(defType),\n multi: true\n }, defType);\n }\n // Next, include providers listed on the definition itself.\n const defProviders = injDef.providers;\n if (defProviders != null && !isDuplicate) {\n const injectorType = container;\n deepForEachProvider(defProviders, provider => {\n ngDevMode && validateProvider(provider, defProviders, injectorType);\n visitor(provider, injectorType);\n });\n }\n } else {\n // Should not happen, but just in case.\n return false;\n }\n return defType !== container && container.providers !== undefined;\n}\nfunction validateProvider(provider, providers, containerType) {\n if (isTypeProvider(provider) || isValueProvider(provider) || isFactoryProvider(provider) || isExistingProvider(provider)) {\n return;\n }\n // Here we expect the provider to be a `useClass` provider (by elimination).\n const classRef = resolveForwardRef(provider && (provider.useClass || provider.provide));\n if (!classRef) {\n throwInvalidProviderError(containerType, providers, provider);\n }\n}\nfunction deepForEachProvider(providers, fn) {\n for (let provider of providers) {\n if (isEnvironmentProviders(provider)) {\n provider = provider.ɵproviders;\n }\n if (Array.isArray(provider)) {\n deepForEachProvider(provider, fn);\n } else {\n fn(provider);\n }\n }\n}\nconst USE_VALUE$1 = getClosureSafeProperty({\n provide: String,\n useValue: getClosureSafeProperty\n});\nfunction isValueProvider(value) {\n return value !== null && typeof value == 'object' && USE_VALUE$1 in value;\n}\nfunction isExistingProvider(value) {\n return !!(value && value.useExisting);\n}\nfunction isFactoryProvider(value) {\n return !!(value && value.useFactory);\n}\nfunction isTypeProvider(value) {\n return typeof value === 'function';\n}\nfunction isClassProvider(value) {\n return !!value.useClass;\n}\n\n/**\n * An internal token whose presence in an injector indicates that the injector should treat itself\n * as a root scoped injector when processing requests for unknown tokens which may indicate\n * they are provided in the root scope.\n */\nconst INJECTOR_SCOPE = new InjectionToken(ngDevMode ? 'Set Injector scope.' : '');\n\n/**\n * Marker which indicates that a value has not yet been created from the factory function.\n */\nconst NOT_YET = {};\n/**\n * Marker which indicates that the factory function for a token is in the process of being called.\n *\n * If the injector is asked to inject a token with its value set to CIRCULAR, that indicates\n * injection of a dependency has recursively attempted to inject the original token, and there is\n * a circular dependency among the providers.\n */\nconst CIRCULAR = {};\n/**\n * A lazily initialized NullInjector.\n */\nlet NULL_INJECTOR = undefined;\nfunction getNullInjector() {\n if (NULL_INJECTOR === undefined) {\n NULL_INJECTOR = new NullInjector();\n }\n return NULL_INJECTOR;\n}\n/**\n * An `Injector` that's part of the environment injector hierarchy, which exists outside of the\n * component tree.\n */\nclass EnvironmentInjector {}\nclass R3Injector extends EnvironmentInjector {\n /**\n * Flag indicating that this injector was previously destroyed.\n */\n get destroyed() {\n return this._destroyed;\n }\n constructor(providers, parent, source, scopes) {\n super();\n this.parent = parent;\n this.source = source;\n this.scopes = scopes;\n /**\n * Map of tokens to records which contain the instances of those tokens.\n * - `null` value implies that we don't have the record. Used by tree-shakable injectors\n * to prevent further searches.\n */\n this.records = new Map();\n /**\n * Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.\n */\n this._ngOnDestroyHooks = new Set();\n this._onDestroyHooks = [];\n this._destroyed = false;\n // Start off by creating Records for every provider.\n forEachSingleProvider(providers, provider => this.processProvider(provider));\n // Make sure the INJECTOR token provides this injector.\n this.records.set(INJECTOR$1, makeRecord(undefined, this));\n // And `EnvironmentInjector` if the current injector is supposed to be env-scoped.\n if (scopes.has('environment')) {\n this.records.set(EnvironmentInjector, makeRecord(undefined, this));\n }\n // Detect whether this injector has the APP_ROOT_SCOPE token and thus should provide\n // any injectable scoped to APP_ROOT_SCOPE.\n const record = this.records.get(INJECTOR_SCOPE);\n if (record != null && typeof record.value === 'string') {\n this.scopes.add(record.value);\n }\n this.injectorDefTypes = new Set(this.get(INJECTOR_DEF_TYPES, EMPTY_ARRAY, InjectFlags.Self));\n }\n /**\n * Destroy the injector and release references to every instance or provider associated with it.\n *\n * Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a\n * hook was found.\n */\n destroy() {\n this.assertNotDestroyed();\n // Set destroyed = true first, in case lifecycle hooks re-enter destroy().\n this._destroyed = true;\n const prevConsumer = setActiveConsumer$1(null);\n try {\n // Call all the lifecycle hooks.\n for (const service of this._ngOnDestroyHooks) {\n service.ngOnDestroy();\n }\n const onDestroyHooks = this._onDestroyHooks;\n // Reset the _onDestroyHooks array before iterating over it to prevent hooks that unregister\n // themselves from mutating the array during iteration.\n this._onDestroyHooks = [];\n for (const hook of onDestroyHooks) {\n hook();\n }\n } finally {\n // Release all references.\n this.records.clear();\n this._ngOnDestroyHooks.clear();\n this.injectorDefTypes.clear();\n setActiveConsumer$1(prevConsumer);\n }\n }\n onDestroy(callback) {\n this.assertNotDestroyed();\n this._onDestroyHooks.push(callback);\n return () => this.removeOnDestroy(callback);\n }\n runInContext(fn) {\n this.assertNotDestroyed();\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n let prevInjectContext;\n if (ngDevMode) {\n prevInjectContext = setInjectorProfilerContext({\n injector: this,\n token: null\n });\n }\n try {\n return fn();\n } finally {\n setCurrentInjector(previousInjector);\n setInjectImplementation(previousInjectImplementation);\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n }\n }\n get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {\n this.assertNotDestroyed();\n if (token.hasOwnProperty(NG_ENV_ID)) {\n return token[NG_ENV_ID](this);\n }\n flags = convertToBitFlags(flags);\n // Set the injection context.\n let prevInjectContext;\n if (ngDevMode) {\n prevInjectContext = setInjectorProfilerContext({\n injector: this,\n token: token\n });\n }\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n // Check for the SkipSelf flag.\n if (!(flags & InjectFlags.SkipSelf)) {\n // SkipSelf isn't set, check if the record belongs to this injector.\n let record = this.records.get(token);\n if (record === undefined) {\n // No record, but maybe the token is scoped to this injector. Look for an injectable\n // def with a scope matching this injector.\n const def = couldBeInjectableType(token) && getInjectableDef(token);\n if (def && this.injectableDefInScope(def)) {\n // Found an injectable def and it's scoped to this injector. Pretend as if it was here\n // all along.\n if (ngDevMode) {\n runInInjectorProfilerContext(this, token, () => {\n emitProviderConfiguredEvent(token);\n });\n }\n record = makeRecord(injectableDefOrInjectorDefFactory(token), NOT_YET);\n } else {\n record = null;\n }\n this.records.set(token, record);\n }\n // If a record was found, get the instance for it and return it.\n if (record != null /* NOT null || undefined */) {\n return this.hydrate(token, record);\n }\n }\n // Select the next injector based on the Self flag - if self is set, the next injector is\n // the NullInjector, otherwise it's the parent.\n const nextInjector = !(flags & InjectFlags.Self) ? this.parent : getNullInjector();\n // Set the notFoundValue based on the Optional flag - if optional is set and notFoundValue\n // is undefined, the value is null, otherwise it's the notFoundValue.\n notFoundValue = flags & InjectFlags.Optional && notFoundValue === THROW_IF_NOT_FOUND ? null : notFoundValue;\n return nextInjector.get(token, notFoundValue);\n } catch (e) {\n if (e.name === 'NullInjectorError') {\n const path = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || [];\n path.unshift(stringify(token));\n if (previousInjector) {\n // We still have a parent injector, keep throwing\n throw e;\n } else {\n // Format & throw the final error message when we don't have any previous injector\n return catchInjectorError(e, token, 'R3InjectorError', this.source);\n }\n } else {\n throw e;\n }\n } finally {\n // Lastly, restore the previous injection context.\n setInjectImplementation(previousInjectImplementation);\n setCurrentInjector(previousInjector);\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n }\n }\n /** @internal */\n resolveInjectorInitializers() {\n const prevConsumer = setActiveConsumer$1(null);\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n let prevInjectContext;\n if (ngDevMode) {\n prevInjectContext = setInjectorProfilerContext({\n injector: this,\n token: null\n });\n }\n try {\n const initializers = this.get(ENVIRONMENT_INITIALIZER, EMPTY_ARRAY, InjectFlags.Self);\n if (ngDevMode && !Array.isArray(initializers)) {\n throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `ENVIRONMENT_INITIALIZER` token value ' + `(expected an array, but got ${typeof initializers}). ` + 'Please check that the `ENVIRONMENT_INITIALIZER` token is configured as a ' + '`multi: true` provider.');\n }\n for (const initializer of initializers) {\n initializer();\n }\n } finally {\n setCurrentInjector(previousInjector);\n setInjectImplementation(previousInjectImplementation);\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n setActiveConsumer$1(prevConsumer);\n }\n }\n toString() {\n const tokens = [];\n const records = this.records;\n for (const token of records.keys()) {\n tokens.push(stringify(token));\n }\n return `R3Injector[${tokens.join(', ')}]`;\n }\n assertNotDestroyed() {\n if (this._destroyed) {\n throw new RuntimeError(205 /* RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED */, ngDevMode && 'Injector has already been destroyed.');\n }\n }\n /**\n * Process a `SingleProvider` and add it.\n */\n processProvider(provider) {\n // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n // property.\n provider = resolveForwardRef(provider);\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);\n // Construct a `Record` for the provider.\n const record = providerToRecord(provider);\n if (ngDevMode) {\n runInInjectorProfilerContext(this, token, () => {\n // Emit InjectorProfilerEventType.Create if provider is a value provider because\n // these are the only providers that do not go through the value hydration logic\n // where this event would normally be emitted from.\n if (isValueProvider(provider)) {\n emitInstanceCreatedByInjectorEvent(provider.useValue);\n }\n emitProviderConfiguredEvent(provider);\n });\n }\n if (!isTypeProvider(provider) && provider.multi === true) {\n // If the provider indicates that it's a multi-provider, process it specially.\n // First check whether it's been defined already.\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n // It has. Throw a nice error if\n if (ngDevMode && multiRecord.multi === undefined) {\n throwMixedMultiProviderError();\n }\n } else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord.multi);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi.push(provider);\n } else {\n if (ngDevMode) {\n const existing = this.records.get(token);\n if (existing && existing.multi !== undefined) {\n throwMixedMultiProviderError();\n }\n }\n }\n this.records.set(token, record);\n }\n hydrate(token, record) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n if (ngDevMode && record.value === CIRCULAR) {\n throwCyclicDependencyError(stringify(token));\n } else if (record.value === NOT_YET) {\n record.value = CIRCULAR;\n if (ngDevMode) {\n runInInjectorProfilerContext(this, token, () => {\n record.value = record.factory();\n emitInstanceCreatedByInjectorEvent(record.value);\n });\n } else {\n record.value = record.factory();\n }\n }\n if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {\n this._ngOnDestroyHooks.add(record.value);\n }\n return record.value;\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n injectableDefInScope(def) {\n if (!def.providedIn) {\n return false;\n }\n const providedIn = resolveForwardRef(def.providedIn);\n if (typeof providedIn === 'string') {\n return providedIn === 'any' || this.scopes.has(providedIn);\n } else {\n return this.injectorDefTypes.has(providedIn);\n }\n }\n removeOnDestroy(callback) {\n const destroyCBIdx = this._onDestroyHooks.indexOf(callback);\n if (destroyCBIdx !== -1) {\n this._onDestroyHooks.splice(destroyCBIdx, 1);\n }\n }\n}\nfunction injectableDefOrInjectorDefFactory(token) {\n // Most tokens will have an injectable def directly on them, which specifies a factory directly.\n const injectableDef = getInjectableDef(token);\n const factory = injectableDef !== null ? injectableDef.factory : getFactoryDef(token);\n if (factory !== null) {\n return factory;\n }\n // InjectionTokens should have an injectable def (ɵprov) and thus should be handled above.\n // If it's missing that, it's an error.\n if (token instanceof InjectionToken) {\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Token ${stringify(token)} is missing a ɵprov definition.`);\n }\n // Undecorated types can sometimes be created if they have no constructor arguments.\n if (token instanceof Function) {\n return getUndecoratedInjectableFactory(token);\n }\n // There was no way to resolve a factory for this token.\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && 'unreachable');\n}\nfunction getUndecoratedInjectableFactory(token) {\n // If the token has parameters then it has dependencies that we cannot resolve implicitly.\n const paramLength = token.length;\n if (paramLength > 0) {\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Can't resolve all parameters for ${stringify(token)}: (${newArray(paramLength, '?').join(', ')}).`);\n }\n // The constructor function appears to have no parameters.\n // This might be because it inherits from a super-class. In which case, use an injectable\n // def from an ancestor if there is one.\n // Otherwise this really is a simple class with no dependencies, so return a factory that\n // just instantiates the zero-arg constructor.\n const inheritedInjectableDef = getInheritedInjectableDef(token);\n if (inheritedInjectableDef !== null) {\n return () => inheritedInjectableDef.factory(token);\n } else {\n return () => new token();\n }\n}\nfunction providerToRecord(provider) {\n if (isValueProvider(provider)) {\n return makeRecord(undefined, provider.useValue);\n } else {\n const factory = providerToFactory(provider);\n return makeRecord(factory, NOT_YET);\n }\n}\n/**\n * Converts a `SingleProvider` into a factory function.\n *\n * @param provider provider to convert to factory\n */\nfunction providerToFactory(provider, ngModuleType, providers) {\n let factory = undefined;\n if (ngDevMode && isEnvironmentProviders(provider)) {\n throwInvalidProviderError(undefined, providers, provider);\n }\n if (isTypeProvider(provider)) {\n const unwrappedProvider = resolveForwardRef(provider);\n return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);\n } else {\n if (isValueProvider(provider)) {\n factory = () => resolveForwardRef(provider.useValue);\n } else if (isFactoryProvider(provider)) {\n factory = () => provider.useFactory(...injectArgs(provider.deps || []));\n } else if (isExistingProvider(provider)) {\n factory = () => ɵɵinject(resolveForwardRef(provider.useExisting));\n } else {\n const classRef = resolveForwardRef(provider && (provider.useClass || provider.provide));\n if (ngDevMode && !classRef) {\n throwInvalidProviderError(ngModuleType, providers, provider);\n }\n if (hasDeps(provider)) {\n factory = () => new classRef(...injectArgs(provider.deps));\n } else {\n return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef);\n }\n }\n }\n return factory;\n}\nfunction makeRecord(factory, value, multi = false) {\n return {\n factory: factory,\n value: value,\n multi: multi ? [] : undefined\n };\n}\nfunction hasDeps(value) {\n return !!value.deps;\n}\nfunction hasOnDestroy(value) {\n return value !== null && typeof value === 'object' && typeof value.ngOnDestroy === 'function';\n}\nfunction couldBeInjectableType(value) {\n return typeof value === 'function' || typeof value === 'object' && value instanceof InjectionToken;\n}\nfunction forEachSingleProvider(providers, fn) {\n for (const provider of providers) {\n if (Array.isArray(provider)) {\n forEachSingleProvider(provider, fn);\n } else if (provider && isEnvironmentProviders(provider)) {\n forEachSingleProvider(provider.ɵproviders, fn);\n } else {\n fn(provider);\n }\n }\n}\n\n/**\n * Runs the given function in the [context](guide/di/dependency-injection-context) of the given\n * `Injector`.\n *\n * Within the function's stack frame, [`inject`](api/core/inject) can be used to inject dependencies\n * from the given `Injector`. Note that `inject` is only usable synchronously, and cannot be used in\n * any asynchronous callbacks or after any `await` points.\n *\n * @param injector the injector which will satisfy calls to [`inject`](api/core/inject) while `fn`\n * is executing\n * @param fn the closure to be run in the context of `injector`\n * @returns the return value of the function, if any\n * @publicApi\n */\nfunction runInInjectionContext(injector, fn) {\n if (injector instanceof R3Injector) {\n injector.assertNotDestroyed();\n }\n let prevInjectorProfilerContext;\n if (ngDevMode) {\n prevInjectorProfilerContext = setInjectorProfilerContext({\n injector,\n token: null\n });\n }\n const prevInjector = setCurrentInjector(injector);\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n return fn();\n } finally {\n setCurrentInjector(prevInjector);\n ngDevMode && setInjectorProfilerContext(prevInjectorProfilerContext);\n setInjectImplementation(previousInjectImplementation);\n }\n}\n/**\n * Whether the current stack frame is inside an injection context.\n */\nfunction isInInjectionContext() {\n return getInjectImplementation() !== undefined || getCurrentInjector() != null;\n}\n/**\n * Asserts that the current stack frame is within an [injection\n * context](guide/di/dependency-injection-context) and has access to `inject`.\n *\n * @param debugFn a reference to the function making the assertion (used for the error message).\n *\n * @publicApi\n */\nfunction assertInInjectionContext(debugFn) {\n // Taking a `Function` instead of a string name here prevents the unminified name of the function\n // from being retained in the bundle regardless of minification.\n if (!isInInjectionContext()) {\n throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode && debugFn.name + '() can only be used within an injection context such as a constructor, a factory function, a field initializer, or a function used with `runInInjectionContext`');\n }\n}\nvar FactoryTarget;\n(function (FactoryTarget) {\n FactoryTarget[FactoryTarget[\"Directive\"] = 0] = \"Directive\";\n FactoryTarget[FactoryTarget[\"Component\"] = 1] = \"Component\";\n FactoryTarget[FactoryTarget[\"Injectable\"] = 2] = \"Injectable\";\n FactoryTarget[FactoryTarget[\"Pipe\"] = 3] = \"Pipe\";\n FactoryTarget[FactoryTarget[\"NgModule\"] = 4] = \"NgModule\";\n})(FactoryTarget || (FactoryTarget = {}));\nvar R3TemplateDependencyKind;\n(function (R3TemplateDependencyKind) {\n R3TemplateDependencyKind[R3TemplateDependencyKind[\"Directive\"] = 0] = \"Directive\";\n R3TemplateDependencyKind[R3TemplateDependencyKind[\"Pipe\"] = 1] = \"Pipe\";\n R3TemplateDependencyKind[R3TemplateDependencyKind[\"NgModule\"] = 2] = \"NgModule\";\n})(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));\nvar ViewEncapsulation;\n(function (ViewEncapsulation) {\n ViewEncapsulation[ViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n ViewEncapsulation[ViewEncapsulation[\"None\"] = 2] = \"None\";\n ViewEncapsulation[ViewEncapsulation[\"ShadowDom\"] = 3] = \"ShadowDom\";\n})(ViewEncapsulation || (ViewEncapsulation = {}));\nfunction getCompilerFacade(request) {\n const globalNg = _global['ng'];\n if (globalNg && globalNg.ɵcompilerFacade) {\n return globalNg.ɵcompilerFacade;\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Log the type as an error so that a developer can easily navigate to the type from the\n // console.\n console.error(`JIT compilation failed for ${request.kind}`, request.type);\n let message = `The ${request.kind} '${request.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\\n\\n`;\n if (request.usage === 1 /* JitCompilerUsage.PartialDeclaration */) {\n message += `The ${request.kind} is part of a library that has been partially compiled.\\n`;\n message += `However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\\n`;\n message += '\\n';\n message += `Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\\n`;\n } else {\n message += `JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\\n`;\n }\n message += `Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\\n`;\n message += `or manually provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.`;\n throw new Error(message);\n } else {\n throw new Error('JIT compiler unavailable');\n }\n}\n\n/**\n * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.\n *\n * This should be kept up to date with the public exports of @angular/core.\n */\nconst angularCoreDiEnv = {\n 'ɵɵdefineInjectable': ɵɵdefineInjectable,\n 'ɵɵdefineInjector': ɵɵdefineInjector,\n 'ɵɵinject': ɵɵinject,\n 'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,\n 'resolveForwardRef': resolveForwardRef\n};\n\n/**\n * @description\n *\n * Represents a type that a Component or other object is instances of.\n *\n * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is represented by\n * the `MyCustomComponent` constructor function.\n *\n * @publicApi\n */\nconst Type = Function;\nfunction isType(v) {\n return typeof v === 'function';\n}\n\n/*\n * #########################\n * Attention: These Regular expressions have to hold even if the code is minified!\n * ##########################\n */\n/**\n * Regular expression that detects pass-through constructors for ES5 output. This Regex\n * intends to capture the common delegation pattern emitted by TypeScript and Babel. Also\n * it intends to capture the pattern where existing constructors have been downleveled from\n * ES2015 to ES5 using TypeScript w/ downlevel iteration. e.g.\n *\n * ```\n * function MyClass() {\n * var _this = _super.apply(this, arguments) || this;\n * ```\n *\n * downleveled to ES5 with `downlevelIteration` for TypeScript < 4.2:\n * ```\n * function MyClass() {\n * var _this = _super.apply(this, __spread(arguments)) || this;\n * ```\n *\n * or downleveled to ES5 with `downlevelIteration` for TypeScript >= 4.2:\n * ```\n * function MyClass() {\n * var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;\n * ```\n *\n * More details can be found in: https://github.com/angular/angular/issues/38453.\n */\nconst ES5_DELEGATE_CTOR = /^function\\s+\\S+\\(\\)\\s*{[\\s\\S]+\\.apply\\(this,\\s*(arguments|(?:[^()]+\\(\\[\\],)?[^()]+\\(arguments\\).*)\\)/;\n/** Regular expression that detects ES2015 classes which extend from other classes. */\nconst ES2015_INHERITED_CLASS = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{/;\n/**\n * Regular expression that detects ES2015 classes which extend from other classes and\n * have an explicit constructor defined.\n */\nconst ES2015_INHERITED_CLASS_WITH_CTOR = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(/;\n/**\n * Regular expression that detects ES2015 classes which extend from other classes\n * and inherit a constructor.\n */\nconst ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(\\)\\s*{[^}]*super\\(\\.\\.\\.arguments\\)/;\n/**\n * Determine whether a stringified type is a class which delegates its constructor\n * to its parent.\n *\n * This is not trivial since compiled code can actually contain a constructor function\n * even if the original source code did not. For instance, when the child class contains\n * an initialized instance property.\n */\nfunction isDelegateCtor(typeStr) {\n return ES5_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr);\n}\nclass ReflectionCapabilities {\n constructor(reflect) {\n this._reflect = reflect || _global['Reflect'];\n }\n factory(t) {\n return (...args) => new t(...args);\n }\n /** @internal */\n _zipTypesAndAnnotations(paramTypes, paramAnnotations) {\n let result;\n if (typeof paramTypes === 'undefined') {\n result = newArray(paramAnnotations.length);\n } else {\n result = newArray(paramTypes.length);\n }\n for (let i = 0; i < result.length; i++) {\n // TS outputs Object for parameters without types, while Traceur omits\n // the annotations. For now we preserve the Traceur behavior to aid\n // migration, but this can be revisited.\n if (typeof paramTypes === 'undefined') {\n result[i] = [];\n } else if (paramTypes[i] && paramTypes[i] != Object) {\n result[i] = [paramTypes[i]];\n } else {\n result[i] = [];\n }\n if (paramAnnotations && paramAnnotations[i] != null) {\n result[i] = result[i].concat(paramAnnotations[i]);\n }\n }\n return result;\n }\n _ownParameters(type, parentCtor) {\n const typeStr = type.toString();\n // If we have no decorators, we only have function.length as metadata.\n // In that case, to detect whether a child class declared an own constructor or not,\n // we need to look inside of that constructor to check whether it is\n // just calling the parent.\n // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439\n // that sets 'design:paramtypes' to []\n // if a class inherits from another class but has no ctor declared itself.\n if (isDelegateCtor(typeStr)) {\n return null;\n }\n // Prefer the direct API.\n if (type.parameters && type.parameters !== parentCtor.parameters) {\n return type.parameters;\n }\n // API of tsickle for lowering decorators to properties on the class.\n const tsickleCtorParams = type.ctorParameters;\n if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {\n // Newer tsickle uses a function closure\n // Retain the non-function case for compatibility with older tsickle\n const ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;\n const paramTypes = ctorParameters.map(ctorParam => ctorParam && ctorParam.type);\n const paramAnnotations = ctorParameters.map(ctorParam => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n // API for metadata created by invoking the decorators.\n const paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS];\n const paramTypes = this._reflect && this._reflect.getOwnMetadata && this._reflect.getOwnMetadata('design:paramtypes', type);\n if (paramTypes || paramAnnotations) {\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n // If a class has no decorators, at least create metadata\n // based on function.length.\n // Note: We know that this is a real constructor as we checked\n // the content of the constructor above.\n return newArray(type.length);\n }\n parameters(type) {\n // Note: only report metadata if we have at least one class decorator\n // to stay in sync with the static reflector.\n if (!isType(type)) {\n return [];\n }\n const parentCtor = getParentCtor(type);\n let parameters = this._ownParameters(type, parentCtor);\n if (!parameters && parentCtor !== Object) {\n parameters = this.parameters(parentCtor);\n }\n return parameters || [];\n }\n _ownAnnotations(typeOrFunc, parentCtor) {\n // Prefer the direct API.\n if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) {\n let annotations = typeOrFunc.annotations;\n if (typeof annotations === 'function' && annotations.annotations) {\n annotations = annotations.annotations;\n }\n return annotations;\n }\n // API of tsickle for lowering decorators to properties on the class.\n if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) {\n return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators);\n }\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {\n return typeOrFunc[ANNOTATIONS];\n }\n return null;\n }\n annotations(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return [];\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];\n const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];\n return parentAnnotations.concat(ownAnnotations);\n }\n _ownPropMetadata(typeOrFunc, parentCtor) {\n // Prefer the direct API.\n if (typeOrFunc.propMetadata && typeOrFunc.propMetadata !== parentCtor.propMetadata) {\n let propMetadata = typeOrFunc.propMetadata;\n if (typeof propMetadata === 'function' && propMetadata.propMetadata) {\n propMetadata = propMetadata.propMetadata;\n }\n return propMetadata;\n }\n // API of tsickle for lowering decorators to properties on the class.\n if (typeOrFunc.propDecorators && typeOrFunc.propDecorators !== parentCtor.propDecorators) {\n const propDecorators = typeOrFunc.propDecorators;\n const propMetadata = {};\n Object.keys(propDecorators).forEach(prop => {\n propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);\n });\n return propMetadata;\n }\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {\n return typeOrFunc[PROP_METADATA];\n }\n return null;\n }\n propMetadata(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return {};\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const propMetadata = {};\n if (parentCtor !== Object) {\n const parentPropMetadata = this.propMetadata(parentCtor);\n Object.keys(parentPropMetadata).forEach(propName => {\n propMetadata[propName] = parentPropMetadata[propName];\n });\n }\n const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);\n if (ownPropMetadata) {\n Object.keys(ownPropMetadata).forEach(propName => {\n const decorators = [];\n if (propMetadata.hasOwnProperty(propName)) {\n decorators.push(...propMetadata[propName]);\n }\n decorators.push(...ownPropMetadata[propName]);\n propMetadata[propName] = decorators;\n });\n }\n return propMetadata;\n }\n ownPropMetadata(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return {};\n }\n return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};\n }\n hasLifecycleHook(type, lcProperty) {\n return type instanceof Type && lcProperty in type.prototype;\n }\n}\nfunction convertTsickleDecoratorIntoMetadata(decoratorInvocations) {\n if (!decoratorInvocations) {\n return [];\n }\n return decoratorInvocations.map(decoratorInvocation => {\n const decoratorType = decoratorInvocation.type;\n const annotationCls = decoratorType.annotationCls;\n const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];\n return new annotationCls(...annotationArgs);\n });\n}\nfunction getParentCtor(ctor) {\n const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;\n const parentCtor = parentProto ? parentProto.constructor : null;\n // Note: We always use `Object` as the null value\n // to simplify checking later on.\n return parentCtor || Object;\n}\n\n// Below are constants for LView indices to help us look up LView members\n// without having to remember the specific indices.\n// Uglify will inline these when minifying so there shouldn't be a cost.\nconst HOST = 0;\nconst TVIEW = 1;\n// Shared with LContainer\nconst FLAGS = 2;\nconst PARENT = 3;\nconst NEXT = 4;\nconst T_HOST = 5;\n// End shared with LContainer\nconst HYDRATION = 6;\nconst CLEANUP = 7;\nconst CONTEXT = 8;\nconst INJECTOR = 9;\nconst ENVIRONMENT = 10;\nconst RENDERER = 11;\nconst CHILD_HEAD = 12;\nconst CHILD_TAIL = 13;\n// FIXME(misko): Investigate if the three declarations aren't all same thing.\nconst DECLARATION_VIEW = 14;\nconst DECLARATION_COMPONENT_VIEW = 15;\nconst DECLARATION_LCONTAINER = 16;\nconst PREORDER_HOOK_FLAGS = 17;\nconst QUERIES = 18;\nconst ID = 19;\nconst EMBEDDED_VIEW_INJECTOR = 20;\nconst ON_DESTROY_HOOKS = 21;\nconst EFFECTS_TO_SCHEDULE = 22;\nconst REACTIVE_TEMPLATE_CONSUMER = 23;\n/**\n * Size of LView's header. Necessary to adjust for it when setting slots.\n *\n * IMPORTANT: `HEADER_OFFSET` should only be referred to the in the `ɵɵ*` instructions to translate\n * instruction index into `LView` index. All other indexes should be in the `LView` index space and\n * there should be no need to refer to `HEADER_OFFSET` anywhere else.\n */\nconst HEADER_OFFSET = 25;\n\n/**\n * Special location which allows easy identification of type. If we have an array which was\n * retrieved from the `LView` and that array has `true` at `TYPE` location, we know it is\n * `LContainer`.\n */\nconst TYPE = 1;\n/**\n * Below are constants for LContainer indices to help us look up LContainer members\n * without having to remember the specific indices.\n * Uglify will inline these when minifying so there shouldn't be a cost.\n */\n// FLAGS, PARENT, NEXT, and T_HOST are indices 2, 3, 4, and 5\n// As we already have these constants in LView, we don't need to re-create them.\nconst DEHYDRATED_VIEWS = 6;\nconst NATIVE = 7;\nconst VIEW_REFS = 8;\nconst MOVED_VIEWS = 9;\n/**\n * Size of LContainer's header. Represents the index after which all views in the\n * container will be inserted. We need to keep a record of current views so we know\n * which views are already in the DOM (and don't need to be re-added) and so we can\n * remove views from the DOM when they are no longer required.\n */\nconst CONTAINER_HEADER_OFFSET = 10;\n/** Flags associated with an LContainer (saved in LContainer[FLAGS]) */\nvar LContainerFlags;\n(function (LContainerFlags) {\n LContainerFlags[LContainerFlags[\"None\"] = 0] = \"None\";\n /**\n * Flag to signify that this `LContainer` may have transplanted views which need to be change\n * detected. (see: `LView[DECLARATION_COMPONENT_VIEW])`.\n *\n * This flag, once set, is never unset for the `LContainer`.\n */\n LContainerFlags[LContainerFlags[\"HasTransplantedViews\"] = 2] = \"HasTransplantedViews\";\n})(LContainerFlags || (LContainerFlags = {}));\n\n/**\n * True if `value` is `LView`.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nfunction isLView(value) {\n return Array.isArray(value) && typeof value[TYPE] === 'object';\n}\n/**\n * True if `value` is `LContainer`.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nfunction isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}\nfunction isContentQueryHost(tNode) {\n return (tNode.flags & 4 /* TNodeFlags.hasContentQuery */) !== 0;\n}\nfunction isComponentHost(tNode) {\n return tNode.componentOffset > -1;\n}\nfunction isDirectiveHost(tNode) {\n return (tNode.flags & 1 /* TNodeFlags.isDirectiveHost */) === 1 /* TNodeFlags.isDirectiveHost */;\n}\nfunction isComponentDef(def) {\n return !!def.template;\n}\nfunction isRootView(target) {\n return (target[FLAGS] & 512 /* LViewFlags.IsRoot */) !== 0;\n}\nfunction isProjectionTNode(tNode) {\n return (tNode.type & 16 /* TNodeType.Projection */) === 16 /* TNodeType.Projection */;\n}\nfunction hasI18n(lView) {\n return (lView[FLAGS] & 32 /* LViewFlags.HasI18n */) === 32 /* LViewFlags.HasI18n */;\n}\nfunction isDestroyed(lView) {\n return (lView[FLAGS] & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */;\n}\n\n// [Assert functions do not constraint type when they are guarded by a truthy\n// expression.](https://github.com/microsoft/TypeScript/issues/37295)\nfunction assertTNodeForLView(tNode, lView) {\n assertTNodeForTView(tNode, lView[TVIEW]);\n}\nfunction assertTNodeForTView(tNode, tView) {\n assertTNode(tNode);\n const tData = tView.data;\n for (let i = HEADER_OFFSET; i < tData.length; i++) {\n if (tData[i] === tNode) {\n return;\n }\n }\n throwError('This TNode does not belong to this TView.');\n}\nfunction assertTNode(tNode) {\n assertDefined(tNode, 'TNode must be defined');\n if (!(tNode && typeof tNode === 'object' && tNode.hasOwnProperty('directiveStylingLast'))) {\n throwError('Not of type TNode, got: ' + tNode);\n }\n}\nfunction assertTIcu(tIcu) {\n assertDefined(tIcu, 'Expected TIcu to be defined');\n if (!(typeof tIcu.currentCaseLViewIndex === 'number')) {\n throwError('Object is not of TIcu type.');\n }\n}\nfunction assertComponentType(actual, msg = \"Type passed in is not ComponentType, it does not have 'ɵcmp' property.\") {\n if (!getComponentDef(actual)) {\n throwError(msg);\n }\n}\nfunction assertNgModuleType(actual, msg = \"Type passed in is not NgModuleType, it does not have 'ɵmod' property.\") {\n if (!getNgModuleDef(actual)) {\n throwError(msg);\n }\n}\nfunction assertCurrentTNodeIsParent(isParent) {\n assertEqual(isParent, true, 'currentTNode should be a parent');\n}\nfunction assertHasParent(tNode) {\n assertDefined(tNode, 'currentTNode should exist!');\n assertDefined(tNode.parent, 'currentTNode should have a parent');\n}\nfunction assertLContainer(value) {\n assertDefined(value, 'LContainer must be defined');\n assertEqual(isLContainer(value), true, 'Expecting LContainer');\n}\nfunction assertLViewOrUndefined(value) {\n value && assertEqual(isLView(value), true, 'Expecting LView or undefined or null');\n}\nfunction assertLView(value) {\n assertDefined(value, 'LView must be defined');\n assertEqual(isLView(value), true, 'Expecting LView');\n}\nfunction assertFirstCreatePass(tView, errMessage) {\n assertEqual(tView.firstCreatePass, true, errMessage || 'Should only be called in first create pass.');\n}\nfunction assertFirstUpdatePass(tView, errMessage) {\n assertEqual(tView.firstUpdatePass, true, errMessage || 'Should only be called in first update pass.');\n}\n/**\n * This is a basic sanity check that an object is probably a directive def. DirectiveDef is\n * an interface, so we can't do a direct instanceof check.\n */\nfunction assertDirectiveDef(obj) {\n if (obj.type === undefined || obj.selectors == undefined || obj.inputs === undefined) {\n throwError(`Expected a DirectiveDef/ComponentDef and this object does not seem to have the expected shape.`);\n }\n}\nfunction assertIndexInDeclRange(tView, index) {\n assertBetween(HEADER_OFFSET, tView.bindingStartIndex, index);\n}\nfunction assertIndexInExpandoRange(lView, index) {\n const tView = lView[1];\n assertBetween(tView.expandoStartIndex, lView.length, index);\n}\nfunction assertBetween(lower, upper, index) {\n if (!(lower <= index && index < upper)) {\n throwError(`Index out of range (expecting ${lower} <= ${index} < ${upper})`);\n }\n}\nfunction assertProjectionSlots(lView, errMessage) {\n assertDefined(lView[DECLARATION_COMPONENT_VIEW], 'Component views should exist.');\n assertDefined(lView[DECLARATION_COMPONENT_VIEW][T_HOST].projection, errMessage || 'Components with projection nodes (<ng-content>) must have projection slots defined.');\n}\nfunction assertParentView(lView, errMessage) {\n assertDefined(lView, errMessage || \"Component views should always have a parent view (component's host view)\");\n}\nfunction assertNoDuplicateDirectives(directives) {\n // The array needs at least two elements in order to have duplicates.\n if (directives.length < 2) {\n return;\n }\n const seenDirectives = new Set();\n for (const current of directives) {\n if (seenDirectives.has(current)) {\n throw new RuntimeError(309 /* RuntimeErrorCode.DUPLICATE_DIRECTIVE */, `Directive ${current.type.name} matches multiple times on the same element. ` + `Directives can only match an element once.`);\n }\n seenDirectives.add(current);\n }\n}\n/**\n * This is a basic sanity check that the `injectorIndex` seems to point to what looks like a\n * NodeInjector data structure.\n *\n * @param lView `LView` which should be checked.\n * @param injectorIndex index into the `LView` where the `NodeInjector` is expected.\n */\nfunction assertNodeInjector(lView, injectorIndex) {\n assertIndexInExpandoRange(lView, injectorIndex);\n assertIndexInExpandoRange(lView, injectorIndex + 8 /* NodeInjectorOffset.PARENT */);\n assertNumber(lView[injectorIndex + 0], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 1], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 2], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 3], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 4], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 5], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 6], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 7], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */], 'injectorIndex should point to parent injector');\n}\n\n/**\n * Represents a basic change from a previous to a new value for a single\n * property on a directive instance. Passed as a value in a\n * {@link SimpleChanges} object to the `ngOnChanges` hook.\n *\n * @see {@link OnChanges}\n *\n * @publicApi\n */\nclass SimpleChange {\n constructor(previousValue, currentValue, firstChange) {\n this.previousValue = previousValue;\n this.currentValue = currentValue;\n this.firstChange = firstChange;\n }\n /**\n * Check whether the new value is the first value assigned.\n */\n isFirstChange() {\n return this.firstChange;\n }\n}\nfunction applyValueToInputField(instance, inputSignalNode, privateName, value) {\n if (inputSignalNode !== null) {\n inputSignalNode.applyValueToInputSignal(inputSignalNode, value);\n } else {\n instance[privateName] = value;\n }\n}\n\n/**\n * The NgOnChangesFeature decorates a component with support for the ngOnChanges\n * lifecycle hook, so it should be included in any component that implements\n * that hook.\n *\n * If the component or directive uses inheritance, the NgOnChangesFeature MUST\n * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise\n * inherited properties will not be propagated to the ngOnChanges lifecycle\n * hook.\n *\n * Example usage:\n *\n * ```\n * static ɵcmp = defineComponent({\n * ...\n * inputs: {name: 'publicName'},\n * features: [NgOnChangesFeature]\n * });\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵNgOnChangesFeature() {\n return NgOnChangesFeatureImpl;\n}\nfunction NgOnChangesFeatureImpl(definition) {\n if (definition.type.prototype.ngOnChanges) {\n definition.setInput = ngOnChangesSetInput;\n }\n return rememberChangeHistoryAndInvokeOnChangesHook;\n}\n// This option ensures that the ngOnChanges lifecycle hook will be inherited\n// from superclasses (in InheritDefinitionFeature).\n/** @nocollapse */\n// tslint:disable-next-line:no-toplevel-property-access\nɵɵNgOnChangesFeature.ngInherit = true;\n/**\n * This is a synthetic lifecycle hook which gets inserted into `TView.preOrderHooks` to simulate\n * `ngOnChanges`.\n *\n * The hook reads the `NgSimpleChangesStore` data from the component instance and if changes are\n * found it invokes `ngOnChanges` on the component instance.\n *\n * @param this Component instance. Because this function gets inserted into `TView.preOrderHooks`,\n * it is guaranteed to be called with component instance.\n */\nfunction rememberChangeHistoryAndInvokeOnChangesHook() {\n const simpleChangesStore = getSimpleChangesStore(this);\n const current = simpleChangesStore?.current;\n if (current) {\n const previous = simpleChangesStore.previous;\n if (previous === EMPTY_OBJ) {\n simpleChangesStore.previous = current;\n } else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (let key in current) {\n previous[key] = current[key];\n }\n }\n simpleChangesStore.current = null;\n this.ngOnChanges(current);\n }\n}\nfunction ngOnChangesSetInput(instance, inputSignalNode, value, publicName, privateName) {\n const declaredName = this.declaredInputs[publicName];\n ngDevMode && assertString(declaredName, 'Name of input in ngOnChanges has to be a string');\n const simpleChangesStore = getSimpleChangesStore(instance) || setSimpleChangesStore(instance, {\n previous: EMPTY_OBJ,\n current: null\n });\n const current = simpleChangesStore.current || (simpleChangesStore.current = {});\n const previous = simpleChangesStore.previous;\n const previousChange = previous[declaredName];\n current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ);\n applyValueToInputField(instance, inputSignalNode, privateName, value);\n}\nconst SIMPLE_CHANGES_STORE = '__ngSimpleChanges__';\nfunction getSimpleChangesStore(instance) {\n return instance[SIMPLE_CHANGES_STORE] || null;\n}\nfunction setSimpleChangesStore(instance, store) {\n return instance[SIMPLE_CHANGES_STORE] = store;\n}\nlet profilerCallback = null;\n/**\n * Sets the callback function which will be invoked before and after performing certain actions at\n * runtime (for example, before and after running change detection).\n *\n * Warning: this function is *INTERNAL* and should not be relied upon in application's code.\n * The contract of the function might be changed in any release and/or the function can be removed\n * completely.\n *\n * @param profiler function provided by the caller or null value to disable profiling.\n */\nconst setProfiler = profiler => {\n profilerCallback = profiler;\n};\n/**\n * Profiler function which wraps user code executed by the runtime.\n *\n * @param event ProfilerEvent corresponding to the execution context\n * @param instance component instance\n * @param hookOrListener lifecycle hook function or output listener. The value depends on the\n * execution context\n * @returns\n */\nconst profiler = function (event, instance, hookOrListener) {\n if (profilerCallback != null /* both `null` and `undefined` */) {\n profilerCallback(event, instance, hookOrListener);\n }\n};\nconst SVG_NAMESPACE = 'svg';\nconst MATH_ML_NAMESPACE = 'math';\n\n/**\n * For efficiency reasons we often put several different data types (`RNode`, `LView`, `LContainer`)\n * in same location in `LView`. This is because we don't want to pre-allocate space for it\n * because the storage is sparse. This file contains utilities for dealing with such data types.\n *\n * How do we know what is stored at a given location in `LView`.\n * - `Array.isArray(value) === false` => `RNode` (The normal storage value)\n * - `Array.isArray(value) === true` => then the `value[0]` represents the wrapped value.\n * - `typeof value[TYPE] === 'object'` => `LView`\n * - This happens when we have a component at a given location\n * - `typeof value[TYPE] === true` => `LContainer`\n * - This happens when we have `LContainer` binding at a given location.\n *\n *\n * NOTE: it is assumed that `Array.isArray` and `typeof` operations are very efficient.\n */\n/**\n * Returns `RNode`.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nfunction unwrapRNode(value) {\n while (Array.isArray(value)) {\n value = value[HOST];\n }\n return value;\n}\n/**\n * Returns `LView` or `null` if not found.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nfunction unwrapLView(value) {\n while (Array.isArray(value)) {\n // This check is same as `isLView()` but we don't call at as we don't want to call\n // `Array.isArray()` twice and give JITer more work for inlining.\n if (typeof value[TYPE] === 'object') return value;\n value = value[HOST];\n }\n return null;\n}\n/**\n * Retrieves an element value from the provided `viewData`, by unwrapping\n * from any containers, component views, or style contexts.\n */\nfunction getNativeByIndex(index, lView) {\n ngDevMode && assertIndexInRange(lView, index);\n ngDevMode && assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Expected to be past HEADER_OFFSET');\n return unwrapRNode(lView[index]);\n}\n/**\n * Retrieve an `RNode` for a given `TNode` and `LView`.\n *\n * This function guarantees in dev mode to retrieve a non-null `RNode`.\n *\n * @param tNode\n * @param lView\n */\nfunction getNativeByTNode(tNode, lView) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n ngDevMode && assertIndexInRange(lView, tNode.index);\n const node = unwrapRNode(lView[tNode.index]);\n return node;\n}\n/**\n * Retrieve an `RNode` or `null` for a given `TNode` and `LView`.\n *\n * Some `TNode`s don't have associated `RNode`s. For example `Projection`\n *\n * @param tNode\n * @param lView\n */\nfunction getNativeByTNodeOrNull(tNode, lView) {\n const index = tNode === null ? -1 : tNode.index;\n if (index !== -1) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n const node = unwrapRNode(lView[index]);\n return node;\n }\n return null;\n}\n// fixme(misko): The return Type should be `TNode|null`\nfunction getTNode(tView, index) {\n ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode');\n ngDevMode && assertLessThan(index, tView.data.length, 'wrong index for TNode');\n const tNode = tView.data[index];\n ngDevMode && tNode !== null && assertTNode(tNode);\n return tNode;\n}\n/** Retrieves a value from any `LView` or `TData`. */\nfunction load(view, index) {\n ngDevMode && assertIndexInRange(view, index);\n return view[index];\n}\nfunction getComponentLViewByIndex(nodeIndex, hostView) {\n // Could be an LView or an LContainer. If LContainer, unwrap to find LView.\n ngDevMode && assertIndexInRange(hostView, nodeIndex);\n const slotValue = hostView[nodeIndex];\n const lView = isLView(slotValue) ? slotValue : slotValue[HOST];\n return lView;\n}\n/** Checks whether a given view is in creation mode */\nfunction isCreationMode(view) {\n return (view[FLAGS] & 4 /* LViewFlags.CreationMode */) === 4 /* LViewFlags.CreationMode */;\n}\n/**\n * Returns a boolean for whether the view is attached to the change detection tree.\n *\n * Note: This determines whether a view should be checked, not whether it's inserted\n * into a container. For that, you'll want `viewAttachedToContainer` below.\n */\nfunction viewAttachedToChangeDetector(view) {\n return (view[FLAGS] & 128 /* LViewFlags.Attached */) === 128 /* LViewFlags.Attached */;\n}\n/** Returns a boolean for whether the view is attached to a container. */\nfunction viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}\nfunction getConstant(consts, index) {\n if (index === null || index === undefined) return null;\n ngDevMode && assertIndexInRange(consts, index);\n return consts[index];\n}\n/**\n * Resets the pre-order hook flags of the view.\n * @param lView the LView on which the flags are reset\n */\nfunction resetPreOrderHookFlags(lView) {\n lView[PREORDER_HOOK_FLAGS] = 0;\n}\n/**\n * Adds the `RefreshView` flag from the lView and updates HAS_CHILD_VIEWS_TO_REFRESH flag of\n * parents.\n */\nfunction markViewForRefresh(lView) {\n if (lView[FLAGS] & 1024 /* LViewFlags.RefreshView */) {\n return;\n }\n lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;\n if (viewAttachedToChangeDetector(lView)) {\n markAncestorsForTraversal(lView);\n }\n}\n/**\n * Walks up the LView hierarchy.\n * @param nestingLevel Number of times to walk up in hierarchy.\n * @param currentView View from which to start the lookup.\n */\nfunction walkUpViews(nestingLevel, currentView) {\n while (nestingLevel > 0) {\n ngDevMode && assertDefined(currentView[DECLARATION_VIEW], 'Declaration view should be defined if nesting level is greater than 0.');\n currentView = currentView[DECLARATION_VIEW];\n nestingLevel--;\n }\n return currentView;\n}\nfunction requiresRefreshOrTraversal(lView) {\n return !!(lView[FLAGS] & (1024 /* LViewFlags.RefreshView */ | 8192 /* LViewFlags.HasChildViewsToRefresh */) || lView[REACTIVE_TEMPLATE_CONSUMER]?.dirty);\n}\n/**\n * Updates the `HasChildViewsToRefresh` flag on the parents of the `LView` as well as the\n * parents above.\n */\nfunction updateAncestorTraversalFlagsOnAttach(lView) {\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(8 /* NotificationSource.ViewAttached */);\n if (lView[FLAGS] & 64 /* LViewFlags.Dirty */) {\n lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;\n }\n if (requiresRefreshOrTraversal(lView)) {\n markAncestorsForTraversal(lView);\n }\n}\n/**\n * Ensures views above the given `lView` are traversed during change detection even when they are\n * not dirty.\n *\n * This is done by setting the `HAS_CHILD_VIEWS_TO_REFRESH` flag up to the root, stopping when the\n * flag is already `true` or the `lView` is detached.\n */\nfunction markAncestorsForTraversal(lView) {\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(0 /* NotificationSource.MarkAncestorsForTraversal */);\n let parent = getLViewParent(lView);\n while (parent !== null) {\n // We stop adding markers to the ancestors once we reach one that already has the marker. This\n // is to avoid needlessly traversing all the way to the root when the marker already exists.\n if (parent[FLAGS] & 8192 /* LViewFlags.HasChildViewsToRefresh */) {\n break;\n }\n parent[FLAGS] |= 8192 /* LViewFlags.HasChildViewsToRefresh */;\n if (!viewAttachedToChangeDetector(parent)) {\n break;\n }\n parent = getLViewParent(parent);\n }\n}\n/**\n * Stores a LView-specific destroy callback.\n */\nfunction storeLViewOnDestroy(lView, onDestroyCallback) {\n if ((lView[FLAGS] & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */) {\n throw new RuntimeError(911 /* RuntimeErrorCode.VIEW_ALREADY_DESTROYED */, ngDevMode && 'View has already been destroyed.');\n }\n if (lView[ON_DESTROY_HOOKS] === null) {\n lView[ON_DESTROY_HOOKS] = [];\n }\n lView[ON_DESTROY_HOOKS].push(onDestroyCallback);\n}\n/**\n * Removes previously registered LView-specific destroy callback.\n */\nfunction removeLViewOnDestroy(lView, onDestroyCallback) {\n if (lView[ON_DESTROY_HOOKS] === null) return;\n const destroyCBIdx = lView[ON_DESTROY_HOOKS].indexOf(onDestroyCallback);\n if (destroyCBIdx !== -1) {\n lView[ON_DESTROY_HOOKS].splice(destroyCBIdx, 1);\n }\n}\n/**\n * Gets the parent LView of the passed LView, if the PARENT is an LContainer, will get the parent of\n * that LContainer, which is an LView\n * @param lView the lView whose parent to get\n */\nfunction getLViewParent(lView) {\n ngDevMode && assertLView(lView);\n const parent = lView[PARENT];\n return isLContainer(parent) ? parent[PARENT] : parent;\n}\nconst instructionState = {\n lFrame: createLFrame(null),\n bindingsEnabled: true,\n skipHydrationRootTNode: null\n};\nvar CheckNoChangesMode;\n(function (CheckNoChangesMode) {\n CheckNoChangesMode[CheckNoChangesMode[\"Off\"] = 0] = \"Off\";\n CheckNoChangesMode[CheckNoChangesMode[\"Exhaustive\"] = 1] = \"Exhaustive\";\n CheckNoChangesMode[CheckNoChangesMode[\"OnlyDirtyViews\"] = 2] = \"OnlyDirtyViews\";\n})(CheckNoChangesMode || (CheckNoChangesMode = {}));\n/**\n * In this mode, any changes in bindings will throw an ExpressionChangedAfterChecked error.\n *\n * Necessary to support ChangeDetectorRef.checkNoChanges().\n *\n * The `checkNoChanges` function is invoked only in ngDevMode=true and verifies that no unintended\n * changes exist in the change detector or its children.\n */\nlet _checkNoChangesMode = 0; /* CheckNoChangesMode.Off */\n/**\n * Flag used to indicate that we are in the middle running change detection on a view\n *\n * @see detectChangesInViewWhileDirty\n */\nlet _isRefreshingViews = false;\n/**\n * Returns true if the instruction state stack is empty.\n *\n * Intended to be called from tests only (tree shaken otherwise).\n */\nfunction specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}\nfunction getElementDepthCount() {\n return instructionState.lFrame.elementDepthCount;\n}\nfunction increaseElementDepthCount() {\n instructionState.lFrame.elementDepthCount++;\n}\nfunction decreaseElementDepthCount() {\n instructionState.lFrame.elementDepthCount--;\n}\nfunction getBindingsEnabled() {\n return instructionState.bindingsEnabled;\n}\n/**\n * Returns true if currently inside a skip hydration block.\n * @returns boolean\n */\nfunction isInSkipHydrationBlock$1() {\n return instructionState.skipHydrationRootTNode !== null;\n}\n/**\n * Returns true if this is the root TNode of the skip hydration block.\n * @param tNode the current TNode\n * @returns boolean\n */\nfunction isSkipHydrationRootTNode(tNode) {\n return instructionState.skipHydrationRootTNode === tNode;\n}\n/**\n * Enables directive matching on elements.\n *\n * * Example:\n * ```\n * <my-comp my-directive>\n * Should match component / directive.\n * </my-comp>\n * <div ngNonBindable>\n * <!-- ɵɵdisableBindings() -->\n * <my-comp my-directive>\n * Should not match component / directive because we are in ngNonBindable.\n * </my-comp>\n * <!-- ɵɵenableBindings() -->\n * </div>\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵenableBindings() {\n instructionState.bindingsEnabled = true;\n}\n/**\n * Sets a flag to specify that the TNode is in a skip hydration block.\n * @param tNode the current TNode\n */\nfunction enterSkipHydrationBlock(tNode) {\n instructionState.skipHydrationRootTNode = tNode;\n}\n/**\n * Disables directive matching on element.\n *\n * * Example:\n * ```\n * <my-comp my-directive>\n * Should match component / directive.\n * </my-comp>\n * <div ngNonBindable>\n * <!-- ɵɵdisableBindings() -->\n * <my-comp my-directive>\n * Should not match component / directive because we are in ngNonBindable.\n * </my-comp>\n * <!-- ɵɵenableBindings() -->\n * </div>\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵdisableBindings() {\n instructionState.bindingsEnabled = false;\n}\n/**\n * Clears the root skip hydration node when leaving a skip hydration block.\n */\nfunction leaveSkipHydrationBlock() {\n instructionState.skipHydrationRootTNode = null;\n}\n/**\n * Return the current `LView`.\n */\nfunction getLView() {\n return instructionState.lFrame.lView;\n}\n/**\n * Return the current `TView`.\n */\nfunction getTView() {\n return instructionState.lFrame.tView;\n}\n/**\n * Restores `contextViewData` to the given OpaqueViewState instance.\n *\n * Used in conjunction with the getCurrentView() instruction to save a snapshot\n * of the current view and restore it when listeners are invoked. This allows\n * walking the declaration view tree in listeners to get vars from parent views.\n *\n * @param viewToRestore The OpaqueViewState instance to restore.\n * @returns Context of the restored OpaqueViewState instance.\n *\n * @codeGenApi\n */\nfunction ɵɵrestoreView(viewToRestore) {\n instructionState.lFrame.contextLView = viewToRestore;\n return viewToRestore[CONTEXT];\n}\n/**\n * Clears the view set in `ɵɵrestoreView` from memory. Returns the passed in\n * value so that it can be used as a return value of an instruction.\n *\n * @codeGenApi\n */\nfunction ɵɵresetView(value) {\n instructionState.lFrame.contextLView = null;\n return value;\n}\nfunction getCurrentTNode() {\n let currentTNode = getCurrentTNodePlaceholderOk();\n while (currentTNode !== null && currentTNode.type === 64 /* TNodeType.Placeholder */) {\n currentTNode = currentTNode.parent;\n }\n return currentTNode;\n}\nfunction getCurrentTNodePlaceholderOk() {\n return instructionState.lFrame.currentTNode;\n}\nfunction getCurrentParentTNode() {\n const lFrame = instructionState.lFrame;\n const currentTNode = lFrame.currentTNode;\n return lFrame.isParent ? currentTNode : currentTNode.parent;\n}\nfunction setCurrentTNode(tNode, isParent) {\n ngDevMode && tNode && assertTNodeForTView(tNode, instructionState.lFrame.tView);\n const lFrame = instructionState.lFrame;\n lFrame.currentTNode = tNode;\n lFrame.isParent = isParent;\n}\nfunction isCurrentTNodeParent() {\n return instructionState.lFrame.isParent;\n}\nfunction setCurrentTNodeAsNotParent() {\n instructionState.lFrame.isParent = false;\n}\nfunction getContextLView() {\n const contextLView = instructionState.lFrame.contextLView;\n ngDevMode && assertDefined(contextLView, 'contextLView must be defined.');\n return contextLView;\n}\nfunction isInCheckNoChangesMode() {\n !ngDevMode && throwError('Must never be called in production mode');\n return _checkNoChangesMode !== CheckNoChangesMode.Off;\n}\nfunction isExhaustiveCheckNoChanges() {\n !ngDevMode && throwError('Must never be called in production mode');\n return _checkNoChangesMode === CheckNoChangesMode.Exhaustive;\n}\nfunction setIsInCheckNoChangesMode(mode) {\n !ngDevMode && throwError('Must never be called in production mode');\n _checkNoChangesMode = mode;\n}\nfunction isRefreshingViews() {\n return _isRefreshingViews;\n}\nfunction setIsRefreshingViews(mode) {\n _isRefreshingViews = mode;\n}\n// top level variables should not be exported for performance reasons (PERF_NOTES.md)\nfunction getBindingRoot() {\n const lFrame = instructionState.lFrame;\n let index = lFrame.bindingRootIndex;\n if (index === -1) {\n index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;\n }\n return index;\n}\nfunction getBindingIndex() {\n return instructionState.lFrame.bindingIndex;\n}\nfunction setBindingIndex(value) {\n return instructionState.lFrame.bindingIndex = value;\n}\nfunction nextBindingIndex() {\n return instructionState.lFrame.bindingIndex++;\n}\nfunction incrementBindingIndex(count) {\n const lFrame = instructionState.lFrame;\n const index = lFrame.bindingIndex;\n lFrame.bindingIndex = lFrame.bindingIndex + count;\n return index;\n}\nfunction isInI18nBlock() {\n return instructionState.lFrame.inI18n;\n}\nfunction setInI18nBlock(isInI18nBlock) {\n instructionState.lFrame.inI18n = isInI18nBlock;\n}\n/**\n * Set a new binding root index so that host template functions can execute.\n *\n * Bindings inside the host template are 0 index. But because we don't know ahead of time\n * how many host bindings we have we can't pre-compute them. For this reason they are all\n * 0 index and we just shift the root so that they match next available location in the LView.\n *\n * @param bindingRootIndex Root index for `hostBindings`\n * @param currentDirectiveIndex `TData[currentDirectiveIndex]` will point to the current directive\n * whose `hostBindings` are being processed.\n */\nfunction setBindingRootForHostBindings(bindingRootIndex, currentDirectiveIndex) {\n const lFrame = instructionState.lFrame;\n lFrame.bindingIndex = lFrame.bindingRootIndex = bindingRootIndex;\n setCurrentDirectiveIndex(currentDirectiveIndex);\n}\n/**\n * When host binding is executing this points to the directive index.\n * `TView.data[getCurrentDirectiveIndex()]` is `DirectiveDef`\n * `LView[getCurrentDirectiveIndex()]` is directive instance.\n */\nfunction getCurrentDirectiveIndex() {\n return instructionState.lFrame.currentDirectiveIndex;\n}\n/**\n * Sets an index of a directive whose `hostBindings` are being processed.\n *\n * @param currentDirectiveIndex `TData` index where current directive instance can be found.\n */\nfunction setCurrentDirectiveIndex(currentDirectiveIndex) {\n instructionState.lFrame.currentDirectiveIndex = currentDirectiveIndex;\n}\n/**\n * Retrieve the current `DirectiveDef` which is active when `hostBindings` instruction is being\n * executed.\n *\n * @param tData Current `TData` where the `DirectiveDef` will be looked up at.\n */\nfunction getCurrentDirectiveDef(tData) {\n const currentDirectiveIndex = instructionState.lFrame.currentDirectiveIndex;\n return currentDirectiveIndex === -1 ? null : tData[currentDirectiveIndex];\n}\nfunction getCurrentQueryIndex() {\n return instructionState.lFrame.currentQueryIndex;\n}\nfunction setCurrentQueryIndex(value) {\n instructionState.lFrame.currentQueryIndex = value;\n}\n/**\n * Returns a `TNode` of the location where the current `LView` is declared at.\n *\n * @param lView an `LView` that we want to find parent `TNode` for.\n */\nfunction getDeclarationTNode(lView) {\n const tView = lView[TVIEW];\n // Return the declaration parent for embedded views\n if (tView.type === 2 /* TViewType.Embedded */) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode;\n }\n // Components don't have `TView.declTNode` because each instance of component could be\n // inserted in different location, hence `TView.declTNode` is meaningless.\n // Falling back to `T_HOST` in case we cross component boundary.\n if (tView.type === 1 /* TViewType.Component */) {\n return lView[T_HOST];\n }\n // Remaining TNode type is `TViewType.Root` which doesn't have a parent TNode.\n return null;\n}\n/**\n * This is a light weight version of the `enterView` which is needed by the DI system.\n *\n * @param lView `LView` location of the DI context.\n * @param tNode `TNode` for DI context\n * @param flags DI context flags. if `SkipSelf` flag is set than we walk up the declaration\n * tree from `tNode` until we find parent declared `TElementNode`.\n * @returns `true` if we have successfully entered DI associated with `tNode` (or with declared\n * `TNode` if `flags` has `SkipSelf`). Failing to enter DI implies that no associated\n * `NodeInjector` can be found and we should instead use `ModuleInjector`.\n * - If `true` than this call must be fallowed by `leaveDI`\n * - If `false` than this call failed and we should NOT call `leaveDI`\n */\nfunction enterDI(lView, tNode, flags) {\n ngDevMode && assertLViewOrUndefined(lView);\n if (flags & InjectFlags.SkipSelf) {\n ngDevMode && assertTNodeForTView(tNode, lView[TVIEW]);\n let parentTNode = tNode;\n let parentLView = lView;\n while (true) {\n ngDevMode && assertDefined(parentTNode, 'Parent TNode should be defined');\n parentTNode = parentTNode.parent;\n if (parentTNode === null && !(flags & InjectFlags.Host)) {\n parentTNode = getDeclarationTNode(parentLView);\n if (parentTNode === null) break;\n // In this case, a parent exists and is definitely an element. So it will definitely\n // have an existing lView as the declaration view, which is why we can assume it's defined.\n ngDevMode && assertDefined(parentLView, 'Parent LView should be defined');\n parentLView = parentLView[DECLARATION_VIEW];\n // In Ivy there are Comment nodes that correspond to ngIf and NgFor embedded directives\n // We want to skip those and look only at Elements and ElementContainers to ensure\n // we're looking at true parent nodes, and not content or other types.\n if (parentTNode.type & (2 /* TNodeType.Element */ | 8 /* TNodeType.ElementContainer */)) {\n break;\n }\n } else {\n break;\n }\n }\n if (parentTNode === null) {\n // If we failed to find a parent TNode this means that we should use module injector.\n return false;\n } else {\n tNode = parentTNode;\n lView = parentLView;\n }\n }\n ngDevMode && assertTNodeForLView(tNode, lView);\n const lFrame = instructionState.lFrame = allocLFrame();\n lFrame.currentTNode = tNode;\n lFrame.lView = lView;\n return true;\n}\n/**\n * Swap the current lView with a new lView.\n *\n * For performance reasons we store the lView in the top level of the module.\n * This way we minimize the number of properties to read. Whenever a new view\n * is entered we have to store the lView for later, and when the view is\n * exited the state has to be restored\n *\n * @param newView New lView to become active\n * @returns the previously active lView;\n */\nfunction enterView(newView) {\n ngDevMode && assertNotEqual(newView[0], newView[1], '????');\n ngDevMode && assertLViewOrUndefined(newView);\n const newLFrame = allocLFrame();\n if (ngDevMode) {\n assertEqual(newLFrame.isParent, true, 'Expected clean LFrame');\n assertEqual(newLFrame.lView, null, 'Expected clean LFrame');\n assertEqual(newLFrame.tView, null, 'Expected clean LFrame');\n assertEqual(newLFrame.selectedIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.elementDepthCount, 0, 'Expected clean LFrame');\n assertEqual(newLFrame.currentDirectiveIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.currentNamespace, null, 'Expected clean LFrame');\n assertEqual(newLFrame.bindingRootIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.currentQueryIndex, 0, 'Expected clean LFrame');\n }\n const tView = newView[TVIEW];\n instructionState.lFrame = newLFrame;\n ngDevMode && tView.firstChild && assertTNodeForTView(tView.firstChild, tView);\n newLFrame.currentTNode = tView.firstChild;\n newLFrame.lView = newView;\n newLFrame.tView = tView;\n newLFrame.contextLView = newView;\n newLFrame.bindingIndex = tView.bindingStartIndex;\n newLFrame.inI18n = false;\n}\n/**\n * Allocates next free LFrame. This function tries to reuse the `LFrame`s to lower memory pressure.\n */\nfunction allocLFrame() {\n const currentLFrame = instructionState.lFrame;\n const childLFrame = currentLFrame === null ? null : currentLFrame.child;\n const newLFrame = childLFrame === null ? createLFrame(currentLFrame) : childLFrame;\n return newLFrame;\n}\nfunction createLFrame(parent) {\n const lFrame = {\n currentTNode: null,\n isParent: true,\n lView: null,\n tView: null,\n selectedIndex: -1,\n contextLView: null,\n elementDepthCount: 0,\n currentNamespace: null,\n currentDirectiveIndex: -1,\n bindingRootIndex: -1,\n bindingIndex: -1,\n currentQueryIndex: 0,\n parent: parent,\n child: null,\n inI18n: false\n };\n parent !== null && (parent.child = lFrame); // link the new LFrame for reuse.\n return lFrame;\n}\n/**\n * A lightweight version of leave which is used with DI.\n *\n * This function only resets `currentTNode` and `LView` as those are the only properties\n * used with DI (`enterDI()`).\n *\n * NOTE: This function is reexported as `leaveDI`. However `leaveDI` has return type of `void` where\n * as `leaveViewLight` has `LFrame`. This is so that `leaveViewLight` can be used in `leaveView`.\n */\nfunction leaveViewLight() {\n const oldLFrame = instructionState.lFrame;\n instructionState.lFrame = oldLFrame.parent;\n oldLFrame.currentTNode = null;\n oldLFrame.lView = null;\n return oldLFrame;\n}\n/**\n * This is a lightweight version of the `leaveView` which is needed by the DI system.\n *\n * NOTE: this function is an alias so that we can change the type of the function to have `void`\n * return type.\n */\nconst leaveDI = leaveViewLight;\n/**\n * Leave the current `LView`\n *\n * This pops the `LFrame` with the associated `LView` from the stack.\n *\n * IMPORTANT: We must zero out the `LFrame` values here otherwise they will be retained. This is\n * because for performance reasons we don't release `LFrame` but rather keep it for next use.\n */\nfunction leaveView() {\n const oldLFrame = leaveViewLight();\n oldLFrame.isParent = true;\n oldLFrame.tView = null;\n oldLFrame.selectedIndex = -1;\n oldLFrame.contextLView = null;\n oldLFrame.elementDepthCount = 0;\n oldLFrame.currentDirectiveIndex = -1;\n oldLFrame.currentNamespace = null;\n oldLFrame.bindingRootIndex = -1;\n oldLFrame.bindingIndex = -1;\n oldLFrame.currentQueryIndex = 0;\n}\nfunction nextContextImpl(level) {\n const contextLView = instructionState.lFrame.contextLView = walkUpViews(level, instructionState.lFrame.contextLView);\n return contextLView[CONTEXT];\n}\n/**\n * Gets the currently selected element index.\n *\n * Used with {@link property} instruction (and more in the future) to identify the index in the\n * current `LView` to act on.\n */\nfunction getSelectedIndex() {\n return instructionState.lFrame.selectedIndex;\n}\n/**\n * Sets the most recent index passed to {@link select}\n *\n * Used with {@link property} instruction (and more in the future) to identify the index in the\n * current `LView` to act on.\n *\n * (Note that if an \"exit function\" was set earlier (via `setElementExitFn()`) then that will be\n * run if and when the provided `index` value is different from the current selected index value.)\n */\nfunction setSelectedIndex(index) {\n ngDevMode && index !== -1 && assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Index must be past HEADER_OFFSET (or -1).');\n ngDevMode && assertLessThan(index, instructionState.lFrame.lView.length, \"Can't set index passed end of LView\");\n instructionState.lFrame.selectedIndex = index;\n}\n/**\n * Gets the `tNode` that represents currently selected element.\n */\nfunction getSelectedTNode() {\n const lFrame = instructionState.lFrame;\n return getTNode(lFrame.tView, lFrame.selectedIndex);\n}\n/**\n * Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state.\n *\n * @codeGenApi\n */\nfunction ɵɵnamespaceSVG() {\n instructionState.lFrame.currentNamespace = SVG_NAMESPACE;\n}\n/**\n * Sets the namespace used to create elements to `'http://www.w3.org/1998/MathML/'` in global state.\n *\n * @codeGenApi\n */\nfunction ɵɵnamespaceMathML() {\n instructionState.lFrame.currentNamespace = MATH_ML_NAMESPACE;\n}\n/**\n * Sets the namespace used to create elements to `null`, which forces element creation to use\n * `createElement` rather than `createElementNS`.\n *\n * @codeGenApi\n */\nfunction ɵɵnamespaceHTML() {\n namespaceHTMLInternal();\n}\n/**\n * Sets the namespace used to create elements to `null`, which forces element creation to use\n * `createElement` rather than `createElementNS`.\n */\nfunction namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}\nfunction getNamespace$1() {\n return instructionState.lFrame.currentNamespace;\n}\nlet _wasLastNodeCreated = true;\n/**\n * Retrieves a global flag that indicates whether the most recent DOM node\n * was created or hydrated.\n */\nfunction wasLastNodeCreated() {\n return _wasLastNodeCreated;\n}\n/**\n * Sets a global flag to indicate whether the most recent DOM node\n * was created or hydrated.\n */\nfunction lastNodeWasCreated(flag) {\n _wasLastNodeCreated = flag;\n}\n\n/**\n * Adds all directive lifecycle hooks from the given `DirectiveDef` to the given `TView`.\n *\n * Must be run *only* on the first template pass.\n *\n * Sets up the pre-order hooks on the provided `tView`,\n * see {@link HookData} for details about the data structure.\n *\n * @param directiveIndex The index of the directive in LView\n * @param directiveDef The definition containing the hooks to setup in tView\n * @param tView The current TView\n */\nfunction registerPreOrderHooks(directiveIndex, directiveDef, tView) {\n ngDevMode && assertFirstCreatePass(tView);\n const {\n ngOnChanges,\n ngOnInit,\n ngDoCheck\n } = directiveDef.type.prototype;\n if (ngOnChanges) {\n const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);\n (tView.preOrderHooks ??= []).push(directiveIndex, wrappedOnChanges);\n (tView.preOrderCheckHooks ??= []).push(directiveIndex, wrappedOnChanges);\n }\n if (ngOnInit) {\n (tView.preOrderHooks ??= []).push(0 - directiveIndex, ngOnInit);\n }\n if (ngDoCheck) {\n (tView.preOrderHooks ??= []).push(directiveIndex, ngDoCheck);\n (tView.preOrderCheckHooks ??= []).push(directiveIndex, ngDoCheck);\n }\n}\n/**\n *\n * Loops through the directives on the provided `tNode` and queues hooks to be\n * run that are not initialization hooks.\n *\n * Should be executed during `elementEnd()` and similar to\n * preserve hook execution order. Content, view, and destroy hooks for projected\n * components and directives must be called *before* their hosts.\n *\n * Sets up the content, view, and destroy hooks on the provided `tView`,\n * see {@link HookData} for details about the data structure.\n *\n * NOTE: This does not set up `onChanges`, `onInit` or `doCheck`, those are set up\n * separately at `elementStart`.\n *\n * @param tView The current TView\n * @param tNode The TNode whose directives are to be searched for hooks to queue\n */\nfunction registerPostOrderHooks(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n // It's necessary to loop through the directives at elementEnd() (rather than processing in\n // directiveCreate) so we can preserve the current hook order. Content, view, and destroy\n // hooks for projected components and directives must be called *before* their hosts.\n for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) {\n const directiveDef = tView.data[i];\n ngDevMode && assertDefined(directiveDef, 'Expecting DirectiveDef');\n const lifecycleHooks = directiveDef.type.prototype;\n const {\n ngAfterContentInit,\n ngAfterContentChecked,\n ngAfterViewInit,\n ngAfterViewChecked,\n ngOnDestroy\n } = lifecycleHooks;\n if (ngAfterContentInit) {\n (tView.contentHooks ??= []).push(-i, ngAfterContentInit);\n }\n if (ngAfterContentChecked) {\n (tView.contentHooks ??= []).push(i, ngAfterContentChecked);\n (tView.contentCheckHooks ??= []).push(i, ngAfterContentChecked);\n }\n if (ngAfterViewInit) {\n (tView.viewHooks ??= []).push(-i, ngAfterViewInit);\n }\n if (ngAfterViewChecked) {\n (tView.viewHooks ??= []).push(i, ngAfterViewChecked);\n (tView.viewCheckHooks ??= []).push(i, ngAfterViewChecked);\n }\n if (ngOnDestroy != null) {\n (tView.destroyHooks ??= []).push(i, ngOnDestroy);\n }\n }\n}\n/**\n * Executing hooks requires complex logic as we need to deal with 2 constraints.\n *\n * 1. Init hooks (ngOnInit, ngAfterContentInit, ngAfterViewInit) must all be executed once and only\n * once, across many change detection cycles. This must be true even if some hooks throw, or if\n * some recursively trigger a change detection cycle.\n * To solve that, it is required to track the state of the execution of these init hooks.\n * This is done by storing and maintaining flags in the view: the {@link InitPhaseState},\n * and the index within that phase. They can be seen as a cursor in the following structure:\n * [[onInit1, onInit2], [afterContentInit1], [afterViewInit1, afterViewInit2, afterViewInit3]]\n * They are stored as flags in LView[FLAGS].\n *\n * 2. Pre-order hooks can be executed in batches, because of the select instruction.\n * To be able to pause and resume their execution, we also need some state about the hook's array\n * that is being processed:\n * - the index of the next hook to be executed\n * - the number of init hooks already found in the processed part of the array\n * They are stored as flags in LView[PREORDER_HOOK_FLAGS].\n */\n/**\n * Executes pre-order check hooks ( OnChanges, DoChanges) given a view where all the init hooks were\n * executed once. This is a light version of executeInitAndCheckPreOrderHooks where we can skip read\n * / write of the init-hooks related flags.\n * @param lView The LView where hooks are defined\n * @param hooks Hooks to be run\n * @param nodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction executeCheckHooks(lView, hooks, nodeIndex) {\n callHooks(lView, hooks, 3 /* InitPhaseState.InitPhaseCompleted */, nodeIndex);\n}\n/**\n * Executes post-order init and check hooks (one of AfterContentInit, AfterContentChecked,\n * AfterViewInit, AfterViewChecked) given a view where there are pending init hooks to be executed.\n * @param lView The LView where hooks are defined\n * @param hooks Hooks to be run\n * @param initPhase A phase for which hooks should be run\n * @param nodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) {\n ngDevMode && assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init pre-order hooks should not be called more than once');\n if ((lView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n callHooks(lView, hooks, initPhase, nodeIndex);\n }\n}\nfunction incrementInitPhaseFlags(lView, initPhase) {\n ngDevMode && assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init hooks phase should not be incremented after all init hooks have been run.');\n let flags = lView[FLAGS];\n if ((flags & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n flags &= 16383 /* LViewFlags.IndexWithinInitPhaseReset */;\n flags += 1 /* LViewFlags.InitPhaseStateIncrementer */;\n lView[FLAGS] = flags;\n }\n}\n/**\n * Calls lifecycle hooks with their contexts, skipping init hooks if it's not\n * the first LView pass\n *\n * @param currentView The current view\n * @param arr The array in which the hooks are found\n * @param initPhaseState the current state of the init phase\n * @param currentNodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction callHooks(currentView, arr, initPhase, currentNodeIndex) {\n ngDevMode && assertEqual(isInCheckNoChangesMode(), false, 'Hooks should never be run when in check no changes mode.');\n const startIndex = currentNodeIndex !== undefined ? currentView[PREORDER_HOOK_FLAGS] & 65535 /* PreOrderHookFlags.IndexOfTheNextPreOrderHookMaskMask */ : 0;\n const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1;\n const max = arr.length - 1; // Stop the loop at length - 1, because we look for the hook at i + 1\n let lastNodeIndexFound = 0;\n for (let i = startIndex; i < max; i++) {\n const hook = arr[i + 1];\n if (typeof hook === 'number') {\n lastNodeIndexFound = arr[i];\n if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) {\n break;\n }\n } else {\n const isInitHook = arr[i] < 0;\n if (isInitHook) {\n currentView[PREORDER_HOOK_FLAGS] += 65536 /* PreOrderHookFlags.NumberOfInitHooksCalledIncrementer */;\n }\n if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {\n callHook(currentView, initPhase, arr, i);\n currentView[PREORDER_HOOK_FLAGS] = (currentView[PREORDER_HOOK_FLAGS] & 4294901760 /* PreOrderHookFlags.NumberOfInitHooksCalledMask */) + i + 2;\n }\n i++;\n }\n }\n}\n/**\n * Executes a single lifecycle hook, making sure that:\n * - it is called in the non-reactive context;\n * - profiling data are registered.\n */\nfunction callHookInternal(directive, hook) {\n profiler(4 /* ProfilerEvent.LifecycleHookStart */, directive, hook);\n const prevConsumer = setActiveConsumer$1(null);\n try {\n hook.call(directive);\n } finally {\n setActiveConsumer$1(prevConsumer);\n profiler(5 /* ProfilerEvent.LifecycleHookEnd */, directive, hook);\n }\n}\n/**\n * Execute one hook against the current `LView`.\n *\n * @param currentView The current view\n * @param initPhaseState the current state of the init phase\n * @param arr The array in which the hooks are found\n * @param i The current index within the hook data array\n */\nfunction callHook(currentView, initPhase, arr, i) {\n const isInitHook = arr[i] < 0;\n const hook = arr[i + 1];\n const directiveIndex = isInitHook ? -arr[i] : arr[i];\n const directive = currentView[directiveIndex];\n if (isInitHook) {\n const indexWithintInitPhase = currentView[FLAGS] >> 14 /* LViewFlags.IndexWithinInitPhaseShift */;\n // The init phase state must be always checked here as it may have been recursively updated.\n if (indexWithintInitPhase < currentView[PREORDER_HOOK_FLAGS] >> 16 /* PreOrderHookFlags.NumberOfInitHooksCalledShift */ && (currentView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n currentView[FLAGS] += 16384 /* LViewFlags.IndexWithinInitPhaseIncrementer */;\n callHookInternal(directive, hook);\n }\n } else {\n callHookInternal(directive, hook);\n }\n}\nconst NO_PARENT_INJECTOR = -1;\n/**\n * Each injector is saved in 9 contiguous slots in `LView` and 9 contiguous slots in\n * `TView.data`. This allows us to store information about the current node's tokens (which\n * can be shared in `TView`) as well as the tokens of its ancestor nodes (which cannot be\n * shared, so they live in `LView`).\n *\n * Each of these slots (aside from the last slot) contains a bloom filter. This bloom filter\n * determines whether a directive is available on the associated node or not. This prevents us\n * from searching the directives array at this level unless it's probable the directive is in it.\n *\n * See: https://en.wikipedia.org/wiki/Bloom_filter for more about bloom filters.\n *\n * Because all injectors have been flattened into `LView` and `TViewData`, they cannot typed\n * using interfaces as they were previously. The start index of each `LInjector` and `TInjector`\n * will differ based on where it is flattened into the main array, so it's not possible to know\n * the indices ahead of time and save their types here. The interfaces are still included here\n * for documentation purposes.\n *\n * export interface LInjector extends Array<any> {\n *\n * // Cumulative bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Cumulative bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Cumulative bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Cumulative bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Cumulative bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Cumulative bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Cumulative bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Cumulative bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // We need to store a reference to the injector's parent so DI can keep looking up\n * // the injector tree until it finds the dependency it's looking for.\n * [PARENT_INJECTOR]: number;\n * }\n *\n * export interface TInjector extends Array<any> {\n *\n * // Shared node bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Shared node bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Shared node bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Shared node bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Shared node bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Shared node bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Shared node bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Shared node bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // Necessary to find directive indices for a particular node.\n * [TNODE]: TElementNode|TElementContainerNode|TContainerNode;\n * }\n */\n/**\n * Factory for creating instances of injectors in the NodeInjector.\n *\n * This factory is complicated by the fact that it can resolve `multi` factories as well.\n *\n * NOTE: Some of the fields are optional which means that this class has two hidden classes.\n * - One without `multi` support (most common)\n * - One with `multi` values, (rare).\n *\n * Since VMs can cache up to 4 inline hidden classes this is OK.\n *\n * - Single factory: Only `resolving` and `factory` is defined.\n * - `providers` factory: `componentProviders` is a number and `index = -1`.\n * - `viewProviders` factory: `componentProviders` is a number and `index` points to `providers`.\n */\nclass NodeInjectorFactory {\n constructor(\n /**\n * Factory to invoke in order to create a new instance.\n */\n factory,\n /**\n * Set to `true` if the token is declared in `viewProviders` (or if it is component).\n */\n isViewProvider, injectImplementation) {\n this.factory = factory;\n /**\n * Marker set to true during factory invocation to see if we get into recursive loop.\n * Recursive loop causes an error to be displayed.\n */\n this.resolving = false;\n ngDevMode && assertDefined(factory, 'Factory not specified');\n ngDevMode && assertEqual(typeof factory, 'function', 'Expected factory function.');\n this.canSeeViewProviders = isViewProvider;\n this.injectImpl = injectImplementation;\n }\n}\nfunction isFactory(obj) {\n return obj instanceof NodeInjectorFactory;\n}\n\n/**\n * Converts `TNodeType` into human readable text.\n * Make sure this matches with `TNodeType`\n */\nfunction toTNodeTypeAsString(tNodeType) {\n let text = '';\n tNodeType & 1 /* TNodeType.Text */ && (text += '|Text');\n tNodeType & 2 /* TNodeType.Element */ && (text += '|Element');\n tNodeType & 4 /* TNodeType.Container */ && (text += '|Container');\n tNodeType & 8 /* TNodeType.ElementContainer */ && (text += '|ElementContainer');\n tNodeType & 16 /* TNodeType.Projection */ && (text += '|Projection');\n tNodeType & 32 /* TNodeType.Icu */ && (text += '|IcuContainer');\n tNodeType & 64 /* TNodeType.Placeholder */ && (text += '|Placeholder');\n tNodeType & 128 /* TNodeType.LetDeclaration */ && (text += '|LetDeclaration');\n return text.length > 0 ? text.substring(1) : text;\n}\n/**\n * Helper function to detect if a given value matches a `TNode` shape.\n *\n * The logic uses the `insertBeforeIndex` and its possible values as\n * a way to differentiate a TNode shape from other types of objects\n * within the `TView.data`. This is not a perfect check, but it can\n * be a reasonable differentiator, since we control the shapes of objects\n * within `TView.data`.\n */\nfunction isTNodeShape(value) {\n return value != null && typeof value === 'object' && (value.insertBeforeIndex === null || typeof value.insertBeforeIndex === 'number' || Array.isArray(value.insertBeforeIndex));\n}\nfunction isLetDeclaration(tNode) {\n return !!(tNode.type & 128 /* TNodeType.LetDeclaration */);\n}\n/**\n * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.\n *\n * ```\n * <div my-dir [class]=\"exp\"></div>\n * ```\n * and\n * ```\n * @Directive({\n * })\n * class MyDirective {\n * @Input()\n * class: string;\n * }\n * ```\n *\n * In the above case it is necessary to write the reconciled styling information into the\n * directive's input.\n *\n * @param tNode\n */\nfunction hasClassInput(tNode) {\n return (tNode.flags & 8 /* TNodeFlags.hasClassInput */) !== 0;\n}\n/**\n * Returns `true` if the `TNode` has a directive which has `@Input()` for `style` binding.\n *\n * ```\n * <div my-dir [style]=\"exp\"></div>\n * ```\n * and\n * ```\n * @Directive({\n * })\n * class MyDirective {\n * @Input()\n * class: string;\n * }\n * ```\n *\n * In the above case it is necessary to write the reconciled styling information into the\n * directive's input.\n *\n * @param tNode\n */\nfunction hasStyleInput(tNode) {\n return (tNode.flags & 16 /* TNodeFlags.hasStyleInput */) !== 0;\n}\nfunction assertTNodeType(tNode, expectedTypes, message) {\n assertDefined(tNode, 'should be called with a TNode');\n if ((tNode.type & expectedTypes) === 0) {\n throwError(message || `Expected [${toTNodeTypeAsString(expectedTypes)}] but got ${toTNodeTypeAsString(tNode.type)}.`);\n }\n}\nfunction assertPureTNodeType(type) {\n if (!(type === 2 /* TNodeType.Element */ || type === 1 /* TNodeType.Text */ || type === 4 /* TNodeType.Container */ || type === 8 /* TNodeType.ElementContainer */ || type === 32 /* TNodeType.Icu */ || type === 16 /* TNodeType.Projection */ || type === 64 /* TNodeType.Placeholder */ || type === 128 /* TNodeType.LetDeclaration */)) {\n throwError(`Expected TNodeType to have only a single type selected, but got ${toTNodeTypeAsString(type)}.`);\n }\n}\n\n// This default value is when checking the hierarchy for a token.\n//\n// It means both:\n// - the token is not provided by the current injector,\n// - only the element injectors should be checked (ie do not check module injectors\n//\n// mod1\n// /\n// el1 mod2\n// \\ /\n// el2\n//\n// When requesting el2.injector.get(token), we should check in the following order and return the\n// first found value:\n// - el2.injector.get(token, default)\n// - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module\n// - mod2.injector.get(token, default)\nconst NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};\n\n/**\n * Injector that looks up a value using a specific injector, before falling back to the module\n * injector. Used primarily when creating components or embedded views dynamically.\n */\nclass ChainedInjector {\n constructor(injector, parentInjector) {\n this.injector = injector;\n this.parentInjector = parentInjector;\n }\n get(token, notFoundValue, flags) {\n flags = convertToBitFlags(flags);\n const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);\n if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR || notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n // Return the value from the root element injector when\n // - it provides it\n // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n // - the module injector should not be checked\n // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n return value;\n }\n return this.parentInjector.get(token, notFoundValue, flags);\n }\n}\n\n/// Parent Injector Utils ///////////////////////////////////////////////////////////////\nfunction hasParentInjector(parentLocation) {\n return parentLocation !== NO_PARENT_INJECTOR;\n}\nfunction getParentInjectorIndex(parentLocation) {\n if (ngDevMode) {\n assertNumber(parentLocation, 'Number expected');\n assertNotEqual(parentLocation, -1, 'Not a valid state.');\n const parentInjectorIndex = parentLocation & 32767 /* RelativeInjectorLocationFlags.InjectorIndexMask */;\n assertGreaterThan(parentInjectorIndex, HEADER_OFFSET, 'Parent injector must be pointing past HEADER_OFFSET.');\n }\n return parentLocation & 32767 /* RelativeInjectorLocationFlags.InjectorIndexMask */;\n}\nfunction getParentInjectorViewOffset(parentLocation) {\n return parentLocation >> 16 /* RelativeInjectorLocationFlags.ViewOffsetShift */;\n}\n/**\n * Unwraps a parent injector location number to find the view offset from the current injector,\n * then walks up the declaration view tree until the view is found that contains the parent\n * injector.\n *\n * @param location The location of the parent injector, which contains the view offset\n * @param startView The LView instance from which to start walking up the view tree\n * @returns The LView instance that contains the parent injector\n */\nfunction getParentInjectorView(location, startView) {\n let viewOffset = getParentInjectorViewOffset(location);\n let parentView = startView;\n // For most cases, the parent injector can be found on the host node (e.g. for component\n // or container), but we must keep the loop here to support the rarer case of deeply nested\n // <ng-template> tags or inline views, where the parent injector might live many views\n // above the child injector.\n while (viewOffset > 0) {\n parentView = parentView[DECLARATION_VIEW];\n viewOffset--;\n }\n return parentView;\n}\n/**\n * Detects whether an injector is an instance of a `ChainedInjector`,\n * created based on the `OutletInjector`.\n */\nfunction isRouterOutletInjector(currentInjector) {\n return currentInjector instanceof ChainedInjector && typeof currentInjector.injector.__ngOutletInjector === 'function';\n}\n\n/**\n * Defines if the call to `inject` should include `viewProviders` in its resolution.\n *\n * This is set to true when we try to instantiate a component. This value is reset in\n * `getNodeInjectable` to a value which matches the declaration location of the token about to be\n * instantiated. This is done so that if we are injecting a token which was declared outside of\n * `viewProviders` we don't accidentally pull `viewProviders` in.\n *\n * Example:\n *\n * ```\n * @Injectable()\n * class MyService {\n * constructor(public value: String) {}\n * }\n *\n * @Component({\n * providers: [\n * MyService,\n * {provide: String, value: 'providers' }\n * ]\n * viewProviders: [\n * {provide: String, value: 'viewProviders'}\n * ]\n * })\n * class MyComponent {\n * constructor(myService: MyService, value: String) {\n * // We expect that Component can see into `viewProviders`.\n * expect(value).toEqual('viewProviders');\n * // `MyService` was not declared in `viewProviders` hence it can't see it.\n * expect(myService.value).toEqual('providers');\n * }\n * }\n *\n * ```\n */\nlet includeViewProviders = true;\nfunction setIncludeViewProviders(v) {\n const oldValue = includeViewProviders;\n includeViewProviders = v;\n return oldValue;\n}\n/**\n * The number of slots in each bloom filter (used by DI). The larger this number, the fewer\n * directives that will share slots, and thus, the fewer false positives when checking for\n * the existence of a directive.\n */\nconst BLOOM_SIZE = 256;\nconst BLOOM_MASK = BLOOM_SIZE - 1;\n/**\n * The number of bits that is represented by a single bloom bucket. JS bit operations are 32 bits,\n * so each bucket represents 32 distinct tokens which accounts for log2(32) = 5 bits of a bloom hash\n * number.\n */\nconst BLOOM_BUCKET_BITS = 5;\n/** Counter used to generate unique IDs for directives. */\nlet nextNgElementId = 0;\n/** Value used when something wasn't found by an injector. */\nconst NOT_FOUND = {};\n/**\n * Registers this directive as present in its node's injector by flipping the directive's\n * corresponding bit in the injector's bloom filter.\n *\n * @param injectorIndex The index of the node injector where this token should be registered\n * @param tView The TView for the injector's bloom filters\n * @param type The directive token to register\n */\nfunction bloomAdd(injectorIndex, tView, type) {\n ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true');\n let id;\n if (typeof type === 'string') {\n id = type.charCodeAt(0) || 0;\n } else if (type.hasOwnProperty(NG_ELEMENT_ID)) {\n id = type[NG_ELEMENT_ID];\n }\n // Set a unique ID on the directive type, so if something tries to inject the directive,\n // we can easily retrieve the ID and hash it into the bloom bit that should be checked.\n if (id == null) {\n id = type[NG_ELEMENT_ID] = nextNgElementId++;\n }\n // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),\n // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.\n const bloomHash = id & BLOOM_MASK;\n // Create a mask that targets the specific bit associated with the directive.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n // Each bloom bucket in `tData` represents `BLOOM_BUCKET_BITS` number of bits of `bloomHash`.\n // Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset that the mask\n // should be written to.\n tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;\n}\n/**\n * Creates (or gets an existing) injector for a given element or container.\n *\n * @param tNode for which an injector should be retrieved / created.\n * @param lView View where the node is stored\n * @returns Node injector\n */\nfunction getOrCreateNodeInjectorForNode(tNode, lView) {\n const existingInjectorIndex = getInjectorIndex(tNode, lView);\n if (existingInjectorIndex !== -1) {\n return existingInjectorIndex;\n }\n const tView = lView[TVIEW];\n if (tView.firstCreatePass) {\n tNode.injectorIndex = lView.length;\n insertBloom(tView.data, tNode); // foundation for node bloom\n insertBloom(lView, null); // foundation for cumulative bloom\n insertBloom(tView.blueprint, null);\n }\n const parentLoc = getParentInjectorLocation(tNode, lView);\n const injectorIndex = tNode.injectorIndex;\n // If a parent injector can't be found, its location is set to -1.\n // In that case, we don't need to set up a cumulative bloom\n if (hasParentInjector(parentLoc)) {\n const parentIndex = getParentInjectorIndex(parentLoc);\n const parentLView = getParentInjectorView(parentLoc, lView);\n const parentData = parentLView[TVIEW].data;\n // Creates a cumulative bloom filter that merges the parent's bloom filter\n // and its own cumulative bloom (which contains tokens for all ancestors)\n for (let i = 0; i < 8 /* NodeInjectorOffset.BLOOM_SIZE */; i++) {\n lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];\n }\n }\n lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */] = parentLoc;\n return injectorIndex;\n}\nfunction insertBloom(arr, footer) {\n arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);\n}\nfunction getInjectorIndex(tNode, lView) {\n if (tNode.injectorIndex === -1 ||\n // If the injector index is the same as its parent's injector index, then the index has been\n // copied down from the parent node. No injector has been created yet on this node.\n tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex ||\n // After the first template pass, the injector index might exist but the parent values\n // might not have been calculated yet for this instance\n lView[tNode.injectorIndex + 8 /* NodeInjectorOffset.PARENT */] === null) {\n return -1;\n } else {\n ngDevMode && assertIndexInRange(lView, tNode.injectorIndex);\n return tNode.injectorIndex;\n }\n}\n/**\n * Finds the index of the parent injector, with a view offset if applicable. Used to set the\n * parent injector initially.\n *\n * @returns Returns a number that is the combination of the number of LViews that we have to go up\n * to find the LView containing the parent inject AND the index of the injector within that LView.\n */\nfunction getParentInjectorLocation(tNode, lView) {\n if (tNode.parent && tNode.parent.injectorIndex !== -1) {\n // If we have a parent `TNode` and there is an injector associated with it we are done, because\n // the parent injector is within the current `LView`.\n return tNode.parent.injectorIndex; // ViewOffset is 0\n }\n // When parent injector location is computed it may be outside of the current view. (ie it could\n // be pointing to a declared parent location). This variable stores number of declaration parents\n // we need to walk up in order to find the parent injector location.\n let declarationViewOffset = 0;\n let parentTNode = null;\n let lViewCursor = lView;\n // The parent injector is not in the current `LView`. We will have to walk the declared parent\n // `LView` hierarchy and look for it. If we walk of the top, that means that there is no parent\n // `NodeInjector`.\n while (lViewCursor !== null) {\n parentTNode = getTNodeFromLView(lViewCursor);\n if (parentTNode === null) {\n // If we have no parent, than we are done.\n return NO_PARENT_INJECTOR;\n }\n ngDevMode && parentTNode && assertTNodeForLView(parentTNode, lViewCursor[DECLARATION_VIEW]);\n // Every iteration of the loop requires that we go to the declared parent.\n declarationViewOffset++;\n lViewCursor = lViewCursor[DECLARATION_VIEW];\n if (parentTNode.injectorIndex !== -1) {\n // We found a NodeInjector which points to something.\n return parentTNode.injectorIndex | declarationViewOffset << 16 /* RelativeInjectorLocationFlags.ViewOffsetShift */;\n }\n }\n return NO_PARENT_INJECTOR;\n}\n/**\n * Makes a type or an injection token public to the DI system by adding it to an\n * injector's bloom filter.\n *\n * @param di The node injector in which a directive will be added\n * @param token The type or the injection token to be made public\n */\nfunction diPublicInInjector(injectorIndex, tView, token) {\n bloomAdd(injectorIndex, tView, token);\n}\n/**\n * Inject static attribute value into directive constructor.\n *\n * This method is used with `factory` functions which are generated as part of\n * `defineDirective` or `defineComponent`. The method retrieves the static value\n * of an attribute. (Dynamic attributes are not supported since they are not resolved\n * at the time of injection and can change over time.)\n *\n * # Example\n * Given:\n * ```\n * @Component(...)\n * class MyComponent {\n * constructor(@Attribute('title') title: string) { ... }\n * }\n * ```\n * When instantiated with\n * ```\n * <my-component title=\"Hello\"></my-component>\n * ```\n *\n * Then factory method generated is:\n * ```\n * MyComponent.ɵcmp = defineComponent({\n * factory: () => new MyComponent(injectAttribute('title'))\n * ...\n * })\n * ```\n *\n * @publicApi\n */\nfunction injectAttributeImpl(tNode, attrNameToInject) {\n ngDevMode && assertTNodeType(tNode, 12 /* TNodeType.AnyContainer */ | 3 /* TNodeType.AnyRNode */);\n ngDevMode && assertDefined(tNode, 'expecting tNode');\n if (attrNameToInject === 'class') {\n return tNode.classes;\n }\n if (attrNameToInject === 'style') {\n return tNode.styles;\n }\n const attrs = tNode.attrs;\n if (attrs) {\n const attrsLength = attrs.length;\n let i = 0;\n while (i < attrsLength) {\n const value = attrs[i];\n // If we hit a `Bindings` or `Template` marker then we are done.\n if (isNameOnlyAttributeMarker(value)) break;\n // Skip namespaced attributes\n if (value === 0 /* AttributeMarker.NamespaceURI */) {\n // we skip the next two values\n // as namespaced attributes looks like\n // [..., AttributeMarker.NamespaceURI, 'http://someuri.com/test', 'test:exist',\n // 'existValue', ...]\n i = i + 2;\n } else if (typeof value === 'number') {\n // Skip to the first value of the marked attribute.\n i++;\n while (i < attrsLength && typeof attrs[i] === 'string') {\n i++;\n }\n } else if (value === attrNameToInject) {\n return attrs[i + 1];\n } else {\n i = i + 2;\n }\n }\n }\n return null;\n}\nfunction notFoundValueOrThrow(notFoundValue, token, flags) {\n if (flags & InjectFlags.Optional || notFoundValue !== undefined) {\n return notFoundValue;\n } else {\n throwProviderNotFoundError(token, 'NodeInjector');\n }\n}\n/**\n * Returns the value associated to the given token from the ModuleInjector or throws exception\n *\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector or throws an exception\n */\nfunction lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) {\n if (flags & InjectFlags.Optional && notFoundValue === undefined) {\n // This must be set or the NullInjector will throw for optional deps\n notFoundValue = null;\n }\n if ((flags & (InjectFlags.Self | InjectFlags.Host)) === 0) {\n const moduleInjector = lView[INJECTOR];\n // switch to `injectInjectorOnly` implementation for module injector, since module injector\n // should not have access to Component/Directive DI scope (that may happen through\n // `directiveInject` implementation)\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n if (moduleInjector) {\n return moduleInjector.get(token, notFoundValue, flags & InjectFlags.Optional);\n } else {\n return injectRootLimpMode(token, notFoundValue, flags & InjectFlags.Optional);\n }\n } finally {\n setInjectImplementation(previousInjectImplementation);\n }\n }\n return notFoundValueOrThrow(notFoundValue, token, flags);\n}\n/**\n * Returns the value associated to the given token from the NodeInjectors => ModuleInjector.\n *\n * Look for the injector providing the token by walking up the node injector tree and then\n * the module injector tree.\n *\n * This function patches `token` with `__NG_ELEMENT_ID__` which contains the id for the bloom\n * filter. `-1` is reserved for injecting `Injector` (implemented by `NodeInjector`)\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction getOrCreateInjectable(tNode, lView, token, flags = InjectFlags.Default, notFoundValue) {\n if (tNode !== null) {\n // If the view or any of its ancestors have an embedded\n // view injector, we have to look it up there first.\n if (lView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */ &&\n // The token must be present on the current node injector when the `Self`\n // flag is set, so the lookup on embedded view injector(s) can be skipped.\n !(flags & InjectFlags.Self)) {\n const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND);\n if (embeddedInjectorValue !== NOT_FOUND) {\n return embeddedInjectorValue;\n }\n }\n // Otherwise try the node injector.\n const value = lookupTokenUsingNodeInjector(tNode, lView, token, flags, NOT_FOUND);\n if (value !== NOT_FOUND) {\n return value;\n }\n }\n // Finally, fall back to the module injector.\n return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n}\n/**\n * Returns the value associated to the given token from the node injector.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) {\n const bloomHash = bloomHashBitOrFactory(token);\n // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef\n // so just call the factory function to create it.\n if (typeof bloomHash === 'function') {\n if (!enterDI(lView, tNode, flags)) {\n // Failed to enter DI, try module injector instead. If a token is injected with the @Host\n // flag, the module injector is not searched for that token in Ivy.\n return flags & InjectFlags.Host ? notFoundValueOrThrow(notFoundValue, token, flags) : lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n }\n try {\n let value;\n if (ngDevMode) {\n runInInjectorProfilerContext(new NodeInjector(getCurrentTNode(), getLView()), token, () => {\n value = bloomHash(flags);\n if (value != null) {\n emitInstanceCreatedByInjectorEvent(value);\n }\n });\n } else {\n value = bloomHash(flags);\n }\n if (value == null && !(flags & InjectFlags.Optional)) {\n throwProviderNotFoundError(token);\n } else {\n return value;\n }\n } finally {\n leaveDI();\n }\n } else if (typeof bloomHash === 'number') {\n // A reference to the previous injector TView that was found while climbing the element\n // injector tree. This is used to know if viewProviders can be accessed on the current\n // injector.\n let previousTView = null;\n let injectorIndex = getInjectorIndex(tNode, lView);\n let parentLocation = NO_PARENT_INJECTOR;\n let hostTElementNode = flags & InjectFlags.Host ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;\n // If we should skip this injector, or if there is no injector on this node, start by\n // searching the parent injector.\n if (injectorIndex === -1 || flags & InjectFlags.SkipSelf) {\n parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) : lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];\n if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {\n injectorIndex = -1;\n } else {\n previousTView = lView[TVIEW];\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n }\n }\n // Traverse up the injector tree until we find a potential match or until we know there\n // *isn't* a match.\n while (injectorIndex !== -1) {\n ngDevMode && assertNodeInjector(lView, injectorIndex);\n // Check the current injector. If it matches, see if it contains token.\n const tView = lView[TVIEW];\n ngDevMode && assertTNodeForLView(tView.data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */], lView);\n if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {\n // At this point, we have an injector which *may* contain the token, so we step through\n // the providers and directives associated with the injector's corresponding node to get\n // the instance.\n const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode);\n if (instance !== NOT_FOUND) {\n return instance;\n }\n }\n parentLocation = lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];\n if (parentLocation !== NO_PARENT_INJECTOR && shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */] === hostTElementNode) && bloomHasToken(bloomHash, injectorIndex, lView)) {\n // The def wasn't found anywhere on this node, so it was a false positive.\n // Traverse up the tree and continue searching.\n previousTView = tView;\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n } else {\n // If we should not search parent OR If the ancestor bloom filter value does not have the\n // bit corresponding to the directive we can give up on traversing up to find the specific\n // injector.\n injectorIndex = -1;\n }\n }\n }\n return notFoundValue;\n}\nfunction searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {\n const currentTView = lView[TVIEW];\n const tNode = currentTView.data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];\n // First, we need to determine if view providers can be accessed by the starting element.\n // There are two possibilities\n const canAccessViewProviders = previousTView == null ?\n // 1) This is the first invocation `previousTView == null` which means that we are at the\n // `TNode` of where injector is starting to look. In such a case the only time we are allowed\n // to look into the ViewProviders is if:\n // - we are on a component\n // - AND the injector set `includeViewProviders` to true (implying that the token can see\n // ViewProviders because it is the Component or a Service which itself was declared in\n // ViewProviders)\n isComponentHost(tNode) && includeViewProviders :\n // 2) `previousTView != null` which means that we are now walking across the parent nodes.\n // In such a case we are only allowed to look into the ViewProviders if:\n // - We just crossed from child View to Parent View `previousTView != currentTView`\n // - AND the parent TNode is an Element.\n // This means that we just came from the Component's View and therefore are allowed to see\n // into the ViewProviders.\n previousTView != currentTView && (tNode.type & 3 /* TNodeType.AnyRNode */) !== 0;\n // This special case happens when there is a @host on the inject and when we are searching\n // on the host element node.\n const isHostSpecialCase = flags & InjectFlags.Host && hostTElementNode === tNode;\n const injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase);\n if (injectableIdx !== null) {\n return getNodeInjectable(lView, currentTView, injectableIdx, tNode);\n } else {\n return NOT_FOUND;\n }\n}\n/**\n * Searches for the given token among the node's directives and providers.\n *\n * @param tNode TNode on which directives are present.\n * @param tView The tView we are currently processing\n * @param token Provider token or type of a directive to look for.\n * @param canAccessViewProviders Whether view providers should be considered.\n * @param isHostSpecialCase Whether the host special case applies.\n * @returns Index of a found directive or provider, or null when none found.\n */\nfunction locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {\n const nodeProviderIndexes = tNode.providerIndexes;\n const tInjectables = tView.data;\n const injectablesStart = nodeProviderIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;\n const directivesStart = tNode.directiveStart;\n const directiveEnd = tNode.directiveEnd;\n const cptViewProvidersCount = nodeProviderIndexes >> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */;\n const startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;\n // When the host special case applies, only the viewProviders and the component are visible\n const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;\n for (let i = startingIndex; i < endIndex; i++) {\n const providerTokenOrDef = tInjectables[i];\n if (i < directivesStart && token === providerTokenOrDef || i >= directivesStart && providerTokenOrDef.type === token) {\n return i;\n }\n }\n if (isHostSpecialCase) {\n const dirDef = tInjectables[directivesStart];\n if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {\n return directivesStart;\n }\n }\n return null;\n}\n/**\n * Retrieve or instantiate the injectable from the `LView` at particular `index`.\n *\n * This function checks to see if the value has already been instantiated and if so returns the\n * cached `injectable`. Otherwise if it detects that the value is still a factory it\n * instantiates the `injectable` and caches the value.\n */\nfunction getNodeInjectable(lView, tView, index, tNode) {\n let value = lView[index];\n const tData = tView.data;\n if (isFactory(value)) {\n const factory = value;\n if (factory.resolving) {\n throwCyclicDependencyError(stringifyForError(tData[index]));\n }\n const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);\n factory.resolving = true;\n let prevInjectContext;\n if (ngDevMode) {\n // tData indexes mirror the concrete instances in its corresponding LView.\n // lView[index] here is either the injectable instace itself or a factory,\n // therefore tData[index] is the constructor of that injectable or a\n // definition object that contains the constructor in a `.type` field.\n const token = tData[index].type || tData[index];\n const injector = new NodeInjector(tNode, lView);\n prevInjectContext = setInjectorProfilerContext({\n injector,\n token\n });\n }\n const previousInjectImplementation = factory.injectImpl ? setInjectImplementation(factory.injectImpl) : null;\n const success = enterDI(lView, tNode, InjectFlags.Default);\n ngDevMode && assertEqual(success, true, \"Because flags do not contain `SkipSelf' we expect this to always succeed.\");\n try {\n value = lView[index] = factory.factory(undefined, tData, lView, tNode);\n ngDevMode && emitInstanceCreatedByInjectorEvent(value);\n // This code path is hit for both directives and providers.\n // For perf reasons, we want to avoid searching for hooks on providers.\n // It does no harm to try (the hooks just won't exist), but the extra\n // checks are unnecessary and this is a hot path. So we check to see\n // if the index of the dependency is in the directive range for this\n // tNode. If it's not, we know it's a provider and skip hook registration.\n if (tView.firstCreatePass && index >= tNode.directiveStart) {\n ngDevMode && assertDirectiveDef(tData[index]);\n registerPreOrderHooks(index, tData[index], tView);\n }\n } finally {\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n previousInjectImplementation !== null && setInjectImplementation(previousInjectImplementation);\n setIncludeViewProviders(previousIncludeViewProviders);\n factory.resolving = false;\n leaveDI();\n }\n }\n return value;\n}\n/**\n * Returns the bit in an injector's bloom filter that should be used to determine whether or not\n * the directive might be provided by the injector.\n *\n * When a directive is public, it is added to the bloom filter and given a unique ID that can be\n * retrieved on the Type. When the directive isn't public or the token is not a directive `null`\n * is returned as the node injector can not possibly provide that token.\n *\n * @param token the injection token\n * @returns the matching bit to check in the bloom filter or `null` if the token is not known.\n * When the returned value is negative then it represents special values such as `Injector`.\n */\nfunction bloomHashBitOrFactory(token) {\n ngDevMode && assertDefined(token, 'token must be defined');\n if (typeof token === 'string') {\n return token.charCodeAt(0) || 0;\n }\n const tokenId =\n // First check with `hasOwnProperty` so we don't get an inherited ID.\n token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : undefined;\n // Negative token IDs are used for special objects such as `Injector`\n if (typeof tokenId === 'number') {\n if (tokenId >= 0) {\n return tokenId & BLOOM_MASK;\n } else {\n ngDevMode && assertEqual(tokenId, -1 /* InjectorMarkers.Injector */, 'Expecting to get Special Injector Id');\n return createNodeInjector;\n }\n } else {\n return tokenId;\n }\n}\nfunction bloomHasToken(bloomHash, injectorIndex, injectorView) {\n // Create a mask that targets the specific bit associated with the directive we're looking for.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n // Each bloom bucket in `injectorView` represents `BLOOM_BUCKET_BITS` number of bits of\n // `bloomHash`. Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset\n // that should be used.\n const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];\n // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,\n // this injector is a potential match.\n return !!(value & mask);\n}\n/** Returns true if flags prevent parent injector from being searched for tokens */\nfunction shouldSearchParent(flags, isFirstHostTNode) {\n return !(flags & InjectFlags.Self) && !(flags & InjectFlags.Host && isFirstHostTNode);\n}\nfunction getNodeInjectorLView(nodeInjector) {\n return nodeInjector._lView;\n}\nfunction getNodeInjectorTNode(nodeInjector) {\n return nodeInjector._tNode;\n}\nclass NodeInjector {\n constructor(_tNode, _lView) {\n this._tNode = _tNode;\n this._lView = _lView;\n }\n get(token, notFoundValue, flags) {\n return getOrCreateInjectable(this._tNode, this._lView, token, convertToBitFlags(flags), notFoundValue);\n }\n}\n/** Creates a `NodeInjector` for the current node. */\nfunction createNodeInjector() {\n return new NodeInjector(getCurrentTNode(), getLView());\n}\n/**\n * @codeGenApi\n */\nfunction ɵɵgetInheritedFactory(type) {\n return noSideEffects(() => {\n const ownConstructor = type.prototype.constructor;\n const ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor);\n const objectPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objectPrototype) {\n const factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent);\n // If we hit something that has a factory and the factory isn't the same as the type,\n // we've found the inherited factory. Note the check that the factory isn't the type's\n // own factory is redundant in most cases, but if the user has custom decorators on the\n // class, this lookup will start one level down in the prototype chain, causing us to\n // find the own factory first and potentially triggering an infinite loop downstream.\n if (factory && factory !== ownFactory) {\n return factory;\n }\n parent = Object.getPrototypeOf(parent);\n }\n // There is no factory defined. Either this was improper usage of inheritance\n // (no Angular decorator on the superclass) or there is no constructor at all\n // in the inheritance chain. Since the two cases cannot be distinguished, the\n // latter has to be assumed.\n return t => new t();\n });\n}\nfunction getFactoryOf(type) {\n if (isForwardRef(type)) {\n return () => {\n const factory = getFactoryOf(resolveForwardRef(type));\n return factory && factory();\n };\n }\n return getFactoryDef(type);\n}\n/**\n * Returns a value from the closest embedded or node injector.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundValue) {\n let currentTNode = tNode;\n let currentLView = lView;\n // When an LView with an embedded view injector is inserted, it'll likely be interlaced with\n // nodes who may have injectors (e.g. node injector -> embedded view injector -> node injector).\n // Since the bloom filters for the node injectors have already been constructed and we don't\n // have a way of extracting the records from an injector, the only way to maintain the correct\n // hierarchy when resolving the value is to walk it node-by-node while attempting to resolve\n // the token at each level.\n while (currentTNode !== null && currentLView !== null && currentLView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */ && !(currentLView[FLAGS] & 512 /* LViewFlags.IsRoot */)) {\n ngDevMode && assertTNodeForLView(currentTNode, currentLView);\n // Note that this lookup on the node injector is using the `Self` flag, because\n // we don't want the node injector to look at any parent injectors since we\n // may hit the embedded view injector first.\n const nodeInjectorValue = lookupTokenUsingNodeInjector(currentTNode, currentLView, token, flags | InjectFlags.Self, NOT_FOUND);\n if (nodeInjectorValue !== NOT_FOUND) {\n return nodeInjectorValue;\n }\n // Has an explicit type due to a TS bug: https://github.com/microsoft/TypeScript/issues/33191\n let parentTNode = currentTNode.parent;\n // `TNode.parent` includes the parent within the current view only. If it doesn't exist,\n // it means that we've hit the view boundary and we need to go up to the next view.\n if (!parentTNode) {\n // Before we go to the next LView, check if the token exists on the current embedded injector.\n const embeddedViewInjector = currentLView[EMBEDDED_VIEW_INJECTOR];\n if (embeddedViewInjector) {\n const embeddedViewInjectorValue = embeddedViewInjector.get(token, NOT_FOUND, flags);\n if (embeddedViewInjectorValue !== NOT_FOUND) {\n return embeddedViewInjectorValue;\n }\n }\n // Otherwise keep going up the tree.\n parentTNode = getTNodeFromLView(currentLView);\n currentLView = currentLView[DECLARATION_VIEW];\n }\n currentTNode = parentTNode;\n }\n return notFoundValue;\n}\n/** Gets the TNode associated with an LView inside of the declaration view. */\nfunction getTNodeFromLView(lView) {\n const tView = lView[TVIEW];\n const tViewType = tView.type;\n // The parent pointer differs based on `TView.type`.\n if (tViewType === 2 /* TViewType.Embedded */) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode;\n } else if (tViewType === 1 /* TViewType.Component */) {\n // Components don't have `TView.declTNode` because each instance of component could be\n // inserted in different location, hence `TView.declTNode` is meaningless.\n return lView[T_HOST];\n }\n return null;\n}\n\n/**\n * Facade for the attribute injection from DI.\n *\n * @codeGenApi\n */\nfunction ɵɵinjectAttribute(attrNameToInject) {\n return injectAttributeImpl(getCurrentTNode(), attrNameToInject);\n}\n\n/**\n * Attribute decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Attribute = makeParamDecorator('Attribute', attributeName => ({\n attributeName,\n __NG_ELEMENT_ID__: () => ɵɵinjectAttribute(attributeName)\n}));\nlet _reflect = null;\nfunction getReflect() {\n return _reflect = _reflect || new ReflectionCapabilities();\n}\nfunction reflectDependencies(type) {\n return convertDependencies(getReflect().parameters(type));\n}\nfunction convertDependencies(deps) {\n return deps.map(dep => reflectDependency(dep));\n}\nfunction reflectDependency(dep) {\n const meta = {\n token: null,\n attribute: null,\n host: false,\n optional: false,\n self: false,\n skipSelf: false\n };\n if (Array.isArray(dep) && dep.length > 0) {\n for (let j = 0; j < dep.length; j++) {\n const param = dep[j];\n if (param === undefined) {\n // param may be undefined if type of dep is not set by ngtsc\n continue;\n }\n const proto = Object.getPrototypeOf(param);\n if (param instanceof Optional || proto.ngMetadataName === 'Optional') {\n meta.optional = true;\n } else if (param instanceof SkipSelf || proto.ngMetadataName === 'SkipSelf') {\n meta.skipSelf = true;\n } else if (param instanceof Self || proto.ngMetadataName === 'Self') {\n meta.self = true;\n } else if (param instanceof Host || proto.ngMetadataName === 'Host') {\n meta.host = true;\n } else if (param instanceof Inject) {\n meta.token = param.token;\n } else if (param instanceof Attribute) {\n if (param.attributeName === undefined) {\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Attribute name must be defined.`);\n }\n meta.attribute = param.attributeName;\n } else {\n meta.token = param;\n }\n }\n } else if (dep === undefined || Array.isArray(dep) && dep.length === 0) {\n meta.token = null;\n } else {\n meta.token = dep;\n }\n return meta;\n}\n\n/**\n * Compile an Angular injectable according to its `Injectable` metadata, and patch the resulting\n * injectable def (`ɵprov`) onto the injectable type.\n */\nfunction compileInjectable(type, meta) {\n let ngInjectableDef = null;\n let ngFactoryDef = null;\n // if NG_PROV_DEF is already defined on this class then don't overwrite it\n if (!type.hasOwnProperty(NG_PROV_DEF)) {\n Object.defineProperty(type, NG_PROV_DEF, {\n get: () => {\n if (ngInjectableDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'injectable',\n type\n });\n ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, `ng:///${type.name}/ɵprov.js`, getInjectableMetadata(type, meta));\n }\n return ngInjectableDef;\n }\n });\n }\n // if NG_FACTORY_DEF is already defined on this class then don't overwrite it\n if (!type.hasOwnProperty(NG_FACTORY_DEF)) {\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'injectable',\n type\n });\n ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ɵfac.js`, {\n name: type.name,\n type,\n typeArgumentCount: 0,\n // In JIT mode types are not available nor used.\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Injectable\n });\n }\n return ngFactoryDef;\n },\n // Leave this configurable so that the factories from directives or pipes can take precedence.\n configurable: true\n });\n }\n}\nconst USE_VALUE = getClosureSafeProperty({\n provide: String,\n useValue: getClosureSafeProperty\n});\nfunction isUseClassProvider(meta) {\n return meta.useClass !== undefined;\n}\nfunction isUseValueProvider(meta) {\n return USE_VALUE in meta;\n}\nfunction isUseFactoryProvider(meta) {\n return meta.useFactory !== undefined;\n}\nfunction isUseExistingProvider(meta) {\n return meta.useExisting !== undefined;\n}\nfunction getInjectableMetadata(type, srcMeta) {\n // Allow the compilation of a class with a `@Injectable()` decorator without parameters\n const meta = srcMeta || {\n providedIn: null\n };\n const compilerMeta = {\n name: type.name,\n type: type,\n typeArgumentCount: 0,\n providedIn: meta.providedIn\n };\n if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== undefined) {\n compilerMeta.deps = convertDependencies(meta.deps);\n }\n // Check to see if the user explicitly provided a `useXxxx` property.\n if (isUseClassProvider(meta)) {\n compilerMeta.useClass = meta.useClass;\n } else if (isUseValueProvider(meta)) {\n compilerMeta.useValue = meta.useValue;\n } else if (isUseFactoryProvider(meta)) {\n compilerMeta.useFactory = meta.useFactory;\n } else if (isUseExistingProvider(meta)) {\n compilerMeta.useExisting = meta.useExisting;\n }\n return compilerMeta;\n}\n\n/**\n * Injectable decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Injectable = makeDecorator('Injectable', undefined, undefined, undefined, (type, meta) => compileInjectable(type, meta));\n\n/**\n * Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s.\n */\nfunction createInjector(defType, parent = null, additionalProviders = null, name) {\n const injector = createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name);\n injector.resolveInjectorInitializers();\n return injector;\n}\n/**\n * Creates a new injector without eagerly resolving its injector types. Can be used in places\n * where resolving the injector types immediately can lead to an infinite loop. The injector types\n * should be resolved at a later point by calling `_resolveInjectorDefTypes`.\n */\nfunction createInjectorWithoutInjectorInstances(defType, parent = null, additionalProviders = null, name, scopes = new Set()) {\n const providers = [additionalProviders || EMPTY_ARRAY, importProvidersFrom(defType)];\n name = name || (typeof defType === 'object' ? undefined : stringify(defType));\n return new R3Injector(providers, parent || getNullInjector(), name || null, scopes);\n}\n\n/**\n * Concrete injectors implement this interface. Injectors are configured\n * with [providers](guide/di/dependency-injection-providers) that associate\n * dependencies of various types with [injection tokens](guide/di/dependency-injection-providers).\n *\n * @see [DI Providers](guide/di/dependency-injection-providers).\n * @see {@link StaticProvider}\n *\n * @usageNotes\n *\n * The following example creates a service injector instance.\n *\n * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}\n *\n * ### Usage example\n *\n * {@example core/di/ts/injector_spec.ts region='Injector'}\n *\n * `Injector` returns itself when given `Injector` as a token:\n *\n * {@example core/di/ts/injector_spec.ts region='injectInjector'}\n *\n * @publicApi\n */\nclass Injector {\n static {\n this.THROW_IF_NOT_FOUND = THROW_IF_NOT_FOUND;\n }\n static {\n this.NULL = new NullInjector();\n }\n static create(options, parent) {\n if (Array.isArray(options)) {\n return createInjector({\n name: ''\n }, parent, options, '');\n } else {\n const name = options.name ?? '';\n return createInjector({\n name\n }, options.parent, options.providers, name);\n }\n }\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: Injector,\n providedIn: 'any',\n factory: () => ɵɵinject(INJECTOR$1)\n });\n }\n /**\n * @internal\n * @nocollapse\n */\n static {\n this.__NG_ELEMENT_ID__ = -1 /* InjectorMarkers.Injector */;\n }\n}\n\n/*!\n * @license\n * Copyright Google LLC 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.dev/license\n */\n/**\n * Creates a token that can be used to inject static attributes of the host node.\n *\n * @usageNotes\n * ### Injecting an attribute that is known to exist\n * ```typescript\n * @Directive()\n * class MyDir {\n * attr: string = inject(new HostAttributeToken('some-attr'));\n * }\n * ```\n *\n * ### Optionally injecting an attribute\n * ```typescript\n * @Directive()\n * class MyDir {\n * attr: string | null = inject(new HostAttributeToken('some-attr'), {optional: true});\n * }\n * ```\n * @publicApi\n */\nclass HostAttributeToken {\n constructor(attributeName) {\n this.attributeName = attributeName;\n /** @internal */\n this.__NG_ELEMENT_ID__ = () => ɵɵinjectAttribute(this.attributeName);\n }\n toString() {\n return `HostAttributeToken ${this.attributeName}`;\n }\n}\n\n/**\n * A token that can be used to inject the tag name of the host node.\n *\n * @usageNotes\n * ### Injecting a tag name that is known to exist\n * ```typescript\n * @Directive()\n * class MyDir {\n * tagName: string = inject(HOST_TAG_NAME);\n * }\n * ```\n *\n * ### Optionally injecting a tag name\n * ```typescript\n * @Directive()\n * class MyDir {\n * tagName: string | null = inject(HOST_TAG_NAME, {optional: true});\n * }\n * ```\n * @publicApi\n */\nconst HOST_TAG_NAME = new InjectionToken(ngDevMode ? 'HOST_TAG_NAME' : '');\n// HOST_TAG_NAME should be resolved at the current node, similar to e.g. ElementRef,\n// so we manually specify __NG_ELEMENT_ID__ here, instead of using a factory.\n// tslint:disable-next-line:no-toplevel-property-access\nHOST_TAG_NAME.__NG_ELEMENT_ID__ = flags => {\n const tNode = getCurrentTNode();\n if (tNode === null) {\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && 'HOST_TAG_NAME can only be injected in directives and components ' + 'during construction time (in a class constructor or as a class field initializer)');\n }\n if (tNode.type & 2 /* TNodeType.Element */) {\n return tNode.value;\n }\n if (flags & InjectFlags.Optional) {\n return null;\n }\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `HOST_TAG_NAME was used on ${getDevModeNodeName(tNode)} which doesn't have an underlying element in the DOM. ` + `This is invalid, and so the dependency should be marked as optional.`);\n};\nfunction getDevModeNodeName(tNode) {\n if (tNode.type & 8 /* TNodeType.ElementContainer */) {\n return 'an <ng-container>';\n } else if (tNode.type & 4 /* TNodeType.Container */) {\n return 'an <ng-template>';\n } else if (tNode.type & 128 /* TNodeType.LetDeclaration */) {\n return 'an @let declaration';\n } else {\n return 'a node';\n }\n}\n\n/**\n * @module\n * @description\n * The `di` module provides dependency injection container services.\n */\n\n/**\n * This file should not be necessary because node resolution should just default to `./di/index`!\n *\n * However it does not seem to work and it breaks:\n * - //packages/animations/browser/test:test_web_chromium-local\n * - //packages/compiler-cli/test:extract_i18n\n * - //packages/compiler-cli/test:ngc\n * - //packages/compiler-cli/test:perform_watch\n * - //packages/compiler-cli/test/diagnostics:check_types\n * - //packages/compiler-cli/test/transformers:test\n * - //packages/compiler/test:test\n * - //tools/public_api_guard:core_api\n *\n * Remove this file once the above is solved or wait until `ngc` is deleted and then it should be\n * safe to delete this file.\n */\n\nconst ERROR_ORIGINAL_ERROR = 'ngOriginalError';\nfunction wrappedError(message, originalError) {\n const msg = `${message} caused by: ${originalError instanceof Error ? originalError.message : originalError}`;\n const error = Error(msg);\n error[ERROR_ORIGINAL_ERROR] = originalError;\n return error;\n}\nfunction getOriginalError(error) {\n return error[ERROR_ORIGINAL_ERROR];\n}\nconst SCHEDULE_IN_ROOT_ZONE_DEFAULT = true;\n\n/**\n * `DestroyRef` lets you set callbacks to run for any cleanup or destruction behavior.\n * The scope of this destruction depends on where `DestroyRef` is injected. If `DestroyRef`\n * is injected in a component or directive, the callbacks run when that component or\n * directive is destroyed. Otherwise the callbacks run when a corresponding injector is destroyed.\n *\n * @publicApi\n */\nclass DestroyRef {\n /**\n * @internal\n * @nocollapse\n */\n static {\n this.__NG_ELEMENT_ID__ = injectDestroyRef;\n }\n /**\n * @internal\n * @nocollapse\n */\n static {\n this.__NG_ENV_ID__ = injector => injector;\n }\n}\nclass NodeInjectorDestroyRef extends DestroyRef {\n constructor(_lView) {\n super();\n this._lView = _lView;\n }\n onDestroy(callback) {\n storeLViewOnDestroy(this._lView, callback);\n return () => removeLViewOnDestroy(this._lView, callback);\n }\n}\nfunction injectDestroyRef() {\n return new NodeInjectorDestroyRef(getLView());\n}\n\n/**\n * Internal implementation of the pending tasks service.\n */\nclass PendingTasks {\n constructor() {\n this.taskId = 0;\n this.pendingTasks = new Set();\n this.hasPendingTasks = new BehaviorSubject(false);\n }\n get _hasPendingTasks() {\n return this.hasPendingTasks.value;\n }\n add() {\n if (!this._hasPendingTasks) {\n this.hasPendingTasks.next(true);\n }\n const taskId = this.taskId++;\n this.pendingTasks.add(taskId);\n return taskId;\n }\n remove(taskId) {\n this.pendingTasks.delete(taskId);\n if (this.pendingTasks.size === 0 && this._hasPendingTasks) {\n this.hasPendingTasks.next(false);\n }\n }\n ngOnDestroy() {\n this.pendingTasks.clear();\n if (this._hasPendingTasks) {\n this.hasPendingTasks.next(false);\n }\n }\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: PendingTasks,\n providedIn: 'root',\n factory: () => new PendingTasks()\n });\n }\n}\n/**\n * Experimental service that keeps track of pending tasks contributing to the stableness of Angular\n * application. While several existing Angular services (ex.: `HttpClient`) will internally manage\n * tasks influencing stability, this API gives control over stability to library and application\n * developers for specific cases not covered by Angular internals.\n *\n * The concept of stability comes into play in several important scenarios:\n * - SSR process needs to wait for the application stability before serializing and sending rendered\n * HTML;\n * - tests might want to delay assertions until the application becomes stable;\n *\n * @usageNotes\n * ```typescript\n * const pendingTasks = inject(ExperimentalPendingTasks);\n * const taskCleanup = pendingTasks.add();\n * // do work that should block application's stability and then:\n * taskCleanup();\n * ```\n *\n * This API is experimental. Neither the shape, nor the underlying behavior is stable and can change\n * in patch versions. We will iterate on the exact API based on the feedback and our understanding\n * of the problem and solution space.\n *\n * @publicApi\n * @experimental\n */\nclass ExperimentalPendingTasks {\n constructor() {\n this.internalPendingTasks = inject(PendingTasks);\n }\n /**\n * Adds a new task that should block application's stability.\n * @returns A cleanup function that removes a task when called.\n */\n add() {\n const taskId = this.internalPendingTasks.add();\n return () => this.internalPendingTasks.remove(taskId);\n }\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: ExperimentalPendingTasks,\n providedIn: 'root',\n factory: () => new ExperimentalPendingTasks()\n });\n }\n}\nclass EventEmitter_ extends Subject {\n constructor(isAsync = false) {\n super();\n this.destroyRef = undefined;\n this.pendingTasks = undefined;\n this.__isAsync = isAsync;\n // Attempt to retrieve a `DestroyRef` and `PendingTasks` optionally.\n // For backwards compatibility reasons, this cannot be required.\n if (isInInjectionContext()) {\n // `DestroyRef` is optional because it is not available in all contexts.\n // But it is useful to properly complete the `EventEmitter` if used with `outputToObservable`\n // when the component/directive is destroyed. (See `outputToObservable` for more details.)\n this.destroyRef = inject(DestroyRef, {\n optional: true\n }) ?? undefined;\n this.pendingTasks = inject(PendingTasks, {\n optional: true\n }) ?? undefined;\n }\n }\n emit(value) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n super.next(value);\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n subscribe(observerOrNext, error, complete) {\n let nextFn = observerOrNext;\n let errorFn = error || (() => null);\n let completeFn = complete;\n if (observerOrNext && typeof observerOrNext === 'object') {\n const observer = observerOrNext;\n nextFn = observer.next?.bind(observer);\n errorFn = observer.error?.bind(observer);\n completeFn = observer.complete?.bind(observer);\n }\n if (this.__isAsync) {\n errorFn = this.wrapInTimeout(errorFn);\n if (nextFn) {\n nextFn = this.wrapInTimeout(nextFn);\n }\n if (completeFn) {\n completeFn = this.wrapInTimeout(completeFn);\n }\n }\n const sink = super.subscribe({\n next: nextFn,\n error: errorFn,\n complete: completeFn\n });\n if (observerOrNext instanceof Subscription) {\n observerOrNext.add(sink);\n }\n return sink;\n }\n wrapInTimeout(fn) {\n return value => {\n const taskId = this.pendingTasks?.add();\n setTimeout(() => {\n fn(value);\n if (taskId !== undefined) {\n this.pendingTasks?.remove(taskId);\n }\n });\n };\n }\n}\n/**\n * @publicApi\n */\nconst EventEmitter = EventEmitter_;\nfunction noop(...args) {\n // Do nothing.\n}\n\n/**\n * Gets a scheduling function that runs the callback after the first of setTimeout and\n * requestAnimationFrame resolves.\n *\n * - `requestAnimationFrame` ensures that change detection runs ahead of a browser repaint.\n * This ensures that the create and update passes of a change detection always happen\n * in the same frame.\n * - When the browser is resource-starved, `rAF` can execute _before_ a `setTimeout` because\n * rendering is a very high priority process. This means that `setTimeout` cannot guarantee\n * same-frame create and update pass, when `setTimeout` is used to schedule the update phase.\n * - While `rAF` gives us the desirable same-frame updates, it has two limitations that\n * prevent it from being used alone. First, it does not run in background tabs, which would\n * prevent Angular from initializing an application when opened in a new tab (for example).\n * Second, repeated calls to requestAnimationFrame will execute at the refresh rate of the\n * hardware (~16ms for a 60Hz display). This would cause significant slowdown of tests that\n * are written with several updates and asserts in the form of \"update; await stable; assert;\".\n * - Both `setTimeout` and `rAF` are able to \"coalesce\" several events from a single user\n * interaction into a single change detection. Importantly, this reduces view tree traversals when\n * compared to an alternative timing mechanism like `queueMicrotask`, where change detection would\n * then be interleaves between each event.\n *\n * By running change detection after the first of `setTimeout` and `rAF` to execute, we get the\n * best of both worlds.\n *\n * @returns a function to cancel the scheduled callback\n */\nfunction scheduleCallbackWithRafRace(callback) {\n let timeoutId;\n let animationFrameId;\n function cleanup() {\n callback = noop;\n try {\n if (animationFrameId !== undefined && typeof cancelAnimationFrame === 'function') {\n cancelAnimationFrame(animationFrameId);\n }\n if (timeoutId !== undefined) {\n clearTimeout(timeoutId);\n }\n } catch {\n // Clearing/canceling can fail in tests due to the timing of functions being patched and unpatched\n // Just ignore the errors - we protect ourselves from this issue by also making the callback a no-op.\n }\n }\n timeoutId = setTimeout(() => {\n callback();\n cleanup();\n });\n if (typeof requestAnimationFrame === 'function') {\n animationFrameId = requestAnimationFrame(() => {\n callback();\n cleanup();\n });\n }\n return () => cleanup();\n}\nfunction scheduleCallbackWithMicrotask(callback) {\n queueMicrotask(() => callback());\n return () => {\n callback = noop;\n };\n}\nclass AsyncStackTaggingZoneSpec {\n constructor(namePrefix, consoleAsyncStackTaggingImpl = console) {\n this.name = 'asyncStackTagging for ' + namePrefix;\n this.createTask = consoleAsyncStackTaggingImpl?.createTask ?? (() => null);\n }\n onScheduleTask(delegate, _current, target, task) {\n task.consoleTask = this.createTask(`Zone - ${task.source || task.type}`);\n return delegate.scheduleTask(target, task);\n }\n onInvokeTask(delegate, _currentZone, targetZone, task, applyThis, applyArgs) {\n let ret;\n if (task.consoleTask) {\n ret = task.consoleTask.run(() => delegate.invokeTask(targetZone, task, applyThis, applyArgs));\n } else {\n ret = delegate.invokeTask(targetZone, task, applyThis, applyArgs);\n }\n return ret;\n }\n}\nconst isAngularZoneProperty = 'isAngularZone';\nconst angularZoneInstanceIdProperty = isAngularZoneProperty + '_ID';\nlet ngZoneInstanceId = 0;\n/**\n * An injectable service for executing work inside or outside of the Angular zone.\n *\n * The most common use of this service is to optimize performance when starting a work consisting of\n * one or more asynchronous tasks that don't require UI updates or error handling to be handled by\n * Angular. Such tasks can be kicked off via {@link #runOutsideAngular} and if needed, these tasks\n * can reenter the Angular zone via {@link #run}.\n *\n * <!-- TODO: add/fix links to:\n * - docs explaining zones and the use of zones in Angular and change-detection\n * - link to runOutsideAngular/run (throughout this file!)\n * -->\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * import {Component, NgZone} from '@angular/core';\n * import {NgIf} from '@angular/common';\n *\n * @Component({\n * selector: 'ng-zone-demo',\n * template: `\n * <h2>Demo: NgZone</h2>\n *\n * <p>Progress: {{progress}}%</p>\n * <p *ngIf=\"progress >= 100\">Done processing {{label}} of Angular zone!</p>\n *\n * <button (click)=\"processWithinAngularZone()\">Process within Angular zone</button>\n * <button (click)=\"processOutsideOfAngularZone()\">Process outside of Angular zone</button>\n * `,\n * })\n * export class NgZoneDemo {\n * progress: number = 0;\n * label: string;\n *\n * constructor(private _ngZone: NgZone) {}\n *\n * // Loop inside the Angular zone\n * // so the UI DOES refresh after each setTimeout cycle\n * processWithinAngularZone() {\n * this.label = 'inside';\n * this.progress = 0;\n * this._increaseProgress(() => console.log('Inside Done!'));\n * }\n *\n * // Loop outside of the Angular zone\n * // so the UI DOES NOT refresh after each setTimeout cycle\n * processOutsideOfAngularZone() {\n * this.label = 'outside';\n * this.progress = 0;\n * this._ngZone.runOutsideAngular(() => {\n * this._increaseProgress(() => {\n * // reenter the Angular zone and display done\n * this._ngZone.run(() => { console.log('Outside Done!'); });\n * });\n * });\n * }\n *\n * _increaseProgress(doneCallback: () => void) {\n * this.progress += 1;\n * console.log(`Current progress: ${this.progress}%`);\n *\n * if (this.progress < 100) {\n * window.setTimeout(() => this._increaseProgress(doneCallback), 10);\n * } else {\n * doneCallback();\n * }\n * }\n * }\n * ```\n *\n * @publicApi\n */\nclass NgZone {\n constructor(options) {\n this.hasPendingMacrotasks = false;\n this.hasPendingMicrotasks = false;\n /**\n * Whether there are no outstanding microtasks or macrotasks.\n */\n this.isStable = true;\n /**\n * Notifies when code enters Angular Zone. This gets fired first on VM Turn.\n */\n this.onUnstable = new EventEmitter(false);\n /**\n * Notifies when there is no more microtasks enqueued in the current VM Turn.\n * This is a hint for Angular to do change detection, which may enqueue more microtasks.\n * For this reason this event can fire multiple times per VM Turn.\n */\n this.onMicrotaskEmpty = new EventEmitter(false);\n /**\n * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which\n * implies we are about to relinquish VM turn.\n * This event gets called just once.\n */\n this.onStable = new EventEmitter(false);\n /**\n * Notifies that an error has been delivered.\n */\n this.onError = new EventEmitter(false);\n const {\n enableLongStackTrace = false,\n shouldCoalesceEventChangeDetection = false,\n shouldCoalesceRunChangeDetection = false,\n scheduleInRootZone = SCHEDULE_IN_ROOT_ZONE_DEFAULT\n } = options;\n if (typeof Zone == 'undefined') {\n throw new RuntimeError(908 /* RuntimeErrorCode.MISSING_ZONEJS */, ngDevMode && `In this configuration Angular requires Zone.js`);\n }\n Zone.assertZonePatched();\n const self = this;\n self._nesting = 0;\n self._outer = self._inner = Zone.current;\n // AsyncStackTaggingZoneSpec provides `linked stack traces` to show\n // where the async operation is scheduled. For more details, refer\n // to this article, https://developer.chrome.com/blog/devtools-better-angular-debugging/\n // And we only import this AsyncStackTaggingZoneSpec in development mode,\n // in the production mode, the AsyncStackTaggingZoneSpec will be tree shaken away.\n if (ngDevMode) {\n self._inner = self._inner.fork(new AsyncStackTaggingZoneSpec('Angular'));\n }\n if (Zone['TaskTrackingZoneSpec']) {\n self._inner = self._inner.fork(new Zone['TaskTrackingZoneSpec']());\n }\n if (enableLongStackTrace && Zone['longStackTraceZoneSpec']) {\n self._inner = self._inner.fork(Zone['longStackTraceZoneSpec']);\n }\n // if shouldCoalesceRunChangeDetection is true, all tasks including event tasks will be\n // coalesced, so shouldCoalesceEventChangeDetection option is not necessary and can be skipped.\n self.shouldCoalesceEventChangeDetection = !shouldCoalesceRunChangeDetection && shouldCoalesceEventChangeDetection;\n self.shouldCoalesceRunChangeDetection = shouldCoalesceRunChangeDetection;\n self.callbackScheduled = false;\n self.scheduleInRootZone = scheduleInRootZone;\n forkInnerZoneWithAngularBehavior(self);\n }\n /**\n This method checks whether the method call happens within an Angular Zone instance.\n */\n static isInAngularZone() {\n // Zone needs to be checked, because this method might be called even when NoopNgZone is used.\n return typeof Zone !== 'undefined' && Zone.current.get(isAngularZoneProperty) === true;\n }\n /**\n Assures that the method is called within the Angular Zone, otherwise throws an error.\n */\n static assertInAngularZone() {\n if (!NgZone.isInAngularZone()) {\n throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to be in Angular Zone, but it is not!');\n }\n }\n /**\n Assures that the method is called outside of the Angular Zone, otherwise throws an error.\n */\n static assertNotInAngularZone() {\n if (NgZone.isInAngularZone()) {\n throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to not be in Angular Zone, but it is!');\n }\n }\n /**\n * Executes the `fn` function synchronously within the Angular zone and returns value returned by\n * the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n run(fn, applyThis, applyArgs) {\n return this._inner.run(fn, applyThis, applyArgs);\n }\n /**\n * Executes the `fn` function synchronously within the Angular zone as a task and returns value\n * returned by the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n runTask(fn, applyThis, applyArgs, name) {\n const zone = this._inner;\n const task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);\n try {\n return zone.runTask(task, applyThis, applyArgs);\n } finally {\n zone.cancelTask(task);\n }\n }\n /**\n * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not\n * rethrown.\n */\n runGuarded(fn, applyThis, applyArgs) {\n return this._inner.runGuarded(fn, applyThis, applyArgs);\n }\n /**\n * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by\n * the function.\n *\n * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do\n * work that\n * doesn't trigger Angular change-detection or is subject to Angular's error handling.\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * outside of the Angular zone.\n *\n * Use {@link #run} to reenter the Angular zone and do work that updates the application model.\n */\n runOutsideAngular(fn) {\n return this._outer.run(fn);\n }\n}\nconst EMPTY_PAYLOAD = {};\nfunction checkStable(zone) {\n // TODO: @JiaLiPassion, should check zone.isCheckStableRunning to prevent\n // re-entry. The case is:\n //\n // @Component({...})\n // export class AppComponent {\n // constructor(private ngZone: NgZone) {\n // this.ngZone.onStable.subscribe(() => {\n // this.ngZone.run(() => console.log('stable'););\n // });\n // }\n //\n // The onStable subscriber run another function inside ngZone\n // which causes `checkStable()` re-entry.\n // But this fix causes some issues in g3, so this fix will be\n // launched in another PR.\n if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {\n try {\n zone._nesting++;\n zone.onMicrotaskEmpty.emit(null);\n } finally {\n zone._nesting--;\n if (!zone.hasPendingMicrotasks) {\n try {\n zone.runOutsideAngular(() => zone.onStable.emit(null));\n } finally {\n zone.isStable = true;\n }\n }\n }\n }\n}\nfunction delayChangeDetectionForEvents(zone) {\n /**\n * We also need to check _nesting here\n * Consider the following case with shouldCoalesceRunChangeDetection = true\n *\n * ngZone.run(() => {});\n * ngZone.run(() => {});\n *\n * We want the two `ngZone.run()` only trigger one change detection\n * when shouldCoalesceRunChangeDetection is true.\n * And because in this case, change detection run in async way(requestAnimationFrame),\n * so we also need to check the _nesting here to prevent multiple\n * change detections.\n */\n if (zone.isCheckStableRunning || zone.callbackScheduled) {\n return;\n }\n zone.callbackScheduled = true;\n function scheduleCheckStable() {\n scheduleCallbackWithRafRace(() => {\n zone.callbackScheduled = false;\n updateMicroTaskStatus(zone);\n zone.isCheckStableRunning = true;\n checkStable(zone);\n zone.isCheckStableRunning = false;\n });\n }\n if (zone.scheduleInRootZone) {\n Zone.root.run(() => {\n scheduleCheckStable();\n });\n } else {\n zone._outer.run(() => {\n scheduleCheckStable();\n });\n }\n updateMicroTaskStatus(zone);\n}\nfunction forkInnerZoneWithAngularBehavior(zone) {\n const delayChangeDetectionForEventsDelegate = () => {\n delayChangeDetectionForEvents(zone);\n };\n const instanceId = ngZoneInstanceId++;\n zone._inner = zone._inner.fork({\n name: 'angular',\n properties: {\n [isAngularZoneProperty]: true,\n [angularZoneInstanceIdProperty]: instanceId,\n [angularZoneInstanceIdProperty + instanceId]: true\n },\n onInvokeTask: (delegate, current, target, task, applyThis, applyArgs) => {\n // Prevent triggering change detection when the flag is detected.\n if (shouldBeIgnoredByZone(applyArgs)) {\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n }\n try {\n onEnter(zone);\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n } finally {\n if (zone.shouldCoalesceEventChangeDetection && task.type === 'eventTask' || zone.shouldCoalesceRunChangeDetection) {\n delayChangeDetectionForEventsDelegate();\n }\n onLeave(zone);\n }\n },\n onInvoke: (delegate, current, target, callback, applyThis, applyArgs, source) => {\n try {\n onEnter(zone);\n return delegate.invoke(target, callback, applyThis, applyArgs, source);\n } finally {\n if (zone.shouldCoalesceRunChangeDetection &&\n // Do not delay change detection when the task is the scheduler's tick.\n // We need to synchronously trigger the stability logic so that the\n // zone-based scheduler can prevent a duplicate ApplicationRef.tick\n // by first checking if the scheduler tick is running. This does seem a bit roundabout,\n // but we _do_ still want to trigger all the correct events when we exit the zone.run\n // (`onMicrotaskEmpty` and `onStable` _should_ emit; developers can have code which\n // relies on these events happening after change detection runs).\n // Note: `zone.callbackScheduled` is already in delayChangeDetectionForEventsDelegate\n // but is added here as well to prevent reads of applyArgs when not necessary\n !zone.callbackScheduled && !isSchedulerTick(applyArgs)) {\n delayChangeDetectionForEventsDelegate();\n }\n onLeave(zone);\n }\n },\n onHasTask: (delegate, current, target, hasTaskState) => {\n delegate.hasTask(target, hasTaskState);\n if (current === target) {\n // We are only interested in hasTask events which originate from our zone\n // (A child hasTask event is not interesting to us)\n if (hasTaskState.change == 'microTask') {\n zone._hasPendingMicrotasks = hasTaskState.microTask;\n updateMicroTaskStatus(zone);\n checkStable(zone);\n } else if (hasTaskState.change == 'macroTask') {\n zone.hasPendingMacrotasks = hasTaskState.macroTask;\n }\n }\n },\n onHandleError: (delegate, current, target, error) => {\n delegate.handleError(target, error);\n zone.runOutsideAngular(() => zone.onError.emit(error));\n return false;\n }\n });\n}\nfunction updateMicroTaskStatus(zone) {\n if (zone._hasPendingMicrotasks || (zone.shouldCoalesceEventChangeDetection || zone.shouldCoalesceRunChangeDetection) && zone.callbackScheduled === true) {\n zone.hasPendingMicrotasks = true;\n } else {\n zone.hasPendingMicrotasks = false;\n }\n}\nfunction onEnter(zone) {\n zone._nesting++;\n if (zone.isStable) {\n zone.isStable = false;\n zone.onUnstable.emit(null);\n }\n}\nfunction onLeave(zone) {\n zone._nesting--;\n checkStable(zone);\n}\n/**\n * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls\n * to framework to perform rendering.\n */\nclass NoopNgZone {\n constructor() {\n this.hasPendingMicrotasks = false;\n this.hasPendingMacrotasks = false;\n this.isStable = true;\n this.onUnstable = new EventEmitter();\n this.onMicrotaskEmpty = new EventEmitter();\n this.onStable = new EventEmitter();\n this.onError = new EventEmitter();\n }\n run(fn, applyThis, applyArgs) {\n return fn.apply(applyThis, applyArgs);\n }\n runGuarded(fn, applyThis, applyArgs) {\n return fn.apply(applyThis, applyArgs);\n }\n runOutsideAngular(fn) {\n return fn();\n }\n runTask(fn, applyThis, applyArgs, name) {\n return fn.apply(applyThis, applyArgs);\n }\n}\nfunction shouldBeIgnoredByZone(applyArgs) {\n return hasApplyArgsData(applyArgs, '__ignore_ng_zone__');\n}\nfunction isSchedulerTick(applyArgs) {\n return hasApplyArgsData(applyArgs, '__scheduler_tick__');\n}\nfunction hasApplyArgsData(applyArgs, key) {\n if (!Array.isArray(applyArgs)) {\n return false;\n }\n // We should only ever get 1 arg passed through to invokeTask.\n // Short circuit here incase that behavior changes.\n if (applyArgs.length !== 1) {\n return false;\n }\n return applyArgs[0]?.data?.[key] === true;\n}\nfunction getNgZone(ngZoneToUse = 'zone.js', options) {\n if (ngZoneToUse === 'noop') {\n return new NoopNgZone();\n }\n if (ngZoneToUse === 'zone.js') {\n return new NgZone(options);\n }\n return ngZoneToUse;\n}\n\n// Public API for Zone\n\n/**\n * Provides a hook for centralized exception handling.\n *\n * The default implementation of `ErrorHandler` prints error messages to the `console`. To\n * intercept error handling, write a custom exception handler that replaces this default as\n * appropriate for your app.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * class MyErrorHandler implements ErrorHandler {\n * handleError(error) {\n * // do something with the exception\n * }\n * }\n *\n * @NgModule({\n * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]\n * })\n * class MyModule {}\n * ```\n *\n * @publicApi\n */\nclass ErrorHandler {\n constructor() {\n /**\n * @internal\n */\n this._console = console;\n }\n handleError(error) {\n const originalError = this._findOriginalError(error);\n this._console.error('ERROR', error);\n if (originalError) {\n this._console.error('ORIGINAL ERROR', originalError);\n }\n }\n /** @internal */\n _findOriginalError(error) {\n let e = error && getOriginalError(error);\n while (e && getOriginalError(e)) {\n e = getOriginalError(e);\n }\n return e || null;\n }\n}\n/**\n * `InjectionToken` used to configure how to call the `ErrorHandler`.\n *\n * `NgZone` is provided by default today so the default (and only) implementation for this\n * is calling `ErrorHandler.handleError` outside of the Angular zone.\n */\nconst INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'internal error handler' : '', {\n providedIn: 'root',\n factory: () => {\n const zone = inject(NgZone);\n const userErrorHandler = inject(ErrorHandler);\n return e => zone.runOutsideAngular(() => userErrorHandler.handleError(e));\n }\n});\n\n/**\n * An `OutputEmitterRef` is created by the `output()` function and can be\n * used to emit values to consumers of your directive or component.\n *\n * Consumers of your directive/component can bind to the output and\n * subscribe to changes via the bound event syntax. For example:\n *\n * ```html\n * <my-comp (valueChange)=\"processNewValue($event)\" />\n * ```\n *\n * @developerPreview\n */\nclass OutputEmitterRef {\n constructor() {\n this.destroyed = false;\n this.listeners = null;\n this.errorHandler = inject(ErrorHandler, {\n optional: true\n });\n /** @internal */\n this.destroyRef = inject(DestroyRef);\n // Clean-up all listeners and mark as destroyed upon destroy.\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n this.listeners = null;\n });\n }\n subscribe(callback) {\n if (this.destroyed) {\n throw new RuntimeError(953 /* RuntimeErrorCode.OUTPUT_REF_DESTROYED */, ngDevMode && 'Unexpected subscription to destroyed `OutputRef`. ' + 'The owning directive/component is destroyed.');\n }\n (this.listeners ??= []).push(callback);\n return {\n unsubscribe: () => {\n const idx = this.listeners?.indexOf(callback);\n if (idx !== undefined && idx !== -1) {\n this.listeners?.splice(idx, 1);\n }\n }\n };\n }\n /** Emits a new value to the output. */\n emit(value) {\n if (this.destroyed) {\n throw new RuntimeError(953 /* RuntimeErrorCode.OUTPUT_REF_DESTROYED */, ngDevMode && 'Unexpected emit for destroyed `OutputRef`. ' + 'The owning directive/component is destroyed.');\n }\n if (this.listeners === null) {\n return;\n }\n const previousConsumer = setActiveConsumer$1(null);\n try {\n for (const listenerFn of this.listeners) {\n try {\n listenerFn(value);\n } catch (err) {\n this.errorHandler?.handleError(err);\n }\n }\n } finally {\n setActiveConsumer$1(previousConsumer);\n }\n }\n}\n/** Gets the owning `DestroyRef` for the given output. */\nfunction getOutputDestroyRef(ref) {\n return ref.destroyRef;\n}\n\n/**\n * The `output` function allows declaration of Angular outputs in\n * directives and components.\n *\n * You can use outputs to emit values to parent directives and component.\n * Parents can subscribe to changes via:\n *\n * - template event bindings. For example, `(myOutput)=\"doSomething($event)\"`\n * - programmatic subscription by using `OutputRef#subscribe`.\n *\n * @usageNotes\n *\n * To use `output()`, import the function from `@angular/core`.\n *\n * ```ts\n * import {output} from '@angular/core';\n * ```\n *\n * Inside your component, introduce a new class member and initialize\n * it with a call to `output`.\n *\n * ```ts\n * @Directive({\n * ...\n * })\n * export class MyDir {\n * nameChange = output<string>(); // OutputEmitterRef<string>\n * onClick = output(); // OutputEmitterRef<void>\n * }\n * ```\n *\n * You can emit values to consumers of your directive, by using\n * the `emit` method from `OutputEmitterRef`.\n *\n * ```ts\n * updateName(newName: string): void {\n * this.nameChange.emit(newName);\n * }\n * ```\n *\n * @developerPreview\n * @initializerApiFunction {\"showTypesInSignaturePreview\": true}\n */\nfunction output(opts) {\n ngDevMode && assertInInjectionContext(output);\n return new OutputEmitterRef();\n}\nfunction inputFunction(initialValue, opts) {\n ngDevMode && assertInInjectionContext(input);\n return createInputSignal(initialValue, opts);\n}\nfunction inputRequiredFunction(opts) {\n ngDevMode && assertInInjectionContext(input);\n return createInputSignal(REQUIRED_UNSET_VALUE, opts);\n}\n/**\n * The `input` function allows declaration of Angular inputs in directives\n * and components.\n *\n * There are two variants of inputs that can be declared:\n *\n * 1. **Optional inputs** with an initial value.\n * 2. **Required inputs** that consumers need to set.\n *\n * By default, the `input` function will declare optional inputs that\n * always have an initial value. Required inputs can be declared\n * using the `input.required()` function.\n *\n * Inputs are signals. The values of an input are exposed as a `Signal`.\n * The signal always holds the latest value of the input that is bound\n * from the parent.\n *\n * @usageNotes\n * To use signal-based inputs, import `input` from `@angular/core`.\n *\n * ```\n * import {input} from '@angular/core`;\n * ```\n *\n * Inside your component, introduce a new class member and initialize\n * it with a call to `input` or `input.required`.\n *\n * ```ts\n * @Component({\n * ...\n * })\n * export class UserProfileComponent {\n * firstName = input<string>(); // Signal<string|undefined>\n * lastName = input.required<string>(); // Signal<string>\n * age = input(0) // Signal<number>\n * }\n * ```\n *\n * Inside your component template, you can display values of the inputs\n * by calling the signal.\n *\n * ```html\n * <span>{{firstName()}}</span>\n * ```\n *\n * @developerPreview\n * @initializerApiFunction\n */\nconst input = (() => {\n // Note: This may be considered a side-effect, but nothing will depend on\n // this assignment, unless this `input` constant export is accessed. It's a\n // self-contained side effect that is local to the user facing`input` export.\n inputFunction.required = inputRequiredFunction;\n return inputFunction;\n})();\n\n/**\n * Creates an ElementRef from the most recent node.\n *\n * @returns The ElementRef instance to use\n */\nfunction injectElementRef() {\n return createElementRef(getCurrentTNode(), getLView());\n}\n/**\n * Creates an ElementRef given a node.\n *\n * @param tNode The node for which you'd like an ElementRef\n * @param lView The view to which the node belongs\n * @returns The ElementRef instance to use\n */\nfunction createElementRef(tNode, lView) {\n return new ElementRef(getNativeByTNode(tNode, lView));\n}\n/**\n * A wrapper around a native element inside of a View.\n *\n * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM\n * element.\n *\n * @security Permitting direct access to the DOM can make your application more vulnerable to\n * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the\n * [Security Guide](https://g.co/ng/security).\n *\n * @publicApi\n */\n// Note: We don't expose things like `Injector`, `ViewContainer`, ... here,\n// i.e. users have to ask for what they need. With that, we can build better analysis tools\n// and could do better codegen in the future.\nclass ElementRef {\n constructor(nativeElement) {\n this.nativeElement = nativeElement;\n }\n /**\n * @internal\n * @nocollapse\n */\n static {\n this.__NG_ELEMENT_ID__ = injectElementRef;\n }\n}\n/**\n * Unwraps `ElementRef` and return the `nativeElement`.\n *\n * @param value value to unwrap\n * @returns `nativeElement` if `ElementRef` otherwise returns value as is.\n */\nfunction unwrapElementRef(value) {\n return value instanceof ElementRef ? value.nativeElement : value;\n}\nfunction symbolIterator() {\n // @ts-expect-error accessing a private member\n return this._results[Symbol.iterator]();\n}\n/**\n * An unmodifiable list of items that Angular keeps up to date when the state\n * of the application changes.\n *\n * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}\n * provide.\n *\n * Implements an iterable interface, therefore it can be used in both ES6\n * javascript `for (var i of items)` loops as well as in Angular templates with\n * `*ngFor=\"let i of myList\"`.\n *\n * Changes can be observed by subscribing to the changes `Observable`.\n *\n * NOTE: In the future this class will implement an `Observable` interface.\n *\n * @usageNotes\n * ### Example\n * ```typescript\n * @Component({...})\n * class Container {\n * @ViewChildren(Item) items:QueryList<Item>;\n * }\n * ```\n *\n * @publicApi\n */\nclass QueryList {\n static {\n Symbol.iterator;\n }\n /**\n * Returns `Observable` of `QueryList` notifying the subscriber of changes.\n */\n get changes() {\n return this._changes ??= new EventEmitter();\n }\n /**\n * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change\n * has occurred. Or if it should fire when query is recomputed. (recomputing could resolve in\n * the same result)\n */\n constructor(_emitDistinctChangesOnly = false) {\n this._emitDistinctChangesOnly = _emitDistinctChangesOnly;\n this.dirty = true;\n this._onDirty = undefined;\n this._results = [];\n this._changesDetected = false;\n this._changes = undefined;\n this.length = 0;\n this.first = undefined;\n this.last = undefined;\n // This function should be declared on the prototype, but doing so there will cause the class\n // declaration to have side-effects and become not tree-shakable. For this reason we do it in\n // the constructor.\n // [Symbol.iterator](): Iterator<T> { ... }\n const proto = QueryList.prototype;\n if (!proto[Symbol.iterator]) proto[Symbol.iterator] = symbolIterator;\n }\n /**\n * Returns the QueryList entry at `index`.\n */\n get(index) {\n return this._results[index];\n }\n /**\n * See\n * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n */\n map(fn) {\n return this._results.map(fn);\n }\n filter(fn) {\n return this._results.filter(fn);\n }\n /**\n * See\n * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n */\n find(fn) {\n return this._results.find(fn);\n }\n /**\n * See\n * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n */\n reduce(fn, init) {\n return this._results.reduce(fn, init);\n }\n /**\n * See\n * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n */\n forEach(fn) {\n this._results.forEach(fn);\n }\n /**\n * See\n * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n */\n some(fn) {\n return this._results.some(fn);\n }\n /**\n * Returns a copy of the internal results list as an Array.\n */\n toArray() {\n return this._results.slice();\n }\n toString() {\n return this._results.toString();\n }\n /**\n * Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that\n * on change detection, it will not notify of changes to the queries, unless a new change\n * occurs.\n *\n * @param resultsTree The query results to store\n * @param identityAccessor Optional function for extracting stable object identity from a value\n * in the array. This function is executed for each element of the query result list while\n * comparing current query list with the new one (provided as a first argument of the `reset`\n * function) to detect if the lists are different. If the function is not provided, elements\n * are compared as is (without any pre-processing).\n */\n reset(resultsTree, identityAccessor) {\n this.dirty = false;\n const newResultFlat = flatten(resultsTree);\n if (this._changesDetected = !arrayEquals(this._results, newResultFlat, identityAccessor)) {\n this._results = newResultFlat;\n this.length = newResultFlat.length;\n this.last = newResultFlat[this.length - 1];\n this.first = newResultFlat[0];\n }\n }\n /**\n * Triggers a change event by emitting on the `changes` {@link EventEmitter}.\n */\n notifyOnChanges() {\n if (this._changes !== undefined && (this._changesDetected || !this._emitDistinctChangesOnly)) this._changes.emit(this);\n }\n /** @internal */\n onDirty(cb) {\n this._onDirty = cb;\n }\n /** internal */\n setDirty() {\n this.dirty = true;\n this._onDirty?.();\n }\n /** internal */\n destroy() {\n if (this._changes !== undefined) {\n this._changes.complete();\n this._changes.unsubscribe();\n }\n }\n}\n\n/**\n * The name of an attribute that can be added to the hydration boundary node\n * (component host node) to disable hydration for the content within that boundary.\n */\nconst SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration';\n/** Lowercase name of the `ngSkipHydration` attribute used for case-insensitive comparisons. */\nconst SKIP_HYDRATION_ATTR_NAME_LOWER_CASE = 'ngskiphydration';\n/**\n * Helper function to check if a given TNode has the 'ngSkipHydration' attribute.\n */\nfunction hasSkipHydrationAttrOnTNode(tNode) {\n const attrs = tNode.mergedAttrs;\n if (attrs === null) return false;\n // only ever look at the attribute name and skip the values\n for (let i = 0; i < attrs.length; i += 2) {\n const value = attrs[i];\n // This is a marker, which means that the static attributes section is over,\n // so we can exit early.\n if (typeof value === 'number') return false;\n if (typeof value === 'string' && value.toLowerCase() === SKIP_HYDRATION_ATTR_NAME_LOWER_CASE) {\n return true;\n }\n }\n return false;\n}\n/**\n * Helper function to check if a given RElement has the 'ngSkipHydration' attribute.\n */\nfunction hasSkipHydrationAttrOnRElement(rNode) {\n return rNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME);\n}\n/**\n * Checks whether a TNode has a flag to indicate that it's a part of\n * a skip hydration block.\n */\nfunction hasInSkipHydrationBlockFlag(tNode) {\n return (tNode.flags & 128 /* TNodeFlags.inSkipHydrationBlock */) === 128 /* TNodeFlags.inSkipHydrationBlock */;\n}\n/**\n * Helper function that determines if a given node is within a skip hydration block\n * by navigating up the TNode tree to see if any parent nodes have skip hydration\n * attribute.\n */\nfunction isInSkipHydrationBlock(tNode) {\n if (hasInSkipHydrationBlockFlag(tNode)) {\n return true;\n }\n let currentTNode = tNode.parent;\n while (currentTNode) {\n if (hasInSkipHydrationBlockFlag(tNode) || hasSkipHydrationAttrOnTNode(currentTNode)) {\n return true;\n }\n currentTNode = currentTNode.parent;\n }\n return false;\n}\n/**\n * Check if an i18n block is in a skip hydration section by looking at a parent TNode\n * to determine if this TNode is in a skip hydration section or the TNode has\n * the `ngSkipHydration` attribute.\n */\nfunction isI18nInSkipHydrationBlock(parentTNode) {\n return hasInSkipHydrationBlockFlag(parentTNode) || hasSkipHydrationAttrOnTNode(parentTNode) || isInSkipHydrationBlock(parentTNode);\n}\n\n// Keeps track of the currently-active LViews.\nconst TRACKED_LVIEWS = new Map();\n// Used for generating unique IDs for LViews.\nlet uniqueIdCounter = 0;\n/** Gets a unique ID that can be assigned to an LView. */\nfunction getUniqueLViewId() {\n return uniqueIdCounter++;\n}\n/** Starts tracking an LView. */\nfunction registerLView(lView) {\n ngDevMode && assertNumber(lView[ID], 'LView must have an ID in order to be registered');\n TRACKED_LVIEWS.set(lView[ID], lView);\n}\n/** Gets an LView by its unique ID. */\nfunction getLViewById(id) {\n ngDevMode && assertNumber(id, 'ID used for LView lookup must be a number');\n return TRACKED_LVIEWS.get(id) || null;\n}\n/** Stops tracking an LView. */\nfunction unregisterLView(lView) {\n ngDevMode && assertNumber(lView[ID], 'Cannot stop tracking an LView that does not have an ID');\n TRACKED_LVIEWS.delete(lView[ID]);\n}\n\n/**\n * The internal view context which is specific to a given DOM element, directive or\n * component instance. Each value in here (besides the LView and element node details)\n * can be present, null or undefined. If undefined then it implies the value has not been\n * looked up yet, otherwise, if null, then a lookup was executed and nothing was found.\n *\n * Each value will get filled when the respective value is examined within the getContext\n * function. The component, element and each directive instance will share the same instance\n * of the context.\n */\nclass LContext {\n /** Component's parent view data. */\n get lView() {\n return getLViewById(this.lViewId);\n }\n constructor(\n /**\n * ID of the component's parent view data.\n */\n lViewId,\n /**\n * The index instance of the node.\n */\n nodeIndex,\n /**\n * The instance of the DOM node that is attached to the lNode.\n */\n native) {\n this.lViewId = lViewId;\n this.nodeIndex = nodeIndex;\n this.native = native;\n }\n}\n\n/**\n * Returns the matching `LContext` data for a given DOM node, directive or component instance.\n *\n * This function will examine the provided DOM element, component, or directive instance\\'s\n * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched\n * value will be that of the newly created `LContext`.\n *\n * If the monkey-patched value is the `LView` instance then the context value for that\n * target will be created and the monkey-patch reference will be updated. Therefore when this\n * function is called it may mutate the provided element\\'s, component\\'s or any of the associated\n * directive\\'s monkey-patch values.\n *\n * If the monkey-patch value is not detected then the code will walk up the DOM until an element\n * is found which contains a monkey-patch reference. When that occurs then the provided element\n * will be updated with a new context (which is then returned). If the monkey-patch value is not\n * detected for a component/directive instance then it will throw an error (all components and\n * directives should be automatically monkey-patched by ivy).\n *\n * @param target Component, Directive or DOM Node.\n */\nfunction getLContext(target) {\n let mpValue = readPatchedData(target);\n if (mpValue) {\n // only when it's an array is it considered an LView instance\n // ... otherwise it's an already constructed LContext instance\n if (isLView(mpValue)) {\n const lView = mpValue;\n let nodeIndex;\n let component = undefined;\n let directives = undefined;\n if (isComponentInstance(target)) {\n nodeIndex = findViaComponent(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided component was not found in the application');\n }\n component = target;\n } else if (isDirectiveInstance(target)) {\n nodeIndex = findViaDirective(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided directive was not found in the application');\n }\n directives = getDirectivesAtNodeIndex(nodeIndex, lView);\n } else {\n nodeIndex = findViaNativeElement(lView, target);\n if (nodeIndex == -1) {\n return null;\n }\n }\n // the goal is not to fill the entire context full of data because the lookups\n // are expensive. Instead, only the target data (the element, component, container, ICU\n // expression or directive details) are filled into the context. If called multiple times\n // with different target values then the missing target data will be filled in.\n const native = unwrapRNode(lView[nodeIndex]);\n const existingCtx = readPatchedData(native);\n const context = existingCtx && !Array.isArray(existingCtx) ? existingCtx : createLContext(lView, nodeIndex, native);\n // only when the component has been discovered then update the monkey-patch\n if (component && context.component === undefined) {\n context.component = component;\n attachPatchData(context.component, context);\n }\n // only when the directives have been discovered then update the monkey-patch\n if (directives && context.directives === undefined) {\n context.directives = directives;\n for (let i = 0; i < directives.length; i++) {\n attachPatchData(directives[i], context);\n }\n }\n attachPatchData(context.native, context);\n mpValue = context;\n }\n } else {\n const rElement = target;\n ngDevMode && assertDomNode(rElement);\n // if the context is not found then we need to traverse upwards up the DOM\n // to find the nearest element that has already been monkey patched with data\n let parent = rElement;\n while (parent = parent.parentNode) {\n const parentContext = readPatchedData(parent);\n if (parentContext) {\n const lView = Array.isArray(parentContext) ? parentContext : parentContext.lView;\n // the edge of the app was also reached here through another means\n // (maybe because the DOM was changed manually).\n if (!lView) {\n return null;\n }\n const index = findViaNativeElement(lView, rElement);\n if (index >= 0) {\n const native = unwrapRNode(lView[index]);\n const context = createLContext(lView, index, native);\n attachPatchData(native, context);\n mpValue = context;\n break;\n }\n }\n }\n }\n return mpValue || null;\n}\n/**\n * Creates an empty instance of a `LContext` context\n */\nfunction createLContext(lView, nodeIndex, native) {\n return new LContext(lView[ID], nodeIndex, native);\n}\n/**\n * Takes a component instance and returns the view for that component.\n *\n * @param componentInstance\n * @returns The component's view\n */\nfunction getComponentViewByInstance(componentInstance) {\n let patchedData = readPatchedData(componentInstance);\n let lView;\n if (isLView(patchedData)) {\n const contextLView = patchedData;\n const nodeIndex = findViaComponent(contextLView, componentInstance);\n lView = getComponentLViewByIndex(nodeIndex, contextLView);\n const context = createLContext(contextLView, nodeIndex, lView[HOST]);\n context.component = componentInstance;\n attachPatchData(componentInstance, context);\n attachPatchData(context.native, context);\n } else {\n const context = patchedData;\n const contextLView = context.lView;\n ngDevMode && assertLView(contextLView);\n lView = getComponentLViewByIndex(context.nodeIndex, contextLView);\n }\n return lView;\n}\n/**\n * This property will be monkey-patched on elements, components and directives.\n */\nconst MONKEY_PATCH_KEY_NAME = '__ngContext__';\nfunction attachLViewId(target, data) {\n target[MONKEY_PATCH_KEY_NAME] = data[ID];\n}\n/**\n * Returns the monkey-patch value data present on the target (which could be\n * a component, directive or a DOM node).\n */\nfunction readLView(target) {\n const data = readPatchedData(target);\n if (isLView(data)) {\n return data;\n }\n return data ? data.lView : null;\n}\n/**\n * Assigns the given data to the given target (which could be a component,\n * directive or DOM node instance) using monkey-patching.\n */\nfunction attachPatchData(target, data) {\n ngDevMode && assertDefined(target, 'Target expected');\n // Only attach the ID of the view in order to avoid memory leaks (see #41047). We only do this\n // for `LView`, because we have control over when an `LView` is created and destroyed, whereas\n // we can't know when to remove an `LContext`.\n if (isLView(data)) {\n target[MONKEY_PATCH_KEY_NAME] = data[ID];\n registerLView(data);\n } else {\n target[MONKEY_PATCH_KEY_NAME] = data;\n }\n}\n/**\n * Returns the monkey-patch value data present on the target (which could be\n * a component, directive or a DOM node).\n */\nfunction readPatchedData(target) {\n ngDevMode && assertDefined(target, 'Target expected');\n const data = target[MONKEY_PATCH_KEY_NAME];\n return typeof data === 'number' ? getLViewById(data) : data || null;\n}\nfunction readPatchedLView(target) {\n const value = readPatchedData(target);\n if (value) {\n return isLView(value) ? value : value.lView;\n }\n return null;\n}\nfunction isComponentInstance(instance) {\n return instance && instance.constructor && instance.constructor.ɵcmp;\n}\nfunction isDirectiveInstance(instance) {\n return instance && instance.constructor && instance.constructor.ɵdir;\n}\n/**\n * Locates the element within the given LView and returns the matching index\n */\nfunction findViaNativeElement(lView, target) {\n const tView = lView[TVIEW];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (unwrapRNode(lView[i]) === target) {\n return i;\n }\n }\n return -1;\n}\n/**\n * Locates the next tNode (child, sibling or parent).\n */\nfunction traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n } else if (tNode.next) {\n return tNode.next;\n } else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}\n/**\n * Locates the component within the given LView and returns the matching index\n */\nfunction findViaComponent(lView, componentInstance) {\n const componentIndices = lView[TVIEW].components;\n if (componentIndices) {\n for (let i = 0; i < componentIndices.length; i++) {\n const elementComponentIndex = componentIndices[i];\n const componentView = getComponentLViewByIndex(elementComponentIndex, lView);\n if (componentView[CONTEXT] === componentInstance) {\n return elementComponentIndex;\n }\n }\n } else {\n const rootComponentView = getComponentLViewByIndex(HEADER_OFFSET, lView);\n const rootComponent = rootComponentView[CONTEXT];\n if (rootComponent === componentInstance) {\n // we are dealing with the root element here therefore we know that the\n // element is the very first element after the HEADER data in the lView\n return HEADER_OFFSET;\n }\n }\n return -1;\n}\n/**\n * Locates the directive within the given LView and returns the matching index\n */\nfunction findViaDirective(lView, directiveInstance) {\n // if a directive is monkey patched then it will (by default)\n // have a reference to the LView of the current view. The\n // element bound to the directive being search lives somewhere\n // in the view data. We loop through the nodes and check their\n // list of directives for the instance.\n let tNode = lView[TVIEW].firstChild;\n while (tNode) {\n const directiveIndexStart = tNode.directiveStart;\n const directiveIndexEnd = tNode.directiveEnd;\n for (let i = directiveIndexStart; i < directiveIndexEnd; i++) {\n if (lView[i] === directiveInstance) {\n return tNode.index;\n }\n }\n tNode = traverseNextElement(tNode);\n }\n return -1;\n}\n/**\n * Returns a list of directives applied to a node at a specific index. The list includes\n * directives matched by selector and any host directives, but it excludes components.\n * Use `getComponentAtNodeIndex` to find the component applied to a node.\n *\n * @param nodeIndex The node index\n * @param lView The target view data\n */\nfunction getDirectivesAtNodeIndex(nodeIndex, lView) {\n const tNode = lView[TVIEW].data[nodeIndex];\n if (tNode.directiveStart === 0) return EMPTY_ARRAY;\n const results = [];\n for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {\n const directiveInstance = lView[i];\n if (!isComponentInstance(directiveInstance)) {\n results.push(directiveInstance);\n }\n }\n return results;\n}\nfunction getComponentAtNodeIndex(nodeIndex, lView) {\n const tNode = lView[TVIEW].data[nodeIndex];\n const {\n directiveStart,\n componentOffset\n } = tNode;\n return componentOffset > -1 ? lView[directiveStart + componentOffset] : null;\n}\n/**\n * Returns a map of local references (local reference name => element or directive instance) that\n * exist on a given element.\n */\nfunction discoverLocalRefs(lView, nodeIndex) {\n const tNode = lView[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n const result = {};\n let localIndex = tNode.index + 1;\n for (let i = 0; i < tNode.localNames.length; i += 2) {\n result[tNode.localNames[i]] = lView[localIndex];\n localIndex++;\n }\n return result;\n }\n return null;\n}\n\n/**\n * Retrieve the root view from any component or `LView` by walking the parent `LView` until\n * reaching the root `LView`.\n *\n * @param componentOrLView any component or `LView`\n */\nfunction getRootView(componentOrLView) {\n ngDevMode && assertDefined(componentOrLView, 'component');\n let lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView);\n while (lView && !(lView[FLAGS] & 512 /* LViewFlags.IsRoot */)) {\n lView = getLViewParent(lView);\n }\n ngDevMode && assertLView(lView);\n return lView;\n}\n/**\n * Returns the context information associated with the application where the target is situated. It\n * does this by walking the parent views until it gets to the root view, then getting the context\n * off of that.\n *\n * @param viewOrComponent the `LView` or component to get the root context for.\n */\nfunction getRootContext(viewOrComponent) {\n const rootView = getRootView(viewOrComponent);\n ngDevMode && assertDefined(rootView[CONTEXT], 'Root view has no context. Perhaps it is disconnected?');\n return rootView[CONTEXT];\n}\n/**\n * Gets the first `LContainer` in the LView or `null` if none exists.\n */\nfunction getFirstLContainer(lView) {\n return getNearestLContainer(lView[CHILD_HEAD]);\n}\n/**\n * Gets the next `LContainer` that is a sibling of the given container.\n */\nfunction getNextLContainer(container) {\n return getNearestLContainer(container[NEXT]);\n}\nfunction getNearestLContainer(viewOrContainer) {\n while (viewOrContainer !== null && !isLContainer(viewOrContainer)) {\n viewOrContainer = viewOrContainer[NEXT];\n }\n return viewOrContainer;\n}\n\n/**\n * Retrieves the component instance associated with a given DOM element.\n *\n * @usageNotes\n * Given the following DOM structure:\n *\n * ```html\n * <app-root>\n * <div>\n * <child-comp></child-comp>\n * </div>\n * </app-root>\n * ```\n *\n * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`\n * associated with this DOM element.\n *\n * Calling the function on `<app-root>` will return the `MyApp` instance.\n *\n *\n * @param element DOM element from which the component should be retrieved.\n * @returns Component instance associated with the element or `null` if there\n * is no component associated with it.\n *\n * @publicApi\n */\nfunction getComponent$1(element) {\n ngDevMode && assertDomElement(element);\n const context = getLContext(element);\n if (context === null) return null;\n if (context.component === undefined) {\n const lView = context.lView;\n if (lView === null) {\n return null;\n }\n context.component = getComponentAtNodeIndex(context.nodeIndex, lView);\n }\n return context.component;\n}\n/**\n * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded\n * view that the element is part of. Otherwise retrieves the instance of the component whose view\n * owns the element (in this case, the result is the same as calling `getOwningComponent`).\n *\n * @param element Element for which to get the surrounding component instance.\n * @returns Instance of the component that is around the element or null if the element isn't\n * inside any component.\n *\n * @publicApi\n */\nfunction getContext(element) {\n assertDomElement(element);\n const context = getLContext(element);\n const lView = context ? context.lView : null;\n return lView === null ? null : lView[CONTEXT];\n}\n/**\n * Retrieves the component instance whose view contains the DOM element.\n *\n * For example, if `<child-comp>` is used in the template of `<app-comp>`\n * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`\n * would return `<app-comp>`.\n *\n * @param elementOrDir DOM element, component or directive instance\n * for which to retrieve the root components.\n * @returns Component instance whose view owns the DOM element or null if the element is not\n * part of a component view.\n *\n * @publicApi\n */\nfunction getOwningComponent(elementOrDir) {\n const context = getLContext(elementOrDir);\n let lView = context ? context.lView : null;\n if (lView === null) return null;\n let parent;\n while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {\n lView = parent;\n }\n return lView[FLAGS] & 512 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];\n}\n/**\n * Retrieves all root components associated with a DOM element, directive or component instance.\n * Root components are those which have been bootstrapped by Angular.\n *\n * @param elementOrDir DOM element, component or directive instance\n * for which to retrieve the root components.\n * @returns Root components associated with the target object.\n *\n * @publicApi\n */\nfunction getRootComponents(elementOrDir) {\n const lView = readPatchedLView(elementOrDir);\n return lView !== null ? [getRootContext(lView)] : [];\n}\n/**\n * Retrieves an `Injector` associated with an element, component or directive instance.\n *\n * @param elementOrDir DOM element, component or directive instance for which to\n * retrieve the injector.\n * @returns Injector associated with the element, component or directive instance.\n *\n * @publicApi\n */\nfunction getInjector(elementOrDir) {\n const context = getLContext(elementOrDir);\n const lView = context ? context.lView : null;\n if (lView === null) return Injector.NULL;\n const tNode = lView[TVIEW].data[context.nodeIndex];\n return new NodeInjector(tNode, lView);\n}\n/**\n * Retrieve a set of injection tokens at a given DOM node.\n *\n * @param element Element for which the injection tokens should be retrieved.\n */\nfunction getInjectionTokens(element) {\n const context = getLContext(element);\n const lView = context ? context.lView : null;\n if (lView === null) return [];\n const tView = lView[TVIEW];\n const tNode = tView.data[context.nodeIndex];\n const providerTokens = [];\n const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;\n const endIndex = tNode.directiveEnd;\n for (let i = startIndex; i < endIndex; i++) {\n let value = tView.data[i];\n if (isDirectiveDefHack(value)) {\n // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a\n // design flaw. We should always store same type so that we can be monomorphic. The issue\n // is that for Components/Directives we store the def instead the type. The correct behavior\n // is that we should always be storing injectable type in this location.\n value = value.type;\n }\n providerTokens.push(value);\n }\n return providerTokens;\n}\n/**\n * Retrieves directive instances associated with a given DOM node. Does not include\n * component instances.\n *\n * @usageNotes\n * Given the following DOM structure:\n *\n * ```html\n * <app-root>\n * <button my-button></button>\n * <my-comp></my-comp>\n * </app-root>\n * ```\n *\n * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`\n * directive that is associated with the DOM node.\n *\n * Calling `getDirectives` on `<my-comp>` will return an empty array.\n *\n * @param node DOM node for which to get the directives.\n * @returns Array of directives associated with the node.\n *\n * @publicApi\n */\nfunction getDirectives(node) {\n // Skip text nodes because we can't have directives associated with them.\n if (node instanceof Text) {\n return [];\n }\n const context = getLContext(node);\n const lView = context ? context.lView : null;\n if (lView === null) {\n return [];\n }\n const tView = lView[TVIEW];\n const nodeIndex = context.nodeIndex;\n if (!tView?.data[nodeIndex]) {\n return [];\n }\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(nodeIndex, lView);\n }\n // The `directives` in this case are a named array called `LComponentView`. Clone the\n // result so we don't expose an internal data structure in the user's console.\n return context.directives === null ? [] : [...context.directives];\n}\n/**\n * Returns the debug (partial) metadata for a particular directive or component instance.\n * The function accepts an instance of a directive or component and returns the corresponding\n * metadata.\n *\n * @param directiveOrComponentInstance Instance of a directive or component\n * @returns metadata of the passed directive or component\n *\n * @publicApi\n */\nfunction getDirectiveMetadata$1(directiveOrComponentInstance) {\n const {\n constructor\n } = directiveOrComponentInstance;\n if (!constructor) {\n throw new Error('Unable to find the instance constructor');\n }\n // In case a component inherits from a directive, we may have component and directive metadata\n // To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.\n const componentDef = getComponentDef(constructor);\n if (componentDef) {\n const inputs = extractInputDebugMetadata(componentDef.inputs);\n return {\n inputs,\n outputs: componentDef.outputs,\n encapsulation: componentDef.encapsulation,\n changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush : ChangeDetectionStrategy.Default\n };\n }\n const directiveDef = getDirectiveDef(constructor);\n if (directiveDef) {\n const inputs = extractInputDebugMetadata(directiveDef.inputs);\n return {\n inputs,\n outputs: directiveDef.outputs\n };\n }\n return null;\n}\n/**\n * Retrieve map of local references.\n *\n * The references are retrieved as a map of local reference name to element or directive instance.\n *\n * @param target DOM element, component or directive instance for which to retrieve\n * the local references.\n */\nfunction getLocalRefs(target) {\n const context = getLContext(target);\n if (context === null) return {};\n if (context.localRefs === undefined) {\n const lView = context.lView;\n if (lView === null) {\n return {};\n }\n context.localRefs = discoverLocalRefs(lView, context.nodeIndex);\n }\n return context.localRefs || {};\n}\n/**\n * Retrieves the host element of a component or directive instance.\n * The host element is the DOM element that matched the selector of the directive.\n *\n * @param componentOrDirective Component or directive instance for which the host\n * element should be retrieved.\n * @returns Host element of the target.\n *\n * @publicApi\n */\nfunction getHostElement(componentOrDirective) {\n return getLContext(componentOrDirective).native;\n}\n/**\n * Retrieves the rendered text for a given component.\n *\n * This function retrieves the host element of a component and\n * and then returns the `textContent` for that element. This implies\n * that the text returned will include re-projected content of\n * the component as well.\n *\n * @param component The component to return the content text for.\n */\nfunction getRenderedText(component) {\n const hostElement = getHostElement(component);\n return hostElement.textContent || '';\n}\n/**\n * Retrieves a list of event listeners associated with a DOM element. The list does include host\n * listeners, but it does not include event listeners defined outside of the Angular context\n * (e.g. through `addEventListener`).\n *\n * @usageNotes\n * Given the following DOM structure:\n *\n * ```html\n * <app-root>\n * <div (click)=\"doSomething()\"></div>\n * </app-root>\n * ```\n *\n * Calling `getListeners` on `<div>` will return an object that looks as follows:\n *\n * ```ts\n * {\n * name: 'click',\n * element: <div>,\n * callback: () => doSomething(),\n * useCapture: false\n * }\n * ```\n *\n * @param element Element for which the DOM listeners should be retrieved.\n * @returns Array of event listeners on the DOM element.\n *\n * @publicApi\n */\nfunction getListeners(element) {\n ngDevMode && assertDomElement(element);\n const lContext = getLContext(element);\n const lView = lContext === null ? null : lContext.lView;\n if (lView === null) return [];\n const tView = lView[TVIEW];\n const lCleanup = lView[CLEANUP];\n const tCleanup = tView.cleanup;\n const listeners = [];\n if (tCleanup && lCleanup) {\n for (let i = 0; i < tCleanup.length;) {\n const firstParam = tCleanup[i++];\n const secondParam = tCleanup[i++];\n if (typeof firstParam === 'string') {\n const name = firstParam;\n const listenerElement = unwrapRNode(lView[secondParam]);\n const callback = lCleanup[tCleanup[i++]];\n const useCaptureOrIndx = tCleanup[i++];\n // if useCaptureOrIndx is boolean then report it as is.\n // if useCaptureOrIndx is positive number then it in unsubscribe method\n // if useCaptureOrIndx is negative number then it is a Subscription\n const type = typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0 ? 'dom' : 'output';\n const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;\n if (element == listenerElement) {\n listeners.push({\n element,\n name,\n callback,\n useCapture,\n type\n });\n }\n }\n }\n }\n listeners.sort(sortListeners);\n return listeners;\n}\nfunction sortListeners(a, b) {\n if (a.name == b.name) return 0;\n return a.name < b.name ? -1 : 1;\n}\n/**\n * This function should not exist because it is megamorphic and only mostly correct.\n *\n * See call site for more info.\n */\nfunction isDirectiveDefHack(obj) {\n return obj.type !== undefined && obj.declaredInputs !== undefined && obj.findHostDirectiveDefs !== undefined;\n}\n/**\n * Retrieve the component `LView` from component/element.\n *\n * NOTE: `LView` is a private and should not be leaked outside.\n * Don't export this method to `ng.*` on window.\n *\n * @param target DOM element or component instance for which to retrieve the LView.\n */\nfunction getComponentLView(target) {\n const lContext = getLContext(target);\n const nodeIndx = lContext.nodeIndex;\n const lView = lContext.lView;\n ngDevMode && assertLView(lView);\n const componentLView = lView[nodeIndx];\n ngDevMode && assertLView(componentLView);\n return componentLView;\n}\n/** Asserts that a value is a DOM Element. */\nfunction assertDomElement(value) {\n if (typeof Element !== 'undefined' && !(value instanceof Element)) {\n throw new Error('Expecting instance of DOM Element');\n }\n}\n/**\n * A directive definition holds additional metadata using bitwise flags to indicate\n * for example whether it is signal based.\n *\n * This information needs to be separate from the `publicName -> minifiedName`\n * mappings for backwards compatibility.\n */\nfunction extractInputDebugMetadata(inputs) {\n const res = {};\n for (const key in inputs) {\n if (!inputs.hasOwnProperty(key)) {\n continue;\n }\n const value = inputs[key];\n if (value === undefined) {\n continue;\n }\n let minifiedName;\n if (Array.isArray(value)) {\n minifiedName = value[0];\n // flags are not used for now.\n // TODO: Consider exposing flag information in discovery.\n } else {\n minifiedName = value;\n }\n res[key] = minifiedName;\n }\n return res;\n}\n\n/**\n * Most of the use of `document` in Angular is from within the DI system so it is possible to simply\n * inject the `DOCUMENT` token and are done.\n *\n * Ivy is special because it does not rely upon the DI and must get hold of the document some other\n * way.\n *\n * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.\n * Wherever ivy needs the global document, it calls `getDocument()` instead.\n *\n * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to\n * tell ivy what the global `document` is.\n *\n * Angular does this for us in each of the standard platforms (`Browser` and `Server`)\n * by calling `setDocument()` when providing the `DOCUMENT` token.\n */\nlet DOCUMENT = undefined;\n/**\n * Tell ivy what the `document` is for this platform.\n *\n * It is only necessary to call this if the current platform is not a browser.\n *\n * @param document The object representing the global `document` in this environment.\n */\nfunction setDocument(document) {\n DOCUMENT = document;\n}\n/**\n * Access the object that represents the `document` for this platform.\n *\n * Ivy calls this whenever it needs to access the `document` object.\n * For example to create the renderer or to do sanitization.\n */\nfunction getDocument() {\n if (DOCUMENT !== undefined) {\n return DOCUMENT;\n } else if (typeof document !== 'undefined') {\n return document;\n }\n throw new RuntimeError(210 /* RuntimeErrorCode.MISSING_DOCUMENT */, (typeof ngDevMode === 'undefined' || ngDevMode) && `The document object is not available in this context. Make sure the DOCUMENT injection token is provided.`);\n // No \"document\" can be found. This should only happen if we are running ivy outside Angular and\n // the current platform is not a browser. Since this is not a supported scenario at the moment\n // this should not happen in Angular apps.\n // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a\n // public API.\n}\n\n/**\n * A DI token representing a string ID, used\n * primarily for prefixing application attributes and CSS styles when\n * {@link ViewEncapsulation#Emulated} is being used.\n *\n * The token is needed in cases when multiple applications are bootstrapped on a page\n * (for example, using `bootstrapApplication` calls). In this case, ensure that those applications\n * have different `APP_ID` value setup. For example:\n *\n * ```\n * bootstrapApplication(ComponentA, {\n * providers: [\n * { provide: APP_ID, useValue: 'app-a' },\n * // ... other providers ...\n * ]\n * });\n *\n * bootstrapApplication(ComponentB, {\n * providers: [\n * { provide: APP_ID, useValue: 'app-b' },\n * // ... other providers ...\n * ]\n * });\n * ```\n *\n * By default, when there is only one application bootstrapped, you don't need to provide the\n * `APP_ID` token (the `ng` will be used as an app ID).\n *\n * @publicApi\n */\nconst APP_ID = new InjectionToken(ngDevMode ? 'AppId' : '', {\n providedIn: 'root',\n factory: () => DEFAULT_APP_ID\n});\n/** Default value of the `APP_ID` token. */\nconst DEFAULT_APP_ID = 'ng';\n/**\n * A function that is executed when a platform is initialized.\n * @publicApi\n */\nconst PLATFORM_INITIALIZER = new InjectionToken(ngDevMode ? 'Platform Initializer' : '');\n/**\n * A token that indicates an opaque platform ID.\n * @publicApi\n */\nconst PLATFORM_ID = new InjectionToken(ngDevMode ? 'Platform ID' : '', {\n providedIn: 'platform',\n factory: () => 'unknown' // set a default platform name, when none set explicitly\n});\n/**\n * A DI token that indicates the root directory of\n * the application\n * @publicApi\n * @deprecated\n */\nconst PACKAGE_ROOT_URL = new InjectionToken(ngDevMode ? 'Application Packages Root URL' : '');\n// We keep this token here, rather than the animations package, so that modules that only care\n// about which animations module is loaded (e.g. the CDK) can retrieve it without having to\n// include extra dependencies. See #44970 for more context.\n/**\n * A [DI token](api/core/InjectionToken) that indicates which animations\n * module has been loaded.\n * @publicApi\n */\nconst ANIMATION_MODULE_TYPE = new InjectionToken(ngDevMode ? 'AnimationModuleType' : '');\n// TODO(crisbeto): link to CSP guide here.\n/**\n * Token used to configure the [Content Security Policy](https://web.dev/strict-csp/) nonce that\n * Angular will apply when inserting inline styles. If not provided, Angular will look up its value\n * from the `ngCspNonce` attribute of the application root node.\n *\n * @publicApi\n */\nconst CSP_NONCE = new InjectionToken(ngDevMode ? 'CSP nonce' : '', {\n providedIn: 'root',\n factory: () => {\n // Ideally we wouldn't have to use `querySelector` here since we know that the nonce will be on\n // the root node, but because the token value is used in renderers, it has to be available\n // *very* early in the bootstrapping process. This should be a fairly shallow search, because\n // the app won't have been added to the DOM yet. Some approaches that were considered:\n // 1. Find the root node through `ApplicationRef.components[i].location` - normally this would\n // be enough for our purposes, but the token is injected very early so the `components` array\n // isn't populated yet.\n // 2. Find the root `LView` through the current `LView` - renderers are a prerequisite to\n // creating the `LView`. This means that no `LView` will have been entered when this factory is\n // invoked for the root component.\n // 3. Have the token factory return `() => string` which is invoked when a nonce is requested -\n // the slightly later execution does allow us to get an `LView` reference, but the fact that\n // it is a function means that it could be executed at *any* time (including immediately) which\n // may lead to weird bugs.\n // 4. Have the `ComponentFactory` read the attribute and provide it to the injector under the\n // hood - has the same problem as #1 and #2 in that the renderer is used to query for the root\n // node and the nonce value needs to be available when the renderer is created.\n return getDocument().body?.querySelector('[ngCspNonce]')?.getAttribute('ngCspNonce') || null;\n }\n});\nconst IMAGE_CONFIG_DEFAULTS = {\n breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],\n placeholderResolution: 30,\n disableImageSizeWarning: false,\n disableImageLazyLoadWarning: false\n};\n/**\n * Injection token that configures the image optimized image functionality.\n * See {@link ImageConfig} for additional information about parameters that\n * can be used.\n *\n * @see {@link NgOptimizedImage}\n * @see {@link ImageConfig}\n * @publicApi\n */\nconst IMAGE_CONFIG = new InjectionToken(ngDevMode ? 'ImageConfig' : '', {\n providedIn: 'root',\n factory: () => IMAGE_CONFIG_DEFAULTS\n});\n\n/**\n * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.\n *\n * Example:\n *\n * ```\n * const COUNTER_KEY = makeStateKey<number>('counter');\n * let value = 10;\n *\n * transferState.set(COUNTER_KEY, value);\n * ```\n *\n * @publicApi\n */\nfunction makeStateKey(key) {\n return key;\n}\nfunction initTransferState() {\n const transferState = new TransferState();\n if (inject(PLATFORM_ID) === 'browser') {\n transferState.store = retrieveTransferredState(getDocument(), inject(APP_ID));\n }\n return transferState;\n}\n/**\n * A key value store that is transferred from the application on the server side to the application\n * on the client side.\n *\n * The `TransferState` is available as an injectable token.\n * On the client, just inject this token using DI and use it, it will be lazily initialized.\n * On the server it's already included if `renderApplication` function is used. Otherwise, import\n * the `ServerTransferStateModule` module to make the `TransferState` available.\n *\n * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only\n * boolean, number, string, null and non-class objects will be serialized and deserialized in a\n * non-lossy manner.\n *\n * @publicApi\n */\nclass TransferState {\n constructor() {\n /** @internal */\n this.store = {};\n this.onSerializeCallbacks = {};\n }\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: TransferState,\n providedIn: 'root',\n factory: initTransferState\n });\n }\n /**\n * Get the value corresponding to a key. Return `defaultValue` if key is not found.\n */\n get(key, defaultValue) {\n return this.store[key] !== undefined ? this.store[key] : defaultValue;\n }\n /**\n * Set the value corresponding to a key.\n */\n set(key, value) {\n this.store[key] = value;\n }\n /**\n * Remove a key from the store.\n */\n remove(key) {\n delete this.store[key];\n }\n /**\n * Test whether a key exists in the store.\n */\n hasKey(key) {\n return this.store.hasOwnProperty(key);\n }\n /**\n * Indicates whether the state is empty.\n */\n get isEmpty() {\n return Object.keys(this.store).length === 0;\n }\n /**\n * Register a callback to provide the value for a key when `toJson` is called.\n */\n onSerialize(key, callback) {\n this.onSerializeCallbacks[key] = callback;\n }\n /**\n * Serialize the current state of the store to JSON.\n */\n toJson() {\n // Call the onSerialize callbacks and put those values into the store.\n for (const key in this.onSerializeCallbacks) {\n if (this.onSerializeCallbacks.hasOwnProperty(key)) {\n try {\n this.store[key] = this.onSerializeCallbacks[key]();\n } catch (e) {\n console.warn('Exception in onSerialize callback: ', e);\n }\n }\n }\n // Escape script tag to avoid break out of <script> tag in serialized output.\n // Encoding of `<` is the same behaviour as G3 script_builders.\n return JSON.stringify(this.store).replace(/</g, '\\\\u003C');\n }\n}\nfunction retrieveTransferredState(doc, appId) {\n // Locate the script tag with the JSON data transferred from the server.\n // The id of the script tag is set to the Angular appId + 'state'.\n const script = doc.getElementById(appId + '-state');\n if (script?.textContent) {\n try {\n // Avoid using any here as it triggers lint errors in google3 (any is not allowed).\n // Decoding of `<` is done of the box by browsers and node.js, same behaviour as G3\n // script_builders.\n return JSON.parse(script.textContent);\n } catch (e) {\n console.warn('Exception while restoring TransferState for app ' + appId, e);\n }\n }\n return {};\n}\n\n/** Encodes that the node lookup should start from the host node of this component. */\nconst REFERENCE_NODE_HOST = 'h';\n/** Encodes that the node lookup should start from the document body node. */\nconst REFERENCE_NODE_BODY = 'b';\n/**\n * Describes navigation steps that the runtime logic need to perform,\n * starting from a given (known) element.\n */\nvar NodeNavigationStep;\n(function (NodeNavigationStep) {\n NodeNavigationStep[\"FirstChild\"] = \"f\";\n NodeNavigationStep[\"NextSibling\"] = \"n\";\n})(NodeNavigationStep || (NodeNavigationStep = {}));\n/**\n * Keys within serialized view data structure to represent various\n * parts. See the `SerializedView` interface below for additional information.\n */\nconst ELEMENT_CONTAINERS = 'e';\nconst TEMPLATES = 't';\nconst CONTAINERS = 'c';\nconst MULTIPLIER = 'x';\nconst NUM_ROOT_NODES = 'r';\nconst TEMPLATE_ID = 'i'; // as it's also an \"id\"\nconst NODES = 'n';\nconst DISCONNECTED_NODES = 'd';\nconst I18N_DATA = 'l';\n\n/**\n * The name of the key used in the TransferState collection,\n * where hydration information is located.\n */\nconst TRANSFER_STATE_TOKEN_ID = '__nghData__';\n/**\n * Lookup key used to reference DOM hydration data (ngh) in `TransferState`.\n */\nconst NGH_DATA_KEY = makeStateKey(TRANSFER_STATE_TOKEN_ID);\n/**\n * The name of the attribute that would be added to host component\n * nodes and contain a reference to a particular slot in transferred\n * state that contains the necessary hydration info for this component.\n */\nconst NGH_ATTR_NAME = 'ngh';\n/**\n * Marker used in a comment node to ensure hydration content integrity\n */\nconst SSR_CONTENT_INTEGRITY_MARKER = 'nghm';\n/**\n * Reference to a function that reads `ngh` attribute value from a given RNode\n * and retrieves hydration information from the TransferState using that value\n * as an index. Returns `null` by default, when hydration is not enabled.\n *\n * @param rNode Component's host element.\n * @param injector Injector that this component has access to.\n * @param isRootView Specifies whether we trying to read hydration info for the root view.\n */\nlet _retrieveHydrationInfoImpl = () => null;\nfunction retrieveHydrationInfoImpl(rNode, injector, isRootView = false) {\n let nghAttrValue = rNode.getAttribute(NGH_ATTR_NAME);\n if (nghAttrValue == null) return null;\n // For cases when a root component also acts as an anchor node for a ViewContainerRef\n // (for example, when ViewContainerRef is injected in a root component), there is a need\n // to serialize information about the component itself, as well as an LContainer that\n // represents this ViewContainerRef. Effectively, we need to serialize 2 pieces of info:\n // (1) hydration info for the root component itself and (2) hydration info for the\n // ViewContainerRef instance (an LContainer). Each piece of information is included into\n // the hydration data (in the TransferState object) separately, thus we end up with 2 ids.\n // Since we only have 1 root element, we encode both bits of info into a single string:\n // ids are separated by the `|` char (e.g. `10|25`, where `10` is the ngh for a component view\n // and 25 is the `ngh` for a root view which holds LContainer).\n const [componentViewNgh, rootViewNgh] = nghAttrValue.split('|');\n nghAttrValue = isRootView ? rootViewNgh : componentViewNgh;\n if (!nghAttrValue) return null;\n // We've read one of the ngh ids, keep the remaining one, so that\n // we can set it back on the DOM element.\n const rootNgh = rootViewNgh ? `|${rootViewNgh}` : '';\n const remainingNgh = isRootView ? componentViewNgh : rootNgh;\n let data = {};\n // An element might have an empty `ngh` attribute value (e.g. `<comp ngh=\"\" />`),\n // which means that no special annotations are required. Do not attempt to read\n // from the TransferState in this case.\n if (nghAttrValue !== '') {\n const transferState = injector.get(TransferState, null, {\n optional: true\n });\n if (transferState !== null) {\n const nghData = transferState.get(NGH_DATA_KEY, []);\n // The nghAttrValue is always a number referencing an index\n // in the hydration TransferState data.\n data = nghData[Number(nghAttrValue)];\n // If the `ngh` attribute exists and has a non-empty value,\n // the hydration info *must* be present in the TransferState.\n // If there is no data for some reasons, this is an error.\n ngDevMode && assertDefined(data, 'Unable to retrieve hydration info from the TransferState.');\n }\n }\n const dehydratedView = {\n data,\n firstChild: rNode.firstChild ?? null\n };\n if (isRootView) {\n // If there is hydration info present for the root view, it means that there was\n // a ViewContainerRef injected in the root component. The root component host element\n // acted as an anchor node in this scenario. As a result, the DOM nodes that represent\n // embedded views in this ViewContainerRef are located as siblings to the host node,\n // i.e. `<app-root /><#VIEW1><#VIEW2>...<!--container-->`. In this case, the current\n // node becomes the first child of this root view and the next sibling is the first\n // element in the DOM segment.\n dehydratedView.firstChild = rNode;\n // We use `0` here, since this is the slot (right after the HEADER_OFFSET)\n // where a component LView or an LContainer is located in a root LView.\n setSegmentHead(dehydratedView, 0, rNode.nextSibling);\n }\n if (remainingNgh) {\n // If we have only used one of the ngh ids, store the remaining one\n // back on this RNode.\n rNode.setAttribute(NGH_ATTR_NAME, remainingNgh);\n } else {\n // The `ngh` attribute is cleared from the DOM node now\n // that the data has been retrieved for all indices.\n rNode.removeAttribute(NGH_ATTR_NAME);\n }\n // Note: don't check whether this node was claimed for hydration,\n // because this node might've been previously claimed while processing\n // template instructions.\n ngDevMode && markRNodeAsClaimedByHydration(rNode, /* checkIfAlreadyClaimed */false);\n ngDevMode && ngDevMode.hydratedComponents++;\n return dehydratedView;\n}\n/**\n * Sets the implementation for the `retrieveHydrationInfo` function.\n */\nfunction enableRetrieveHydrationInfoImpl() {\n _retrieveHydrationInfoImpl = retrieveHydrationInfoImpl;\n}\n/**\n * Retrieves hydration info by reading the value from the `ngh` attribute\n * and accessing a corresponding slot in TransferState storage.\n */\nfunction retrieveHydrationInfo(rNode, injector, isRootView = false) {\n return _retrieveHydrationInfoImpl(rNode, injector, isRootView);\n}\n/**\n * Retrieves the necessary object from a given ViewRef to serialize:\n * - an LView for component views\n * - an LContainer for cases when component acts as a ViewContainerRef anchor\n * - `null` in case of an embedded view\n */\nfunction getLNodeForHydration(viewRef) {\n // Reading an internal field from `ViewRef` instance.\n let lView = viewRef._lView;\n const tView = lView[TVIEW];\n // A registered ViewRef might represent an instance of an\n // embedded view, in which case we do not need to annotate it.\n if (tView.type === 2 /* TViewType.Embedded */) {\n return null;\n }\n // Check if it's a root view and if so, retrieve component's\n // LView from the first slot after the header.\n if (isRootView(lView)) {\n lView = lView[HEADER_OFFSET];\n }\n return lView;\n}\nfunction getTextNodeContent(node) {\n return node.textContent?.replace(/\\s/gm, '');\n}\n/**\n * Restores text nodes and separators into the DOM that were lost during SSR\n * serialization. The hydration process replaces empty text nodes and text\n * nodes that are immediately adjacent to other text nodes with comment nodes\n * that this method filters on to restore those missing nodes that the\n * hydration process is expecting to be present.\n *\n * @param node The app's root HTML Element\n */\nfunction processTextNodeMarkersBeforeHydration(node) {\n const doc = getDocument();\n const commentNodesIterator = doc.createNodeIterator(node, NodeFilter.SHOW_COMMENT, {\n acceptNode(node) {\n const content = getTextNodeContent(node);\n const isTextNodeMarker = content === \"ngetn\" /* TextNodeMarker.EmptyNode */ || content === \"ngtns\" /* TextNodeMarker.Separator */;\n return isTextNodeMarker ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;\n }\n });\n let currentNode;\n // We cannot modify the DOM while using the commentIterator,\n // because it throws off the iterator state.\n // So we collect all marker nodes first and then follow up with\n // applying the changes to the DOM: either inserting an empty node\n // or just removing the marker if it was used as a separator.\n const nodes = [];\n while (currentNode = commentNodesIterator.nextNode()) {\n nodes.push(currentNode);\n }\n for (const node of nodes) {\n if (node.textContent === \"ngetn\" /* TextNodeMarker.EmptyNode */) {\n node.replaceWith(doc.createTextNode(''));\n } else {\n node.remove();\n }\n }\n}\n/**\n * Internal type that represents a claimed node.\n * Only used in dev mode.\n */\nvar HydrationStatus;\n(function (HydrationStatus) {\n HydrationStatus[\"Hydrated\"] = \"hydrated\";\n HydrationStatus[\"Skipped\"] = \"skipped\";\n HydrationStatus[\"Mismatched\"] = \"mismatched\";\n})(HydrationStatus || (HydrationStatus = {}));\nconst HYDRATION_INFO_KEY = '__ngDebugHydrationInfo__';\nfunction patchHydrationInfo(node, info) {\n node[HYDRATION_INFO_KEY] = info;\n}\nfunction readHydrationInfo(node) {\n return node[HYDRATION_INFO_KEY] ?? null;\n}\n/**\n * Marks a node as \"claimed\" by hydration process.\n * This is needed to make assessments in tests whether\n * the hydration process handled all nodes.\n */\nfunction markRNodeAsClaimedByHydration(node, checkIfAlreadyClaimed = true) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsClaimedByHydration` in prod mode ' + 'is not supported and likely a mistake.');\n }\n if (checkIfAlreadyClaimed && isRNodeClaimedForHydration(node)) {\n throw new Error('Trying to claim a node, which was claimed already.');\n }\n patchHydrationInfo(node, {\n status: HydrationStatus.Hydrated\n });\n ngDevMode.hydratedNodes++;\n}\nfunction markRNodeAsSkippedByHydration(node) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsSkippedByHydration` in prod mode ' + 'is not supported and likely a mistake.');\n }\n patchHydrationInfo(node, {\n status: HydrationStatus.Skipped\n });\n ngDevMode.componentsSkippedHydration++;\n}\nfunction markRNodeAsHavingHydrationMismatch(node, expectedNodeDetails = null, actualNodeDetails = null) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsMismatchedByHydration` in prod mode ' + 'is not supported and likely a mistake.');\n }\n // The RNode can be a standard HTMLElement (not an Angular component or directive)\n // The devtools component tree only displays Angular components & directives\n // Therefore we attach the debug info to the closest component/directive\n while (node && !getComponent$1(node)) {\n node = node?.parentNode;\n }\n if (node) {\n patchHydrationInfo(node, {\n status: HydrationStatus.Mismatched,\n expectedNodeDetails,\n actualNodeDetails\n });\n }\n}\nfunction isRNodeClaimedForHydration(node) {\n return readHydrationInfo(node)?.status === HydrationStatus.Hydrated;\n}\nfunction setSegmentHead(hydrationInfo, index, node) {\n hydrationInfo.segmentHeads ??= {};\n hydrationInfo.segmentHeads[index] = node;\n}\nfunction getSegmentHead(hydrationInfo, index) {\n return hydrationInfo.segmentHeads?.[index] ?? null;\n}\n/**\n * Returns the size of an <ng-container>, using either the information\n * serialized in `ELEMENT_CONTAINERS` (element container size) or by\n * computing the sum of root nodes in all dehydrated views in a given\n * container (in case this `<ng-container>` was also used as a view\n * container host node, e.g. <ng-container *ngIf>).\n */\nfunction getNgContainerSize(hydrationInfo, index) {\n const data = hydrationInfo.data;\n let size = data[ELEMENT_CONTAINERS]?.[index] ?? null;\n // If there is no serialized information available in the `ELEMENT_CONTAINERS` slot,\n // check if we have info about view containers at this location (e.g.\n // `<ng-container *ngIf>`) and use container size as a number of root nodes in this\n // element container.\n if (size === null && data[CONTAINERS]?.[index]) {\n size = calcSerializedContainerSize(hydrationInfo, index);\n }\n return size;\n}\nfunction isSerializedElementContainer(hydrationInfo, index) {\n return hydrationInfo.data[ELEMENT_CONTAINERS]?.[index] !== undefined;\n}\nfunction getSerializedContainerViews(hydrationInfo, index) {\n return hydrationInfo.data[CONTAINERS]?.[index] ?? null;\n}\n/**\n * Computes the size of a serialized container (the number of root nodes)\n * by calculating the sum of root nodes in all dehydrated views in this container.\n */\nfunction calcSerializedContainerSize(hydrationInfo, index) {\n const views = getSerializedContainerViews(hydrationInfo, index) ?? [];\n let numNodes = 0;\n for (let view of views) {\n numNodes += view[NUM_ROOT_NODES] * (view[MULTIPLIER] ?? 1);\n }\n return numNodes;\n}\n/**\n * Attempt to initialize the `disconnectedNodes` field of the given\n * `DehydratedView`. Returns the initialized value.\n */\nfunction initDisconnectedNodes(hydrationInfo) {\n // Check if we are processing disconnected info for the first time.\n if (typeof hydrationInfo.disconnectedNodes === 'undefined') {\n const nodeIds = hydrationInfo.data[DISCONNECTED_NODES];\n hydrationInfo.disconnectedNodes = nodeIds ? new Set(nodeIds) : null;\n }\n return hydrationInfo.disconnectedNodes;\n}\n/**\n * Checks whether a node is annotated as \"disconnected\", i.e. not present\n * in the DOM at serialization time. We should not attempt hydration for\n * such nodes and instead, use a regular \"creation mode\".\n */\nfunction isDisconnectedNode$1(hydrationInfo, index) {\n // Check if we are processing disconnected info for the first time.\n if (typeof hydrationInfo.disconnectedNodes === 'undefined') {\n const nodeIds = hydrationInfo.data[DISCONNECTED_NODES];\n hydrationInfo.disconnectedNodes = nodeIds ? new Set(nodeIds) : null;\n }\n return !!initDisconnectedNodes(hydrationInfo)?.has(index);\n}\n/**\n * Helper function to prepare text nodes for serialization by ensuring\n * that seperate logical text blocks in the DOM remain separate after\n * serialization.\n */\nfunction processTextNodeBeforeSerialization(context, node) {\n // Handle cases where text nodes can be lost after DOM serialization:\n // 1. When there is an *empty text node* in DOM: in this case, this\n // node would not make it into the serialized string and as a result,\n // this node wouldn't be created in a browser. This would result in\n // a mismatch during the hydration, where the runtime logic would expect\n // a text node to be present in live DOM, but no text node would exist.\n // Example: `<span>{{ name }}</span>` when the `name` is an empty string.\n // This would result in `<span></span>` string after serialization and\n // in a browser only the `span` element would be created. To resolve that,\n // an extra comment node is appended in place of an empty text node and\n // that special comment node is replaced with an empty text node *before*\n // hydration.\n // 2. When there are 2 consecutive text nodes present in the DOM.\n // Example: `<div>Hello <ng-container *ngIf=\"true\">world</ng-container></div>`.\n // In this scenario, the live DOM would look like this:\n // <div>#text('Hello ') #text('world') #comment('container')</div>\n // Serialized string would look like this: `<div>Hello world<!--container--></div>`.\n // The live DOM in a browser after that would be:\n // <div>#text('Hello world') #comment('container')</div>\n // Notice how 2 text nodes are now \"merged\" into one. This would cause hydration\n // logic to fail, since it'd expect 2 text nodes being present, not one.\n // To fix this, we insert a special comment node in between those text nodes, so\n // serialized representation is: `<div>Hello <!--ngtns-->world<!--container--></div>`.\n // This forces browser to create 2 text nodes separated by a comment node.\n // Before running a hydration process, this special comment node is removed, so the\n // live DOM has exactly the same state as it was before serialization.\n // Collect this node as required special annotation only when its\n // contents is empty. Otherwise, such text node would be present on\n // the client after server-side rendering and no special handling needed.\n const el = node;\n const corruptedTextNodes = context.corruptedTextNodes;\n if (el.textContent === '') {\n corruptedTextNodes.set(el, \"ngetn\" /* TextNodeMarker.EmptyNode */);\n } else if (el.nextSibling?.nodeType === Node.TEXT_NODE) {\n corruptedTextNodes.set(el, \"ngtns\" /* TextNodeMarker.Separator */);\n }\n}\n\n/**\n * Internal token that specifies whether DOM reuse logic\n * during hydration is enabled.\n */\nconst IS_HYDRATION_DOM_REUSE_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'IS_HYDRATION_DOM_REUSE_ENABLED' : '');\n// By default (in client rendering mode), we remove all the contents\n// of the host element and render an application after that.\nconst PRESERVE_HOST_CONTENT_DEFAULT = false;\n/**\n * Internal token that indicates whether host element content should be\n * retained during the bootstrap.\n */\nconst PRESERVE_HOST_CONTENT = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'PRESERVE_HOST_CONTENT' : '', {\n providedIn: 'root',\n factory: () => PRESERVE_HOST_CONTENT_DEFAULT\n});\n/**\n * Internal token that indicates whether hydration support for i18n\n * is enabled.\n */\nconst IS_I18N_HYDRATION_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'IS_I18N_HYDRATION_ENABLED' : '');\n/**\n * Internal token that indicates whether event replay support for SSR\n * is enabled.\n */\nconst IS_EVENT_REPLAY_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'IS_EVENT_REPLAY_ENABLED' : '');\nconst EVENT_REPLAY_ENABLED_DEFAULT = false;\n\n/**\n * @fileoverview\n * A module to facilitate use of a Trusted Types policy internally within\n * Angular. It lazily constructs the Trusted Types policy, providing helper\n * utilities for promoting strings to Trusted Types. When Trusted Types are not\n * available, strings are used as a fallback.\n * @security All use of this module is security-sensitive and should go through\n * security review.\n */\n/**\n * The Trusted Types policy, or null if Trusted Types are not\n * enabled/supported, or undefined if the policy has not been created yet.\n */\nlet policy$1;\n/**\n * Returns the Trusted Types policy, or null if Trusted Types are not\n * enabled/supported. The first call to this function will create the policy.\n */\nfunction getPolicy$1() {\n if (policy$1 === undefined) {\n policy$1 = null;\n if (_global.trustedTypes) {\n try {\n policy$1 = _global.trustedTypes.createPolicy('angular', {\n createHTML: s => s,\n createScript: s => s,\n createScriptURL: s => s\n });\n } catch {\n // trustedTypes.createPolicy throws if called with a name that is\n // already registered, even in report-only mode. Until the API changes,\n // catch the error not to break the applications functionally. In such\n // cases, the code will fall back to using strings.\n }\n }\n }\n return policy$1;\n}\n/**\n * Unsafely promote a string to a TrustedHTML, falling back to strings when\n * Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that the\n * provided string will never cause an XSS vulnerability if used in a context\n * that will be interpreted as HTML by a browser, e.g. when assigning to\n * element.innerHTML.\n */\nfunction trustedHTMLFromString(html) {\n return getPolicy$1()?.createHTML(html) || html;\n}\n/**\n * Unsafely promote a string to a TrustedScript, falling back to strings when\n * Trusted Types are not available.\n * @security In particular, it must be assured that the provided string will\n * never cause an XSS vulnerability if used in a context that will be\n * interpreted and executed as a script by a browser, e.g. when calling eval.\n */\nfunction trustedScriptFromString(script) {\n return getPolicy$1()?.createScript(script) || script;\n}\n/**\n * Unsafely promote a string to a TrustedScriptURL, falling back to strings\n * when Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that the\n * provided string will never cause an XSS vulnerability if used in a context\n * that will cause a browser to load and execute a resource, e.g. when\n * assigning to script.src.\n */\nfunction trustedScriptURLFromString(url) {\n return getPolicy$1()?.createScriptURL(url) || url;\n}\n/**\n * Unsafely call the Function constructor with the given string arguments. It\n * is only available in development mode, and should be stripped out of\n * production code.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that it\n * is only called from development code, as use in production code can lead to\n * XSS vulnerabilities.\n */\nfunction newTrustedFunctionForDev(...args) {\n if (typeof ngDevMode === 'undefined') {\n throw new Error('newTrustedFunctionForDev should never be called in production');\n }\n if (!_global.trustedTypes) {\n // In environments that don't support Trusted Types, fall back to the most\n // straightforward implementation:\n return new Function(...args);\n }\n // Chrome currently does not support passing TrustedScript to the Function\n // constructor. The following implements the workaround proposed on the page\n // below, where the Chromium bug is also referenced:\n // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor\n const fnArgs = args.slice(0, -1).join(',');\n const fnBody = args[args.length - 1];\n const body = `(function anonymous(${fnArgs}\n) { ${fnBody}\n})`;\n // Using eval directly confuses the compiler and prevents this module from\n // being stripped out of JS binaries even if not used. The global['eval']\n // indirection fixes that.\n const fn = _global['eval'](trustedScriptFromString(body));\n if (fn.bind === undefined) {\n // Workaround for a browser bug that only exists in Chrome 83, where passing\n // a TrustedScript to eval just returns the TrustedScript back without\n // evaluating it. In that case, fall back to the most straightforward\n // implementation:\n return new Function(...args);\n }\n // To completely mimic the behavior of calling \"new Function\", two more\n // things need to happen:\n // 1. Stringifying the resulting function should return its source code\n fn.toString = () => body;\n // 2. When calling the resulting function, `this` should refer to `global`\n return fn.bind(_global);\n // When Trusted Types support in Function constructors is widely available,\n // the implementation of this function can be simplified to:\n // return new Function(...args.map(a => trustedScriptFromString(a)));\n}\n\n/**\n * @fileoverview\n * A module to facilitate use of a Trusted Types policy internally within\n * Angular specifically for bypassSecurityTrust* and custom sanitizers. It\n * lazily constructs the Trusted Types policy, providing helper utilities for\n * promoting strings to Trusted Types. When Trusted Types are not available,\n * strings are used as a fallback.\n * @security All use of this module is security-sensitive and should go through\n * security review.\n */\n/**\n * The Trusted Types policy, or null if Trusted Types are not\n * enabled/supported, or undefined if the policy has not been created yet.\n */\nlet policy;\n/**\n * Returns the Trusted Types policy, or null if Trusted Types are not\n * enabled/supported. The first call to this function will create the policy.\n */\nfunction getPolicy() {\n if (policy === undefined) {\n policy = null;\n if (_global.trustedTypes) {\n try {\n policy = _global.trustedTypes.createPolicy('angular#unsafe-bypass', {\n createHTML: s => s,\n createScript: s => s,\n createScriptURL: s => s\n });\n } catch {\n // trustedTypes.createPolicy throws if called with a name that is\n // already registered, even in report-only mode. Until the API changes,\n // catch the error not to break the applications functionally. In such\n // cases, the code will fall back to using strings.\n }\n }\n }\n return policy;\n}\n/**\n * Unsafely promote a string to a TrustedHTML, falling back to strings when\n * Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nfunction trustedHTMLFromStringBypass(html) {\n return getPolicy()?.createHTML(html) || html;\n}\n/**\n * Unsafely promote a string to a TrustedScript, falling back to strings when\n * Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nfunction trustedScriptFromStringBypass(script) {\n return getPolicy()?.createScript(script) || script;\n}\n/**\n * Unsafely promote a string to a TrustedScriptURL, falling back to strings\n * when Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nfunction trustedScriptURLFromStringBypass(url) {\n return getPolicy()?.createScriptURL(url) || url;\n}\nclass SafeValueImpl {\n constructor(changingThisBreaksApplicationSecurity) {\n this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;\n }\n toString() {\n return `SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` + ` (see ${XSS_SECURITY_URL})`;\n }\n}\nclass SafeHtmlImpl extends SafeValueImpl {\n getTypeName() {\n return \"HTML\" /* BypassType.Html */;\n }\n}\nclass SafeStyleImpl extends SafeValueImpl {\n getTypeName() {\n return \"Style\" /* BypassType.Style */;\n }\n}\nclass SafeScriptImpl extends SafeValueImpl {\n getTypeName() {\n return \"Script\" /* BypassType.Script */;\n }\n}\nclass SafeUrlImpl extends SafeValueImpl {\n getTypeName() {\n return \"URL\" /* BypassType.Url */;\n }\n}\nclass SafeResourceUrlImpl extends SafeValueImpl {\n getTypeName() {\n return \"ResourceURL\" /* BypassType.ResourceUrl */;\n }\n}\nfunction unwrapSafeValue(value) {\n return value instanceof SafeValueImpl ? value.changingThisBreaksApplicationSecurity : value;\n}\nfunction allowSanitizationBypassAndThrow(value, type) {\n const actualType = getSanitizationBypassType(value);\n if (actualType != null && actualType !== type) {\n // Allow ResourceURLs in URL contexts, they are strictly more trusted.\n if (actualType === \"ResourceURL\" /* BypassType.ResourceUrl */ && type === \"URL\" /* BypassType.Url */) return true;\n throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`);\n }\n return actualType === type;\n}\nfunction getSanitizationBypassType(value) {\n return value instanceof SafeValueImpl && value.getTypeName() || null;\n}\n/**\n * Mark `html` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link htmlSanitizer} to be trusted implicitly.\n *\n * @param trustedHtml `html` string which needs to be implicitly trusted.\n * @returns a `html` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustHtml(trustedHtml) {\n return new SafeHtmlImpl(trustedHtml);\n}\n/**\n * Mark `style` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link styleSanitizer} to be trusted implicitly.\n *\n * @param trustedStyle `style` string which needs to be implicitly trusted.\n * @returns a `style` hich has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustStyle(trustedStyle) {\n return new SafeStyleImpl(trustedStyle);\n}\n/**\n * Mark `script` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link scriptSanitizer} to be trusted implicitly.\n *\n * @param trustedScript `script` string which needs to be implicitly trusted.\n * @returns a `script` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustScript(trustedScript) {\n return new SafeScriptImpl(trustedScript);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link urlSanitizer} to be trusted implicitly.\n *\n * @param trustedUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustUrl(trustedUrl) {\n return new SafeUrlImpl(trustedUrl);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.\n *\n * @param trustedResourceUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustResourceUrl(trustedResourceUrl) {\n return new SafeResourceUrlImpl(trustedResourceUrl);\n}\n\n/**\n * This helper is used to get hold of an inert tree of DOM elements containing dirty HTML\n * that needs sanitizing.\n * Depending upon browser support we use one of two strategies for doing this.\n * Default: DOMParser strategy\n * Fallback: InertDocument strategy\n */\nfunction getInertBodyHelper(defaultDoc) {\n const inertDocumentHelper = new InertDocumentHelper(defaultDoc);\n return isDOMParserAvailable() ? new DOMParserHelper(inertDocumentHelper) : inertDocumentHelper;\n}\n/**\n * Uses DOMParser to create and fill an inert body element.\n * This is the default strategy used in browsers that support it.\n */\nclass DOMParserHelper {\n constructor(inertDocumentHelper) {\n this.inertDocumentHelper = inertDocumentHelper;\n }\n getInertBodyElement(html) {\n // We add these extra elements to ensure that the rest of the content is parsed as expected\n // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the\n // `<head>` tag. Note that the `<body>` tag is closed implicitly to prevent unclosed tags\n // in `html` from consuming the otherwise explicit `</body>` tag.\n html = '<body><remove></remove>' + html;\n try {\n const body = new window.DOMParser().parseFromString(trustedHTMLFromString(html), 'text/html').body;\n if (body === null) {\n // In some browsers (e.g. Mozilla/5.0 iPad AppleWebKit Mobile) the `body` property only\n // becomes available in the following tick of the JS engine. In that case we fall back to\n // the `inertDocumentHelper` instead.\n return this.inertDocumentHelper.getInertBodyElement(html);\n }\n body.firstChild?.remove();\n return body;\n } catch {\n return null;\n }\n }\n}\n/**\n * Use an HTML5 `template` element to create and fill an inert DOM element.\n * This is the fallback strategy if the browser does not support DOMParser.\n */\nclass InertDocumentHelper {\n constructor(defaultDoc) {\n this.defaultDoc = defaultDoc;\n this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');\n }\n getInertBodyElement(html) {\n const templateEl = this.inertDocument.createElement('template');\n templateEl.innerHTML = trustedHTMLFromString(html);\n return templateEl;\n }\n}\n/**\n * We need to determine whether the DOMParser exists in the global context and\n * supports parsing HTML; HTML parsing support is not as wide as other formats, see\n * https://developer.mozilla.org/en-US/docs/Web/API/DOMParser#Browser_compatibility.\n *\n * @suppress {uselessCode}\n */\nfunction isDOMParserAvailable() {\n try {\n return !!new window.DOMParser().parseFromString(trustedHTMLFromString(''), 'text/html');\n } catch {\n return false;\n }\n}\n\n/**\n * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation\n * contexts.\n *\n * This regular expression matches a subset of URLs that will not cause script\n * execution if used in URL context within a HTML document. Specifically, this\n * regular expression matches if:\n * (1) Either a protocol that is not javascript:, and that has valid characters\n * (alphanumeric or [+-.]).\n * (2) or no protocol. A protocol must be followed by a colon. The below\n * allows that by allowing colons only after one of the characters [/?#].\n * A colon after a hash (#) must be in the fragment.\n * Otherwise, a colon after a (?) must be in a query.\n * Otherwise, a colon after a single solidus (/) must be in a path.\n * Otherwise, a colon after a double solidus (//) must be in the authority\n * (before port).\n *\n * The pattern disallows &, used in HTML entity declarations before\n * one of the characters in [/?#]. This disallows HTML entities used in the\n * protocol name, which should never happen, e.g. \"h&#116;tp\" for \"http\".\n * It also disallows HTML entities in the first path part of a relative path,\n * e.g. \"foo&lt;bar/baz\". Our existing escaping functions should not produce\n * that. More importantly, it disallows masking of a colon,\n * e.g. \"javascript&#58;...\".\n *\n * This regular expression was taken from the Closure sanitization library.\n */\nconst SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\\/?#]*(?:[\\/?#]|$))/i;\nfunction _sanitizeUrl(url) {\n url = String(url);\n if (url.match(SAFE_URL_PATTERN)) return url;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`);\n }\n return 'unsafe:' + url;\n}\nfunction tagSet(tags) {\n const res = {};\n for (const t of tags.split(',')) res[t] = true;\n return res;\n}\nfunction merge(...sets) {\n const res = {};\n for (const s of sets) {\n for (const v in s) {\n if (s.hasOwnProperty(v)) res[v] = true;\n }\n }\n return res;\n}\n// Good source of info about elements and attributes\n// https://html.spec.whatwg.org/#semantics\n// https://simon.html5.org/html-elements\n// Safe Void Elements - HTML5\n// https://html.spec.whatwg.org/#void-elements\nconst VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');\n// Elements that you can, intentionally, leave open (and which close themselves)\n// https://html.spec.whatwg.org/#optional-tags\nconst OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');\nconst OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');\nconst OPTIONAL_END_TAG_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);\n// Safe Block Elements - HTML5\nconst BLOCK_ELEMENTS = merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' + 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' + 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));\n// Inline Elements - HTML5\nconst INLINE_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' + 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' + 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));\nconst VALID_ELEMENTS = merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);\n// Attributes that have href and hence need to be sanitized\nconst URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');\nconst HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' + 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' + 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' + 'scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,' + 'valign,value,vspace,width');\n// Accessibility attributes as per WAI-ARIA 1.1 (W3C Working Draft 14 December 2018)\nconst ARIA_ATTRS = tagSet('aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,' + 'aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,' + 'aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,' + 'aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,' + 'aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,' + 'aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,' + 'aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext');\n// NB: This currently consciously doesn't support SVG. SVG sanitization has had several security\n// issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via\n// innerHTML is required, SVG attributes should be added here.\n// NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those\n// can be sanitized, but they increase security surface area without a legitimate use case, so they\n// are left out here.\nconst VALID_ATTRS = merge(URI_ATTRS, HTML_ATTRS, ARIA_ATTRS);\n// Elements whose content should not be traversed/preserved, if the elements themselves are invalid.\n//\n// Typically, `<invalid>Some content</invalid>` would traverse (and in this case preserve)\n// `Some content`, but strip `invalid-element` opening/closing tags. For some elements, though, we\n// don't want to preserve the content, if the elements themselves are going to be removed.\nconst SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet('script,style,template');\n/**\n * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe\n * attributes.\n */\nclass SanitizingHtmlSerializer {\n constructor() {\n // Explicitly track if something was stripped, to avoid accidentally warning of sanitization just\n // because characters were re-encoded.\n this.sanitizedSomething = false;\n this.buf = [];\n }\n sanitizeChildren(el) {\n // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.\n // However this code never accesses properties off of `document` before deleting its contents\n // again, so it shouldn't be vulnerable to DOM clobbering.\n let current = el.firstChild;\n let traverseContent = true;\n let parentNodes = [];\n while (current) {\n if (current.nodeType === Node.ELEMENT_NODE) {\n traverseContent = this.startElement(current);\n } else if (current.nodeType === Node.TEXT_NODE) {\n this.chars(current.nodeValue);\n } else {\n // Strip non-element, non-text nodes.\n this.sanitizedSomething = true;\n }\n if (traverseContent && current.firstChild) {\n // Push current node to the parent stack before entering its content.\n parentNodes.push(current);\n current = getFirstChild(current);\n continue;\n }\n while (current) {\n // Leaving the element.\n // Walk up and to the right, closing tags as we go.\n if (current.nodeType === Node.ELEMENT_NODE) {\n this.endElement(current);\n }\n let next = getNextSibling(current);\n if (next) {\n current = next;\n break;\n }\n // There was no next sibling, walk up to the parent node (extract it from the stack).\n current = parentNodes.pop();\n }\n }\n return this.buf.join('');\n }\n /**\n * Sanitizes an opening element tag (if valid) and returns whether the element's contents should\n * be traversed. Element content must always be traversed (even if the element itself is not\n * valid/safe), unless the element is one of `SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS`.\n *\n * @param element The element to sanitize.\n * @return True if the element's contents should be traversed.\n */\n startElement(element) {\n const tagName = getNodeName(element).toLowerCase();\n if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {\n this.sanitizedSomething = true;\n return !SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName);\n }\n this.buf.push('<');\n this.buf.push(tagName);\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const elAttr = elAttrs.item(i);\n const attrName = elAttr.name;\n const lower = attrName.toLowerCase();\n if (!VALID_ATTRS.hasOwnProperty(lower)) {\n this.sanitizedSomething = true;\n continue;\n }\n let value = elAttr.value;\n // TODO(martinprobst): Special case image URIs for data:image/...\n if (URI_ATTRS[lower]) value = _sanitizeUrl(value);\n this.buf.push(' ', attrName, '=\"', encodeEntities(value), '\"');\n }\n this.buf.push('>');\n return true;\n }\n endElement(current) {\n const tagName = getNodeName(current).toLowerCase();\n if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {\n this.buf.push('</');\n this.buf.push(tagName);\n this.buf.push('>');\n }\n }\n chars(chars) {\n this.buf.push(encodeEntities(chars));\n }\n}\n/**\n * Verifies whether a given child node is a descendant of a given parent node.\n * It may not be the case when properties like `.firstChild` are clobbered and\n * accessing `.firstChild` results in an unexpected node returned.\n */\nfunction isClobberedElement(parentNode, childNode) {\n return (parentNode.compareDocumentPosition(childNode) & Node.DOCUMENT_POSITION_CONTAINED_BY) !== Node.DOCUMENT_POSITION_CONTAINED_BY;\n}\n/**\n * Retrieves next sibling node and makes sure that there is no\n * clobbering of the `nextSibling` property happening.\n */\nfunction getNextSibling(node) {\n const nextSibling = node.nextSibling;\n // Make sure there is no `nextSibling` clobbering: navigating to\n // the next sibling and going back to the previous one should result\n // in the original node.\n if (nextSibling && node !== nextSibling.previousSibling) {\n throw clobberedElementError(nextSibling);\n }\n return nextSibling;\n}\n/**\n * Retrieves first child node and makes sure that there is no\n * clobbering of the `firstChild` property happening.\n */\nfunction getFirstChild(node) {\n const firstChild = node.firstChild;\n if (firstChild && isClobberedElement(node, firstChild)) {\n throw clobberedElementError(firstChild);\n }\n return firstChild;\n}\n/** Gets a reasonable nodeName, even for clobbered nodes. */\nfunction getNodeName(node) {\n const nodeName = node.nodeName;\n // If the property is clobbered, assume it is an `HTMLFormElement`.\n return typeof nodeName === 'string' ? nodeName : 'FORM';\n}\nfunction clobberedElementError(node) {\n return new Error(`Failed to sanitize html because the element is clobbered: ${node.outerHTML}`);\n}\n// Regular Expressions for parsing tags and attributes\nconst SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n// ! to ~ is the ASCII range.\nconst NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param value\n */\nfunction encodeEntities(value) {\n return value.replace(/&/g, '&amp;').replace(SURROGATE_PAIR_REGEXP, function (match) {\n const hi = match.charCodeAt(0);\n const low = match.charCodeAt(1);\n return '&#' + ((hi - 0xd800) * 0x400 + (low - 0xdc00) + 0x10000) + ';';\n }).replace(NON_ALPHANUMERIC_REGEXP, function (match) {\n return '&#' + match.charCodeAt(0) + ';';\n }).replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\nlet inertBodyHelper;\n/**\n * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to\n * the DOM in a browser environment.\n */\nfunction _sanitizeHtml(defaultDoc, unsafeHtmlInput) {\n let inertBodyElement = null;\n try {\n inertBodyHelper = inertBodyHelper || getInertBodyHelper(defaultDoc);\n // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).\n let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser\n // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.\n let mXSSAttempts = 5;\n let parsedHtml = unsafeHtml;\n do {\n if (mXSSAttempts === 0) {\n throw new Error('Failed to sanitize html because the input is unstable');\n }\n mXSSAttempts--;\n unsafeHtml = parsedHtml;\n parsedHtml = inertBodyElement.innerHTML;\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n } while (unsafeHtml !== parsedHtml);\n const sanitizer = new SanitizingHtmlSerializer();\n const safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && sanitizer.sanitizedSomething) {\n console.warn(`WARNING: sanitizing HTML stripped some content, see ${XSS_SECURITY_URL}`);\n }\n return trustedHTMLFromString(safeHtml);\n } finally {\n // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.\n if (inertBodyElement) {\n const parent = getTemplateContent(inertBodyElement) || inertBodyElement;\n while (parent.firstChild) {\n parent.firstChild.remove();\n }\n }\n }\n}\nfunction getTemplateContent(el) {\n return 'content' in el /** Microsoft/TypeScript#21517 */ && isTemplateElement(el) ? el.content : null;\n}\nfunction isTemplateElement(el) {\n return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE';\n}\n\n/**\n * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property\n * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly\n * handled.\n *\n * See DomSanitizer for more details on security in Angular applications.\n *\n * @publicApi\n */\nvar SecurityContext;\n(function (SecurityContext) {\n SecurityContext[SecurityContext[\"NONE\"] = 0] = \"NONE\";\n SecurityContext[SecurityContext[\"HTML\"] = 1] = \"HTML\";\n SecurityContext[SecurityContext[\"STYLE\"] = 2] = \"STYLE\";\n SecurityContext[SecurityContext[\"SCRIPT\"] = 3] = \"SCRIPT\";\n SecurityContext[SecurityContext[\"URL\"] = 4] = \"URL\";\n SecurityContext[SecurityContext[\"RESOURCE_URL\"] = 5] = \"RESOURCE_URL\";\n})(SecurityContext || (SecurityContext = {}));\n\n/**\n * An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing\n * dangerous content.\n *\n * This method parses the `html` and locates potentially dangerous content (such as urls and\n * javascript) and removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.\n *\n * @param unsafeHtml untrusted `html`, typically from the user.\n * @returns `html` string which is safe to display to user, because all of the dangerous javascript\n * and urls have been removed.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeHtml(unsafeHtml) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedHTMLFromStringBypass(sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeHtml, \"HTML\" /* BypassType.Html */)) {\n return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml));\n }\n return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml));\n}\n/**\n * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing\n * dangerous content.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.\n *\n * @param unsafeStyle untrusted `style`, typically from the user.\n * @returns `style` string which is safe to bind to the `style` properties.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeStyle(unsafeStyle) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || '';\n }\n if (allowSanitizationBypassAndThrow(unsafeStyle, \"Style\" /* BypassType.Style */)) {\n return unwrapSafeValue(unsafeStyle);\n }\n return renderStringify(unsafeStyle);\n}\n/**\n * A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing\n * dangerous\n * content.\n *\n * This method parses the `url` and locates potentially dangerous content (such as javascript) and\n * removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.\n *\n * @param unsafeUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * all of the dangerous javascript has been removed.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeUrl(unsafeUrl) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || '';\n }\n if (allowSanitizationBypassAndThrow(unsafeUrl, \"URL\" /* BypassType.Url */)) {\n return unwrapSafeValue(unsafeUrl);\n }\n return _sanitizeUrl(renderStringify(unsafeUrl));\n}\n/**\n * A `url` sanitizer which only lets trusted `url`s through.\n *\n * This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.\n *\n * @param unsafeResourceUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * only trusted `url`s have been allowed to pass.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeResourceUrl(unsafeResourceUrl) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedScriptURLFromStringBypass(sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeResourceUrl, \"ResourceURL\" /* BypassType.ResourceUrl */)) {\n return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));\n }\n throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);\n}\n/**\n * A `script` sanitizer which only lets trusted javascript through.\n *\n * This passes only `script`s marked trusted by calling {@link\n * bypassSanitizationTrustScript}.\n *\n * @param unsafeScript untrusted `script`, typically from the user.\n * @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,\n * because only trusted `scripts` have been allowed to pass.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeScript(unsafeScript) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedScriptFromStringBypass(sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeScript, \"Script\" /* BypassType.Script */)) {\n return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));\n }\n throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, ngDevMode && 'unsafe value used in a script context');\n}\n/**\n * A template tag function for promoting the associated constant literal to a\n * TrustedHTML. Interpolation is explicitly not allowed.\n *\n * @param html constant template literal containing trusted HTML.\n * @returns TrustedHTML wrapping `html`.\n *\n * @security This is a security-sensitive function and should only be used to\n * convert constant values of attributes and properties found in\n * application-provided Angular templates to TrustedHTML.\n *\n * @codeGenApi\n */\nfunction ɵɵtrustConstantHtml(html) {\n // The following runtime check ensures that the function was called as a\n // template tag (e.g. ɵɵtrustConstantHtml`content`), without any interpolation\n // (e.g. not ɵɵtrustConstantHtml`content ${variable}`). A TemplateStringsArray\n // is an array with a `raw` property that is also an array. The associated\n // template literal has no interpolation if and only if the length of the\n // TemplateStringsArray is 1.\n if (ngDevMode && (!Array.isArray(html) || !Array.isArray(html.raw) || html.length !== 1)) {\n throw new Error(`Unexpected interpolation in trusted HTML constant: ${html.join('?')}`);\n }\n return trustedHTMLFromString(html[0]);\n}\n/**\n * A template tag function for promoting the associated constant literal to a\n * TrustedScriptURL. Interpolation is explicitly not allowed.\n *\n * @param url constant template literal containing a trusted script URL.\n * @returns TrustedScriptURL wrapping `url`.\n *\n * @security This is a security-sensitive function and should only be used to\n * convert constant values of attributes and properties found in\n * application-provided Angular templates to TrustedScriptURL.\n *\n * @codeGenApi\n */\nfunction ɵɵtrustConstantResourceUrl(url) {\n // The following runtime check ensures that the function was called as a\n // template tag (e.g. ɵɵtrustConstantResourceUrl`content`), without any\n // interpolation (e.g. not ɵɵtrustConstantResourceUrl`content ${variable}`). A\n // TemplateStringsArray is an array with a `raw` property that is also an\n // array. The associated template literal has no interpolation if and only if\n // the length of the TemplateStringsArray is 1.\n if (ngDevMode && (!Array.isArray(url) || !Array.isArray(url.raw) || url.length !== 1)) {\n throw new Error(`Unexpected interpolation in trusted URL constant: ${url.join('?')}`);\n }\n return trustedScriptURLFromString(url[0]);\n}\n/**\n * Detects which sanitizer to use for URL property, based on tag name and prop name.\n *\n * The rules are based on the RESOURCE_URL context config from\n * `packages/compiler/src/schema/dom_security_schema.ts`.\n * If tag and prop names don't match Resource URL schema, use URL sanitizer.\n */\nfunction getUrlSanitizer(tag, prop) {\n if (prop === 'src' && (tag === 'embed' || tag === 'frame' || tag === 'iframe' || tag === 'media' || tag === 'script') || prop === 'href' && (tag === 'base' || tag === 'link')) {\n return ɵɵsanitizeResourceUrl;\n }\n return ɵɵsanitizeUrl;\n}\n/**\n * Sanitizes URL, selecting sanitizer function based on tag and property names.\n *\n * This function is used in case we can't define security context at compile time, when only prop\n * name is available. This happens when we generate host bindings for Directives/Components. The\n * host element is unknown at compile time, so we defer calculation of specific sanitizer to\n * runtime.\n *\n * @param unsafeUrl untrusted `url`, typically from the user.\n * @param tag target element tag name.\n * @param prop name of the property that contains the value.\n * @returns `url` string which is safe to bind.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {\n return getUrlSanitizer(tag, prop)(unsafeUrl);\n}\nfunction validateAgainstEventProperties(name) {\n if (name.toLowerCase().startsWith('on')) {\n const errorMessage = `Binding to event property '${name}' is disallowed for security reasons, ` + `please use (${name.slice(2)})=...` + `\\nIf '${name}' is a directive input, make sure the directive is imported by the` + ` current module.`;\n throw new RuntimeError(306 /* RuntimeErrorCode.INVALID_EVENT_BINDING */, errorMessage);\n }\n}\nfunction validateAgainstEventAttributes(name) {\n if (name.toLowerCase().startsWith('on')) {\n const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, ` + `please use (${name.slice(2)})=...`;\n throw new RuntimeError(306 /* RuntimeErrorCode.INVALID_EVENT_BINDING */, errorMessage);\n }\n}\nfunction getSanitizer() {\n const lView = getLView();\n return lView && lView[ENVIRONMENT].sanitizer;\n}\n\n/**\n * Disallowed strings in the comment.\n *\n * see: https://html.spec.whatwg.org/multipage/syntax.html#comments\n */\nconst COMMENT_DISALLOWED = /^>|^->|<!--|-->|--!>|<!-$/g;\n/**\n * Delimiter in the disallowed strings which needs to be wrapped with zero with character.\n */\nconst COMMENT_DELIMITER = /(<|>)/g;\nconst COMMENT_DELIMITER_ESCAPED = '\\u200B$1\\u200B';\n/**\n * Escape the content of comment strings so that it can be safely inserted into a comment node.\n *\n * The issue is that HTML does not specify any way to escape comment end text inside the comment.\n * Consider: `<!-- The way you close a comment is with \">\", and \"->\" at the beginning or by \"-->\" or\n * \"--!>\" at the end. -->`. Above the `\"-->\"` is meant to be text not an end to the comment. This\n * can be created programmatically through DOM APIs. (`<!--` are also disallowed.)\n *\n * see: https://html.spec.whatwg.org/multipage/syntax.html#comments\n *\n * ```\n * div.innerHTML = div.innerHTML\n * ```\n *\n * One would expect that the above code would be safe to do, but it turns out that because comment\n * text is not escaped, the comment may contain text which will prematurely close the comment\n * opening up the application for XSS attack. (In SSR we programmatically create comment nodes which\n * may contain such text and expect them to be safe.)\n *\n * This function escapes the comment text by looking for comment delimiters (`<` and `>`) and\n * surrounding them with `_>_` where the `_` is a zero width space `\\u200B`. The result is that if a\n * comment contains any of the comment start/end delimiters (such as `<!--`, `-->` or `--!>`) the\n * text it will render normally but it will not cause the HTML parser to close/open the comment.\n *\n * @param value text to make safe for comment node by escaping the comment open/close character\n * sequence.\n */\nfunction escapeCommentText(value) {\n return value.replace(COMMENT_DISALLOWED, text => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));\n}\nfunction normalizeDebugBindingName(name) {\n // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers\n name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));\n return `ng-reflect-${name}`;\n}\nconst CAMEL_CASE_REGEXP = /([A-Z])/g;\nfunction camelCaseToDashCase(input) {\n return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());\n}\nfunction normalizeDebugBindingValue(value) {\n try {\n // Limit the size of the value as otherwise the DOM just gets polluted.\n return value != null ? value.toString().slice(0, 30) : value;\n } catch (e) {\n return '[ERROR] Exception while trying to serialize the value';\n }\n}\n\n/**\n * Defines a schema that allows an NgModule to contain the following:\n * - Non-Angular elements named with dash case (`-`).\n * - Element properties named with dash case (`-`).\n * Dash case is the naming convention for custom elements.\n *\n * @publicApi\n */\nconst CUSTOM_ELEMENTS_SCHEMA = {\n name: 'custom-elements'\n};\n/**\n * Defines a schema that allows any property on any element.\n *\n * This schema allows you to ignore the errors related to any unknown elements or properties in a\n * template. The usage of this schema is generally discouraged because it prevents useful validation\n * and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead.\n *\n * @publicApi\n */\nconst NO_ERRORS_SCHEMA = {\n name: 'no-errors-schema'\n};\nlet shouldThrowErrorOnUnknownElement = false;\n/**\n * Sets a strict mode for JIT-compiled components to throw an error on unknown elements,\n * instead of just logging the error.\n * (for AOT-compiled ones this check happens at build time).\n */\nfunction ɵsetUnknownElementStrictMode(shouldThrow) {\n shouldThrowErrorOnUnknownElement = shouldThrow;\n}\n/**\n * Gets the current value of the strict mode.\n */\nfunction ɵgetUnknownElementStrictMode() {\n return shouldThrowErrorOnUnknownElement;\n}\nlet shouldThrowErrorOnUnknownProperty = false;\n/**\n * Sets a strict mode for JIT-compiled components to throw an error on unknown properties,\n * instead of just logging the error.\n * (for AOT-compiled ones this check happens at build time).\n */\nfunction ɵsetUnknownPropertyStrictMode(shouldThrow) {\n shouldThrowErrorOnUnknownProperty = shouldThrow;\n}\n/**\n * Gets the current value of the strict mode.\n */\nfunction ɵgetUnknownPropertyStrictMode() {\n return shouldThrowErrorOnUnknownProperty;\n}\n/**\n * Validates that the element is known at runtime and produces\n * an error if it's not the case.\n * This check is relevant for JIT-compiled components (for AOT-compiled\n * ones this check happens at build time).\n *\n * The element is considered known if either:\n * - it's a known HTML element\n * - it's a known custom element\n * - the element matches any directive\n * - the element is allowed by one of the schemas\n *\n * @param element Element to validate\n * @param lView An `LView` that represents a current component that is being rendered\n * @param tagName Name of the tag to check\n * @param schemas Array of schemas\n * @param hasDirectives Boolean indicating that the element matches any directive\n */\nfunction validateElementIsKnown(element, lView, tagName, schemas, hasDirectives) {\n // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT\n // mode where this check happens at compile time. In JIT mode, `schemas` is always present and\n // defined as an array (as an empty array in case `schemas` field is not defined) and we should\n // execute the check below.\n if (schemas === null) return;\n // If the element matches any directive, it's considered as valid.\n if (!hasDirectives && tagName !== null) {\n // The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered\n // as a custom element. Note that unknown elements with a dash in their name won't be instances\n // of HTMLUnknownElement in browsers that support web components.\n const isUnknown =\n // Note that we can't check for `typeof HTMLUnknownElement === 'function'` because\n // Domino doesn't expose HTMLUnknownElement globally.\n typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement && element instanceof HTMLUnknownElement || typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 && !customElements.get(tagName);\n if (isUnknown && !matchingSchemas(schemas, tagName)) {\n const isHostStandalone = isHostComponentStandalone(lView);\n const templateLocation = getTemplateLocationDetails(lView);\n const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;\n let message = `'${tagName}' is not a known element${templateLocation}:\\n`;\n message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone ? \"included in the '@Component.imports' of this component\" : 'a part of an @NgModule where this component is declared'}.\\n`;\n if (tagName && tagName.indexOf('-') > -1) {\n message += `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;\n } else {\n message += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;\n }\n if (shouldThrowErrorOnUnknownElement) {\n throw new RuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message);\n } else {\n console.error(formatRuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message));\n }\n }\n }\n}\n/**\n * Validates that the property of the element is known at runtime and returns\n * false if it's not the case.\n * This check is relevant for JIT-compiled components (for AOT-compiled\n * ones this check happens at build time).\n *\n * The property is considered known if either:\n * - it's a known property of the element\n * - the element is allowed by one of the schemas\n * - the property is used for animations\n *\n * @param element Element to validate\n * @param propName Name of the property to check\n * @param tagName Name of the tag hosting the property\n * @param schemas Array of schemas\n */\nfunction isPropertyValid(element, propName, tagName, schemas) {\n // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT\n // mode where this check happens at compile time. In JIT mode, `schemas` is always present and\n // defined as an array (as an empty array in case `schemas` field is not defined) and we should\n // execute the check below.\n if (schemas === null) return true;\n // The property is considered valid if the element matches the schema, it exists on the element,\n // or it is synthetic.\n if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {\n return true;\n }\n // Note: `typeof Node` returns 'function' in most browsers, but is undefined with domino.\n return typeof Node === 'undefined' || Node === null || !(element instanceof Node);\n}\n/**\n * Logs or throws an error that a property is not supported on an element.\n *\n * @param propName Name of the invalid property\n * @param tagName Name of the tag hosting the property\n * @param nodeType Type of the node hosting the property\n * @param lView An `LView` that represents a current component\n */\nfunction handleUnknownPropertyError(propName, tagName, nodeType, lView) {\n // Special-case a situation when a structural directive is applied to\n // an `<ng-template>` element, for example: `<ng-template *ngIf=\"true\">`.\n // In this case the compiler generates the `ɵɵtemplate` instruction with\n // the `null` as the tagName. The directive matching logic at runtime relies\n // on this effect (see `isInlineTemplate`), thus using the 'ng-template' as\n // a default value of the `tNode.value` is not feasible at this moment.\n if (!tagName && nodeType === 4 /* TNodeType.Container */) {\n tagName = 'ng-template';\n }\n const isHostStandalone = isHostComponentStandalone(lView);\n const templateLocation = getTemplateLocationDetails(lView);\n let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;\n const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;\n const importLocation = isHostStandalone ? \"included in the '@Component.imports' of this component\" : 'a part of an @NgModule where this component is declared';\n if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {\n // Most likely this is a control flow directive (such as `*ngIf`) used in\n // a template, but the directive or the `CommonModule` is not imported.\n const correspondingImport = KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName);\n message += `\\nIf the '${propName}' is an Angular control flow directive, ` + `please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`;\n } else {\n // May be an Angular component, which is not imported/declared?\n message += `\\n1. If '${tagName}' is an Angular component and it has the ` + `'${propName}' input, then verify that it is ${importLocation}.`;\n // May be a Web Component?\n if (tagName && tagName.indexOf('-') > -1) {\n message += `\\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' ` + `to the ${schemas} of this component to suppress this message.`;\n message += `\\n3. To allow any property add 'NO_ERRORS_SCHEMA' to ` + `the ${schemas} of this component.`;\n } else {\n // If it's expected, the error can be suppressed by the `NO_ERRORS_SCHEMA` schema.\n message += `\\n2. To allow any property add 'NO_ERRORS_SCHEMA' to ` + `the ${schemas} of this component.`;\n }\n }\n reportUnknownPropertyError(message);\n}\nfunction reportUnknownPropertyError(message) {\n if (shouldThrowErrorOnUnknownProperty) {\n throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);\n } else {\n console.error(formatRuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message));\n }\n}\n/**\n * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)\n * and must **not** be used in production bundles. The function makes megamorphic reads, which might\n * be too slow for production mode and also it relies on the constructor function being available.\n *\n * Gets a reference to the host component def (where a current component is declared).\n *\n * @param lView An `LView` that represents a current component that is being rendered.\n */\nfunction getDeclarationComponentDef(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const declarationLView = lView[DECLARATION_COMPONENT_VIEW];\n const context = declarationLView[CONTEXT];\n // Unable to obtain a context.\n if (!context) return null;\n return context.constructor ? getComponentDef(context.constructor) : null;\n}\n/**\n * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)\n * and must **not** be used in production bundles. The function makes megamorphic reads, which might\n * be too slow for production mode.\n *\n * Checks if the current component is declared inside of a standalone component template.\n *\n * @param lView An `LView` that represents a current component that is being rendered.\n */\nfunction isHostComponentStandalone(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const componentDef = getDeclarationComponentDef(lView);\n // Treat host component as non-standalone if we can't obtain the def.\n return !!componentDef?.standalone;\n}\n/**\n * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)\n * and must **not** be used in production bundles. The function makes megamorphic reads, which might\n * be too slow for production mode.\n *\n * Constructs a string describing the location of the host component template. The function is used\n * in dev mode to produce error messages.\n *\n * @param lView An `LView` that represents a current component that is being rendered.\n */\nfunction getTemplateLocationDetails(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n return componentClassName ? ` (used in the '${componentClassName}' component template)` : '';\n}\n/**\n * The set of known control flow directives and their corresponding imports.\n * We use this set to produce a more precises error message with a note\n * that the `CommonModule` should also be included.\n */\nconst KNOWN_CONTROL_FLOW_DIRECTIVES = new Map([['ngIf', 'NgIf'], ['ngFor', 'NgFor'], ['ngSwitchCase', 'NgSwitchCase'], ['ngSwitchDefault', 'NgSwitchDefault']]);\n/**\n * Returns true if the tag name is allowed by specified schemas.\n * @param schemas Array of schemas\n * @param tagName Name of the tag\n */\nfunction matchingSchemas(schemas, tagName) {\n if (schemas !== null) {\n for (let i = 0; i < schemas.length; i++) {\n const schema = schemas[i];\n if (schema === NO_ERRORS_SCHEMA || schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveWindow(element) {\n return element.ownerDocument.defaultView;\n}\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveDocument(element) {\n return element.ownerDocument;\n}\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveBody(element) {\n return element.ownerDocument.body;\n}\n/**\n * The special delimiter we use to separate property names, prefixes, and suffixes\n * in property binding metadata. See storeBindingMetadata().\n *\n * We intentionally use the Unicode \"REPLACEMENT CHARACTER\" (U+FFFD) as a delimiter\n * because it is a very uncommon character that is unlikely to be part of a user's\n * property names or interpolation strings. If it is in fact used in a property\n * binding, DebugElement.properties will not return the correct value for that\n * binding. However, there should be no runtime effect for real applications.\n *\n * This character is typically rendered as a question mark inside of a diamond.\n * See https://en.wikipedia.org/wiki/Specials_(Unicode_block)\n *\n */\nconst INTERPOLATION_DELIMITER = `<60>`;\n/**\n * Unwrap a value which might be behind a closure (for forward declaration reasons).\n */\nfunction maybeUnwrapFn(value) {\n if (value instanceof Function) {\n return value();\n } else {\n return value;\n }\n}\n/**\n * Detects whether the code is invoked in a browser.\n * Later on, this check should be replaced with a tree-shakable\n * flag (e.g. `!isServer`).\n */\nfunction isPlatformBrowser(injector) {\n return (injector ?? inject(Injector)).get(PLATFORM_ID) === 'browser';\n}\n\n/**\n * The max length of the string representation of a value in an error message\n */\nconst VALUE_STRING_LENGTH_LIMIT = 200;\n/** Verifies that a given type is a Standalone Component. */\nfunction assertStandaloneComponentType(type) {\n assertComponentDef(type);\n const componentDef = getComponentDef(type);\n if (!componentDef.standalone) {\n throw new RuntimeError(907 /* RuntimeErrorCode.TYPE_IS_NOT_STANDALONE */, `The ${stringifyForError(type)} component is not marked as standalone, ` + `but Angular expects to have a standalone component here. ` + `Please make sure the ${stringifyForError(type)} component has ` + `the \\`standalone: true\\` flag in the decorator.`);\n }\n}\n/** Verifies whether a given type is a component */\nfunction assertComponentDef(type) {\n if (!getComponentDef(type)) {\n throw new RuntimeError(906 /* RuntimeErrorCode.MISSING_GENERATED_DEF */, `The ${stringifyForError(type)} is not an Angular component, ` + `make sure it has the \\`@Component\\` decorator.`);\n }\n}\n/** Called when there are multiple component selectors that match a given node */\nfunction throwMultipleComponentError(tNode, first, second) {\n throw new RuntimeError(-300 /* RuntimeErrorCode.MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}: ` + `${stringifyForError(first)} and ` + `${stringifyForError(second)}`);\n}\n/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */\nfunction throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName, lView) {\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n const field = propName ? ` for '${propName}'` : '';\n let msg = `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value${field}: '${formatValue(oldValue)}'. Current value: '${formatValue(currValue)}'.${componentClassName ? ` Expression location: ${componentClassName} component` : ''}`;\n if (creationMode) {\n msg += ` It seems like the view has been created after its parent and its children have been dirty checked.` + ` Has it been created in a change detection hook?`;\n }\n throw new RuntimeError(-100 /* RuntimeErrorCode.EXPRESSION_CHANGED_AFTER_CHECKED */, msg);\n}\nfunction formatValue(value) {\n let strValue = String(value);\n // JSON.stringify will throw on circular references\n try {\n if (Array.isArray(value) || strValue === '[object Object]') {\n strValue = JSON.stringify(value);\n }\n } catch (error) {}\n return strValue.length > VALUE_STRING_LENGTH_LIMIT ? strValue.substring(0, VALUE_STRING_LENGTH_LIMIT) + '…' : strValue;\n}\nfunction constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {\n const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER);\n let oldValue = prefix,\n newValue = prefix;\n for (let i = 0; i < chunks.length; i++) {\n const slotIdx = rootIndex + i;\n oldValue += `${lView[slotIdx]}${chunks[i]}`;\n newValue += `${slotIdx === expressionIndex ? changedValue : lView[slotIdx]}${chunks[i]}`;\n }\n return {\n propName,\n oldValue,\n newValue\n };\n}\n/**\n * Constructs an object that contains details for the ExpressionChangedAfterItHasBeenCheckedError:\n * - property name (for property bindings or interpolations)\n * - old and new values, enriched using information from metadata\n *\n * More information on the metadata storage format can be found in `storePropertyBindingMetadata`\n * function description.\n */\nfunction getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValue) {\n const tData = lView[TVIEW].data;\n const metadata = tData[bindingIndex];\n if (typeof metadata === 'string') {\n // metadata for property interpolation\n if (metadata.indexOf(INTERPOLATION_DELIMITER) > -1) {\n return constructDetailsForInterpolation(lView, bindingIndex, bindingIndex, metadata, newValue);\n }\n // metadata for property binding\n return {\n propName: metadata,\n oldValue,\n newValue\n };\n }\n // metadata is not available for this expression, check if this expression is a part of the\n // property interpolation by going from the current binding index left and look for a string that\n // contains INTERPOLATION_DELIMITER, the layout in tView.data for this case will look like this:\n // [..., 'id<69>Prefix <20> and <20> suffix', null, null, null, ...]\n if (metadata === null) {\n let idx = bindingIndex - 1;\n while (typeof tData[idx] !== 'string' && tData[idx + 1] === null) {\n idx--;\n }\n const meta = tData[idx];\n if (typeof meta === 'string') {\n const matches = meta.match(new RegExp(INTERPOLATION_DELIMITER, 'g'));\n // first interpolation delimiter separates property name from interpolation parts (in case of\n // property interpolations), so we subtract one from total number of found delimiters\n if (matches && matches.length - 1 > bindingIndex - idx) {\n return constructDetailsForInterpolation(lView, idx, bindingIndex, meta, newValue);\n }\n }\n }\n return {\n propName: undefined,\n oldValue,\n newValue\n };\n}\n\n/**\n * Flags for renderer-specific style modifiers.\n * @publicApi\n */\nvar RendererStyleFlags2;\n(function (RendererStyleFlags2) {\n // TODO(misko): This needs to be refactored into a separate file so that it can be imported from\n // `node_manipulation.ts` Currently doing the import cause resolution order to change and fails\n // the tests. The work around is to have hard coded value in `node_manipulation.ts` for now.\n /**\n * Marks a style as important.\n */\n RendererStyleFlags2[RendererStyleFlags2[\"Important\"] = 1] = \"Important\";\n /**\n * Marks a style as using dash case naming (this-is-dash-case).\n */\n RendererStyleFlags2[RendererStyleFlags2[\"DashCase\"] = 2] = \"DashCase\";\n})(RendererStyleFlags2 || (RendererStyleFlags2 = {}));\nlet _icuContainerIterate;\n/**\n * Iterator which provides ability to visit all of the `TIcuContainerNode` root `RNode`s.\n */\nfunction icuContainerIterate(tIcuContainerNode, lView) {\n return _icuContainerIterate(tIcuContainerNode, lView);\n}\n/**\n * Ensures that `IcuContainerVisitor`'s implementation is present.\n *\n * This function is invoked when i18n instruction comes across an ICU. The purpose is to allow the\n * bundler to tree shake ICU logic and only load it if ICU instruction is executed.\n */\nfunction ensureIcuContainerVisitorLoaded(loader) {\n if (_icuContainerIterate === undefined) {\n // Do not inline this function. We want to keep `ensureIcuContainerVisitorLoaded` light, so it\n // can be inlined into call-site.\n _icuContainerIterate = loader();\n }\n}\n\n/**\n * NOTE: for performance reasons, the possible actions are inlined within the function instead of\n * being passed as an argument.\n */\nfunction applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {\n // If this slot was allocated for a text node dynamically created by i18n, the text node itself\n // won't be created until i18nApply() in the update block, so this node should be skipped.\n // For more info, see \"ICU expressions should work inside an ngTemplateOutlet inside an ngFor\"\n // in `i18n_spec.ts`.\n if (lNodeToHandle != null) {\n let lContainer;\n let isComponent = false;\n // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is\n // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if\n // it has LContainer so that we can process all of those cases appropriately.\n if (isLContainer(lNodeToHandle)) {\n lContainer = lNodeToHandle;\n } else if (isLView(lNodeToHandle)) {\n isComponent = true;\n ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n lNodeToHandle = lNodeToHandle[HOST];\n }\n const rNode = unwrapRNode(lNodeToHandle);\n if (action === 0 /* WalkTNodeTreeAction.Create */ && parent !== null) {\n if (beforeNode == null) {\n nativeAppendChild(renderer, parent, rNode);\n } else {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n } else if (action === 1 /* WalkTNodeTreeAction.Insert */ && parent !== null) {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n } else if (action === 2 /* WalkTNodeTreeAction.Detach */) {\n nativeRemoveNode(renderer, rNode, isComponent);\n } else if (action === 3 /* WalkTNodeTreeAction.Destroy */) {\n ngDevMode && ngDevMode.rendererDestroyNode++;\n renderer.destroyNode(rNode);\n }\n if (lContainer != null) {\n applyContainer(renderer, action, lContainer, parent, beforeNode);\n }\n }\n}\nfunction createTextNode(renderer, value) {\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n ngDevMode && ngDevMode.rendererSetText++;\n return renderer.createText(value);\n}\nfunction updateTextNode(renderer, rNode, value) {\n ngDevMode && ngDevMode.rendererSetText++;\n renderer.setValue(rNode, value);\n}\nfunction createCommentNode(renderer, value) {\n ngDevMode && ngDevMode.rendererCreateComment++;\n return renderer.createComment(escapeCommentText(value));\n}\n/**\n * Creates a native element from a tag name, using a renderer.\n * @param renderer A renderer to use\n * @param name the tag name\n * @param namespace Optional namespace for element.\n * @returns the element created\n */\nfunction createElementNode(renderer, name, namespace) {\n ngDevMode && ngDevMode.rendererCreateElement++;\n return renderer.createElement(name, namespace);\n}\n/**\n * Removes all DOM elements associated with a view.\n *\n * Because some root nodes of the view may be containers, we sometimes need\n * to propagate deeply into the nested containers to remove all elements in the\n * views beneath it.\n *\n * @param tView The `TView' of the `LView` from which elements should be added or removed\n * @param lView The view from which elements should be added or removed\n */\nfunction removeViewFromDOM(tView, lView) {\n detachViewFromDOM(tView, lView);\n lView[HOST] = null;\n lView[T_HOST] = null;\n}\n/**\n * Adds all DOM elements associated with a view.\n *\n * Because some root nodes of the view may be containers, we sometimes need\n * to propagate deeply into the nested containers to add all elements in the\n * views beneath it.\n *\n * @param tView The `TView' of the `LView` from which elements should be added or removed\n * @param parentTNode The `TNode` where the `LView` should be attached to.\n * @param renderer Current renderer to use for DOM manipulations.\n * @param lView The view from which elements should be added or removed\n * @param parentNativeNode The parent `RElement` where it should be inserted into.\n * @param beforeNode The node before which elements should be added, if insert mode\n */\nfunction addViewToDOM(tView, parentTNode, renderer, lView, parentNativeNode, beforeNode) {\n lView[HOST] = parentNativeNode;\n lView[T_HOST] = parentTNode;\n applyView(tView, lView, renderer, 1 /* WalkTNodeTreeAction.Insert */, parentNativeNode, beforeNode);\n}\n/**\n * Detach a `LView` from the DOM by detaching its nodes.\n *\n * @param tView The `TView' of the `LView` to be detached\n * @param lView the `LView` to be detached.\n */\nfunction detachViewFromDOM(tView, lView) {\n // When we remove a view from the DOM, we need to rerun afterRender hooks\n // We don't necessarily needs to run change detection. DOM removal only requires\n // change detection if animations are enabled (this notification is handled by animations).\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(9 /* NotificationSource.ViewDetachedFromDOM */);\n applyView(tView, lView, lView[RENDERER], 2 /* WalkTNodeTreeAction.Detach */, null, null);\n}\n/**\n * Traverses down and up the tree of views and containers to remove listeners and\n * call onDestroy callbacks.\n *\n * Notes:\n * - Because it's used for onDestroy calls, it needs to be bottom-up.\n * - Must process containers instead of their views to avoid splicing\n * when views are destroyed and re-added.\n * - Using a while loop because it's faster than recursion\n * - Destroy only called on movement to sibling or movement to parent (laterally or up)\n *\n * @param rootView The view to destroy\n */\nfunction destroyViewTree(rootView) {\n // If the view has no children, we can clean it up and return early.\n let lViewOrLContainer = rootView[CHILD_HEAD];\n if (!lViewOrLContainer) {\n return cleanUpView(rootView[TVIEW], rootView);\n }\n while (lViewOrLContainer) {\n let next = null;\n if (isLView(lViewOrLContainer)) {\n // If LView, traverse down to child.\n next = lViewOrLContainer[CHILD_HEAD];\n } else {\n ngDevMode && assertLContainer(lViewOrLContainer);\n // If container, traverse down to its first LView.\n const firstView = lViewOrLContainer[CONTAINER_HEADER_OFFSET];\n if (firstView) next = firstView;\n }\n if (!next) {\n // Only clean up view when moving to the side or up, as destroy hooks\n // should be called in order from the bottom up.\n while (lViewOrLContainer && !lViewOrLContainer[NEXT] && lViewOrLContainer !== rootView) {\n if (isLView(lViewOrLContainer)) {\n cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);\n }\n lViewOrLContainer = lViewOrLContainer[PARENT];\n }\n if (lViewOrLContainer === null) lViewOrLContainer = rootView;\n if (isLView(lViewOrLContainer)) {\n cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);\n }\n next = lViewOrLContainer && lViewOrLContainer[NEXT];\n }\n lViewOrLContainer = next;\n }\n}\n/**\n * Inserts a view into a container.\n *\n * This adds the view to the container's array of active views in the correct\n * position. It also adds the view's elements to the DOM if the container isn't a\n * root node of another view (in that case, the view's elements will be added when\n * the container's parent view is added later).\n *\n * @param tView The `TView' of the `LView` to insert\n * @param lView The view to insert\n * @param lContainer The container into which the view should be inserted\n * @param index Which index in the container to insert the child view into\n */\nfunction insertView(tView, lView, lContainer, index) {\n ngDevMode && assertLView(lView);\n ngDevMode && assertLContainer(lContainer);\n const indexInContainer = CONTAINER_HEADER_OFFSET + index;\n const containerLength = lContainer.length;\n if (index > 0) {\n // This is a new view, we need to add it to the children.\n lContainer[indexInContainer - 1][NEXT] = lView;\n }\n if (index < containerLength - CONTAINER_HEADER_OFFSET) {\n lView[NEXT] = lContainer[indexInContainer];\n addToArray(lContainer, CONTAINER_HEADER_OFFSET + index, lView);\n } else {\n lContainer.push(lView);\n lView[NEXT] = null;\n }\n lView[PARENT] = lContainer;\n // track views where declaration and insertion points are different\n const declarationLContainer = lView[DECLARATION_LCONTAINER];\n if (declarationLContainer !== null && lContainer !== declarationLContainer) {\n trackMovedView(declarationLContainer, lView);\n }\n // notify query that a new view has been added\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.insertView(tView);\n }\n updateAncestorTraversalFlagsOnAttach(lView);\n // Sets the attached flag\n lView[FLAGS] |= 128 /* LViewFlags.Attached */;\n}\n/**\n * Track views created from the declaration container (TemplateRef) and inserted into a\n * different LContainer or attached directly to ApplicationRef.\n */\nfunction trackMovedView(declarationContainer, lView) {\n ngDevMode && assertDefined(lView, 'LView required');\n ngDevMode && assertLContainer(declarationContainer);\n const movedViews = declarationContainer[MOVED_VIEWS];\n const parent = lView[PARENT];\n ngDevMode && assertDefined(parent, 'missing parent');\n if (isLView(parent)) {\n declarationContainer[FLAGS] |= LContainerFlags.HasTransplantedViews;\n } else {\n const insertedComponentLView = parent[PARENT][DECLARATION_COMPONENT_VIEW];\n ngDevMode && assertDefined(insertedComponentLView, 'Missing insertedComponentLView');\n const declaredComponentLView = lView[DECLARATION_COMPONENT_VIEW];\n ngDevMode && assertDefined(declaredComponentLView, 'Missing declaredComponentLView');\n if (declaredComponentLView !== insertedComponentLView) {\n // At this point the declaration-component is not same as insertion-component; this means that\n // this is a transplanted view. Mark the declared lView as having transplanted views so that\n // those views can participate in CD.\n declarationContainer[FLAGS] |= LContainerFlags.HasTransplantedViews;\n }\n }\n if (movedViews === null) {\n declarationContainer[MOVED_VIEWS] = [lView];\n } else {\n movedViews.push(lView);\n }\n}\nfunction detachMovedView(declarationContainer, lView) {\n ngDevMode && assertLContainer(declarationContainer);\n ngDevMode && assertDefined(declarationContainer[MOVED_VIEWS], 'A projected view should belong to a non-empty projected views collection');\n const movedViews = declarationContainer[MOVED_VIEWS];\n const declarationViewIndex = movedViews.indexOf(lView);\n movedViews.splice(declarationViewIndex, 1);\n}\n/**\n * Detaches a view from a container.\n *\n * This method removes the view from the container's array of active views. It also\n * removes the view's elements from the DOM.\n *\n * @param lContainer The container from which to detach a view\n * @param removeIndex The index of the view to detach\n * @returns Detached LView instance.\n */\nfunction detachView(lContainer, removeIndex) {\n if (lContainer.length <= CONTAINER_HEADER_OFFSET) return;\n const indexInContainer = CONTAINER_HEADER_OFFSET + removeIndex;\n const viewToDetach = lContainer[indexInContainer];\n if (viewToDetach) {\n const declarationLContainer = viewToDetach[DECLARATION_LCONTAINER];\n if (declarationLContainer !== null && declarationLContainer !== lContainer) {\n detachMovedView(declarationLContainer, viewToDetach);\n }\n if (removeIndex > 0) {\n lContainer[indexInContainer - 1][NEXT] = viewToDetach[NEXT];\n }\n const removedLView = removeFromArray(lContainer, CONTAINER_HEADER_OFFSET + removeIndex);\n removeViewFromDOM(viewToDetach[TVIEW], viewToDetach);\n // notify query that a view has been removed\n const lQueries = removedLView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(removedLView[TVIEW]);\n }\n viewToDetach[PARENT] = null;\n viewToDetach[NEXT] = null;\n // Unsets the attached flag\n viewToDetach[FLAGS] &= ~128 /* LViewFlags.Attached */;\n }\n return viewToDetach;\n}\n/**\n * A standalone function which destroys an LView,\n * conducting clean up (e.g. removing listeners, calling onDestroys).\n *\n * @param tView The `TView' of the `LView` to be destroyed\n * @param lView The view to be destroyed.\n */\nfunction destroyLView(tView, lView) {\n if (!(lView[FLAGS] & 256 /* LViewFlags.Destroyed */)) {\n const renderer = lView[RENDERER];\n if (renderer.destroyNode) {\n applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);\n }\n destroyViewTree(lView);\n }\n}\n/**\n * Calls onDestroys hooks for all directives and pipes in a given view and then removes all\n * listeners. Listeners are removed as the last step so events delivered in the onDestroys hooks\n * can be propagated to @Output listeners.\n *\n * @param tView `TView` for the `LView` to clean up.\n * @param lView The LView to clean up\n */\nfunction cleanUpView(tView, lView) {\n if (lView[FLAGS] & 256 /* LViewFlags.Destroyed */) {\n return;\n }\n const prevConsumer = setActiveConsumer$1(null);\n try {\n // Usually the Attached flag is removed when the view is detached from its parent, however\n // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n lView[FLAGS] &= ~128 /* LViewFlags.Attached */;\n // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n // really more of an \"afterDestroy\" hook if you think about it.\n lView[FLAGS] |= 256 /* LViewFlags.Destroyed */;\n lView[REACTIVE_TEMPLATE_CONSUMER] && consumerDestroy$1(lView[REACTIVE_TEMPLATE_CONSUMER]);\n executeOnDestroys(tView, lView);\n processCleanups(tView, lView);\n // For component views only, the local renderer is destroyed at clean up time.\n if (lView[TVIEW].type === 1 /* TViewType.Component */) {\n ngDevMode && ngDevMode.rendererDestroy++;\n lView[RENDERER].destroy();\n }\n const declarationContainer = lView[DECLARATION_LCONTAINER];\n // we are dealing with an embedded view that is still inserted into a container\n if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n // and this is a projected view\n if (declarationContainer !== lView[PARENT]) {\n detachMovedView(declarationContainer, lView);\n }\n // For embedded views still attached to a container: remove query result from this view.\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(tView);\n }\n }\n // Unregister the view once everything else has been cleaned up.\n unregisterLView(lView);\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n}\n/** Removes listeners and unsubscribes from output subscriptions */\nfunction processCleanups(tView, lView) {\n ngDevMode && assertNotReactive(processCleanups.name);\n const tCleanup = tView.cleanup;\n const lCleanup = lView[CLEANUP];\n if (tCleanup !== null) {\n for (let i = 0; i < tCleanup.length - 1; i += 2) {\n if (typeof tCleanup[i] === 'string') {\n // This is a native DOM listener. It will occupy 4 entries in the TCleanup array (hence i +=\n // 2 at the end of this block).\n const targetIdx = tCleanup[i + 3];\n ngDevMode && assertNumber(targetIdx, 'cleanup target must be a number');\n if (targetIdx >= 0) {\n // Destroy anything whose teardown is a function call (e.g. QueryList, ModelSignal).\n lCleanup[targetIdx]();\n } else {\n // Subscription\n lCleanup[-targetIdx].unsubscribe();\n }\n i += 2;\n } else {\n // This is a cleanup function that is grouped with the index of its context\n const context = lCleanup[tCleanup[i + 1]];\n tCleanup[i].call(context);\n }\n }\n }\n if (lCleanup !== null) {\n lView[CLEANUP] = null;\n }\n const destroyHooks = lView[ON_DESTROY_HOOKS];\n if (destroyHooks !== null) {\n // Reset the ON_DESTROY_HOOKS array before iterating over it to prevent hooks that unregister\n // themselves from mutating the array during iteration.\n lView[ON_DESTROY_HOOKS] = null;\n for (let i = 0; i < destroyHooks.length; i++) {\n const destroyHooksFn = destroyHooks[i];\n ngDevMode && assertFunction(destroyHooksFn, 'Expecting destroy hook to be a function.');\n destroyHooksFn();\n }\n }\n}\n/** Calls onDestroy hooks for this view */\nfunction executeOnDestroys(tView, lView) {\n ngDevMode && assertNotReactive(executeOnDestroys.name);\n let destroyHooks;\n if (tView != null && (destroyHooks = tView.destroyHooks) != null) {\n for (let i = 0; i < destroyHooks.length; i += 2) {\n const context = lView[destroyHooks[i]];\n // Only call the destroy hook if the context has been requested.\n if (!(context instanceof NodeInjectorFactory)) {\n const toCall = destroyHooks[i + 1];\n if (Array.isArray(toCall)) {\n for (let j = 0; j < toCall.length; j += 2) {\n const callContext = context[toCall[j]];\n const hook = toCall[j + 1];\n profiler(4 /* ProfilerEvent.LifecycleHookStart */, callContext, hook);\n try {\n hook.call(callContext);\n } finally {\n profiler(5 /* ProfilerEvent.LifecycleHookEnd */, callContext, hook);\n }\n }\n } else {\n profiler(4 /* ProfilerEvent.LifecycleHookStart */, context, toCall);\n try {\n toCall.call(context);\n } finally {\n profiler(5 /* ProfilerEvent.LifecycleHookEnd */, context, toCall);\n }\n }\n }\n }\n }\n}\n/**\n * Returns a native element if a node can be inserted into the given parent.\n *\n * There are two reasons why we may not be able to insert a element immediately.\n * - Projection: When creating a child content element of a component, we have to skip the\n * insertion because the content of a component will be projected.\n * `<component><content>delayed due to projection</content></component>`\n * - Parent container is disconnected: This can happen when we are inserting a view into\n * parent container, which itself is disconnected. For example the parent container is part\n * of a View which has not be inserted or is made for projection but has not been inserted\n * into destination.\n *\n * @param tView: Current `TView`.\n * @param tNode: `TNode` for which we wish to retrieve render parent.\n * @param lView: Current `LView`.\n */\nfunction getParentRElement(tView, tNode, lView) {\n return getClosestRElement(tView, tNode.parent, lView);\n}\n/**\n * Get closest `RElement` or `null` if it can't be found.\n *\n * If `TNode` is `TNodeType.Element` => return `RElement` at `LView[tNode.index]` location.\n * If `TNode` is `TNodeType.ElementContainer|IcuContain` => return the parent (recursively).\n * If `TNode` is `null` then return host `RElement`:\n * - return `null` if projection\n * - return `null` if parent container is disconnected (we have no parent.)\n *\n * @param tView: Current `TView`.\n * @param tNode: `TNode` for which we wish to retrieve `RElement` (or `null` if host element is\n * needed).\n * @param lView: Current `LView`.\n * @returns `null` if the `RElement` can't be determined at this time (no parent / projection)\n */\nfunction getClosestRElement(tView, tNode, lView) {\n let parentTNode = tNode;\n // Skip over element and ICU containers as those are represented by a comment node and\n // can't be used as a render parent. Also skip let declarations since they don't have a\n // corresponding DOM node at all.\n while (parentTNode !== null && parentTNode.type & (8 /* TNodeType.ElementContainer */ | 32 /* TNodeType.Icu */ | 128 /* TNodeType.LetDeclaration */)) {\n tNode = parentTNode;\n parentTNode = tNode.parent;\n }\n // If the parent tNode is null, then we are inserting across views: either into an embedded view\n // or a component view.\n if (parentTNode === null) {\n // We are inserting a root element of the component view into the component host element and\n // it should always be eager.\n return lView[HOST];\n } else {\n ngDevMode && assertTNodeType(parentTNode, 3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */);\n const {\n componentOffset\n } = parentTNode;\n if (componentOffset > -1) {\n ngDevMode && assertTNodeForLView(parentTNode, lView);\n const {\n encapsulation\n } = tView.data[parentTNode.directiveStart + componentOffset];\n // We've got a parent which is an element in the current view. We just need to verify if the\n // parent element is not a component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would then move it to its final destination. Note that we can't\n // make this assumption when using the Shadow DOM, because the native projection placeholders\n // (<content> or <slot>) have to be in place as elements are being inserted.\n if (encapsulation === ViewEncapsulation$1.None || encapsulation === ViewEncapsulation$1.Emulated) {\n return null;\n }\n }\n return getNativeByTNode(parentTNode, lView);\n }\n}\n/**\n * Inserts a native node before another native node for a given parent.\n * This is a utility function that can be used when native nodes were determined.\n */\nfunction nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {\n ngDevMode && ngDevMode.rendererInsertBefore++;\n renderer.insertBefore(parent, child, beforeNode, isMove);\n}\nfunction nativeAppendChild(renderer, parent, child) {\n ngDevMode && ngDevMode.rendererAppendChild++;\n ngDevMode && assertDefined(parent, 'parent node must be defined');\n renderer.appendChild(parent, child);\n}\nfunction nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {\n if (beforeNode !== null) {\n nativeInsertBefore(renderer, parent, child, beforeNode, isMove);\n } else {\n nativeAppendChild(renderer, parent, child);\n }\n}\n/**\n * Returns a native parent of a given native node.\n */\nfunction nativeParentNode(renderer, node) {\n return renderer.parentNode(node);\n}\n/**\n * Returns a native sibling of a given native node.\n */\nfunction nativeNextSibling(renderer, node) {\n return renderer.nextSibling(node);\n}\n/**\n * Find a node in front of which `currentTNode` should be inserted.\n *\n * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n * takes `TNode.insertBeforeIndex` into account if i18n code has been invoked.\n *\n * @param parentTNode parent `TNode`\n * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n * @param lView current `LView`\n */\nfunction getInsertInFrontOfRNode(parentTNode, currentTNode, lView) {\n return _getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView);\n}\n/**\n * Find a node in front of which `currentTNode` should be inserted. (Does not take i18n into\n * account)\n *\n * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n * does not take `TNode.insertBeforeIndex` into account.\n *\n * @param parentTNode parent `TNode`\n * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n * @param lView current `LView`\n */\nfunction getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView) {\n if (parentTNode.type & (8 /* TNodeType.ElementContainer */ | 32 /* TNodeType.Icu */)) {\n return getNativeByTNode(parentTNode, lView);\n }\n return null;\n}\n/**\n * Tree shakable boundary for `getInsertInFrontOfRNodeWithI18n` function.\n *\n * This function will only be set if i18n code runs.\n */\nlet _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithNoI18n;\n/**\n * Tree shakable boundary for `processI18nInsertBefore` function.\n *\n * This function will only be set if i18n code runs.\n */\nlet _processI18nInsertBefore;\nfunction setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore) {\n _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithI18n;\n _processI18nInsertBefore = processI18nInsertBefore;\n}\n/**\n * Appends the `child` native node (or a collection of nodes) to the `parent`.\n *\n * @param tView The `TView' to be appended\n * @param lView The current LView\n * @param childRNode The native child (or children) that should be appended\n * @param childTNode The TNode of the child element\n */\nfunction appendChild(tView, lView, childRNode, childTNode) {\n const parentRNode = getParentRElement(tView, childTNode, lView);\n const renderer = lView[RENDERER];\n const parentTNode = childTNode.parent || lView[T_HOST];\n const anchorNode = getInsertInFrontOfRNode(parentTNode, childTNode, lView);\n if (parentRNode != null) {\n if (Array.isArray(childRNode)) {\n for (let i = 0; i < childRNode.length; i++) {\n nativeAppendOrInsertBefore(renderer, parentRNode, childRNode[i], anchorNode, false);\n }\n } else {\n nativeAppendOrInsertBefore(renderer, parentRNode, childRNode, anchorNode, false);\n }\n }\n _processI18nInsertBefore !== undefined && _processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRNode);\n}\n/**\n * Returns the first native node for a given LView, starting from the provided TNode.\n *\n * Native nodes are returned in the order in which those appear in the native tree (DOM).\n */\nfunction getFirstNativeNode(lView, tNode) {\n if (tNode !== null) {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 32 /* TNodeType.Icu */ | 16 /* TNodeType.Projection */ | 128 /* TNodeType.LetDeclaration */);\n const tNodeType = tNode.type;\n if (tNodeType & 3 /* TNodeType.AnyRNode */) {\n return getNativeByTNode(tNode, lView);\n } else if (tNodeType & 4 /* TNodeType.Container */) {\n return getBeforeNodeForView(-1, lView[tNode.index]);\n } else if (tNodeType & 8 /* TNodeType.ElementContainer */) {\n const elIcuContainerChild = tNode.child;\n if (elIcuContainerChild !== null) {\n return getFirstNativeNode(lView, elIcuContainerChild);\n } else {\n const rNodeOrLContainer = lView[tNode.index];\n if (isLContainer(rNodeOrLContainer)) {\n return getBeforeNodeForView(-1, rNodeOrLContainer);\n } else {\n return unwrapRNode(rNodeOrLContainer);\n }\n }\n } else if (tNodeType & 128 /* TNodeType.LetDeclaration */) {\n return getFirstNativeNode(lView, tNode.next);\n } else if (tNodeType & 32 /* TNodeType.Icu */) {\n let nextRNode = icuContainerIterate(tNode, lView);\n let rNode = nextRNode();\n // If the ICU container has no nodes, than we use the ICU anchor as the node.\n return rNode || unwrapRNode(lView[tNode.index]);\n } else {\n const projectionNodes = getProjectionNodes(lView, tNode);\n if (projectionNodes !== null) {\n if (Array.isArray(projectionNodes)) {\n return projectionNodes[0];\n }\n const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);\n ngDevMode && assertParentView(parentView);\n return getFirstNativeNode(parentView, projectionNodes);\n } else {\n return getFirstNativeNode(lView, tNode.next);\n }\n }\n }\n return null;\n}\nfunction getProjectionNodes(lView, tNode) {\n if (tNode !== null) {\n const componentView = lView[DECLARATION_COMPONENT_VIEW];\n const componentHost = componentView[T_HOST];\n const slotIdx = tNode.projection;\n ngDevMode && assertProjectionSlots(lView);\n return componentHost.projection[slotIdx];\n }\n return null;\n}\nfunction getBeforeNodeForView(viewIndexInContainer, lContainer) {\n const nextViewIndex = CONTAINER_HEADER_OFFSET + viewIndexInContainer + 1;\n if (nextViewIndex < lContainer.length) {\n const lView = lContainer[nextViewIndex];\n const firstTNodeOfView = lView[TVIEW].firstChild;\n if (firstTNodeOfView !== null) {\n return getFirstNativeNode(lView, firstTNodeOfView);\n }\n }\n return lContainer[NATIVE];\n}\n/**\n * Removes a native node itself using a given renderer. To remove the node we are looking up its\n * parent from the native tree as not all platforms / browsers support the equivalent of\n * node.remove().\n *\n * @param renderer A renderer to be used\n * @param rNode The native node that should be removed\n * @param isHostElement A flag indicating if a node to be removed is a host of a component.\n */\nfunction nativeRemoveNode(renderer, rNode, isHostElement) {\n ngDevMode && ngDevMode.rendererRemoveNode++;\n renderer.removeChild(null, rNode, isHostElement);\n}\n/**\n * Clears the contents of a given RElement.\n *\n * @param rElement the native RElement to be cleared\n */\nfunction clearElementContents(rElement) {\n rElement.textContent = '';\n}\n/**\n * Performs the operation of `action` on the node. Typically this involves inserting or removing\n * nodes on the LView or projection boundary.\n */\nfunction applyNodes(renderer, action, tNode, lView, parentRElement, beforeNode, isProjection) {\n while (tNode != null) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n // Let declarations don't have corresponding DOM nodes so we skip over them.\n if (tNode.type === 128 /* TNodeType.LetDeclaration */) {\n tNode = tNode.next;\n continue;\n }\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 16 /* TNodeType.Projection */ | 32 /* TNodeType.Icu */);\n const rawSlotValue = lView[tNode.index];\n const tNodeType = tNode.type;\n if (isProjection) {\n if (action === 0 /* WalkTNodeTreeAction.Create */) {\n rawSlotValue && attachPatchData(unwrapRNode(rawSlotValue), lView);\n tNode.flags |= 2 /* TNodeFlags.isProjected */;\n }\n }\n if ((tNode.flags & 32 /* TNodeFlags.isDetached */) !== 32 /* TNodeFlags.isDetached */) {\n if (tNodeType & 8 /* TNodeType.ElementContainer */) {\n applyNodes(renderer, action, tNode.child, lView, parentRElement, beforeNode, false);\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n } else if (tNodeType & 32 /* TNodeType.Icu */) {\n const nextRNode = icuContainerIterate(tNode, lView);\n let rNode;\n while (rNode = nextRNode()) {\n applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);\n }\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n } else if (tNodeType & 16 /* TNodeType.Projection */) {\n applyProjectionRecursive(renderer, action, lView, tNode, parentRElement, beforeNode);\n } else {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */);\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n }\n }\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n }\n}\nfunction applyView(tView, lView, renderer, action, parentRElement, beforeNode) {\n applyNodes(renderer, action, tView.firstChild, lView, parentRElement, beforeNode, false);\n}\n/**\n * `applyProjection` performs operation on the projection.\n *\n * Inserting a projection requires us to locate the projected nodes from the parent component. The\n * complication is that those nodes themselves could be re-projected from their parent component.\n *\n * @param tView The `TView` of `LView` which needs to be inserted, detached, destroyed\n * @param lView The `LView` which needs to be inserted, detached, destroyed.\n * @param tProjectionNode node to project\n */\nfunction applyProjection(tView, lView, tProjectionNode) {\n const renderer = lView[RENDERER];\n const parentRNode = getParentRElement(tView, tProjectionNode, lView);\n const parentTNode = tProjectionNode.parent || lView[T_HOST];\n let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n applyProjectionRecursive(renderer, 0 /* WalkTNodeTreeAction.Create */, lView, tProjectionNode, parentRNode, beforeNode);\n}\n/**\n * `applyProjectionRecursive` performs operation on the projection specified by `action` (insert,\n * detach, destroy)\n *\n * Inserting a projection requires us to locate the projected nodes from the parent component. The\n * complication is that those nodes themselves could be re-projected from their parent component.\n *\n * @param renderer Render to use\n * @param action action to perform (insert, detach, destroy)\n * @param lView The LView which needs to be inserted, detached, destroyed.\n * @param tProjectionNode node to project\n * @param parentRElement parent DOM element for insertion/removal.\n * @param beforeNode Before which node the insertions should happen.\n */\nfunction applyProjectionRecursive(renderer, action, lView, tProjectionNode, parentRElement, beforeNode) {\n const componentLView = lView[DECLARATION_COMPONENT_VIEW];\n const componentNode = componentLView[T_HOST];\n ngDevMode && assertEqual(typeof tProjectionNode.projection, 'number', 'expecting projection index');\n const nodeToProjectOrRNodes = componentNode.projection[tProjectionNode.projection];\n if (Array.isArray(nodeToProjectOrRNodes)) {\n // This should not exist, it is a bit of a hack. When we bootstrap a top level node and we\n // need to support passing projectable nodes, so we cheat and put them in the TNode\n // of the Host TView. (Yes we put instance info at the T Level). We can get away with it\n // because we know that TView is not shared and therefore it will not be a problem.\n // This should be refactored and cleaned up.\n for (let i = 0; i < nodeToProjectOrRNodes.length; i++) {\n const rNode = nodeToProjectOrRNodes[i];\n applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);\n }\n } else {\n let nodeToProject = nodeToProjectOrRNodes;\n const projectedComponentLView = componentLView[PARENT];\n // If a parent <ng-content> is located within a skip hydration block,\n // annotate an actual node that is being projected with the same flag too.\n if (hasInSkipHydrationBlockFlag(tProjectionNode)) {\n nodeToProject.flags |= 128 /* TNodeFlags.inSkipHydrationBlock */;\n }\n applyNodes(renderer, action, nodeToProject, projectedComponentLView, parentRElement, beforeNode, true);\n }\n}\n/**\n * `applyContainer` performs an operation on the container and its views as specified by\n * `action` (insert, detach, destroy)\n *\n * Inserting a Container is complicated by the fact that the container may have Views which\n * themselves have containers or projections.\n *\n * @param renderer Renderer to use\n * @param action action to perform (insert, detach, destroy)\n * @param lContainer The LContainer which needs to be inserted, detached, destroyed.\n * @param parentRElement parent DOM element for insertion/removal.\n * @param beforeNode Before which node the insertions should happen.\n */\nfunction applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {\n ngDevMode && assertLContainer(lContainer);\n const anchor = lContainer[NATIVE]; // LContainer has its own before node.\n const native = unwrapRNode(lContainer);\n // An LContainer can be created dynamically on any node by injecting ViewContainerRef.\n // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor\n // node (comment in the DOM) that will be different from the LContainer's host node. In this\n // particular case we need to execute action on 2 nodes:\n // - container's host node (this is done in the executeActionOnElementOrContainer)\n // - container's host node (this is done here)\n if (anchor !== native) {\n // This is very strange to me (Misko). I would expect that the native is same as anchor. I\n // don't see a reason why they should be different, but they are.\n //\n // If they are we need to process the second anchor as well.\n applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lView = lContainer[i];\n applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);\n }\n}\n/**\n * Writes class/style to element.\n *\n * @param renderer Renderer to use.\n * @param isClassBased `true` if it should be written to `class` (`false` to write to `style`)\n * @param rNode The Node to write to.\n * @param prop Property to write to. This would be the class/style name.\n * @param value Value to write. If `null`/`undefined`/`false` this is considered a remove (set/add\n * otherwise).\n */\nfunction applyStyling(renderer, isClassBased, rNode, prop, value) {\n if (isClassBased) {\n // We actually want JS true/false here because any truthy value should add the class\n if (!value) {\n ngDevMode && ngDevMode.rendererRemoveClass++;\n renderer.removeClass(rNode, prop);\n } else {\n ngDevMode && ngDevMode.rendererAddClass++;\n renderer.addClass(rNode, prop);\n }\n } else {\n let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;\n if (value == null /** || value === undefined */) {\n ngDevMode && ngDevMode.rendererRemoveStyle++;\n renderer.removeStyle(rNode, prop, flags);\n } else {\n // A value is important if it ends with `!important`. The style\n // parser strips any semicolons at the end of the value.\n const isImportant = typeof value === 'string' ? value.endsWith('!important') : false;\n if (isImportant) {\n // !important has to be stripped from the value for it to be valid.\n value = value.slice(0, -10);\n flags |= RendererStyleFlags2.Important;\n }\n ngDevMode && ngDevMode.rendererSetStyle++;\n renderer.setStyle(rNode, prop, value, flags);\n }\n }\n}\n/**\n * Write `cssText` to `RElement`.\n *\n * This function does direct write without any reconciliation. Used for writing initial values, so\n * that static styling values do not pull in the style parser.\n *\n * @param renderer Renderer to use\n * @param element The element which needs to be updated.\n * @param newValue The new class list to write.\n */\nfunction writeDirectStyle(renderer, element, newValue) {\n ngDevMode && assertString(newValue, \"'newValue' should be a string\");\n renderer.setAttribute(element, 'style', newValue);\n ngDevMode && ngDevMode.rendererSetStyle++;\n}\n/**\n * Write `className` to `RElement`.\n *\n * This function does direct write without any reconciliation. Used for writing initial values, so\n * that static styling values do not pull in the style parser.\n *\n * @param renderer Renderer to use\n * @param element The element which needs to be updated.\n * @param newValue The new class list to write.\n */\nfunction writeDirectClass(renderer, element, newValue) {\n ngDevMode && assertString(newValue, \"'newValue' should be a string\");\n if (newValue === '') {\n // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.\n renderer.removeAttribute(element, 'class');\n } else {\n renderer.setAttribute(element, 'class', newValue);\n }\n ngDevMode && ngDevMode.rendererSetClassName++;\n}\n/** Sets up the static DOM attributes on an `RNode`. */\nfunction setupStaticAttributes(renderer, element, tNode) {\n const {\n mergedAttrs,\n classes,\n styles\n } = tNode;\n if (mergedAttrs !== null) {\n setUpAttributes(renderer, element, mergedAttrs);\n }\n if (classes !== null) {\n writeDirectClass(renderer, element, classes);\n }\n if (styles !== null) {\n writeDirectStyle(renderer, element, styles);\n }\n}\n\n/** A special value which designates that a value has not changed. */\nconst NO_CHANGE = typeof ngDevMode === 'undefined' || ngDevMode ? {\n __brand__: 'NO_CHANGE'\n} : {};\n\n/**\n * Advances to an element for later binding instructions.\n *\n * Used in conjunction with instructions like {@link property} to act on elements with specified\n * indices, for example those created with {@link element} or {@link elementStart}.\n *\n * ```ts\n * (rf: RenderFlags, ctx: any) => {\n * if (rf & 1) {\n * text(0, 'Hello');\n * text(1, 'Goodbye')\n * element(2, 'div');\n * }\n * if (rf & 2) {\n * advance(2); // Advance twice to the <div>.\n * property('title', 'test');\n * }\n * }\n * ```\n * @param delta Number of elements to advance forwards by.\n *\n * @codeGenApi\n */\nfunction ɵɵadvance(delta = 1) {\n ngDevMode && assertGreaterThan(delta, 0, 'Can only advance forward');\n selectIndexInternal(getTView(), getLView(), getSelectedIndex() + delta, !!ngDevMode && isInCheckNoChangesMode());\n}\nfunction selectIndexInternal(tView, lView, index, checkNoChangesMode) {\n ngDevMode && assertIndexInDeclRange(lView[TVIEW], index);\n // Flush the initial hooks for elements in the view that have been added up to this point.\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!checkNoChangesMode) {\n const hooksInitPhaseCompleted = (lView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === 3 /* InitPhaseState.InitPhaseCompleted */;\n if (hooksInitPhaseCompleted) {\n const preOrderCheckHooks = tView.preOrderCheckHooks;\n if (preOrderCheckHooks !== null) {\n executeCheckHooks(lView, preOrderCheckHooks, index);\n }\n } else {\n const preOrderHooks = tView.preOrderHooks;\n if (preOrderHooks !== null) {\n executeInitAndCheckHooks(lView, preOrderHooks, 0 /* InitPhaseState.OnInitHooksToBeRun */, index);\n }\n }\n }\n // We must set the selected index *after* running the hooks, because hooks may have side-effects\n // that cause other template functions to run, thus updating the selected index, which is global\n // state. If we run `setSelectedIndex` *before* we run the hooks, in some cases the selected index\n // will be altered by the time we leave the `ɵɵadvance` instruction.\n setSelectedIndex(index);\n}\nfunction ɵɵdirectiveInject(token, flags = InjectFlags.Default) {\n const lView = getLView();\n // Fall back to inject() if view hasn't been created. This situation can happen in tests\n // if inject utilities are used before bootstrapping.\n if (lView === null) {\n // Verify that we will not get into infinite loop.\n ngDevMode && assertInjectImplementationNotEqual(ɵɵdirectiveInject);\n return ɵɵinject(token, flags);\n }\n const tNode = getCurrentTNode();\n const value = getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);\n ngDevMode && emitInjectEvent(token, value, flags);\n return value;\n}\n/**\n * Throws an error indicating that a factory function could not be generated by the compiler for a\n * particular class.\n *\n * This instruction allows the actual error message to be optimized away when ngDevMode is turned\n * off, saving bytes of generated code while still providing a good experience in dev mode.\n *\n * The name of the class is not mentioned here, but will be in the generated factory function name\n * and thus in the stack trace.\n *\n * @codeGenApi\n */\nfunction ɵɵinvalidFactory() {\n const msg = ngDevMode ? `This constructor was not compatible with Dependency Injection.` : 'invalid';\n throw new Error(msg);\n}\nfunction writeToDirectiveInput(def, instance, publicName, privateName, flags, value) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n // If we know we are dealing with a signal input, we cache its reference\n // in a tree-shakable way. The input signal node can then be used for\n // value transform execution or actual value updates without introducing\n // additional megamorphic accesses for accessing the instance field.\n let inputSignalNode = null;\n if ((flags & InputFlags.SignalBased) !== 0) {\n const field = instance[privateName];\n inputSignalNode = field[SIGNAL$1];\n }\n // If there is a signal node and a transform, run it before potentially\n // delegating to features like `NgOnChanges`.\n if (inputSignalNode !== null && inputSignalNode.transformFn !== undefined) {\n value = inputSignalNode.transformFn(value);\n }\n // If there is a decorator input transform, run it.\n if ((flags & InputFlags.HasDecoratorInputTransform) !== 0) {\n value = def.inputTransforms[privateName].call(instance, value);\n }\n if (def.setInput !== null) {\n def.setInput(instance, inputSignalNode, value, publicName, privateName);\n } else {\n applyValueToInputField(instance, inputSignalNode, privateName, value);\n }\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n}\n\n/**\n * Invoke `HostBindingsFunction`s for view.\n *\n * This methods executes `TView.hostBindingOpCodes`. It is used to execute the\n * `HostBindingsFunction`s associated with the current `LView`.\n *\n * @param tView Current `TView`.\n * @param lView Current `LView`.\n */\nfunction processHostBindingOpCodes(tView, lView) {\n const hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null) return;\n try {\n for (let i = 0; i < hostBindingOpCodes.length; i++) {\n const opCode = hostBindingOpCodes[i];\n if (opCode < 0) {\n // Negative numbers are element indexes.\n setSelectedIndex(~opCode);\n } else {\n // Positive numbers are NumberTuple which store bindingRootIndex and directiveIndex.\n const directiveIdx = opCode;\n const bindingRootIndx = hostBindingOpCodes[++i];\n const hostBindingFn = hostBindingOpCodes[++i];\n setBindingRootForHostBindings(bindingRootIndx, directiveIdx);\n const context = lView[directiveIdx];\n hostBindingFn(2 /* RenderFlags.Update */, context);\n }\n }\n } finally {\n setSelectedIndex(-1);\n }\n}\nfunction createLView(parentLView, tView, context, flags, host, tHostNode, environment, renderer, injector, embeddedViewInjector, hydrationInfo) {\n const lView = tView.blueprint.slice();\n lView[HOST] = host;\n lView[FLAGS] = flags | 4 /* LViewFlags.CreationMode */ | 128 /* LViewFlags.Attached */ | 8 /* LViewFlags.FirstLViewPass */ | 64 /* LViewFlags.Dirty */;\n if (embeddedViewInjector !== null || parentLView && parentLView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */) {\n lView[FLAGS] |= 2048 /* LViewFlags.HasEmbeddedViewInjector */;\n }\n resetPreOrderHookFlags(lView);\n ngDevMode && tView.declTNode && parentLView && assertTNodeForLView(tView.declTNode, parentLView);\n lView[PARENT] = lView[DECLARATION_VIEW] = parentLView;\n lView[CONTEXT] = context;\n lView[ENVIRONMENT] = environment || parentLView && parentLView[ENVIRONMENT];\n ngDevMode && assertDefined(lView[ENVIRONMENT], 'LViewEnvironment is required');\n lView[RENDERER] = renderer || parentLView && parentLView[RENDERER];\n ngDevMode && assertDefined(lView[RENDERER], 'Renderer is required');\n lView[INJECTOR] = injector || parentLView && parentLView[INJECTOR] || null;\n lView[T_HOST] = tHostNode;\n lView[ID] = getUniqueLViewId();\n lView[HYDRATION] = hydrationInfo;\n lView[EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector;\n ngDevMode && assertEqual(tView.type == 2 /* TViewType.Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');\n lView[DECLARATION_COMPONENT_VIEW] = tView.type == 2 /* TViewType.Embedded */ ? parentLView[DECLARATION_COMPONENT_VIEW] : lView;\n return lView;\n}\nfunction getOrCreateTNode(tView, index, type, name, attrs) {\n ngDevMode && index !== 0 &&\n // 0 are bogus nodes and they are OK. See `createContainerRef` in\n // `view_engine_compatibility` for additional context.\n assertGreaterThanOrEqual(index, HEADER_OFFSET, \"TNodes can't be in the LView header.\");\n // Keep this function short, so that the VM will inline it.\n ngDevMode && assertPureTNodeType(type);\n let tNode = tView.data[index];\n if (tNode === null) {\n tNode = createTNodeAtIndex(tView, index, type, name, attrs);\n if (isInI18nBlock()) {\n // If we are in i18n block then all elements should be pre declared through `Placeholder`\n // See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n // If the `TNode` was not pre-declared than it means it was not mentioned which means it was\n // removed, so we mark it as detached.\n tNode.flags |= 32 /* TNodeFlags.isDetached */;\n }\n } else if (tNode.type & 64 /* TNodeType.Placeholder */) {\n tNode.type = type;\n tNode.value = name;\n tNode.attrs = attrs;\n const parent = getCurrentParentTNode();\n tNode.injectorIndex = parent === null ? -1 : parent.injectorIndex;\n ngDevMode && assertTNodeForTView(tNode, tView);\n ngDevMode && assertEqual(index, tNode.index, 'Expecting same index');\n }\n setCurrentTNode(tNode, true);\n return tNode;\n}\nfunction createTNodeAtIndex(tView, index, type, name, attrs) {\n const currentTNode = getCurrentTNodePlaceholderOk();\n const isParent = isCurrentTNodeParent();\n const parent = isParent ? currentTNode : currentTNode && currentTNode.parent;\n // Parents cannot cross component boundaries because components will be used in multiple places.\n const tNode = tView.data[index] = createTNode(tView, parent, type, index, name, attrs);\n // Assign a pointer to the first child node of a given view. The first node is not always the one\n // at index 0, in case of i18n, index 0 can be the instruction `i18nStart` and the first node has\n // the index 1 or more, so we can't just check node index.\n if (tView.firstChild === null) {\n tView.firstChild = tNode;\n }\n if (currentTNode !== null) {\n if (isParent) {\n // FIXME(misko): This logic looks unnecessarily complicated. Could we simplify?\n if (currentTNode.child == null && tNode.parent !== null) {\n // We are in the same view, which means we are adding content node to the parent view.\n currentTNode.child = tNode;\n }\n } else {\n if (currentTNode.next === null) {\n // In the case of i18n the `currentTNode` may already be linked, in which case we don't want\n // to break the links which i18n created.\n currentTNode.next = tNode;\n tNode.prev = currentTNode;\n }\n }\n }\n return tNode;\n}\n/**\n * When elements are created dynamically after a view blueprint is created (e.g. through\n * i18nApply()), we need to adjust the blueprint for future\n * template passes.\n *\n * @param tView `TView` associated with `LView`\n * @param lView The `LView` containing the blueprint to adjust\n * @param numSlotsToAlloc The number of slots to alloc in the LView, should be >0\n * @param initialValue Initial value to store in blueprint\n */\nfunction allocExpando(tView, lView, numSlotsToAlloc, initialValue) {\n if (numSlotsToAlloc === 0) return -1;\n if (ngDevMode) {\n assertFirstCreatePass(tView);\n assertSame(tView, lView[TVIEW], '`LView` must be associated with `TView`!');\n assertEqual(tView.data.length, lView.length, 'Expecting LView to be same size as TView');\n assertEqual(tView.data.length, tView.blueprint.length, 'Expecting Blueprint to be same size as TView');\n assertFirstUpdatePass(tView);\n }\n const allocIdx = lView.length;\n for (let i = 0; i < numSlotsToAlloc; i++) {\n lView.push(initialValue);\n tView.blueprint.push(initialValue);\n tView.data.push(null);\n }\n return allocIdx;\n}\nfunction executeTemplate(tView, lView, templateFn, rf, context) {\n const prevSelectedIndex = getSelectedIndex();\n const isUpdatePhase = rf & 2 /* RenderFlags.Update */;\n try {\n setSelectedIndex(-1);\n if (isUpdatePhase && lView.length > HEADER_OFFSET) {\n // When we're updating, inherently select 0 so we don't\n // have to generate that instruction for most update blocks.\n selectIndexInternal(tView, lView, HEADER_OFFSET, !!ngDevMode && isInCheckNoChangesMode());\n }\n const preHookType = isUpdatePhase ? 2 /* ProfilerEvent.TemplateUpdateStart */ : 0 /* ProfilerEvent.TemplateCreateStart */;\n profiler(preHookType, context);\n templateFn(rf, context);\n } finally {\n setSelectedIndex(prevSelectedIndex);\n const postHookType = isUpdatePhase ? 3 /* ProfilerEvent.TemplateUpdateEnd */ : 1 /* ProfilerEvent.TemplateCreateEnd */;\n profiler(postHookType, context);\n }\n}\n//////////////////////////\n//// Element\n//////////////////////////\nfunction executeContentQueries(tView, tNode, lView) {\n if (isContentQueryHost(tNode)) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {\n const def = tView.data[directiveIndex];\n if (def.contentQueries) {\n const directiveInstance = lView[directiveIndex];\n ngDevMode && assertDefined(directiveIndex, 'Incorrect reference to a directive defining a content query');\n def.contentQueries(1 /* RenderFlags.Create */, directiveInstance, directiveIndex);\n }\n }\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n}\n/**\n * Creates directive instances.\n */\nfunction createDirectivesInstances(tView, lView, tNode) {\n if (!getBindingsEnabled()) return;\n instantiateAllDirectives(tView, lView, tNode, getNativeByTNode(tNode, lView));\n if ((tNode.flags & 64 /* TNodeFlags.hasHostBindings */) === 64 /* TNodeFlags.hasHostBindings */) {\n invokeDirectivesHostBindings(tView, lView, tNode);\n }\n}\n/**\n * Takes a list of local names and indices and pushes the resolved local variable values\n * to LView in the same order as they are loaded in the template with load().\n */\nfunction saveResolvedLocalsInData(viewData, tNode, localRefExtractor = getNativeByTNode) {\n const localNames = tNode.localNames;\n if (localNames !== null) {\n let localIndex = tNode.index + 1;\n for (let i = 0; i < localNames.length; i += 2) {\n const index = localNames[i + 1];\n const value = index === -1 ? localRefExtractor(tNode, viewData) : viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}\n/**\n * Gets TView from a template function or creates a new TView\n * if it doesn't already exist.\n *\n * @param def ComponentDef\n * @returns TView\n */\nfunction getOrCreateComponentTView(def) {\n const tView = def.tView;\n // Create a TView if there isn't one, or recreate it if the first create pass didn't\n // complete successfully since we can't know for sure whether it's in a usable shape.\n if (tView === null || tView.incompleteFirstPass) {\n // Declaration node here is null since this function is called when we dynamically create a\n // component and hence there is no declaration.\n const declTNode = null;\n return def.tView = createTView(1 /* TViewType.Component */, declTNode, def.template, def.decls, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery, def.schemas, def.consts, def.id);\n }\n return tView;\n}\n/**\n * Creates a TView instance\n *\n * @param type Type of `TView`.\n * @param declTNode Declaration location of this `TView`.\n * @param templateFn Template function\n * @param decls The number of nodes, local refs, and pipes in this template\n * @param directives Registry of directives for this view\n * @param pipes Registry of pipes for this view\n * @param viewQuery View queries for this view\n * @param schemas Schemas for this view\n * @param consts Constants for this view\n */\nfunction createTView(type, declTNode, templateFn, decls, vars, directives, pipes, viewQuery, schemas, constsOrFactory, ssrId) {\n ngDevMode && ngDevMode.tView++;\n const bindingStartIndex = HEADER_OFFSET + decls;\n // This length does not yet contain host bindings from child directives because at this point,\n // we don't know which directives are active on this template. As soon as a directive is matched\n // that has a host binding, we will update the blueprint with that def's hostVars count.\n const initialViewLength = bindingStartIndex + vars;\n const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);\n const consts = typeof constsOrFactory === 'function' ? constsOrFactory() : constsOrFactory;\n const tView = blueprint[TVIEW] = {\n type: type,\n blueprint: blueprint,\n template: templateFn,\n queries: null,\n viewQuery: viewQuery,\n declTNode: declTNode,\n data: blueprint.slice().fill(null, bindingStartIndex),\n bindingStartIndex: bindingStartIndex,\n expandoStartIndex: initialViewLength,\n hostBindingOpCodes: null,\n firstCreatePass: true,\n firstUpdatePass: true,\n staticViewQueries: false,\n staticContentQueries: false,\n preOrderHooks: null,\n preOrderCheckHooks: null,\n contentHooks: null,\n contentCheckHooks: null,\n viewHooks: null,\n viewCheckHooks: null,\n destroyHooks: null,\n cleanup: null,\n contentQueries: null,\n components: null,\n directiveRegistry: typeof directives === 'function' ? directives() : directives,\n pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,\n firstChild: null,\n schemas: schemas,\n consts: consts,\n incompleteFirstPass: false,\n ssrId\n };\n if (ngDevMode) {\n // For performance reasons it is important that the tView retains the same shape during runtime.\n // (To make sure that all of the code is monomorphic.) For this reason we seal the object to\n // prevent class transitions.\n Object.seal(tView);\n }\n return tView;\n}\nfunction createViewBlueprint(bindingStartIndex, initialViewLength) {\n const blueprint = [];\n for (let i = 0; i < initialViewLength; i++) {\n blueprint.push(i < bindingStartIndex ? null : NO_CHANGE);\n }\n return blueprint;\n}\n/**\n * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.\n *\n * @param renderer the renderer used to locate the element.\n * @param elementOrSelector Render element or CSS selector to locate the element.\n * @param encapsulation View Encapsulation defined for component that requests host element.\n * @param injector Root view injector instance.\n */\nfunction locateHostElement(renderer, elementOrSelector, encapsulation, injector) {\n // Note: we use default value for the `PRESERVE_HOST_CONTENT` here even though it's a\n // tree-shakable one (providedIn:'root'). This code path can be triggered during dynamic\n // component creation (after calling ViewContainerRef.createComponent) when an injector\n // instance can be provided. The injector instance might be disconnected from the main DI\n // tree, thus the `PRESERVE_HOST_CONTENT` would not be able to instantiate. In this case, the\n // default value will be used.\n const preserveHostContent = injector.get(PRESERVE_HOST_CONTENT, PRESERVE_HOST_CONTENT_DEFAULT);\n // When using native Shadow DOM, do not clear host element to allow native slot\n // projection.\n const preserveContent = preserveHostContent || encapsulation === ViewEncapsulation$1.ShadowDom;\n const rootElement = renderer.selectRootElement(elementOrSelector, preserveContent);\n applyRootElementTransform(rootElement);\n return rootElement;\n}\n/**\n * Applies any root element transformations that are needed. If hydration is enabled,\n * this will process corrupted text nodes.\n *\n * @param rootElement the app root HTML Element\n */\nfunction applyRootElementTransform(rootElement) {\n _applyRootElementTransformImpl(rootElement);\n}\n/**\n * Reference to a function that applies transformations to the root HTML element\n * of an app. When hydration is enabled, this processes any corrupt text nodes\n * so they are properly hydratable on the client.\n *\n * @param rootElement the app root HTML Element\n */\nlet _applyRootElementTransformImpl = () => null;\n/**\n * Processes text node markers before hydration begins. This replaces any special comment\n * nodes that were added prior to serialization are swapped out to restore proper text\n * nodes before hydration.\n *\n * @param rootElement the app root HTML Element\n */\nfunction applyRootElementTransformImpl(rootElement) {\n if (hasSkipHydrationAttrOnRElement(rootElement)) {\n // Handle a situation when the `ngSkipHydration` attribute is applied\n // to the root node of an application. In this case, we should clear\n // the contents and render everything from scratch.\n clearElementContents(rootElement);\n } else {\n processTextNodeMarkersBeforeHydration(rootElement);\n }\n}\n/**\n * Sets the implementation for the `applyRootElementTransform` function.\n */\nfunction enableApplyRootElementTransformImpl() {\n _applyRootElementTransformImpl = applyRootElementTransformImpl;\n}\n/**\n * Saves context for this cleanup function in LView.cleanupInstances.\n *\n * On the first template pass, saves in TView:\n * - Cleanup function\n * - Index of context we just saved in LView.cleanupInstances\n */\nfunction storeCleanupWithContext(tView, lView, context, cleanupFn) {\n const lCleanup = getOrCreateLViewCleanup(lView);\n // Historically the `storeCleanupWithContext` was used to register both framework-level and\n // user-defined cleanup callbacks, but over time those two types of cleanups were separated.\n // This dev mode checks assures that user-level cleanup callbacks are _not_ stored in data\n // structures reserved for framework-specific hooks.\n ngDevMode && assertDefined(context, 'Cleanup context is mandatory when registering framework-level destroy hooks');\n lCleanup.push(context);\n if (tView.firstCreatePass) {\n getOrCreateTViewCleanup(tView).push(cleanupFn, lCleanup.length - 1);\n } else {\n // Make sure that no new framework-level cleanup functions are registered after the first\n // template pass is done (and TView data structures are meant to fully constructed).\n if (ngDevMode) {\n Object.freeze(getOrCreateTViewCleanup(tView));\n }\n }\n}\nfunction createTNode(tView, tParent, type, index, value, attrs) {\n ngDevMode && index !== 0 &&\n // 0 are bogus nodes and they are OK. See `createContainerRef` in\n // `view_engine_compatibility` for additional context.\n assertGreaterThanOrEqual(index, HEADER_OFFSET, \"TNodes can't be in the LView header.\");\n ngDevMode && assertNotSame(attrs, undefined, \"'undefined' is not valid value for 'attrs'\");\n ngDevMode && ngDevMode.tNode++;\n ngDevMode && tParent && assertTNodeForTView(tParent, tView);\n let injectorIndex = tParent ? tParent.injectorIndex : -1;\n let flags = 0;\n if (isInSkipHydrationBlock$1()) {\n flags |= 128 /* TNodeFlags.inSkipHydrationBlock */;\n }\n const tNode = {\n type,\n index,\n insertBeforeIndex: null,\n injectorIndex,\n directiveStart: -1,\n directiveEnd: -1,\n directiveStylingLast: -1,\n componentOffset: -1,\n propertyBindings: null,\n flags,\n providerIndexes: 0,\n value: value,\n attrs: attrs,\n mergedAttrs: null,\n localNames: null,\n initialInputs: undefined,\n inputs: null,\n outputs: null,\n tView: null,\n next: null,\n prev: null,\n projectionNext: null,\n child: null,\n parent: tParent,\n projection: null,\n styles: null,\n stylesWithoutHost: null,\n residualStyles: undefined,\n classes: null,\n classesWithoutHost: null,\n residualClasses: undefined,\n classBindings: 0,\n styleBindings: 0\n };\n if (ngDevMode) {\n // For performance reasons it is important that the tNode retains the same shape during runtime.\n // (To make sure that all of the code is monomorphic.) For this reason we seal the object to\n // prevent class transitions.\n Object.seal(tNode);\n }\n return tNode;\n}\nfunction captureNodeBindings(mode, aliasMap, directiveIndex, bindingsResult, hostDirectiveAliasMap) {\n for (let publicName in aliasMap) {\n if (!aliasMap.hasOwnProperty(publicName)) {\n continue;\n }\n const value = aliasMap[publicName];\n if (value === undefined) {\n continue;\n }\n bindingsResult ??= {};\n let internalName;\n let inputFlags = InputFlags.None;\n // For inputs, the value might be an array capturing additional\n // input flags.\n if (Array.isArray(value)) {\n internalName = value[0];\n inputFlags = value[1];\n } else {\n internalName = value;\n }\n // If there are no host directive mappings, we want to remap using the alias map from the\n // definition itself. If there is an alias map, it has two functions:\n // 1. It serves as an allowlist of bindings that are exposed by the host directives. Only the\n // ones inside the host directive map will be exposed on the host.\n // 2. The public name of the property is aliased using the host directive alias map, rather\n // than the alias map from the definition.\n let finalPublicName = publicName;\n if (hostDirectiveAliasMap !== null) {\n // If there is no mapping, it's not part of the allowlist and this input/output\n // is not captured and should be ignored.\n if (!hostDirectiveAliasMap.hasOwnProperty(publicName)) {\n continue;\n }\n finalPublicName = hostDirectiveAliasMap[publicName];\n }\n if (mode === 0 /* CaptureNodeBindingMode.Inputs */) {\n addPropertyBinding(bindingsResult, directiveIndex, finalPublicName, internalName, inputFlags);\n } else {\n addPropertyBinding(bindingsResult, directiveIndex, finalPublicName, internalName);\n }\n }\n return bindingsResult;\n}\nfunction addPropertyBinding(bindings, directiveIndex, publicName, internalName, inputFlags) {\n let values;\n if (bindings.hasOwnProperty(publicName)) {\n (values = bindings[publicName]).push(directiveIndex, internalName);\n } else {\n values = bindings[publicName] = [directiveIndex, internalName];\n }\n if (inputFlags !== undefined) {\n values.push(inputFlags);\n }\n}\n/**\n * Initializes data structures required to work with directive inputs and outputs.\n * Initialization is done for all directives matched on a given TNode.\n */\nfunction initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefinitionMap) {\n ngDevMode && assertFirstCreatePass(tView);\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n const tViewData = tView.data;\n const tNodeAttrs = tNode.attrs;\n const inputsFromAttrs = [];\n let inputsStore = null;\n let outputsStore = null;\n for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {\n const directiveDef = tViewData[directiveIndex];\n const aliasData = hostDirectiveDefinitionMap ? hostDirectiveDefinitionMap.get(directiveDef) : null;\n const aliasedInputs = aliasData ? aliasData.inputs : null;\n const aliasedOutputs = aliasData ? aliasData.outputs : null;\n inputsStore = captureNodeBindings(0 /* CaptureNodeBindingMode.Inputs */, directiveDef.inputs, directiveIndex, inputsStore, aliasedInputs);\n outputsStore = captureNodeBindings(1 /* CaptureNodeBindingMode.Outputs */, directiveDef.outputs, directiveIndex, outputsStore, aliasedOutputs);\n // Do not use unbound attributes as inputs to structural directives, since structural\n // directive inputs can only be set using microsyntax (e.g. `<div *dir=\"exp\">`).\n // TODO(FW-1930): microsyntax expressions may also contain unbound/static attributes, which\n // should be set for inline templates.\n const initialInputs = inputsStore !== null && tNodeAttrs !== null && !isInlineTemplate(tNode) ? generateInitialInputs(inputsStore, directiveIndex, tNodeAttrs) : null;\n inputsFromAttrs.push(initialInputs);\n }\n if (inputsStore !== null) {\n if (inputsStore.hasOwnProperty('class')) {\n tNode.flags |= 8 /* TNodeFlags.hasClassInput */;\n }\n if (inputsStore.hasOwnProperty('style')) {\n tNode.flags |= 16 /* TNodeFlags.hasStyleInput */;\n }\n }\n tNode.initialInputs = inputsFromAttrs;\n tNode.inputs = inputsStore;\n tNode.outputs = outputsStore;\n}\n/**\n * Mapping between attributes names that don't correspond to their element property names.\n *\n * Performance note: this function is written as a series of if checks (instead of, say, a property\n * object lookup) for performance reasons - the series of `if` checks seems to be the fastest way of\n * mapping property names. Do NOT change without benchmarking.\n *\n * Note: this mapping has to be kept in sync with the equally named mapping in the template\n * type-checking machinery of ngtsc.\n */\nfunction mapPropName(name) {\n if (name === 'class') return 'className';\n if (name === 'for') return 'htmlFor';\n if (name === 'formaction') return 'formAction';\n if (name === 'innerHtml') return 'innerHTML';\n if (name === 'readonly') return 'readOnly';\n if (name === 'tabindex') return 'tabIndex';\n return name;\n}\nfunction elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, nativeOnly) {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n const element = getNativeByTNode(tNode, lView);\n let inputData = tNode.inputs;\n let dataValue;\n if (!nativeOnly && inputData != null && (dataValue = inputData[propName])) {\n setInputsForProperty(tView, lView, dataValue, propName, value);\n if (isComponentHost(tNode)) markDirtyIfOnPush(lView, tNode.index);\n if (ngDevMode) {\n setNgReflectProperties(lView, element, tNode.type, dataValue, value);\n }\n } else if (tNode.type & 3 /* TNodeType.AnyRNode */) {\n propName = mapPropName(propName);\n if (ngDevMode) {\n validateAgainstEventProperties(propName);\n if (!isPropertyValid(element, propName, tNode.value, tView.schemas)) {\n handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);\n }\n ngDevMode.rendererSetProperty++;\n }\n // It is assumed that the sanitizer is only added when the compiler determines that the\n // property is risky, so sanitization can be done without further checks.\n value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value;\n renderer.setProperty(element, propName, value);\n } else if (tNode.type & 12 /* TNodeType.AnyContainer */) {\n // If the node is a container and the property didn't\n // match any of the inputs or schemas we should throw.\n if (ngDevMode && !matchingSchemas(tView.schemas, tNode.value)) {\n handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);\n }\n }\n}\n/** If node is an OnPush component, marks its LView dirty. */\nfunction markDirtyIfOnPush(lView, viewIndex) {\n ngDevMode && assertLView(lView);\n const childComponentLView = getComponentLViewByIndex(viewIndex, lView);\n if (!(childComponentLView[FLAGS] & 16 /* LViewFlags.CheckAlways */)) {\n childComponentLView[FLAGS] |= 64 /* LViewFlags.Dirty */;\n }\n}\nfunction setNgReflectProperty(lView, element, type, attrName, value) {\n const renderer = lView[RENDERER];\n attrName = normalizeDebugBindingName(attrName);\n const debugValue = normalizeDebugBindingValue(value);\n if (type & 3 /* TNodeType.AnyRNode */) {\n if (value == null) {\n renderer.removeAttribute(element, attrName);\n } else {\n renderer.setAttribute(element, attrName, debugValue);\n }\n } else {\n const textContent = escapeCommentText(`bindings=${JSON.stringify({\n [attrName]: debugValue\n }, null, 2)}`);\n renderer.setValue(element, textContent);\n }\n}\nfunction setNgReflectProperties(lView, element, type, dataValue, value) {\n if (type & (3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */)) {\n /**\n * dataValue is an array containing runtime input or output names for the directives:\n * i+0: directive instance index\n * i+1: privateName\n *\n * e.g. [0, 'change', 'change-minified']\n * we want to set the reflected property with the privateName: dataValue[i+1]\n */\n for (let i = 0; i < dataValue.length; i += 3) {\n setNgReflectProperty(lView, element, type, dataValue[i + 1], value);\n }\n }\n}\n/**\n * Resolve the matched directives on a node.\n */\nfunction resolveDirectives(tView, lView, tNode, localRefs) {\n // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in\n // tsickle.\n ngDevMode && assertFirstCreatePass(tView);\n if (getBindingsEnabled()) {\n const exportsMap = localRefs === null ? null : {\n '': -1\n };\n const matchResult = findDirectiveDefMatches(tView, tNode);\n let directiveDefs;\n let hostDirectiveDefs;\n if (matchResult === null) {\n directiveDefs = hostDirectiveDefs = null;\n } else {\n [directiveDefs, hostDirectiveDefs] = matchResult;\n }\n if (directiveDefs !== null) {\n initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs);\n }\n if (exportsMap) cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n }\n // Merge the template attrs last so that they have the highest priority.\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);\n}\n/** Initializes the data structures necessary for a list of directives to be instantiated. */\nfunction initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs) {\n ngDevMode && assertFirstCreatePass(tView);\n // Publishes the directive types to DI so they can be injected. Needs to\n // happen in a separate pass before the TNode flags have been initialized.\n for (let i = 0; i < directives.length; i++) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, directives[i].type);\n }\n initTNodeFlags(tNode, tView.data.length, directives.length);\n // When the same token is provided by several directives on the same node, some rules apply in\n // the viewEngine:\n // - viewProviders have priority over providers\n // - the last directive in NgModule.declarations has priority over the previous one\n // So to match these rules, the order in which providers are added in the arrays is very\n // important.\n for (let i = 0; i < directives.length; i++) {\n const def = directives[i];\n if (def.providersResolver) def.providersResolver(def);\n }\n let preOrderHooksFound = false;\n let preOrderCheckHooksFound = false;\n let directiveIdx = allocExpando(tView, lView, directives.length, null);\n ngDevMode && assertSame(directiveIdx, tNode.directiveStart, 'TNode.directiveStart should point to just allocated space');\n for (let i = 0; i < directives.length; i++) {\n const def = directives[i];\n // Merge the attrs in the order of matches. This assumes that the first directive is the\n // component itself, so that the component has the least priority.\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);\n configureViewWithDirective(tView, tNode, lView, directiveIdx, def);\n saveNameToExportMap(directiveIdx, def, exportsMap);\n if (def.contentQueries !== null) tNode.flags |= 4 /* TNodeFlags.hasContentQuery */;\n if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0) tNode.flags |= 64 /* TNodeFlags.hasHostBindings */;\n const lifeCycleHooks = def.type.prototype;\n // Only push a node index into the preOrderHooks array if this is the first\n // pre-order hook found on this node.\n if (!preOrderHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) {\n // We will push the actual hook function into this array later during dir instantiation.\n // We cannot do it now because we must ensure hooks are registered in the same\n // order that directives are created (i.e. injection order).\n (tView.preOrderHooks ??= []).push(tNode.index);\n preOrderHooksFound = true;\n }\n if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {\n (tView.preOrderCheckHooks ??= []).push(tNode.index);\n preOrderCheckHooksFound = true;\n }\n directiveIdx++;\n }\n initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs);\n}\n/**\n * Add `hostBindings` to the `TView.hostBindingOpCodes`.\n *\n * @param tView `TView` to which the `hostBindings` should be added.\n * @param tNode `TNode` the element which contains the directive\n * @param directiveIdx Directive index in view.\n * @param directiveVarsIdx Where will the directive's vars be stored\n * @param def `ComponentDef`/`DirectiveDef`, which contains the `hostVars`/`hostBindings` to add.\n */\nfunction registerHostBindingOpCodes(tView, tNode, directiveIdx, directiveVarsIdx, def) {\n ngDevMode && assertFirstCreatePass(tView);\n const hostBindings = def.hostBindings;\n if (hostBindings) {\n let hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null) {\n hostBindingOpCodes = tView.hostBindingOpCodes = [];\n }\n const elementIndx = ~tNode.index;\n if (lastSelectedElementIdx(hostBindingOpCodes) != elementIndx) {\n // Conditionally add select element so that we are more efficient in execution.\n // NOTE: this is strictly not necessary and it trades code size for runtime perf.\n // (We could just always add it.)\n hostBindingOpCodes.push(elementIndx);\n }\n hostBindingOpCodes.push(directiveIdx, directiveVarsIdx, hostBindings);\n }\n}\n/**\n * Returns the last selected element index in the `HostBindingOpCodes`\n *\n * For perf reasons we don't need to update the selected element index in `HostBindingOpCodes` only\n * if it changes. This method returns the last index (or '0' if not found.)\n *\n * Selected element index are only the ones which are negative.\n */\nfunction lastSelectedElementIdx(hostBindingOpCodes) {\n let i = hostBindingOpCodes.length;\n while (i > 0) {\n const value = hostBindingOpCodes[--i];\n if (typeof value === 'number' && value < 0) {\n return value;\n }\n }\n return 0;\n}\n/**\n * Instantiate all the directives that were previously resolved on the current node.\n */\nfunction instantiateAllDirectives(tView, lView, tNode, native) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n // The component view needs to be created before creating the node injector\n // since it is used to inject some special symbols like `ChangeDetectorRef`.\n if (isComponentHost(tNode)) {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);\n addComponentLogic(lView, tNode, tView.data[start + tNode.componentOffset]);\n }\n if (!tView.firstCreatePass) {\n getOrCreateNodeInjectorForNode(tNode, lView);\n }\n attachPatchData(native, lView);\n const initialInputs = tNode.initialInputs;\n for (let i = start; i < end; i++) {\n const def = tView.data[i];\n const directive = getNodeInjectable(lView, tView, i, tNode);\n attachPatchData(directive, lView);\n if (initialInputs !== null) {\n setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs);\n }\n if (isComponentDef(def)) {\n const componentView = getComponentLViewByIndex(tNode.index, lView);\n componentView[CONTEXT] = getNodeInjectable(lView, tView, i, tNode);\n }\n }\n}\nfunction invokeDirectivesHostBindings(tView, lView, tNode) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n const elementIndex = tNode.index;\n const currentDirectiveIndex = getCurrentDirectiveIndex();\n try {\n setSelectedIndex(elementIndex);\n for (let dirIndex = start; dirIndex < end; dirIndex++) {\n const def = tView.data[dirIndex];\n const directive = lView[dirIndex];\n setCurrentDirectiveIndex(dirIndex);\n if (def.hostBindings !== null || def.hostVars !== 0 || def.hostAttrs !== null) {\n invokeHostBindingsInCreationMode(def, directive);\n }\n }\n } finally {\n setSelectedIndex(-1);\n setCurrentDirectiveIndex(currentDirectiveIndex);\n }\n}\n/**\n * Invoke the host bindings in creation mode.\n *\n * @param def `DirectiveDef` which may contain the `hostBindings` function.\n * @param directive Instance of directive.\n */\nfunction invokeHostBindingsInCreationMode(def, directive) {\n if (def.hostBindings !== null) {\n def.hostBindings(1 /* RenderFlags.Create */, directive);\n }\n}\n/**\n * Matches the current node against all available selectors.\n * If a component is matched (at most one), it is returned in first position in the array.\n */\nfunction findDirectiveDefMatches(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);\n const registry = tView.directiveRegistry;\n let matches = null;\n let hostDirectiveDefs = null;\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */false)) {\n matches || (matches = []);\n if (isComponentDef(def)) {\n if (ngDevMode) {\n assertTNodeType(tNode, 2 /* TNodeType.Element */, `\"${tNode.value}\" tags cannot be used as component hosts. ` + `Please use a different tag to activate the ${stringify(def.type)} component.`);\n if (isComponentHost(tNode)) {\n throwMultipleComponentError(tNode, matches.find(isComponentDef).type, def.type);\n }\n }\n // Components are inserted at the front of the matches array so that their lifecycle\n // hooks run before any directive lifecycle hooks. This appears to be for ViewEngine\n // compatibility. This logic doesn't make sense with host directives, because it\n // would allow the host directives to undo any overrides the host may have made.\n // To handle this case, the host directives of components are inserted at the beginning\n // of the array, followed by the component. As such, the insertion order is as follows:\n // 1. Host directives belonging to the selector-matched component.\n // 2. Selector-matched component.\n // 3. Host directives belonging to selector-matched directives.\n // 4. Selector-matched directives.\n if (def.findHostDirectiveDefs !== null) {\n const hostDirectiveMatches = [];\n hostDirectiveDefs = hostDirectiveDefs || new Map();\n def.findHostDirectiveDefs(def, hostDirectiveMatches, hostDirectiveDefs);\n // Add all host directives declared on this component, followed by the component itself.\n // Host directives should execute first so the host has a chance to override changes\n // to the DOM made by them.\n matches.unshift(...hostDirectiveMatches, def);\n // Component is offset starting from the beginning of the host directives array.\n const componentOffset = hostDirectiveMatches.length;\n markAsComponentHost(tView, tNode, componentOffset);\n } else {\n // No host directives on this component, just add the\n // component def to the beginning of the matches.\n matches.unshift(def);\n markAsComponentHost(tView, tNode, 0);\n }\n } else {\n // Append any host directives to the matches first.\n hostDirectiveDefs = hostDirectiveDefs || new Map();\n def.findHostDirectiveDefs?.(def, matches, hostDirectiveDefs);\n matches.push(def);\n }\n }\n }\n }\n ngDevMode && matches !== null && assertNoDuplicateDirectives(matches);\n return matches === null ? null : [matches, hostDirectiveDefs];\n}\n/**\n * Marks a given TNode as a component's host. This consists of:\n * - setting the component offset on the TNode.\n * - storing index of component's host element so it will be queued for view refresh during CD.\n */\nfunction markAsComponentHost(tView, hostTNode, componentOffset) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertGreaterThan(componentOffset, -1, 'componentOffset must be great than -1');\n hostTNode.componentOffset = componentOffset;\n (tView.components ??= []).push(hostTNode.index);\n}\n/** Caches local names and their matching directive indices for query and template lookups. */\nfunction cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n const localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (let i = 0; i < localRefs.length; i += 2) {\n const index = exportsMap[localRefs[i + 1]];\n if (index == null) throw new RuntimeError(-301 /* RuntimeErrorCode.EXPORT_NOT_FOUND */, ngDevMode && `Export of name '${localRefs[i + 1]}' not found!`);\n localNames.push(localRefs[i], index);\n }\n }\n}\n/**\n * Builds up an export map as directives are created, so local refs can be quickly mapped\n * to their directive instances.\n */\nfunction saveNameToExportMap(directiveIdx, def, exportsMap) {\n if (exportsMap) {\n if (def.exportAs) {\n for (let i = 0; i < def.exportAs.length; i++) {\n exportsMap[def.exportAs[i]] = directiveIdx;\n }\n }\n if (isComponentDef(def)) exportsMap[''] = directiveIdx;\n }\n}\n/**\n * Initializes the flags on the current node, setting all indices to the initial index,\n * the directive count to 0, and adding the isComponent flag.\n * @param index the initial index\n */\nfunction initTNodeFlags(tNode, index, numberOfDirectives) {\n ngDevMode && assertNotEqual(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, 'Reached the max number of directives');\n tNode.flags |= 1 /* TNodeFlags.isDirectiveHost */;\n // When the first directive is created on a node, save the index\n tNode.directiveStart = index;\n tNode.directiveEnd = index + numberOfDirectives;\n tNode.providerIndexes = index;\n}\n/**\n * Setup directive for instantiation.\n *\n * We need to create a `NodeInjectorFactory` which is then inserted in both the `Blueprint` as well\n * as `LView`. `TView` gets the `DirectiveDef`.\n *\n * @param tView `TView`\n * @param tNode `TNode`\n * @param lView `LView`\n * @param directiveIndex Index where the directive will be stored in the Expando.\n * @param def `DirectiveDef`\n */\nfunction configureViewWithDirective(tView, tNode, lView, directiveIndex, def) {\n ngDevMode && assertGreaterThanOrEqual(directiveIndex, HEADER_OFFSET, 'Must be in Expando section');\n tView.data[directiveIndex] = def;\n const directiveFactory = def.factory || (def.factory = getFactoryDef(def.type, true));\n // Even though `directiveFactory` will already be using `ɵɵdirectiveInject` in its generated code,\n // we also want to support `inject()` directly from the directive constructor context so we set\n // `ɵɵdirectiveInject` as the inject implementation here too.\n const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), ɵɵdirectiveInject);\n tView.blueprint[directiveIndex] = nodeInjectorFactory;\n lView[directiveIndex] = nodeInjectorFactory;\n registerHostBindingOpCodes(tView, tNode, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def);\n}\nfunction addComponentLogic(lView, hostTNode, def) {\n const native = getNativeByTNode(hostTNode, lView);\n const tView = getOrCreateComponentTView(def);\n // Only component views should be added to the view tree directly. Embedded views are\n // accessed through their containers because they may be removed / re-added later.\n const rendererFactory = lView[ENVIRONMENT].rendererFactory;\n let lViewFlags = 16 /* LViewFlags.CheckAlways */;\n if (def.signals) {\n lViewFlags = 4096 /* LViewFlags.SignalView */;\n } else if (def.onPush) {\n lViewFlags = 64 /* LViewFlags.Dirty */;\n }\n const componentView = addToViewTree(lView, createLView(lView, tView, null, lViewFlags, native, hostTNode, null, rendererFactory.createRenderer(native, def), null, null, null));\n // Component view will always be created before any injected LContainers,\n // so this is a regular element, wrap it with the component view\n lView[hostTNode.index] = componentView;\n}\nfunction elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace) {\n if (ngDevMode) {\n assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n validateAgainstEventAttributes(name);\n assertTNodeType(tNode, 2 /* TNodeType.Element */, `Attempted to set attribute \\`${name}\\` on a container node. ` + `Host bindings are not valid on ng-container or ng-template.`);\n }\n const element = getNativeByTNode(tNode, lView);\n setElementAttribute(lView[RENDERER], element, namespace, tNode.value, name, value, sanitizer);\n}\nfunction setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {\n if (value == null) {\n ngDevMode && ngDevMode.rendererRemoveAttribute++;\n renderer.removeAttribute(element, name, namespace);\n } else {\n ngDevMode && ngDevMode.rendererSetAttribute++;\n const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);\n renderer.setAttribute(element, name, strValue, namespace);\n }\n}\n/**\n * Sets initial input properties on directive instances from attribute data\n *\n * @param lView Current LView that is being processed.\n * @param directiveIndex Index of the directive in directives array\n * @param instance Instance of the directive on which to set the initial inputs\n * @param def The directive def that contains the list of inputs\n * @param tNode The static data for this node\n */\nfunction setInputsFromAttrs(lView, directiveIndex, instance, def, tNode, initialInputData) {\n const initialInputs = initialInputData[directiveIndex];\n if (initialInputs !== null) {\n for (let i = 0; i < initialInputs.length;) {\n const publicName = initialInputs[i++];\n const privateName = initialInputs[i++];\n const flags = initialInputs[i++];\n const value = initialInputs[i++];\n writeToDirectiveInput(def, instance, publicName, privateName, flags, value);\n if (ngDevMode) {\n const nativeElement = getNativeByTNode(tNode, lView);\n setNgReflectProperty(lView, nativeElement, tNode.type, privateName, value);\n }\n }\n }\n}\n/**\n * Generates initialInputData for a node and stores it in the template's static storage\n * so subsequent template invocations don't have to recalculate it.\n *\n * initialInputData is an array containing values that need to be set as input properties\n * for directives on this node, but only once on creation. We need this array to support\n * the case where you set an @Input property of a directive using attribute-like syntax.\n * e.g. if you have a `name` @Input, you can set it once like this:\n *\n * <my-component name=\"Bess\"></my-component>\n *\n * @param inputs Input alias map that was generated from the directive def inputs.\n * @param directiveIndex Index of the directive that is currently being processed.\n * @param attrs Static attrs on this node.\n */\nfunction generateInitialInputs(inputs, directiveIndex, attrs) {\n let inputsToStore = null;\n let i = 0;\n while (i < attrs.length) {\n const attrName = attrs[i];\n if (attrName === 0 /* AttributeMarker.NamespaceURI */) {\n // We do not allow inputs on namespaced attributes.\n i += 4;\n continue;\n } else if (attrName === 5 /* AttributeMarker.ProjectAs */) {\n // Skip over the `ngProjectAs` value.\n i += 2;\n continue;\n }\n // If we hit any other attribute markers, we're done anyway. None of those are valid inputs.\n if (typeof attrName === 'number') break;\n if (inputs.hasOwnProperty(attrName)) {\n if (inputsToStore === null) inputsToStore = [];\n // Find the input's public name from the input store. Note that we can be found easier\n // through the directive def, but we want to do it using the inputs store so that it can\n // account for host directive aliases.\n const inputConfig = inputs[attrName];\n for (let j = 0; j < inputConfig.length; j += 3) {\n if (inputConfig[j] === directiveIndex) {\n inputsToStore.push(attrName, inputConfig[j + 1], inputConfig[j + 2], attrs[i + 1]);\n // A directive can't have multiple inputs with the same name so we can break here.\n break;\n }\n }\n }\n i += 2;\n }\n return inputsToStore;\n}\n//////////////////////////\n//// ViewContainer & View\n//////////////////////////\n/**\n * Creates a LContainer, either from a container instruction, or for a ViewContainerRef.\n *\n * @param hostNative The host element for the LContainer\n * @param hostTNode The host TNode for the LContainer\n * @param currentView The parent view of the LContainer\n * @param native The native comment element\n * @param isForViewContainerRef Optional a flag indicating the ViewContainerRef case\n * @returns LContainer\n */\nfunction createLContainer(hostNative, currentView, native, tNode) {\n ngDevMode && assertLView(currentView);\n const lContainer = [hostNative,\n // host native\n true,\n // Boolean `true` in this position signifies that this is an `LContainer`\n 0,\n // flags\n currentView,\n // parent\n null,\n // next\n tNode,\n // t_host\n null,\n // dehydrated views\n native,\n // native,\n null,\n // view refs\n null // moved views\n ];\n ngDevMode && assertEqual(lContainer.length, CONTAINER_HEADER_OFFSET, 'Should allocate correct number of slots for LContainer header.');\n return lContainer;\n}\n/** Refreshes all content queries declared by directives in a given view */\nfunction refreshContentQueries(tView, lView) {\n const contentQueries = tView.contentQueries;\n if (contentQueries !== null) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n for (let i = 0; i < contentQueries.length; i += 2) {\n const queryStartIdx = contentQueries[i];\n const directiveDefIdx = contentQueries[i + 1];\n if (directiveDefIdx !== -1) {\n const directiveDef = tView.data[directiveDefIdx];\n ngDevMode && assertDefined(directiveDef, 'DirectiveDef not found.');\n ngDevMode && assertDefined(directiveDef.contentQueries, 'contentQueries function should be defined');\n setCurrentQueryIndex(queryStartIdx);\n directiveDef.contentQueries(2 /* RenderFlags.Update */, lView[directiveDefIdx], directiveDefIdx);\n }\n }\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n}\n/**\n * Adds LView or LContainer to the end of the current view tree.\n *\n * This structure will be used to traverse through nested views to remove listeners\n * and call onDestroy callbacks.\n *\n * @param lView The view where LView or LContainer should be added\n * @param adjustedHostIndex Index of the view's host node in LView[], adjusted for header\n * @param lViewOrLContainer The LView or LContainer to add to the view tree\n * @returns The state passed in\n */\nfunction addToViewTree(lView, lViewOrLContainer) {\n // TODO(benlesh/misko): This implementation is incorrect, because it always adds the LContainer\n // to the end of the queue, which means if the developer retrieves the LContainers from RNodes out\n // of order, the change detection will run out of order, as the act of retrieving the the\n // LContainer from the RNode is what adds it to the queue.\n if (lView[CHILD_HEAD]) {\n lView[CHILD_TAIL][NEXT] = lViewOrLContainer;\n } else {\n lView[CHILD_HEAD] = lViewOrLContainer;\n }\n lView[CHILD_TAIL] = lViewOrLContainer;\n return lViewOrLContainer;\n}\n///////////////////////////////\n//// Change detection\n///////////////////////////////\nfunction executeViewQueryFn(flags, viewQueryFn, component) {\n ngDevMode && assertDefined(viewQueryFn, 'View queries function to execute must be defined.');\n setCurrentQueryIndex(0);\n const prevConsumer = setActiveConsumer$1(null);\n try {\n viewQueryFn(flags, component);\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n}\n///////////////////////////////\n//// Bindings & interpolations\n///////////////////////////////\n/**\n * Stores meta-data for a property binding to be used by TestBed's `DebugElement.properties`.\n *\n * In order to support TestBed's `DebugElement.properties` we need to save, for each binding:\n * - a bound property name;\n * - a static parts of interpolated strings;\n *\n * A given property metadata is saved at the binding's index in the `TView.data` (in other words, a\n * property binding metadata will be stored in `TView.data` at the same index as a bound value in\n * `LView`). Metadata are represented as `INTERPOLATION_DELIMITER`-delimited string with the\n * following format:\n * - `propertyName` for bound properties;\n * - `propertyName<6D>prefix<69>interpolation_static_part1<74>..interpolation_static_partN<74>suffix` for\n * interpolated properties.\n *\n * @param tData `TData` where meta-data will be saved;\n * @param tNode `TNode` that is a target of the binding;\n * @param propertyName bound property name;\n * @param bindingIndex binding index in `LView`\n * @param interpolationParts static interpolation parts (for property interpolations)\n */\nfunction storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex, ...interpolationParts) {\n // Binding meta-data are stored only the first time a given property instruction is processed.\n // Since we don't have a concept of the \"first update pass\" we need to check for presence of the\n // binding meta-data to decide if one should be stored (or if was stored already).\n if (tData[bindingIndex] === null) {\n if (tNode.inputs == null || !tNode.inputs[propertyName]) {\n const propBindingIdxs = tNode.propertyBindings || (tNode.propertyBindings = []);\n propBindingIdxs.push(bindingIndex);\n let bindingMetadata = propertyName;\n if (interpolationParts.length > 0) {\n bindingMetadata += INTERPOLATION_DELIMITER + interpolationParts.join(INTERPOLATION_DELIMITER);\n }\n tData[bindingIndex] = bindingMetadata;\n }\n }\n}\nfunction getOrCreateLViewCleanup(view) {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return view[CLEANUP] ??= [];\n}\nfunction getOrCreateTViewCleanup(tView) {\n return tView.cleanup ??= [];\n}\n/**\n * There are cases where the sub component's renderer needs to be included\n * instead of the current renderer (see the componentSyntheticHost* instructions).\n */\nfunction loadComponentRenderer(currentDef, tNode, lView) {\n // TODO(FW-2043): the `currentDef` is null when host bindings are invoked while creating root\n // component (see packages/core/src/render3/component.ts). This is not consistent with the process\n // of creating inner components, when current directive index is available in the state. In order\n // to avoid relying on current def being `null` (thus special-casing root component creation), the\n // process of creating root component should be unified with the process of creating inner\n // components.\n if (currentDef === null || isComponentDef(currentDef)) {\n lView = unwrapLView(lView[tNode.index]);\n }\n return lView[RENDERER];\n}\n/** Handles an error thrown in an LView. */\nfunction handleError(lView, error) {\n const injector = lView[INJECTOR];\n const errorHandler = injector ? injector.get(ErrorHandler, null) : null;\n errorHandler && errorHandler.handleError(error);\n}\n/**\n * Set the inputs of directives at the current node to corresponding value.\n *\n * @param tView The current TView\n * @param lView the `LView` which contains the directives.\n * @param inputs mapping between the public \"input\" name and privately-known,\n * possibly minified, property names to write to.\n * @param value Value to set.\n */\nfunction setInputsForProperty(tView, lView, inputs, publicName, value) {\n for (let i = 0; i < inputs.length;) {\n const index = inputs[i++];\n const privateName = inputs[i++];\n const flags = inputs[i++];\n const instance = lView[index];\n ngDevMode && assertIndexInRange(lView, index);\n const def = tView.data[index];\n writeToDirectiveInput(def, instance, publicName, privateName, flags, value);\n }\n}\n/**\n * Updates a text binding at a given index in a given LView.\n */\nfunction textBindingInternal(lView, index, value) {\n ngDevMode && assertString(value, 'Value should be a string');\n ngDevMode && assertNotSame(value, NO_CHANGE, 'value should not be NO_CHANGE');\n ngDevMode && assertIndexInRange(lView, index);\n const element = getNativeByIndex(index, lView);\n ngDevMode && assertDefined(element, 'native element should exist');\n updateTextNode(lView[RENDERER], element, value);\n}\nfunction renderComponent(hostLView, componentHostIdx) {\n ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');\n const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);\n const componentTView = componentView[TVIEW];\n syncViewWithBlueprint(componentTView, componentView);\n const hostRNode = componentView[HOST];\n // Populate an LView with hydration info retrieved from the DOM via TransferState.\n if (hostRNode !== null && componentView[HYDRATION] === null) {\n componentView[HYDRATION] = retrieveHydrationInfo(hostRNode, componentView[INJECTOR]);\n }\n renderView(componentTView, componentView, componentView[CONTEXT]);\n}\n/**\n * Syncs an LView instance with its blueprint if they have gotten out of sync.\n *\n * Typically, blueprints and their view instances should always be in sync, so the loop here\n * will be skipped. However, consider this case of two components side-by-side:\n *\n * App template:\n * ```\n * <comp></comp>\n * <comp></comp>\n * ```\n *\n * The following will happen:\n * 1. App template begins processing.\n * 2. First <comp> is matched as a component and its LView is created.\n * 3. Second <comp> is matched as a component and its LView is created.\n * 4. App template completes processing, so it's time to check child templates.\n * 5. First <comp> template is checked. It has a directive, so its def is pushed to blueprint.\n * 6. Second <comp> template is checked. Its blueprint has been updated by the first\n * <comp> template, but its LView was created before this update, so it is out of sync.\n *\n * Note that embedded views inside ngFor loops will never be out of sync because these views\n * are processed as soon as they are created.\n *\n * @param tView The `TView` that contains the blueprint for syncing\n * @param lView The view to sync\n */\nfunction syncViewWithBlueprint(tView, lView) {\n for (let i = lView.length; i < tView.blueprint.length; i++) {\n lView.push(tView.blueprint[i]);\n }\n}\n/**\n * Processes a view in the creation mode. This includes a number of steps in a specific order:\n * - creating view query functions (if any);\n * - executing a template function in the creation mode;\n * - updating static queries (if any);\n * - creating child components defined in a given view.\n */\nfunction renderView(tView, lView, context) {\n ngDevMode && assertEqual(isCreationMode(lView), true, 'Should be run in creation mode');\n ngDevMode && assertNotReactive(renderView.name);\n enterView(lView);\n try {\n const viewQuery = tView.viewQuery;\n if (viewQuery !== null) {\n executeViewQueryFn(1 /* RenderFlags.Create */, viewQuery, context);\n }\n // Execute a template associated with this view, if it exists. A template function might not be\n // defined for the root component views.\n const templateFn = tView.template;\n if (templateFn !== null) {\n executeTemplate(tView, lView, templateFn, 1 /* RenderFlags.Create */, context);\n }\n // This needs to be set before children are processed to support recursive components.\n // This must be set to false immediately after the first creation run because in an\n // ngFor loop, all the views will be created together before update mode runs and turns\n // off firstCreatePass. If we don't set it here, instances will perform directive\n // matching, etc again and again.\n if (tView.firstCreatePass) {\n tView.firstCreatePass = false;\n }\n // Mark all queries active in this view as dirty. This is necessary for signal-based queries to\n // have a clear marking point where we can read query results atomically (for a given view).\n lView[QUERIES]?.finishViewCreation(tView);\n // We resolve content queries specifically marked as `static` in creation mode. Dynamic\n // content queries are resolved during change detection (i.e. update mode), after embedded\n // views are refreshed (see block above).\n if (tView.staticContentQueries) {\n refreshContentQueries(tView, lView);\n }\n // We must materialize query results before child components are processed\n // in case a child component has projected a container. The LContainer needs\n // to exist so the embedded views are properly attached by the container.\n if (tView.staticViewQueries) {\n executeViewQueryFn(2 /* RenderFlags.Update */, tView.viewQuery, context);\n }\n // Render child component views.\n const components = tView.components;\n if (components !== null) {\n renderChildComponents(lView, components);\n }\n } catch (error) {\n // If we didn't manage to get past the first template pass due to\n // an error, mark the view as corrupted so we can try to recover.\n if (tView.firstCreatePass) {\n tView.incompleteFirstPass = true;\n tView.firstCreatePass = false;\n }\n throw error;\n } finally {\n lView[FLAGS] &= ~4 /* LViewFlags.CreationMode */;\n leaveView();\n }\n}\n/** Renders child components in the current view (creation mode). */\nfunction renderChildComponents(hostLView, components) {\n for (let i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n}\nfunction createAndRenderEmbeddedLView(declarationLView, templateTNode, context, options) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n const embeddedTView = templateTNode.tView;\n ngDevMode && assertDefined(embeddedTView, 'TView must be defined for a template node.');\n ngDevMode && assertTNodeForLView(templateTNode, declarationLView);\n // Embedded views follow the change detection strategy of the view they're declared in.\n const isSignalView = declarationLView[FLAGS] & 4096 /* LViewFlags.SignalView */;\n const viewFlags = isSignalView ? 4096 /* LViewFlags.SignalView */ : 16 /* LViewFlags.CheckAlways */;\n const embeddedLView = createLView(declarationLView, embeddedTView, context, viewFlags, null, templateTNode, null, null, options?.injector ?? null, options?.embeddedViewInjector ?? null, options?.dehydratedView ?? null);\n const declarationLContainer = declarationLView[templateTNode.index];\n ngDevMode && assertLContainer(declarationLContainer);\n embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;\n const declarationViewLQueries = declarationLView[QUERIES];\n if (declarationViewLQueries !== null) {\n embeddedLView[QUERIES] = declarationViewLQueries.createEmbeddedView(embeddedTView);\n }\n // execute creation mode of a view\n renderView(embeddedTView, embeddedLView, context);\n return embeddedLView;\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n}\nfunction getLViewFromLContainer(lContainer, index) {\n const adjustedIndex = CONTAINER_HEADER_OFFSET + index;\n // avoid reading past the array boundaries\n if (adjustedIndex < lContainer.length) {\n const lView = lContainer[adjustedIndex];\n ngDevMode && assertLView(lView);\n return lView;\n }\n return undefined;\n}\n/**\n * Returns whether an elements that belong to a view should be\n * inserted into the DOM. For client-only cases, DOM elements are\n * always inserted. For hydration cases, we check whether serialized\n * info is available for a view and the view is not in a \"skip hydration\"\n * block (in which case view contents was re-created, thus needing insertion).\n */\nfunction shouldAddViewToDom(tNode, dehydratedView) {\n return !dehydratedView || dehydratedView.firstChild === null || hasInSkipHydrationBlockFlag(tNode);\n}\nfunction addLViewToLContainer(lContainer, lView, index, addToDOM = true) {\n const tView = lView[TVIEW];\n // Insert into the view tree so the new view can be change-detected\n insertView(tView, lView, lContainer, index);\n // Insert elements that belong to this view into the DOM tree\n if (addToDOM) {\n const beforeNode = getBeforeNodeForView(index, lContainer);\n const renderer = lView[RENDERER];\n const parentRNode = nativeParentNode(renderer, lContainer[NATIVE]);\n if (parentRNode !== null) {\n addViewToDOM(tView, lContainer[T_HOST], renderer, lView, parentRNode, beforeNode);\n }\n }\n // When in hydration mode, reset the pointer to the first child in\n // the dehydrated view. This indicates that the view was hydrated and\n // further attaching/detaching should work with this view as normal.\n const hydrationInfo = lView[HYDRATION];\n if (hydrationInfo !== null && hydrationInfo.firstChild !== null) {\n hydrationInfo.firstChild = null;\n }\n}\nfunction removeLViewFromLContainer(lContainer, index) {\n const lView = detachView(lContainer, index);\n if (lView !== undefined) {\n destroyLView(lView[TVIEW], lView);\n }\n return lView;\n}\nfunction collectNativeNodes(tView, lView, tNode, result, isProjection = false) {\n while (tNode !== null) {\n // Let declarations don't have corresponding DOM nodes so we skip over them.\n if (tNode.type === 128 /* TNodeType.LetDeclaration */) {\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n continue;\n }\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 16 /* TNodeType.Projection */ | 32 /* TNodeType.Icu */);\n const lNode = lView[tNode.index];\n if (lNode !== null) {\n result.push(unwrapRNode(lNode));\n }\n // A given lNode can represent either a native node or a LContainer (when it is a host of a\n // ViewContainerRef). When we find a LContainer we need to descend into it to collect root nodes\n // from the views in this container.\n if (isLContainer(lNode)) {\n collectNativeNodesInLContainer(lNode, result);\n }\n const tNodeType = tNode.type;\n if (tNodeType & 8 /* TNodeType.ElementContainer */) {\n collectNativeNodes(tView, lView, tNode.child, result);\n } else if (tNodeType & 32 /* TNodeType.Icu */) {\n const nextRNode = icuContainerIterate(tNode, lView);\n let rNode;\n while (rNode = nextRNode()) {\n result.push(rNode);\n }\n } else if (tNodeType & 16 /* TNodeType.Projection */) {\n const nodesInSlot = getProjectionNodes(lView, tNode);\n if (Array.isArray(nodesInSlot)) {\n result.push(...nodesInSlot);\n } else {\n const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);\n ngDevMode && assertParentView(parentView);\n collectNativeNodes(parentView[TVIEW], parentView, nodesInSlot, result, true);\n }\n }\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n }\n return result;\n}\n/**\n * Collects all root nodes in all views in a given LContainer.\n */\nfunction collectNativeNodesInLContainer(lContainer, result) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lViewInAContainer = lContainer[i];\n const lViewFirstChildTNode = lViewInAContainer[TVIEW].firstChild;\n if (lViewFirstChildTNode !== null) {\n collectNativeNodes(lViewInAContainer[TVIEW], lViewInAContainer, lViewFirstChildTNode, result);\n }\n }\n // When an LContainer is created, the anchor (comment) node is:\n // - (1) either reused in case of an ElementContainer (<ng-container>)\n // - (2) or a new comment node is created\n // In the first case, the anchor comment node would be added to the final\n // list by the code in the `collectNativeNodes` function\n // (see the `result.push(unwrapRNode(lNode))` line), but the second\n // case requires extra handling: the anchor node needs to be added to the\n // final list manually. See additional information in the `createAnchorNode`\n // function in the `view_container_ref.ts`.\n //\n // In the first case, the same reference would be stored in the `NATIVE`\n // and `HOST` slots in an LContainer. Otherwise, this is the second case and\n // we should add an element to the final list.\n if (lContainer[NATIVE] !== lContainer[HOST]) {\n result.push(lContainer[NATIVE]);\n }\n}\nlet freeConsumers = [];\n/**\n * Create a new template consumer pointing at the specified LView.\n * Sometimes, a previously created consumer may be reused, in order to save on allocations. In that\n * case, the LView will be updated.\n */\nfunction getOrBorrowReactiveLViewConsumer(lView) {\n return lView[REACTIVE_TEMPLATE_CONSUMER] ?? borrowReactiveLViewConsumer(lView);\n}\nfunction borrowReactiveLViewConsumer(lView) {\n const consumer = freeConsumers.pop() ?? Object.create(REACTIVE_LVIEW_CONSUMER_NODE);\n consumer.lView = lView;\n return consumer;\n}\nfunction maybeReturnReactiveLViewConsumer(consumer) {\n if (consumer.lView[REACTIVE_TEMPLATE_CONSUMER] === consumer) {\n // The consumer got committed.\n return;\n }\n consumer.lView = null;\n freeConsumers.push(consumer);\n}\nconst REACTIVE_LVIEW_CONSUMER_NODE = {\n ...REACTIVE_NODE$1,\n consumerIsAlwaysLive: true,\n consumerMarkedDirty: node => {\n markAncestorsForTraversal(node.lView);\n },\n consumerOnSignalRead() {\n this.lView[REACTIVE_TEMPLATE_CONSUMER] = this;\n }\n};\n/**\n * Creates a temporary consumer for use with `LView`s that should not have consumers.\n * If the LView already has a consumer, returns the existing one instead.\n *\n * This is necessary because some APIs may cause change detection directly on an LView\n * that we do not want to have a consumer (Embedded views today). As a result, there\n * would be no active consumer from running change detection on its host component\n * and any signals in the LView template would be untracked. Instead, we create\n * this temporary consumer that marks the first parent that _should_ have a consumer\n * for refresh. Once change detection runs as part of that refresh, we throw away\n * this consumer because its signals will then be tracked by the parent's consumer.\n */\nfunction getOrCreateTemporaryConsumer(lView) {\n const consumer = lView[REACTIVE_TEMPLATE_CONSUMER] ?? Object.create(TEMPORARY_CONSUMER_NODE);\n consumer.lView = lView;\n return consumer;\n}\nconst TEMPORARY_CONSUMER_NODE = {\n ...REACTIVE_NODE$1,\n consumerIsAlwaysLive: true,\n consumerMarkedDirty: node => {\n let parent = getLViewParent(node.lView);\n while (parent && !viewShouldHaveReactiveConsumer(parent[TVIEW])) {\n parent = getLViewParent(parent);\n }\n if (!parent) {\n // If we can't find an appropriate parent that should have a consumer, we\n // don't have a way of appropriately refreshing this LView as part of application synchronization.\n return;\n }\n markViewForRefresh(parent);\n },\n consumerOnSignalRead() {\n this.lView[REACTIVE_TEMPLATE_CONSUMER] = this;\n }\n};\n/**\n * Indicates if the view should get its own reactive consumer node.\n *\n * In the current design, all embedded views share a consumer with the component view. This allows\n * us to refresh at the component level rather than at a per-view level. In addition, root views get\n * their own reactive node because root component will have a host view that executes the\n * component's host bindings. This needs to be tracked in a consumer as well.\n *\n * To get a more granular change detection than per-component, all we would just need to update the\n * condition here so that a given view gets a reactive consumer which can become dirty independently\n * from its parent component. For example embedded views for signal components could be created with\n * a new type \"SignalEmbeddedView\" and the condition here wouldn't even need updating in order to\n * get granular per-view change detection for signal components.\n */\nfunction viewShouldHaveReactiveConsumer(tView) {\n return tView.type !== 2 /* TViewType.Embedded */;\n}\n\n/**\n * The maximum number of times the change detection traversal will rerun before throwing an error.\n */\nconst MAXIMUM_REFRESH_RERUNS$1 = 100;\nfunction detectChangesInternal(lView, notifyErrorHandler = true, mode = 0 /* ChangeDetectionMode.Global */) {\n const environment = lView[ENVIRONMENT];\n const rendererFactory = environment.rendererFactory;\n // Check no changes mode is a dev only mode used to verify that bindings have not changed\n // since they were assigned. We do not want to invoke renderer factory functions in that mode\n // to avoid any possible side-effects.\n const checkNoChangesMode = !!ngDevMode && isInCheckNoChangesMode();\n if (!checkNoChangesMode) {\n rendererFactory.begin?.();\n }\n try {\n detectChangesInViewWhileDirty(lView, mode);\n } catch (error) {\n if (notifyErrorHandler) {\n handleError(lView, error);\n }\n throw error;\n } finally {\n if (!checkNoChangesMode) {\n rendererFactory.end?.();\n // One final flush of the effects queue to catch any effects created in `ngAfterViewInit` or\n // other post-order hooks.\n environment.inlineEffectRunner?.flush();\n }\n }\n}\nfunction detectChangesInViewWhileDirty(lView, mode) {\n const lastIsRefreshingViewsValue = isRefreshingViews();\n try {\n setIsRefreshingViews(true);\n detectChangesInView(lView, mode);\n // We don't need or want to do any looping when in exhaustive checkNoChanges because we\n // already traverse all the views and nothing should change so we shouldn't have to do\n // another pass to pick up new changes.\n if (ngDevMode && isExhaustiveCheckNoChanges()) {\n return;\n }\n let retries = 0;\n // If after running change detection, this view still needs to be refreshed or there are\n // descendants views that need to be refreshed due to re-dirtying during the change detection\n // run, detect changes on the view again. We run change detection in `Targeted` mode to only\n // refresh views with the `RefreshView` flag.\n while (requiresRefreshOrTraversal(lView)) {\n if (retries === MAXIMUM_REFRESH_RERUNS$1) {\n throw new RuntimeError(103 /* RuntimeErrorCode.INFINITE_CHANGE_DETECTION */, ngDevMode && 'Infinite change detection while trying to refresh views. ' + 'There may be components which each cause the other to require a refresh, ' + 'causing an infinite loop.');\n }\n retries++;\n // Even if this view is detached, we still detect changes in targeted mode because this was\n // the root of the change detection run.\n detectChangesInView(lView, 1 /* ChangeDetectionMode.Targeted */);\n }\n } finally {\n // restore state to what it was before entering this change detection loop\n setIsRefreshingViews(lastIsRefreshingViewsValue);\n }\n}\nfunction checkNoChangesInternal(lView, mode, notifyErrorHandler = true) {\n setIsInCheckNoChangesMode(mode);\n try {\n detectChangesInternal(lView, notifyErrorHandler);\n } finally {\n setIsInCheckNoChangesMode(CheckNoChangesMode.Off);\n }\n}\n/**\n * Processes a view in update mode. This includes a number of steps in a specific order:\n * - executing a template function in update mode;\n * - executing hooks;\n * - refreshing queries;\n * - setting host bindings;\n * - refreshing child (embedded and component) views.\n */\nfunction refreshView(tView, lView, templateFn, context) {\n ngDevMode && assertEqual(isCreationMode(lView), false, 'Should be run in update mode');\n const flags = lView[FLAGS];\n if ((flags & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */) return;\n // Check no changes mode is a dev only mode used to verify that bindings have not changed\n // since they were assigned. We do not want to execute lifecycle hooks in that mode.\n const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();\n const isInExhaustiveCheckNoChangesPass = ngDevMode && isExhaustiveCheckNoChanges();\n !isInCheckNoChangesPass && lView[ENVIRONMENT].inlineEffectRunner?.flush();\n // Start component reactive context\n // - We might already be in a reactive context if this is an embedded view of the host.\n // - We might be descending into a view that needs a consumer.\n enterView(lView);\n let returnConsumerToPool = true;\n let prevConsumer = null;\n let currentConsumer = null;\n if (!isInCheckNoChangesPass) {\n if (viewShouldHaveReactiveConsumer(tView)) {\n currentConsumer = getOrBorrowReactiveLViewConsumer(lView);\n prevConsumer = consumerBeforeComputation$1(currentConsumer);\n } else if (getActiveConsumer$1() === null) {\n // If the current view should not have a reactive consumer but we don't have an active consumer,\n // we still need to create a temporary consumer to track any signal reads in this template.\n // This is a rare case that can happen with `viewContainerRef.createEmbeddedView(...).detectChanges()`.\n // This temporary consumer marks the first parent that _should_ have a consumer for refresh.\n // Once that refresh happens, the signals will be tracked in the parent consumer and we can destroy\n // the temporary one.\n returnConsumerToPool = false;\n currentConsumer = getOrCreateTemporaryConsumer(lView);\n prevConsumer = consumerBeforeComputation$1(currentConsumer);\n } else if (lView[REACTIVE_TEMPLATE_CONSUMER]) {\n consumerDestroy$1(lView[REACTIVE_TEMPLATE_CONSUMER]);\n lView[REACTIVE_TEMPLATE_CONSUMER] = null;\n }\n }\n try {\n resetPreOrderHookFlags(lView);\n setBindingIndex(tView.bindingStartIndex);\n if (templateFn !== null) {\n executeTemplate(tView, lView, templateFn, 2 /* RenderFlags.Update */, context);\n }\n const hooksInitPhaseCompleted = (flags & 3 /* LViewFlags.InitPhaseStateMask */) === 3 /* InitPhaseState.InitPhaseCompleted */;\n // execute pre-order hooks (OnInit, OnChanges, DoCheck)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const preOrderCheckHooks = tView.preOrderCheckHooks;\n if (preOrderCheckHooks !== null) {\n executeCheckHooks(lView, preOrderCheckHooks, null);\n }\n } else {\n const preOrderHooks = tView.preOrderHooks;\n if (preOrderHooks !== null) {\n executeInitAndCheckHooks(lView, preOrderHooks, 0 /* InitPhaseState.OnInitHooksToBeRun */, null);\n }\n incrementInitPhaseFlags(lView, 0 /* InitPhaseState.OnInitHooksToBeRun */);\n }\n }\n // We do not need to mark transplanted views for refresh when doing exhaustive checks\n // because all views will be reached anyways during the traversal.\n if (!isInExhaustiveCheckNoChangesPass) {\n // First mark transplanted views that are declared in this lView as needing a refresh at their\n // insertion points. This is needed to avoid the situation where the template is defined in this\n // `LView` but its declaration appears after the insertion component.\n markTransplantedViewsForRefresh(lView);\n }\n detectChangesInEmbeddedViews(lView, 0 /* ChangeDetectionMode.Global */);\n // Content query results must be refreshed before content hooks are called.\n if (tView.contentQueries !== null) {\n refreshContentQueries(tView, lView);\n }\n // execute content hooks (AfterContentInit, AfterContentChecked)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const contentCheckHooks = tView.contentCheckHooks;\n if (contentCheckHooks !== null) {\n executeCheckHooks(lView, contentCheckHooks);\n }\n } else {\n const contentHooks = tView.contentHooks;\n if (contentHooks !== null) {\n executeInitAndCheckHooks(lView, contentHooks, 1 /* InitPhaseState.AfterContentInitHooksToBeRun */);\n }\n incrementInitPhaseFlags(lView, 1 /* InitPhaseState.AfterContentInitHooksToBeRun */);\n }\n }\n processHostBindingOpCodes(tView, lView);\n // Refresh child component views.\n const components = tView.components;\n if (components !== null) {\n detectChangesInChildComponents(lView, components, 0 /* ChangeDetectionMode.Global */);\n }\n // View queries must execute after refreshing child components because a template in this view\n // could be inserted in a child component. If the view query executes before child component\n // refresh, the template might not yet be inserted.\n const viewQuery = tView.viewQuery;\n if (viewQuery !== null) {\n executeViewQueryFn(2 /* RenderFlags.Update */, viewQuery, context);\n }\n // execute view hooks (AfterViewInit, AfterViewChecked)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const viewCheckHooks = tView.viewCheckHooks;\n if (viewCheckHooks !== null) {\n executeCheckHooks(lView, viewCheckHooks);\n }\n } else {\n const viewHooks = tView.viewHooks;\n if (viewHooks !== null) {\n executeInitAndCheckHooks(lView, viewHooks, 2 /* InitPhaseState.AfterViewInitHooksToBeRun */);\n }\n incrementInitPhaseFlags(lView, 2 /* InitPhaseState.AfterViewInitHooksToBeRun */);\n }\n }\n if (tView.firstUpdatePass === true) {\n // We need to make sure that we only flip the flag on successful `refreshView` only\n // Don't do this in `finally` block.\n // If we did this in `finally` block then an exception could block the execution of styling\n // instructions which in turn would be unable to insert themselves into the styling linked\n // list. The result of this would be that if the exception would not be throw on subsequent CD\n // the styling would be unable to process it data and reflect to the DOM.\n tView.firstUpdatePass = false;\n }\n // Schedule any effects that are waiting on the update pass of this view.\n if (lView[EFFECTS_TO_SCHEDULE]) {\n for (const notifyEffect of lView[EFFECTS_TO_SCHEDULE]) {\n notifyEffect();\n }\n // Once they've been run, we can drop the array.\n lView[EFFECTS_TO_SCHEDULE] = null;\n }\n // Do not reset the dirty state when running in check no changes mode. We don't want components\n // to behave differently depending on whether check no changes is enabled or not. For example:\n // Marking an OnPush component as dirty from within the `ngAfterViewInit` hook in order to\n // refresh a `NgClass` binding should work. If we would reset the dirty state in the check\n // no changes cycle, the component would be not be dirty for the next update pass. This would\n // be different in production mode where the component dirty state is not reset.\n if (!isInCheckNoChangesPass) {\n lView[FLAGS] &= ~(64 /* LViewFlags.Dirty */ | 8 /* LViewFlags.FirstLViewPass */);\n }\n } catch (e) {\n if (!isInCheckNoChangesPass) {\n // If refreshing a view causes an error, we need to remark the ancestors as needing traversal\n // because the error might have caused a situation where views below the current location are\n // dirty but will be unreachable because the \"has dirty children\" flag in the ancestors has been\n // cleared during change detection and we failed to run to completion.\n markAncestorsForTraversal(lView);\n }\n throw e;\n } finally {\n if (currentConsumer !== null) {\n consumerAfterComputation$1(currentConsumer, prevConsumer);\n if (returnConsumerToPool) {\n maybeReturnReactiveLViewConsumer(currentConsumer);\n }\n }\n leaveView();\n }\n}\n/**\n * Goes over embedded views (ones created through ViewContainerRef APIs) and refreshes\n * them by executing an associated template function.\n */\nfunction detectChangesInEmbeddedViews(lView, mode) {\n for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const embeddedLView = lContainer[i];\n detectChangesInViewIfAttached(embeddedLView, mode);\n }\n }\n}\n/**\n * Mark transplanted views as needing to be refreshed at their attachment points.\n *\n * @param lView The `LView` that may have transplanted views.\n */\nfunction markTransplantedViewsForRefresh(lView) {\n for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {\n if (!(lContainer[FLAGS] & LContainerFlags.HasTransplantedViews)) continue;\n const movedViews = lContainer[MOVED_VIEWS];\n ngDevMode && assertDefined(movedViews, 'Transplanted View flags set but missing MOVED_VIEWS');\n for (let i = 0; i < movedViews.length; i++) {\n const movedLView = movedViews[i];\n markViewForRefresh(movedLView);\n }\n }\n}\n/**\n * Detects changes in a component by entering the component view and processing its bindings,\n * queries, etc. if it is CheckAlways, OnPush and Dirty, etc.\n *\n * @param componentHostIdx Element index in LView[] (adjusted for HEADER_OFFSET)\n */\nfunction detectChangesInComponent(hostLView, componentHostIdx, mode) {\n ngDevMode && assertEqual(isCreationMode(hostLView), false, 'Should be run in update mode');\n const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);\n detectChangesInViewIfAttached(componentView, mode);\n}\n/**\n * Visits a view as part of change detection traversal.\n *\n * If the view is detached, no additional traversal happens.\n */\nfunction detectChangesInViewIfAttached(lView, mode) {\n if (!viewAttachedToChangeDetector(lView)) {\n return;\n }\n detectChangesInView(lView, mode);\n}\n/**\n * Visits a view as part of change detection traversal.\n *\n * The view is refreshed if:\n * - If the view is CheckAlways or Dirty and ChangeDetectionMode is `Global`\n * - If the view has the `RefreshView` flag\n *\n * The view is not refreshed, but descendants are traversed in `ChangeDetectionMode.Targeted` if the\n * view HasChildViewsToRefresh flag is set.\n */\nfunction detectChangesInView(lView, mode) {\n const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();\n const tView = lView[TVIEW];\n const flags = lView[FLAGS];\n const consumer = lView[REACTIVE_TEMPLATE_CONSUMER];\n // Refresh CheckAlways views in Global mode.\n let shouldRefreshView = !!(mode === 0 /* ChangeDetectionMode.Global */ && flags & 16 /* LViewFlags.CheckAlways */);\n // Refresh Dirty views in Global mode, as long as we're not in checkNoChanges.\n // CheckNoChanges never worked with `OnPush` components because the `Dirty` flag was\n // cleared before checkNoChanges ran. Because there is now a loop for to check for\n // backwards views, it gives an opportunity for `OnPush` components to be marked `Dirty`\n // before the CheckNoChanges pass. We don't want existing errors that are hidden by the\n // current CheckNoChanges bug to surface when making unrelated changes.\n shouldRefreshView ||= !!(flags & 64 /* LViewFlags.Dirty */ && mode === 0 /* ChangeDetectionMode.Global */ && !isInCheckNoChangesPass);\n // Always refresh views marked for refresh, regardless of mode.\n shouldRefreshView ||= !!(flags & 1024 /* LViewFlags.RefreshView */);\n // Refresh views when they have a dirty reactive consumer, regardless of mode.\n shouldRefreshView ||= !!(consumer?.dirty && consumerPollProducersForChange$1(consumer));\n shouldRefreshView ||= !!(ngDevMode && isExhaustiveCheckNoChanges());\n // Mark the Flags and `ReactiveNode` as not dirty before refreshing the component, so that they\n // can be re-dirtied during the refresh process.\n if (consumer) {\n consumer.dirty = false;\n }\n lView[FLAGS] &= ~(8192 /* LViewFlags.HasChildViewsToRefresh */ | 1024 /* LViewFlags.RefreshView */);\n if (shouldRefreshView) {\n refreshView(tView, lView, tView.template, lView[CONTEXT]);\n } else if (flags & 8192 /* LViewFlags.HasChildViewsToRefresh */) {\n detectChangesInEmbeddedViews(lView, 1 /* ChangeDetectionMode.Targeted */);\n const components = tView.components;\n if (components !== null) {\n detectChangesInChildComponents(lView, components, 1 /* ChangeDetectionMode.Targeted */);\n }\n }\n}\n/** Refreshes child components in the current view (update mode). */\nfunction detectChangesInChildComponents(hostLView, components, mode) {\n for (let i = 0; i < components.length; i++) {\n detectChangesInComponent(hostLView, components[i], mode);\n }\n}\n\n/**\n * Marks current view and all ancestors dirty.\n *\n * Returns the root view because it is found as a byproduct of marking the view tree\n * dirty, and can be used by methods that consume markViewDirty() to easily schedule\n * change detection. Otherwise, such methods would need to traverse up the view tree\n * an additional time to get the root view and schedule a tick on it.\n *\n * @param lView The starting LView to mark dirty\n * @returns the root LView\n */\nfunction markViewDirty(lView, source) {\n const dirtyBitsToUse = isRefreshingViews() ?\n // When we are actively refreshing views, we only use the `Dirty` bit to mark a view\n 64 /* LViewFlags.Dirty */ :\n // When we are not actively refreshing a view tree, it is absolutely\n // valid to update state and mark views dirty. We use the `RefreshView` flag in this\n // case to allow synchronously rerunning change detection. This applies today to\n // afterRender hooks as well as animation listeners which execute after detecting\n // changes in a view when the render factory flushes.\n 1024 /* LViewFlags.RefreshView */ | 64 /* LViewFlags.Dirty */;\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(source);\n while (lView) {\n lView[FLAGS] |= dirtyBitsToUse;\n const parent = getLViewParent(lView);\n // Stop traversing up as soon as you find a root view that wasn't attached to any container\n if (isRootView(lView) && !parent) {\n return lView;\n }\n // continue otherwise\n lView = parent;\n }\n return null;\n}\nclass ViewRef$1 {\n get rootNodes() {\n const lView = this._lView;\n const tView = lView[TVIEW];\n return collectNativeNodes(tView, lView, tView.firstChild, []);\n }\n constructor(\n /**\n * This represents `LView` associated with the component when ViewRef is a ChangeDetectorRef.\n *\n * When ViewRef is created for a dynamic component, this also represents the `LView` for the\n * component.\n *\n * For a \"regular\" ViewRef created for an embedded view, this is the `LView` for the embedded\n * view.\n *\n * @internal\n */\n _lView,\n /**\n * This represents the `LView` associated with the point where `ChangeDetectorRef` was\n * requested.\n *\n * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.\n */\n _cdRefInjectingView, notifyErrorHandler = true) {\n this._lView = _lView;\n this._cdRefInjectingView = _cdRefInjectingView;\n this.notifyErrorHandler = notifyErrorHandler;\n this._appRef = null;\n this._attachedToViewContainer = false;\n }\n get context() {\n return this._lView[CONTEXT];\n }\n /**\n * @deprecated Replacing the full context object is not supported. Modify the context\n * directly, or consider using a `Proxy` if you need to replace the full object.\n * // TODO(devversion): Remove this.\n */\n set context(value) {\n if (ngDevMode) {\n // Note: We have a warning message here because the `@deprecated` JSDoc will not be picked\n // up for assignments on the setter. We want to let users know about the deprecated usage.\n console.warn('Angular: Replacing the `context` object of an `EmbeddedViewRef` is deprecated.');\n }\n this._lView[CONTEXT] = value;\n }\n get destroyed() {\n return (this._lView[FLAGS] & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */;\n }\n destroy() {\n if (this._appRef) {\n this._appRef.detachView(this);\n } else if (this._attachedToViewContainer) {\n const parent = this._lView[PARENT];\n if (isLContainer(parent)) {\n const viewRefs = parent[VIEW_REFS];\n const index = viewRefs ? viewRefs.indexOf(this) : -1;\n if (index > -1) {\n ngDevMode && assertEqual(index, parent.indexOf(this._lView) - CONTAINER_HEADER_OFFSET, 'An attached view should be in the same position within its container as its ViewRef in the VIEW_REFS array.');\n detachView(parent, index);\n removeFromArray(viewRefs, index);\n }\n }\n this._attachedToViewContainer = false;\n }\n destroyLView(this._lView[TVIEW], this._lView);\n }\n onDestroy(callback) {\n storeLViewOnDestroy(this._lView, callback);\n }\n /**\n * Marks a view and all of its ancestors dirty.\n *\n * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush} component is\n * checked when it needs to be re-rendered but the two normal triggers haven't marked it\n * dirty (i.e. inputs haven't changed and events haven't fired in the view).\n *\n * <!-- TODO: Add a link to a chapter on OnPush components -->\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Component({\n * selector: 'app-root',\n * template: `Number of ticks: {{numberOfTicks}}`\n * changeDetection: ChangeDetectionStrategy.OnPush,\n * })\n * class AppComponent {\n * numberOfTicks = 0;\n *\n * constructor(private ref: ChangeDetectorRef) {\n * setInterval(() => {\n * this.numberOfTicks++;\n * // the following is required, otherwise the view will not be updated\n * this.ref.markForCheck();\n * }, 1000);\n * }\n * }\n * ```\n */\n markForCheck() {\n markViewDirty(this._cdRefInjectingView || this._lView, 4 /* NotificationSource.MarkForCheck */);\n }\n /**\n * Detaches the view from the change detection tree.\n *\n * Detached views will not be checked during change detection runs until they are\n * re-attached, even if they are dirty. `detach` can be used in combination with\n * {@link ChangeDetectorRef#detectChanges} to implement local change\n * detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds. We can do that by detaching\n * the component's change detector and doing a local check every five seconds.\n *\n * ```typescript\n * class DataProvider {\n * // in a real application the returned data will be different every time\n * get data() {\n * return [1,2,3,4,5];\n * }\n * }\n *\n * @Component({\n * selector: 'giant-list',\n * template: `\n * <li *ngFor=\"let d of dataProvider.data\">Data {{d}}</li>\n * `,\n * })\n * class GiantList {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {\n * ref.detach();\n * setInterval(() => {\n * this.ref.detectChanges();\n * }, 5000);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * providers: [DataProvider],\n * template: `\n * <giant-list><giant-list>\n * `,\n * })\n * class App {\n * }\n * ```\n */\n detach() {\n this._lView[FLAGS] &= ~128 /* LViewFlags.Attached */;\n }\n /**\n * Re-attaches a view to the change detection tree.\n *\n * This can be used to re-attach views that were previously detached from the tree\n * using {@link ChangeDetectorRef#detach}. Views are attached to the tree by default.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example creates a component displaying `live` data. The component will detach\n * its change detector from the main change detector tree when the component's live property\n * is set to false.\n *\n * ```typescript\n * class DataProvider {\n * data = 1;\n *\n * constructor() {\n * setInterval(() => {\n * this.data = this.data * 2;\n * }, 500);\n * }\n * }\n *\n * @Component({\n * selector: 'live-data',\n * inputs: ['live'],\n * template: 'Data: {{dataProvider.data}}'\n * })\n * class LiveData {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}\n *\n * set live(value) {\n * if (value) {\n * this.ref.reattach();\n * } else {\n * this.ref.detach();\n * }\n * }\n * }\n *\n * @Component({\n * selector: 'app-root',\n * providers: [DataProvider],\n * template: `\n * Live Update: <input type=\"checkbox\" [(ngModel)]=\"live\">\n * <live-data [live]=\"live\"><live-data>\n * `,\n * })\n * class AppComponent {\n * live = true;\n * }\n * ```\n */\n reattach() {\n updateAncestorTraversalFlagsOnAttach(this._lView);\n this._lView[FLAGS] |= 128 /* LViewFlags.Attached */;\n }\n /**\n * Checks the view and its children.\n *\n * This can also be used in combination with {@link ChangeDetectorRef#detach} to implement\n * local change detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine, the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds.\n *\n * We can do that by detaching the component's change detector and doing a local change detection\n * check every five seconds.\n *\n * See {@link ChangeDetectorRef#detach} for more information.\n */\n detectChanges() {\n // Add `RefreshView` flag to ensure this view is refreshed if not already dirty.\n // `RefreshView` flag is used intentionally over `Dirty` because it gets cleared before\n // executing any of the actual refresh code while the `Dirty` flag doesn't get cleared\n // until the end of the refresh. Using `RefreshView` prevents creating a potential difference\n // in the state of the LViewFlags during template execution.\n this._lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;\n detectChangesInternal(this._lView, this.notifyErrorHandler);\n }\n /**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * This is used in development mode to verify that running change detection doesn't\n * introduce other changes.\n */\n checkNoChanges() {\n if (ngDevMode) {\n checkNoChangesInternal(this._lView, CheckNoChangesMode.OnlyDirtyViews, this.notifyErrorHandler);\n }\n }\n attachToViewContainerRef() {\n if (this._appRef) {\n throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached directly to the ApplicationRef!');\n }\n this._attachedToViewContainer = true;\n }\n detachFromAppRef() {\n this._appRef = null;\n const isRoot = isRootView(this._lView);\n const declarationContainer = this._lView[DECLARATION_LCONTAINER];\n if (declarationContainer !== null && !isRoot) {\n detachMovedView(declarationContainer, this._lView);\n }\n detachViewFromDOM(this._lView[TVIEW], this._lView);\n }\n attachToAppRef(appRef) {\n if (this._attachedToViewContainer) {\n throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached to a ViewContainer!');\n }\n this._appRef = appRef;\n const isRoot = isRootView(this._lView);\n const declarationContainer = this._lView[DECLARATION_LCONTAINER];\n if (declarationContainer !== null && !isRoot) {\n trackMovedView(declarationContainer, this._lView);\n }\n updateAncestorTraversalFlagsOnAttach(this._lView);\n }\n}\n\n/**\n * Represents an embedded template that can be used to instantiate embedded views.\n * To instantiate embedded views based on a template, use the `ViewContainerRef`\n * method `createEmbeddedView()`.\n *\n * Access a `TemplateRef` instance by placing a directive on an `<ng-template>`\n * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view\n * is injected into the constructor of the directive,\n * using the `TemplateRef` token.\n *\n * You can also use a `Query` to find a `TemplateRef` associated with\n * a component or a directive.\n *\n * @see {@link ViewContainerRef}\n *\n * @publicApi\n */\nclass TemplateRef {\n /**\n * @internal\n * @nocollapse\n */\n static {\n this.__NG_ELEMENT_ID__ = injectTemplateRef;\n }\n}\nconst ViewEngineTemplateRef = TemplateRef;\n// TODO(alxhub): combine interface and implementation. Currently this is challenging since something\n// in g3 depends on them being separate.\nconst R3TemplateRef = class TemplateRef extends ViewEngineTemplateRef {\n constructor(_declarationLView, _declarationTContainer, elementRef) {\n super();\n this._declarationLView = _declarationLView;\n this._declarationTContainer = _declarationTContainer;\n this.elementRef = elementRef;\n }\n /**\n * Returns an `ssrId` associated with a TView, which was used to\n * create this instance of the `TemplateRef`.\n *\n * @internal\n */\n get ssrId() {\n return this._declarationTContainer.tView?.ssrId || null;\n }\n createEmbeddedView(context, injector) {\n return this.createEmbeddedViewImpl(context, injector);\n }\n /**\n * @internal\n */\n createEmbeddedViewImpl(context, injector, dehydratedView) {\n const embeddedLView = createAndRenderEmbeddedLView(this._declarationLView, this._declarationTContainer, context, {\n embeddedViewInjector: injector,\n dehydratedView\n });\n return new ViewRef$1(embeddedLView);\n }\n};\n/**\n * Creates a TemplateRef given a node.\n *\n * @returns The TemplateRef instance to use\n */\nfunction injectTemplateRef() {\n return createTemplateRef(getCurrentTNode(), getLView());\n}\n/**\n * Creates a TemplateRef and stores it on the injector.\n *\n * @param hostTNode The node on which a TemplateRef is requested\n * @param hostLView The `LView` to which the node belongs\n * @returns The TemplateRef instance or null if we can't create a TemplateRef on a given node type\n */\nfunction createTemplateRef(hostTNode, hostLView) {\n if (hostTNode.type & 4 /* TNodeType.Container */) {\n ngDevMode && assertDefined(hostTNode.tView, 'TView must be allocated');\n return new R3TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView));\n }\n return null;\n}\nconst AT_THIS_LOCATION = '<-- AT THIS LOCATION';\n/**\n * Retrieves a user friendly string for a given TNodeType for use in\n * friendly error messages\n *\n * @param tNodeType\n * @returns\n */\nfunction getFriendlyStringFromTNodeType(tNodeType) {\n switch (tNodeType) {\n case 4 /* TNodeType.Container */:\n return 'view container';\n case 2 /* TNodeType.Element */:\n return 'element';\n case 8 /* TNodeType.ElementContainer */:\n return 'ng-container';\n case 32 /* TNodeType.Icu */:\n return 'icu';\n case 64 /* TNodeType.Placeholder */:\n return 'i18n';\n case 16 /* TNodeType.Projection */:\n return 'projection';\n case 1 /* TNodeType.Text */:\n return 'text';\n case 128 /* TNodeType.LetDeclaration */:\n return '@let';\n default:\n // This should not happen as we cover all possible TNode types above.\n return '<unknown>';\n }\n}\n/**\n * Validates that provided nodes match during the hydration process.\n */\nfunction validateMatchingNode(node, nodeType, tagName, lView, tNode, isViewContainerAnchor = false) {\n if (!node || node.nodeType !== nodeType || node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() !== tagName?.toLowerCase()) {\n const expectedNode = shortRNodeDescription(nodeType, tagName, null);\n let header = `During hydration Angular expected ${expectedNode} but `;\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n const expectedDom = describeExpectedDom(lView, tNode, isViewContainerAnchor);\n const expected = `Angular expected this DOM:\\n\\n${expectedDom}\\n\\n`;\n let actual = '';\n const componentHostElement = unwrapRNode(lView[HOST]);\n if (!node) {\n // No node found during hydration.\n header += `the node was not found.\\n\\n`;\n // Since the node is missing, we use the closest node to attach the error to\n markRNodeAsHavingHydrationMismatch(componentHostElement, expectedDom);\n } else {\n const actualNode = shortRNodeDescription(node.nodeType, node.tagName ?? null, node.textContent ?? null);\n header += `found ${actualNode}.\\n\\n`;\n const actualDom = describeDomFromNode(node);\n actual = `Actual DOM is:\\n\\n${actualDom}\\n\\n`;\n // DevTools only report hydration issues on the component level, so we attach extra debug\n // info to a component host element to make it available to DevTools.\n markRNodeAsHavingHydrationMismatch(componentHostElement, expectedDom, actualDom);\n }\n const footer = getHydrationErrorFooter(componentClassName);\n const message = header + expected + actual + getHydrationAttributeNote() + footer;\n throw new RuntimeError(-500 /* RuntimeErrorCode.HYDRATION_NODE_MISMATCH */, message);\n }\n}\n/**\n * Validates that a given node has sibling nodes\n */\nfunction validateSiblingNodeExists(node) {\n validateNodeExists(node);\n if (!node.nextSibling) {\n const header = 'During hydration Angular expected more sibling nodes to be present.\\n\\n';\n const actual = `Actual DOM is:\\n\\n${describeDomFromNode(node)}\\n\\n`;\n const footer = getHydrationErrorFooter();\n const message = header + actual + footer;\n markRNodeAsHavingHydrationMismatch(node, '', actual);\n throw new RuntimeError(-501 /* RuntimeErrorCode.HYDRATION_MISSING_SIBLINGS */, message);\n }\n}\n/**\n * Validates that a node exists or throws\n */\nfunction validateNodeExists(node, lView = null, tNode = null) {\n if (!node) {\n const header = 'During hydration, Angular expected an element to be present at this location.\\n\\n';\n let expected = '';\n let footer = '';\n if (lView !== null && tNode !== null) {\n expected = describeExpectedDom(lView, tNode, false);\n footer = getHydrationErrorFooter();\n // Since the node is missing, we use the closest node to attach the error to\n markRNodeAsHavingHydrationMismatch(unwrapRNode(lView[HOST]), expected, '');\n }\n throw new RuntimeError(-502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, `${header}${expected}\\n\\n${footer}`);\n }\n}\n/**\n * Builds the hydration error message when a node is not found\n *\n * @param lView the LView where the node exists\n * @param tNode the TNode\n */\nfunction nodeNotFoundError(lView, tNode) {\n const header = 'During serialization, Angular was unable to find an element in the DOM:\\n\\n';\n const expected = `${describeExpectedDom(lView, tNode, false)}\\n\\n`;\n const footer = getHydrationErrorFooter();\n throw new RuntimeError(-502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, header + expected + footer);\n}\n/**\n * Builds a hydration error message when a node is not found at a path location\n *\n * @param host the Host Node\n * @param path the path to the node\n */\nfunction nodeNotFoundAtPathError(host, path) {\n const header = `During hydration Angular was unable to locate a node ` + `using the \"${path}\" path, starting from the ${describeRNode(host)} node.\\n\\n`;\n const footer = getHydrationErrorFooter();\n markRNodeAsHavingHydrationMismatch(host);\n throw new RuntimeError(-502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, header + footer);\n}\n/**\n * Builds the hydration error message in the case that dom nodes are created outside of\n * the Angular context and are being used as projected nodes\n *\n * @param lView the LView\n * @param tNode the TNode\n * @returns an error\n */\nfunction unsupportedProjectionOfDomNodes(rNode) {\n const header = 'During serialization, Angular detected DOM nodes ' + 'that were created outside of Angular context and provided as projectable nodes ' + '(likely via `ViewContainerRef.createComponent` or `createComponent` APIs). ' + 'Hydration is not supported for such cases, consider refactoring the code to avoid ' + 'this pattern or using `ngSkipHydration` on the host element of the component.\\n\\n';\n const actual = `${describeDomFromNode(rNode)}\\n\\n`;\n const message = header + actual + getHydrationAttributeNote();\n return new RuntimeError(-503 /* RuntimeErrorCode.UNSUPPORTED_PROJECTION_DOM_NODES */, message);\n}\n/**\n * Builds the hydration error message in the case that ngSkipHydration was used on a\n * node that is not a component host element or host binding\n *\n * @param rNode the HTML Element\n * @returns an error\n */\nfunction invalidSkipHydrationHost(rNode) {\n const header = 'The `ngSkipHydration` flag is applied on a node ' + \"that doesn't act as a component host. Hydration can be \" + 'skipped only on per-component basis.\\n\\n';\n const actual = `${describeDomFromNode(rNode)}\\n\\n`;\n const footer = 'Please move the `ngSkipHydration` attribute to the component host element.\\n\\n';\n const message = header + actual + footer;\n return new RuntimeError(-504 /* RuntimeErrorCode.INVALID_SKIP_HYDRATION_HOST */, message);\n}\n// Stringification methods\n/**\n * Stringifies a given TNode's attributes\n *\n * @param tNode a provided TNode\n * @returns string\n */\nfunction stringifyTNodeAttrs(tNode) {\n const results = [];\n if (tNode.attrs) {\n for (let i = 0; i < tNode.attrs.length;) {\n const attrName = tNode.attrs[i++];\n // Once we reach the first flag, we know that the list of\n // attributes is over.\n if (typeof attrName == 'number') {\n break;\n }\n const attrValue = tNode.attrs[i++];\n results.push(`${attrName}=\"${shorten(attrValue)}\"`);\n }\n }\n return results.join(' ');\n}\n/**\n * The list of internal attributes that should be filtered out while\n * producing an error message.\n */\nconst internalAttrs = new Set(['ngh', 'ng-version', 'ng-server-context']);\n/**\n * Stringifies an HTML Element's attributes\n *\n * @param rNode an HTML Element\n * @returns string\n */\nfunction stringifyRNodeAttrs(rNode) {\n const results = [];\n for (let i = 0; i < rNode.attributes.length; i++) {\n const attr = rNode.attributes[i];\n if (internalAttrs.has(attr.name)) continue;\n results.push(`${attr.name}=\"${shorten(attr.value)}\"`);\n }\n return results.join(' ');\n}\n// Methods for Describing the DOM\n/**\n * Converts a tNode to a helpful readable string value for use in error messages\n *\n * @param tNode a given TNode\n * @param innerContent the content of the node\n * @returns string\n */\nfunction describeTNode(tNode, innerContent = '…') {\n switch (tNode.type) {\n case 1 /* TNodeType.Text */:\n const content = tNode.value ? `(${tNode.value})` : '';\n return `#text${content}`;\n case 2 /* TNodeType.Element */:\n const attrs = stringifyTNodeAttrs(tNode);\n const tag = tNode.value.toLowerCase();\n return `<${tag}${attrs ? ' ' + attrs : ''}>${innerContent}</${tag}>`;\n case 8 /* TNodeType.ElementContainer */:\n return '<!-- ng-container -->';\n case 4 /* TNodeType.Container */:\n return '<!-- container -->';\n default:\n const typeAsString = getFriendlyStringFromTNodeType(tNode.type);\n return `#node(${typeAsString})`;\n }\n}\n/**\n * Converts an RNode to a helpful readable string value for use in error messages\n *\n * @param rNode a given RNode\n * @param innerContent the content of the node\n * @returns string\n */\nfunction describeRNode(rNode, innerContent = '…') {\n const node = rNode;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n const tag = node.tagName.toLowerCase();\n const attrs = stringifyRNodeAttrs(node);\n return `<${tag}${attrs ? ' ' + attrs : ''}>${innerContent}</${tag}>`;\n case Node.TEXT_NODE:\n const content = node.textContent ? shorten(node.textContent) : '';\n return `#text${content ? `(${content})` : ''}`;\n case Node.COMMENT_NODE:\n return `<!-- ${shorten(node.textContent ?? '')} -->`;\n default:\n return `#node(${node.nodeType})`;\n }\n}\n/**\n * Builds the string containing the expected DOM present given the LView and TNode\n * values for a readable error message\n *\n * @param lView the lView containing the DOM\n * @param tNode the tNode\n * @param isViewContainerAnchor boolean\n * @returns string\n */\nfunction describeExpectedDom(lView, tNode, isViewContainerAnchor) {\n const spacer = ' ';\n let content = '';\n if (tNode.prev) {\n content += spacer + '…\\n';\n content += spacer + describeTNode(tNode.prev) + '\\n';\n } else if (tNode.type && tNode.type & 12 /* TNodeType.AnyContainer */) {\n content += spacer + '…\\n';\n }\n if (isViewContainerAnchor) {\n content += spacer + describeTNode(tNode) + '\\n';\n content += spacer + `<!-- container --> ${AT_THIS_LOCATION}\\n`;\n } else {\n content += spacer + describeTNode(tNode) + ` ${AT_THIS_LOCATION}\\n`;\n }\n content += spacer + '…\\n';\n const parentRNode = tNode.type ? getParentRElement(lView[TVIEW], tNode, lView) : null;\n if (parentRNode) {\n content = describeRNode(parentRNode, '\\n' + content);\n }\n return content;\n}\n/**\n * Builds the string containing the DOM present around a given RNode for a\n * readable error message\n *\n * @param node the RNode\n * @returns string\n */\nfunction describeDomFromNode(node) {\n const spacer = ' ';\n let content = '';\n const currentNode = node;\n if (currentNode.previousSibling) {\n content += spacer + '…\\n';\n content += spacer + describeRNode(currentNode.previousSibling) + '\\n';\n }\n content += spacer + describeRNode(currentNode) + ` ${AT_THIS_LOCATION}\\n`;\n if (node.nextSibling) {\n content += spacer + '…\\n';\n }\n if (node.parentNode) {\n content = describeRNode(currentNode.parentNode, '\\n' + content);\n }\n return content;\n}\n/**\n * Shortens the description of a given RNode by its type for readability\n *\n * @param nodeType the type of node\n * @param tagName the node tag name\n * @param textContent the text content in the node\n * @returns string\n */\nfunction shortRNodeDescription(nodeType, tagName, textContent) {\n switch (nodeType) {\n case Node.ELEMENT_NODE:\n return `<${tagName.toLowerCase()}>`;\n case Node.TEXT_NODE:\n const content = textContent ? ` (with the \"${shorten(textContent)}\" content)` : '';\n return `a text node${content}`;\n case Node.COMMENT_NODE:\n return 'a comment node';\n default:\n return `#node(nodeType=${nodeType})`;\n }\n}\n/**\n * Builds the footer hydration error message\n *\n * @param componentClassName the name of the component class\n * @returns string\n */\nfunction getHydrationErrorFooter(componentClassName) {\n const componentInfo = componentClassName ? `the \"${componentClassName}\"` : 'corresponding';\n return `To fix this problem:\\n` + ` * check ${componentInfo} component for hydration-related issues\\n` + ` * check to see if your template has valid HTML structure\\n` + ` * or skip hydration by adding the \\`ngSkipHydration\\` attribute ` + `to its host node in a template\\n\\n`;\n}\n/**\n * An attribute related note for hydration errors\n */\nfunction getHydrationAttributeNote() {\n return 'Note: attributes are only displayed to better represent the DOM' + ' but have no effect on hydration mismatches.\\n\\n';\n}\n// Node string utility functions\n/**\n * Strips all newlines out of a given string\n *\n * @param input a string to be cleared of new line characters\n * @returns\n */\nfunction stripNewlines(input) {\n return input.replace(/\\s+/gm, '');\n}\n/**\n * Reduces a string down to a maximum length of characters with ellipsis for readability\n *\n * @param input a string input\n * @param maxLength a maximum length in characters\n * @returns string\n */\nfunction shorten(input, maxLength = 50) {\n if (!input) {\n return '';\n }\n input = stripNewlines(input);\n return input.length > maxLength ? `${input.substring(0, maxLength - 1)}…` : input;\n}\n\n/**\n * Find a node in front of which `currentTNode` should be inserted (takes i18n into account).\n *\n * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n * takes `TNode.insertBeforeIndex` into account.\n *\n * @param parentTNode parent `TNode`\n * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n * @param lView current `LView`\n */\nfunction getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView) {\n const tNodeInsertBeforeIndex = currentTNode.insertBeforeIndex;\n const insertBeforeIndex = Array.isArray(tNodeInsertBeforeIndex) ? tNodeInsertBeforeIndex[0] : tNodeInsertBeforeIndex;\n if (insertBeforeIndex === null) {\n return getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView);\n } else {\n ngDevMode && assertIndexInRange(lView, insertBeforeIndex);\n return unwrapRNode(lView[insertBeforeIndex]);\n }\n}\n/**\n * Process `TNode.insertBeforeIndex` by adding i18n text nodes.\n *\n * See `TNode.insertBeforeIndex`\n */\nfunction processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRElement) {\n const tNodeInsertBeforeIndex = childTNode.insertBeforeIndex;\n if (Array.isArray(tNodeInsertBeforeIndex)) {\n // An array indicates that there are i18n nodes that need to be added as children of this\n // `childRNode`. These i18n nodes were created before this `childRNode` was available and so\n // only now can be added. The first element of the array is the normal index where we should\n // insert the `childRNode`. Additional elements are the extra nodes to be added as children of\n // `childRNode`.\n ngDevMode && assertDomNode(childRNode);\n let i18nParent = childRNode;\n let anchorRNode = null;\n if (!(childTNode.type & 3 /* TNodeType.AnyRNode */)) {\n anchorRNode = i18nParent;\n i18nParent = parentRElement;\n }\n if (i18nParent !== null && childTNode.componentOffset === -1) {\n for (let i = 1; i < tNodeInsertBeforeIndex.length; i++) {\n // No need to `unwrapRNode` because all of the indexes point to i18n text nodes.\n // see `assertDomNode` below.\n const i18nChild = lView[tNodeInsertBeforeIndex[i]];\n nativeInsertBefore(renderer, i18nParent, i18nChild, anchorRNode, false);\n }\n }\n }\n}\n\n/**\n * Add `tNode` to `previousTNodes` list and update relevant `TNode`s in `previousTNodes` list\n * `tNode.insertBeforeIndex`.\n *\n * Things to keep in mind:\n * 1. All i18n text nodes are encoded as `TNodeType.Element` and are created eagerly by the\n * `ɵɵi18nStart` instruction.\n * 2. All `TNodeType.Placeholder` `TNodes` are elements which will be created later by\n * `ɵɵelementStart` instruction.\n * 3. `ɵɵelementStart` instruction will create `TNode`s in the ascending `TNode.index` order. (So a\n * smaller index `TNode` is guaranteed to be created before a larger one)\n *\n * We use the above three invariants to determine `TNode.insertBeforeIndex`.\n *\n * In an ideal world `TNode.insertBeforeIndex` would always be `TNode.next.index`. However,\n * this will not work because `TNode.next.index` may be larger than `TNode.index` which means that\n * the next node is not yet created and therefore we can't insert in front of it.\n *\n * Rule1: `TNode.insertBeforeIndex = null` if `TNode.next === null` (Initial condition, as we don't\n * know if there will be further `TNode`s inserted after.)\n * Rule2: If `previousTNode` is created after the `tNode` being inserted, then\n * `previousTNode.insertBeforeNode = tNode.index` (So when a new `tNode` is added we check\n * previous to see if we can update its `insertBeforeTNode`)\n *\n * See `TNode.insertBeforeIndex` for more context.\n *\n * @param previousTNodes A list of previous TNodes so that we can easily traverse `TNode`s in\n * reverse order. (If `TNode` would have `previous` this would not be necessary.)\n * @param newTNode A TNode to add to the `previousTNodes` list.\n */\nfunction addTNodeAndUpdateInsertBeforeIndex(previousTNodes, newTNode) {\n // Start with Rule1\n ngDevMode && assertEqual(newTNode.insertBeforeIndex, null, 'We expect that insertBeforeIndex is not set');\n previousTNodes.push(newTNode);\n if (previousTNodes.length > 1) {\n for (let i = previousTNodes.length - 2; i >= 0; i--) {\n const existingTNode = previousTNodes[i];\n // Text nodes are created eagerly and so they don't need their `indexBeforeIndex` updated.\n // It is safe to ignore them.\n if (!isI18nText(existingTNode)) {\n if (isNewTNodeCreatedBefore(existingTNode, newTNode) && getInsertBeforeIndex(existingTNode) === null) {\n // If it was created before us in time, (and it does not yet have `insertBeforeIndex`)\n // then add the `insertBeforeIndex`.\n setInsertBeforeIndex(existingTNode, newTNode.index);\n }\n }\n }\n }\n}\nfunction isI18nText(tNode) {\n return !(tNode.type & 64 /* TNodeType.Placeholder */);\n}\nfunction isNewTNodeCreatedBefore(existingTNode, newTNode) {\n return isI18nText(newTNode) || existingTNode.index > newTNode.index;\n}\nfunction getInsertBeforeIndex(tNode) {\n const index = tNode.insertBeforeIndex;\n return Array.isArray(index) ? index[0] : index;\n}\nfunction setInsertBeforeIndex(tNode, value) {\n const index = tNode.insertBeforeIndex;\n if (Array.isArray(index)) {\n // Array is stored if we have to insert child nodes. See `TNode.insertBeforeIndex`\n index[0] = value;\n } else {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n tNode.insertBeforeIndex = value;\n }\n}\n\n/**\n * Retrieve `TIcu` at a given `index`.\n *\n * The `TIcu` can be stored either directly (if it is nested ICU) OR\n * it is stored inside tho `TIcuContainer` if it is top level ICU.\n *\n * The reason for this is that the top level ICU need a `TNode` so that they are part of the render\n * tree, but nested ICU's have no TNode, because we don't know ahead of time if the nested ICU is\n * expressed (parent ICU may have selected a case which does not contain it.)\n *\n * @param tView Current `TView`.\n * @param index Index where the value should be read from.\n */\nfunction getTIcu(tView, index) {\n const value = tView.data[index];\n if (value === null || typeof value === 'string') return null;\n if (ngDevMode && !(value.hasOwnProperty('tView') || value.hasOwnProperty('currentCaseLViewIndex'))) {\n throwError(\"We expect to get 'null'|'TIcu'|'TIcuContainer', but got: \" + value);\n }\n // Here the `value.hasOwnProperty('currentCaseLViewIndex')` is a polymorphic read as it can be\n // either TIcu or TIcuContainerNode. This is not ideal, but we still think it is OK because it\n // will be just two cases which fits into the browser inline cache (inline cache can take up to\n // 4)\n const tIcu = value.hasOwnProperty('currentCaseLViewIndex') ? value : value.value;\n ngDevMode && assertTIcu(tIcu);\n return tIcu;\n}\n/**\n * Store `TIcu` at a give `index`.\n *\n * The `TIcu` can be stored either directly (if it is nested ICU) OR\n * it is stored inside tho `TIcuContainer` if it is top level ICU.\n *\n * The reason for this is that the top level ICU need a `TNode` so that they are part of the render\n * tree, but nested ICU's have no TNode, because we don't know ahead of time if the nested ICU is\n * expressed (parent ICU may have selected a case which does not contain it.)\n *\n * @param tView Current `TView`.\n * @param index Index where the value should be stored at in `Tview.data`\n * @param tIcu The TIcu to store.\n */\nfunction setTIcu(tView, index, tIcu) {\n const tNode = tView.data[index];\n ngDevMode && assertEqual(tNode === null || tNode.hasOwnProperty('tView'), true, \"We expect to get 'null'|'TIcuContainer'\");\n if (tNode === null) {\n tView.data[index] = tIcu;\n } else {\n ngDevMode && assertTNodeType(tNode, 32 /* TNodeType.Icu */);\n tNode.value = tIcu;\n }\n}\n/**\n * Set `TNode.insertBeforeIndex` taking the `Array` into account.\n *\n * See `TNode.insertBeforeIndex`\n */\nfunction setTNodeInsertBeforeIndex(tNode, index) {\n ngDevMode && assertTNode(tNode);\n let insertBeforeIndex = tNode.insertBeforeIndex;\n if (insertBeforeIndex === null) {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n insertBeforeIndex = tNode.insertBeforeIndex = [null /* may be updated to number later */, index];\n } else {\n assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');\n insertBeforeIndex.push(index);\n }\n}\n/**\n * Create `TNode.type=TNodeType.Placeholder` node.\n *\n * See `TNodeType.Placeholder` for more information.\n */\nfunction createTNodePlaceholder(tView, previousTNodes, index) {\n const tNode = createTNodeAtIndex(tView, index, 64 /* TNodeType.Placeholder */, null, null);\n addTNodeAndUpdateInsertBeforeIndex(previousTNodes, tNode);\n return tNode;\n}\n/**\n * Returns current ICU case.\n *\n * ICU cases are stored as index into the `TIcu.cases`.\n * At times it is necessary to communicate that the ICU case just switched and that next ICU update\n * should update all bindings regardless of the mask. In such a case the we store negative numbers\n * for cases which have just been switched. This function removes the negative flag.\n */\nfunction getCurrentICUCaseIndex(tIcu, lView) {\n const currentCase = lView[tIcu.currentCaseLViewIndex];\n return currentCase === null ? currentCase : currentCase < 0 ? ~currentCase : currentCase;\n}\nfunction getParentFromIcuCreateOpCode(mergedCode) {\n return mergedCode >>> 17 /* IcuCreateOpCode.SHIFT_PARENT */;\n}\nfunction getRefFromIcuCreateOpCode(mergedCode) {\n return (mergedCode & 131070 /* IcuCreateOpCode.MASK_REF */) >>> 1 /* IcuCreateOpCode.SHIFT_REF */;\n}\nfunction getInstructionFromIcuCreateOpCode(mergedCode) {\n return mergedCode & 1 /* IcuCreateOpCode.MASK_INSTRUCTION */;\n}\nfunction icuCreateOpCode(opCode, parentIdx, refIdx) {\n ngDevMode && assertGreaterThanOrEqual(parentIdx, 0, 'Missing parent index');\n ngDevMode && assertGreaterThan(refIdx, 0, 'Missing ref index');\n return opCode | parentIdx << 17 /* IcuCreateOpCode.SHIFT_PARENT */ | refIdx << 1 /* IcuCreateOpCode.SHIFT_REF */;\n}\n// Returns whether the given value corresponds to a root template message,\n// or a sub-template.\nfunction isRootTemplateMessage(subTemplateIndex) {\n return subTemplateIndex === -1;\n}\nfunction enterIcu(state, tIcu, lView) {\n state.index = 0;\n const currentCase = getCurrentICUCaseIndex(tIcu, lView);\n if (currentCase !== null) {\n ngDevMode && assertNumberInRange(currentCase, 0, tIcu.cases.length - 1);\n state.removes = tIcu.remove[currentCase];\n } else {\n state.removes = EMPTY_ARRAY;\n }\n}\nfunction icuContainerIteratorNext(state) {\n if (state.index < state.removes.length) {\n const removeOpCode = state.removes[state.index++];\n ngDevMode && assertNumber(removeOpCode, 'Expecting OpCode number');\n if (removeOpCode > 0) {\n const rNode = state.lView[removeOpCode];\n ngDevMode && assertDomNode(rNode);\n return rNode;\n } else {\n state.stack.push(state.index, state.removes);\n // ICUs are represented by negative indices\n const tIcuIndex = ~removeOpCode;\n const tIcu = state.lView[TVIEW].data[tIcuIndex];\n ngDevMode && assertTIcu(tIcu);\n enterIcu(state, tIcu, state.lView);\n return icuContainerIteratorNext(state);\n }\n } else {\n if (state.stack.length === 0) {\n return null;\n } else {\n state.removes = state.stack.pop();\n state.index = state.stack.pop();\n return icuContainerIteratorNext(state);\n }\n }\n}\nfunction loadIcuContainerVisitor() {\n const _state = {\n stack: [],\n index: -1\n };\n /**\n * Retrieves a set of root nodes from `TIcu.remove`. Used by `TNodeType.ICUContainer`\n * to determine which root belong to the ICU.\n *\n * Example of usage.\n * ```\n * const nextRNode = icuContainerIteratorStart(tIcuContainerNode, lView);\n * let rNode: RNode|null;\n * while(rNode = nextRNode()) {\n * console.log(rNode);\n * }\n * ```\n *\n * @param tIcuContainerNode Current `TIcuContainerNode`\n * @param lView `LView` where the `RNode`s should be looked up.\n */\n function icuContainerIteratorStart(tIcuContainerNode, lView) {\n _state.lView = lView;\n while (_state.stack.length) _state.stack.pop();\n ngDevMode && assertTNodeForLView(tIcuContainerNode, lView);\n enterIcu(_state, tIcuContainerNode.value, lView);\n return icuContainerIteratorNext.bind(null, _state);\n }\n return icuContainerIteratorStart;\n}\nfunction createIcuIterator(tIcu, lView) {\n const state = {\n stack: [],\n index: -1,\n lView\n };\n ngDevMode && assertTIcu(tIcu);\n enterIcu(state, tIcu, lView);\n return icuContainerIteratorNext.bind(null, state);\n}\n\n/**\n * Regexp that extracts a reference node information from the compressed node location.\n * The reference node is represented as either:\n * - a number which points to an LView slot\n * - the `b` char which indicates that the lookup should start from the `document.body`\n * - the `h` char to start lookup from the component host node (`lView[HOST]`)\n */\nconst REF_EXTRACTOR_REGEXP = new RegExp(`^(\\\\d+)*(${REFERENCE_NODE_BODY}|${REFERENCE_NODE_HOST})*(.*)`);\n/**\n * Helper function that takes a reference node location and a set of navigation steps\n * (from the reference node) to a target node and outputs a string that represents\n * a location.\n *\n * For example, given: referenceNode = 'b' (body) and path = ['firstChild', 'firstChild',\n * 'nextSibling'], the function returns: `bf2n`.\n */\nfunction compressNodeLocation(referenceNode, path) {\n const result = [referenceNode];\n for (const segment of path) {\n const lastIdx = result.length - 1;\n if (lastIdx > 0 && result[lastIdx - 1] === segment) {\n // An empty string in a count slot represents 1 occurrence of an instruction.\n const value = result[lastIdx] || 1;\n result[lastIdx] = value + 1;\n } else {\n // Adding a new segment to the path.\n // Using an empty string in a counter field to avoid encoding `1`s\n // into the path, since they are implicit (e.g. `f1n1` vs `fn`), so\n // it's enough to have a single char in this case.\n result.push(segment, '');\n }\n }\n return result.join('');\n}\n/**\n * Helper function that reverts the `compressNodeLocation` and transforms a given\n * string into an array where at 0th position there is a reference node info and\n * after that it contains information (in pairs) about a navigation step and the\n * number of repetitions.\n *\n * For example, the path like 'bf2n' will be transformed to:\n * ['b', 'firstChild', 2, 'nextSibling', 1].\n *\n * This information is later consumed by the code that navigates the DOM to find\n * a given node by its location.\n */\nfunction decompressNodeLocation(path) {\n const matches = path.match(REF_EXTRACTOR_REGEXP);\n const [_, refNodeId, refNodeName, rest] = matches;\n // If a reference node is represented by an index, transform it to a number.\n const ref = refNodeId ? parseInt(refNodeId, 10) : refNodeName;\n const steps = [];\n // Match all segments in a path.\n for (const [_, step, count] of rest.matchAll(/(f|n)(\\d*)/g)) {\n const repeat = parseInt(count, 10) || 1;\n steps.push(step, repeat);\n }\n return [ref, ...steps];\n}\n\n/** Whether current TNode is a first node in an <ng-container>. */\nfunction isFirstElementInNgContainer(tNode) {\n return !tNode.prev && tNode.parent?.type === 8 /* TNodeType.ElementContainer */;\n}\n/** Returns an instruction index (subtracting HEADER_OFFSET). */\nfunction getNoOffsetIndex(tNode) {\n return tNode.index - HEADER_OFFSET;\n}\n/**\n * Check whether a given node exists, but is disconnected from the DOM.\n */\nfunction isDisconnectedNode(tNode, lView) {\n return !(tNode.type & (16 /* TNodeType.Projection */ | 128 /* TNodeType.LetDeclaration */)) && !!lView[tNode.index] && isDisconnectedRNode(unwrapRNode(lView[tNode.index]));\n}\n/**\n * Check whether the given node exists, but is disconnected from the DOM.\n *\n * Note: we leverage the fact that we have this information available in the DOM emulation\n * layer (in Domino) for now. Longer-term solution should not rely on the DOM emulation and\n * only use internal data structures and state to compute this information.\n */\nfunction isDisconnectedRNode(rNode) {\n return !!rNode && !rNode.isConnected;\n}\n/**\n * Locate a node in an i18n tree that corresponds to a given instruction index.\n *\n * @param hydrationInfo The hydration annotation data\n * @param noOffsetIndex the instruction index\n * @returns an RNode that corresponds to the instruction index\n */\nfunction locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex) {\n const i18nNodes = hydrationInfo.i18nNodes;\n if (i18nNodes) {\n return i18nNodes.get(noOffsetIndex);\n }\n return undefined;\n}\n/**\n * Attempt to locate an RNode by a path, if it exists.\n *\n * @param hydrationInfo The hydration annotation data\n * @param lView the current lView\n * @param noOffsetIndex the instruction index\n * @returns an RNode that corresponds to the instruction index or null if no path exists\n */\nfunction tryLocateRNodeByPath(hydrationInfo, lView, noOffsetIndex) {\n const nodes = hydrationInfo.data[NODES];\n const path = nodes?.[noOffsetIndex];\n return path ? locateRNodeByPath(path, lView) : null;\n}\n/**\n * Locate a node in DOM tree that corresponds to a given TNode.\n *\n * @param hydrationInfo The hydration annotation data\n * @param tView the current tView\n * @param lView the current lView\n * @param tNode the current tNode\n * @returns an RNode that represents a given tNode\n */\nfunction locateNextRNode(hydrationInfo, tView, lView, tNode) {\n const noOffsetIndex = getNoOffsetIndex(tNode);\n let native = locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex);\n if (native === undefined) {\n const nodes = hydrationInfo.data[NODES];\n if (nodes?.[noOffsetIndex]) {\n // We know the exact location of the node.\n native = locateRNodeByPath(nodes[noOffsetIndex], lView);\n } else if (tView.firstChild === tNode) {\n // We create a first node in this view, so we use a reference\n // to the first child in this DOM segment.\n native = hydrationInfo.firstChild;\n } else {\n // Locate a node based on a previous sibling or a parent node.\n const previousTNodeParent = tNode.prev === null;\n const previousTNode = tNode.prev ?? tNode.parent;\n ngDevMode && assertDefined(previousTNode, 'Unexpected state: current TNode does not have a connection ' + 'to the previous node or a parent node.');\n if (isFirstElementInNgContainer(tNode)) {\n const noOffsetParentIndex = getNoOffsetIndex(tNode.parent);\n native = getSegmentHead(hydrationInfo, noOffsetParentIndex);\n } else {\n let previousRElement = getNativeByTNode(previousTNode, lView);\n if (previousTNodeParent) {\n native = previousRElement.firstChild;\n } else {\n // If the previous node is an element, but it also has container info,\n // this means that we are processing a node like `<div #vcrTarget>`, which is\n // represented in the DOM as `<div></div>...<!--container-->`.\n // In this case, there are nodes *after* this element and we need to skip\n // all of them to reach an element that we are looking for.\n const noOffsetPrevSiblingIndex = getNoOffsetIndex(previousTNode);\n const segmentHead = getSegmentHead(hydrationInfo, noOffsetPrevSiblingIndex);\n if (previousTNode.type === 2 /* TNodeType.Element */ && segmentHead) {\n const numRootNodesToSkip = calcSerializedContainerSize(hydrationInfo, noOffsetPrevSiblingIndex);\n // `+1` stands for an anchor comment node after all the views in this container.\n const nodesToSkip = numRootNodesToSkip + 1;\n // First node after this segment.\n native = siblingAfter(nodesToSkip, segmentHead);\n } else {\n native = previousRElement.nextSibling;\n }\n }\n }\n }\n }\n return native;\n}\n/**\n * Skips over a specified number of nodes and returns the next sibling node after that.\n */\nfunction siblingAfter(skip, from) {\n let currentNode = from;\n for (let i = 0; i < skip; i++) {\n ngDevMode && validateSiblingNodeExists(currentNode);\n currentNode = currentNode.nextSibling;\n }\n return currentNode;\n}\n/**\n * Helper function to produce a string representation of the navigation steps\n * (in terms of `nextSibling` and `firstChild` navigations). Used in error\n * messages in dev mode.\n */\nfunction stringifyNavigationInstructions(instructions) {\n const container = [];\n for (let i = 0; i < instructions.length; i += 2) {\n const step = instructions[i];\n const repeat = instructions[i + 1];\n for (let r = 0; r < repeat; r++) {\n container.push(step === NodeNavigationStep.FirstChild ? 'firstChild' : 'nextSibling');\n }\n }\n return container.join('.');\n}\n/**\n * Helper function that navigates from a starting point node (the `from` node)\n * using provided set of navigation instructions (within `path` argument).\n */\nfunction navigateToNode(from, instructions) {\n let node = from;\n for (let i = 0; i < instructions.length; i += 2) {\n const step = instructions[i];\n const repeat = instructions[i + 1];\n for (let r = 0; r < repeat; r++) {\n if (ngDevMode && !node) {\n throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));\n }\n switch (step) {\n case NodeNavigationStep.FirstChild:\n node = node.firstChild;\n break;\n case NodeNavigationStep.NextSibling:\n node = node.nextSibling;\n break;\n }\n }\n }\n if (ngDevMode && !node) {\n throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));\n }\n return node;\n}\n/**\n * Locates an RNode given a set of navigation instructions (which also contains\n * a starting point node info).\n */\nfunction locateRNodeByPath(path, lView) {\n const [referenceNode, ...navigationInstructions] = decompressNodeLocation(path);\n let ref;\n if (referenceNode === REFERENCE_NODE_HOST) {\n ref = lView[DECLARATION_COMPONENT_VIEW][HOST];\n } else if (referenceNode === REFERENCE_NODE_BODY) {\n ref = ɵɵresolveBody(lView[DECLARATION_COMPONENT_VIEW][HOST]);\n } else {\n const parentElementId = Number(referenceNode);\n ref = unwrapRNode(lView[parentElementId + HEADER_OFFSET]);\n }\n return navigateToNode(ref, navigationInstructions);\n}\n/**\n * Generate a list of DOM navigation operations to get from node `start` to node `finish`.\n *\n * Note: assumes that node `start` occurs before node `finish` in an in-order traversal of the DOM\n * tree. That is, we should be able to get from `start` to `finish` purely by using `.firstChild`\n * and `.nextSibling` operations.\n */\nfunction navigateBetween(start, finish) {\n if (start === finish) {\n return [];\n } else if (start.parentElement == null || finish.parentElement == null) {\n return null;\n } else if (start.parentElement === finish.parentElement) {\n return navigateBetweenSiblings(start, finish);\n } else {\n // `finish` is a child of its parent, so the parent will always have a child.\n const parent = finish.parentElement;\n const parentPath = navigateBetween(start, parent);\n const childPath = navigateBetween(parent.firstChild, finish);\n if (!parentPath || !childPath) return null;\n return [\n // First navigate to `finish`'s parent\n ...parentPath,\n // Then to its first child.\n NodeNavigationStep.FirstChild,\n // And finally from that node to `finish` (maybe a no-op if we're already there).\n ...childPath];\n }\n}\n/**\n * Calculates a path between 2 sibling nodes (generates a number of `NextSibling` navigations).\n * Returns `null` if no such path exists between the given nodes.\n */\nfunction navigateBetweenSiblings(start, finish) {\n const nav = [];\n let node = null;\n for (node = start; node != null && node !== finish; node = node.nextSibling) {\n nav.push(NodeNavigationStep.NextSibling);\n }\n // If the `node` becomes `null` or `undefined` at the end, that means that we\n // didn't find the `end` node, thus return `null` (which would trigger serialization\n // error to be produced).\n return node == null ? null : nav;\n}\n/**\n * Calculates a path between 2 nodes in terms of `nextSibling` and `firstChild`\n * navigations:\n * - the `from` node is a known node, used as an starting point for the lookup\n * (the `fromNodeName` argument is a string representation of the node).\n * - the `to` node is a node that the runtime logic would be looking up,\n * using the path generated by this function.\n */\nfunction calcPathBetween(from, to, fromNodeName) {\n const path = navigateBetween(from, to);\n return path === null ? null : compressNodeLocation(fromNodeName, path);\n}\n/**\n * Invoked at serialization time (on the server) when a set of navigation\n * instructions needs to be generated for a TNode.\n */\nfunction calcPathForNode(tNode, lView, excludedParentNodes) {\n let parentTNode = tNode.parent;\n let parentIndex;\n let parentRNode;\n let referenceNodeName;\n // Skip over all parent nodes that are disconnected from the DOM, such nodes\n // can not be used as anchors.\n //\n // This might happen in certain content projection-based use-cases, where\n // a content of an element is projected and used, when a parent element\n // itself remains detached from DOM. In this scenario we try to find a parent\n // element that is attached to DOM and can act as an anchor instead.\n //\n // It can also happen that the parent node should be excluded, for example,\n // because it belongs to an i18n block, which requires paths which aren't\n // relative to other views in an i18n block.\n while (parentTNode !== null && (isDisconnectedNode(parentTNode, lView) || excludedParentNodes?.has(parentTNode.index))) {\n parentTNode = parentTNode.parent;\n }\n if (parentTNode === null || !(parentTNode.type & 3 /* TNodeType.AnyRNode */)) {\n // If there is no parent TNode or a parent TNode does not represent an RNode\n // (i.e. not a DOM node), use component host element as a reference node.\n parentIndex = referenceNodeName = REFERENCE_NODE_HOST;\n parentRNode = lView[DECLARATION_COMPONENT_VIEW][HOST];\n } else {\n // Use parent TNode as a reference node.\n parentIndex = parentTNode.index;\n parentRNode = unwrapRNode(lView[parentIndex]);\n referenceNodeName = renderStringify(parentIndex - HEADER_OFFSET);\n }\n let rNode = unwrapRNode(lView[tNode.index]);\n if (tNode.type & (12 /* TNodeType.AnyContainer */ | 32 /* TNodeType.Icu */)) {\n // For <ng-container> nodes, instead of serializing a reference\n // to the anchor comment node, serialize a location of the first\n // DOM element. Paired with the container size (serialized as a part\n // of `ngh.containers`), it should give enough information for runtime\n // to hydrate nodes in this container.\n const firstRNode = getFirstNativeNode(lView, tNode);\n // If container is not empty, use a reference to the first element,\n // otherwise, rNode would point to an anchor comment node.\n if (firstRNode) {\n rNode = firstRNode;\n }\n }\n let path = calcPathBetween(parentRNode, rNode, referenceNodeName);\n if (path === null && parentRNode !== rNode) {\n // Searching for a path between elements within a host node failed.\n // Trying to find a path to an element starting from the `document.body` instead.\n //\n // Important note: this type of reference is relatively unstable, since Angular\n // may not be able to control parts of the page that the runtime logic navigates\n // through. This is mostly needed to cover \"portals\" use-case (like menus, dialog boxes,\n // etc), where nodes are content-projected (including direct DOM manipulations) outside\n // of the host node. The better solution is to provide APIs to work with \"portals\",\n // at which point this code path would not be needed.\n const body = parentRNode.ownerDocument.body;\n path = calcPathBetween(body, rNode, REFERENCE_NODE_BODY);\n if (path === null) {\n // If the path is still empty, it's likely that this node is detached and\n // won't be found during hydration.\n throw nodeNotFoundError(lView, tNode);\n }\n }\n return path;\n}\nlet _isI18nHydrationSupportEnabled = false;\nlet _prepareI18nBlockForHydrationImpl = () => {\n // noop unless `enablePrepareI18nBlockForHydrationImpl` is invoked.\n};\nfunction setIsI18nHydrationSupportEnabled(enabled) {\n _isI18nHydrationSupportEnabled = enabled;\n}\nfunction isI18nHydrationSupportEnabled() {\n return _isI18nHydrationSupportEnabled;\n}\n/**\n * Prepares an i18n block and its children, located at the given\n * view and instruction index, for hydration.\n *\n * @param lView lView with the i18n block\n * @param index index of the i18n block in the lView\n * @param parentTNode TNode of the parent of the i18n block\n * @param subTemplateIndex sub-template index, or -1 for the main template\n */\nfunction prepareI18nBlockForHydration(lView, index, parentTNode, subTemplateIndex) {\n _prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex);\n}\nfunction enablePrepareI18nBlockForHydrationImpl() {\n _prepareI18nBlockForHydrationImpl = prepareI18nBlockForHydrationImpl;\n}\nfunction isI18nHydrationEnabled(injector) {\n injector = injector ?? inject(Injector);\n return injector.get(IS_I18N_HYDRATION_ENABLED, false);\n}\n/**\n * Collects, if not already cached, all of the indices in the\n * given TView which are children of an i18n block.\n *\n * Since i18n blocks don't introduce a parent TNode, this is necessary\n * in order to determine which indices in a LView are translated.\n */\nfunction getOrComputeI18nChildren(tView, context) {\n let i18nChildren = context.i18nChildren.get(tView);\n if (i18nChildren === undefined) {\n i18nChildren = collectI18nChildren(tView);\n context.i18nChildren.set(tView, i18nChildren);\n }\n return i18nChildren;\n}\nfunction collectI18nChildren(tView) {\n const children = new Set();\n function collectI18nViews(node) {\n children.add(node.index);\n switch (node.kind) {\n case 1 /* I18nNodeKind.ELEMENT */:\n case 2 /* I18nNodeKind.PLACEHOLDER */:\n {\n for (const childNode of node.children) {\n collectI18nViews(childNode);\n }\n break;\n }\n case 3 /* I18nNodeKind.ICU */:\n {\n for (const caseNodes of node.cases) {\n for (const caseNode of caseNodes) {\n collectI18nViews(caseNode);\n }\n }\n break;\n }\n }\n }\n // Traverse through the AST of each i18n block in the LView,\n // and collect every instruction index.\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n const tI18n = tView.data[i];\n if (!tI18n || !tI18n.ast) {\n continue;\n }\n for (const node of tI18n.ast) {\n collectI18nViews(node);\n }\n }\n return children.size === 0 ? null : children;\n}\n/**\n * Attempts to serialize i18n data for an i18n block, located at\n * the given view and instruction index.\n *\n * @param lView lView with the i18n block\n * @param index index of the i18n block in the lView\n * @param context the hydration context\n * @returns the i18n data, or null if there is no relevant data\n */\nfunction trySerializeI18nBlock(lView, index, context) {\n if (!context.isI18nHydrationEnabled) {\n return null;\n }\n const tView = lView[TVIEW];\n const tI18n = tView.data[index];\n if (!tI18n || !tI18n.ast) {\n return null;\n }\n const parentTNode = tView.data[tI18n.parentTNodeIndex];\n if (parentTNode && isI18nInSkipHydrationBlock(parentTNode)) {\n return null;\n }\n const serializedI18nBlock = {\n caseQueue: [],\n disconnectedNodes: new Set(),\n disjointNodes: new Set()\n };\n serializeI18nBlock(lView, serializedI18nBlock, context, tI18n.ast);\n return serializedI18nBlock.caseQueue.length === 0 && serializedI18nBlock.disconnectedNodes.size === 0 && serializedI18nBlock.disjointNodes.size === 0 ? null : serializedI18nBlock;\n}\nfunction serializeI18nBlock(lView, serializedI18nBlock, context, nodes) {\n let prevRNode = null;\n for (const node of nodes) {\n const nextRNode = serializeI18nNode(lView, serializedI18nBlock, context, node);\n if (nextRNode) {\n if (isDisjointNode(prevRNode, nextRNode)) {\n serializedI18nBlock.disjointNodes.add(node.index - HEADER_OFFSET);\n }\n prevRNode = nextRNode;\n }\n }\n return prevRNode;\n}\n/**\n * Helper to determine whether the given nodes are \"disjoint\".\n *\n * The i18n hydration process walks through the DOM and i18n nodes\n * at the same time. It expects the sibling DOM node of the previous\n * i18n node to be the first node of the next i18n node.\n *\n * In cases of content projection, this won't always be the case. So\n * when we detect that, we mark the node as \"disjoint\", ensuring that\n * we will serialize the path to the node. This way, when we hydrate the\n * i18n node, we will be able to find the correct place to start.\n */\nfunction isDisjointNode(prevNode, nextNode) {\n return prevNode && prevNode.nextSibling !== nextNode;\n}\n/**\n * Process the given i18n node for serialization.\n * Returns the first RNode for the i18n node to begin hydration.\n */\nfunction serializeI18nNode(lView, serializedI18nBlock, context, node) {\n const maybeRNode = unwrapRNode(lView[node.index]);\n if (!maybeRNode || isDisconnectedRNode(maybeRNode)) {\n serializedI18nBlock.disconnectedNodes.add(node.index - HEADER_OFFSET);\n return null;\n }\n const rNode = maybeRNode;\n switch (node.kind) {\n case 0 /* I18nNodeKind.TEXT */:\n {\n processTextNodeBeforeSerialization(context, rNode);\n break;\n }\n case 1 /* I18nNodeKind.ELEMENT */:\n case 2 /* I18nNodeKind.PLACEHOLDER */:\n {\n serializeI18nBlock(lView, serializedI18nBlock, context, node.children);\n break;\n }\n case 3 /* I18nNodeKind.ICU */:\n {\n const currentCase = lView[node.currentCaseLViewIndex];\n if (currentCase != null) {\n // i18n uses a negative value to signal a change to a new case, so we\n // need to invert it to get the proper value.\n const caseIdx = currentCase < 0 ? ~currentCase : currentCase;\n serializedI18nBlock.caseQueue.push(caseIdx);\n serializeI18nBlock(lView, serializedI18nBlock, context, node.cases[caseIdx]);\n }\n break;\n }\n }\n return getFirstNativeNodeForI18nNode(lView, node);\n}\n/**\n * Helper function to get the first native node to begin hydrating\n * the given i18n node.\n */\nfunction getFirstNativeNodeForI18nNode(lView, node) {\n const tView = lView[TVIEW];\n const maybeTNode = tView.data[node.index];\n if (isTNodeShape(maybeTNode)) {\n // If the node is backed by an actual TNode, we can simply delegate.\n return getFirstNativeNode(lView, maybeTNode);\n } else if (node.kind === 3 /* I18nNodeKind.ICU */) {\n // A nested ICU container won't have an actual TNode. In that case, we can use\n // an iterator to find the first child.\n const icuIterator = createIcuIterator(maybeTNode, lView);\n let rNode = icuIterator();\n // If the ICU container has no nodes, then we use the ICU anchor as the node.\n return rNode ?? unwrapRNode(lView[node.index]);\n } else {\n // Otherwise, the node is a text or trivial element in an ICU container,\n // and we can just use the RNode directly.\n return unwrapRNode(lView[node.index]) ?? null;\n }\n}\nfunction setCurrentNode(state, node) {\n state.currentNode = node;\n}\n/**\n * Marks the current RNode as the hydration root for the given\n * AST node.\n */\nfunction appendI18nNodeToCollection(context, state, astNode) {\n const noOffsetIndex = astNode.index - HEADER_OFFSET;\n const {\n disconnectedNodes\n } = context;\n const currentNode = state.currentNode;\n if (state.isConnected) {\n context.i18nNodes.set(noOffsetIndex, currentNode);\n // We expect the node to be connected, so ensure that it\n // is not in the set, regardless of whether we found it,\n // so that the downstream error handling can provide the\n // proper context.\n disconnectedNodes.delete(noOffsetIndex);\n } else {\n disconnectedNodes.add(noOffsetIndex);\n }\n return currentNode;\n}\n/**\n * Skip over some sibling nodes during hydration.\n *\n * Note: we use this instead of `siblingAfter` as it's expected that\n * sometimes we might encounter null nodes. In those cases, we want to\n * defer to downstream error handling to provide proper context.\n */\nfunction skipSiblingNodes(state, skip) {\n let currentNode = state.currentNode;\n for (let i = 0; i < skip; i++) {\n if (!currentNode) {\n break;\n }\n currentNode = currentNode?.nextSibling ?? null;\n }\n return currentNode;\n}\n/**\n * Fork the given state into a new state for hydrating children.\n */\nfunction forkHydrationState(state, nextNode) {\n return {\n currentNode: nextNode,\n isConnected: state.isConnected\n };\n}\nfunction prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex) {\n const hydrationInfo = lView[HYDRATION];\n if (!hydrationInfo) {\n return;\n }\n if (!isI18nHydrationSupportEnabled() || parentTNode && (isI18nInSkipHydrationBlock(parentTNode) || isDisconnectedNode$1(hydrationInfo, parentTNode.index - HEADER_OFFSET))) {\n return;\n }\n const tView = lView[TVIEW];\n const tI18n = tView.data[index];\n ngDevMode && assertDefined(tI18n, 'Expected i18n data to be present in a given TView slot during hydration');\n function findHydrationRoot() {\n if (isRootTemplateMessage(subTemplateIndex)) {\n // This is the root of an i18n block. In this case, our hydration root will\n // depend on where our parent TNode (i.e. the block with i18n applied) is\n // in the DOM.\n ngDevMode && assertDefined(parentTNode, 'Expected parent TNode while hydrating i18n root');\n const rootNode = locateNextRNode(hydrationInfo, tView, lView, parentTNode);\n // If this i18n block is attached to an <ng-container>, then we want to begin\n // hydrating directly with the RNode. Otherwise, for a TNode with a physical DOM\n // element, we want to recurse into the first child and begin there.\n return parentTNode.type & 8 /* TNodeType.ElementContainer */ ? rootNode : rootNode.firstChild;\n }\n // This is a nested template in an i18n block. In this case, the entire view\n // is translated, and part of a dehydrated view in a container. This means that\n // we can simply begin hydration with the first dehydrated child.\n return hydrationInfo?.firstChild;\n }\n const currentNode = findHydrationRoot();\n ngDevMode && assertDefined(currentNode, 'Expected root i18n node during hydration');\n const disconnectedNodes = initDisconnectedNodes(hydrationInfo) ?? new Set();\n const i18nNodes = hydrationInfo.i18nNodes ??= new Map();\n const caseQueue = hydrationInfo.data[I18N_DATA]?.[index - HEADER_OFFSET] ?? [];\n const dehydratedIcuData = hydrationInfo.dehydratedIcuData ??= new Map();\n collectI18nNodesFromDom({\n hydrationInfo,\n lView,\n i18nNodes,\n disconnectedNodes,\n caseQueue,\n dehydratedIcuData\n }, {\n currentNode,\n isConnected: true\n }, tI18n.ast);\n // Nodes from inactive ICU cases should be considered disconnected. We track them above\n // because they aren't (and shouldn't be) serialized. Since we may mutate or create a\n // new set, we need to be sure to write the expected value back to the DehydratedView.\n hydrationInfo.disconnectedNodes = disconnectedNodes.size === 0 ? null : disconnectedNodes;\n}\nfunction collectI18nNodesFromDom(context, state, nodeOrNodes) {\n if (Array.isArray(nodeOrNodes)) {\n let nextState = state;\n for (const node of nodeOrNodes) {\n // Whenever a node doesn't directly follow the previous RNode, it\n // is given a path. We need to resume collecting nodes from that location\n // until and unless we find another disjoint node.\n const targetNode = tryLocateRNodeByPath(context.hydrationInfo, context.lView, node.index - HEADER_OFFSET);\n if (targetNode) {\n nextState = forkHydrationState(state, targetNode);\n }\n collectI18nNodesFromDom(context, nextState, node);\n }\n } else {\n if (context.disconnectedNodes.has(nodeOrNodes.index - HEADER_OFFSET)) {\n // i18n nodes can be considered disconnected if e.g. they were projected.\n // In that case, we have to make sure to skip over them.\n return;\n }\n switch (nodeOrNodes.kind) {\n case 0 /* I18nNodeKind.TEXT */:\n {\n // Claim a text node for hydration\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n case 1 /* I18nNodeKind.ELEMENT */:\n {\n // Recurse into the current element's children...\n collectI18nNodesFromDom(context, forkHydrationState(state, state.currentNode?.firstChild ?? null), nodeOrNodes.children);\n // And claim the parent element itself.\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n case 2 /* I18nNodeKind.PLACEHOLDER */:\n {\n const noOffsetIndex = nodeOrNodes.index - HEADER_OFFSET;\n const {\n hydrationInfo\n } = context;\n const containerSize = getNgContainerSize(hydrationInfo, noOffsetIndex);\n switch (nodeOrNodes.type) {\n case 0 /* I18nPlaceholderType.ELEMENT */:\n {\n // Hydration expects to find the head of the element.\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n // A TNode for the node may not yet if we're hydrating during the first pass,\n // so use the serialized data to determine if this is an <ng-container>.\n if (isSerializedElementContainer(hydrationInfo, noOffsetIndex)) {\n // An <ng-container> doesn't have a physical DOM node, so we need to\n // continue hydrating from siblings.\n collectI18nNodesFromDom(context, state, nodeOrNodes.children);\n // Skip over the anchor element. It will be claimed by the\n // downstream container hydration.\n const nextNode = skipSiblingNodes(state, 1);\n setCurrentNode(state, nextNode);\n } else {\n // Non-container elements represent an actual node in the DOM, so we\n // need to continue hydration with the children, and claim the node.\n collectI18nNodesFromDom(context, forkHydrationState(state, state.currentNode?.firstChild ?? null), nodeOrNodes.children);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n // Elements can also be the anchor of a view container, so there may\n // be elements after this node that we need to skip.\n if (containerSize !== null) {\n // `+1` stands for an anchor node after all of the views in the container.\n const nextNode = skipSiblingNodes(state, containerSize + 1);\n setCurrentNode(state, nextNode);\n }\n }\n break;\n }\n case 1 /* I18nPlaceholderType.SUBTEMPLATE */:\n {\n ngDevMode && assertNotEqual(containerSize, null, 'Expected a container size while hydrating i18n subtemplate');\n // Hydration expects to find the head of the template.\n appendI18nNodeToCollection(context, state, nodeOrNodes);\n // Skip over all of the template children, as well as the anchor\n // node, since the template itself will handle them instead.\n const nextNode = skipSiblingNodes(state, containerSize + 1);\n setCurrentNode(state, nextNode);\n break;\n }\n }\n break;\n }\n case 3 /* I18nNodeKind.ICU */:\n {\n // If the current node is connected, we need to pop the next case from the\n // queue, so that the active case is also considered connected.\n const selectedCase = state.isConnected ? context.caseQueue.shift() : null;\n const childState = {\n currentNode: null,\n isConnected: false\n };\n // We traverse through each case, even if it's not active,\n // so that we correctly populate disconnected nodes.\n for (let i = 0; i < nodeOrNodes.cases.length; i++) {\n collectI18nNodesFromDom(context, i === selectedCase ? state : childState, nodeOrNodes.cases[i]);\n }\n if (selectedCase !== null) {\n // ICUs represent a branching state, and the selected case could be different\n // than what it was on the server. In that case, we need to be able to clean\n // up the nodes from the original case. To do that, we store the selected case.\n context.dehydratedIcuData.set(nodeOrNodes.index, {\n case: selectedCase,\n node: nodeOrNodes\n });\n }\n // Hydration expects to find the ICU anchor element.\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n }\n }\n}\nlet _claimDehydratedIcuCaseImpl = () => {\n // noop unless `enableClaimDehydratedIcuCaseImpl` is invoked\n};\n/**\n * Mark the case for the ICU node at the given index in the view as claimed,\n * allowing its nodes to be hydrated and not cleaned up.\n */\nfunction claimDehydratedIcuCase(lView, icuIndex, caseIndex) {\n _claimDehydratedIcuCaseImpl(lView, icuIndex, caseIndex);\n}\nfunction enableClaimDehydratedIcuCaseImpl() {\n _claimDehydratedIcuCaseImpl = claimDehydratedIcuCaseImpl;\n}\nfunction claimDehydratedIcuCaseImpl(lView, icuIndex, caseIndex) {\n const dehydratedIcuDataMap = lView[HYDRATION]?.dehydratedIcuData;\n if (dehydratedIcuDataMap) {\n const dehydratedIcuData = dehydratedIcuDataMap.get(icuIndex);\n if (dehydratedIcuData?.case === caseIndex) {\n // If the case we're attempting to claim matches the dehydrated one,\n // we remove it from the map to mark it as \"claimed.\"\n dehydratedIcuDataMap.delete(icuIndex);\n }\n }\n}\n/**\n * Clean up all i18n hydration data associated with the given view.\n */\nfunction cleanupI18nHydrationData(lView) {\n const hydrationInfo = lView[HYDRATION];\n if (hydrationInfo) {\n const {\n i18nNodes,\n dehydratedIcuData: dehydratedIcuDataMap\n } = hydrationInfo;\n if (i18nNodes && dehydratedIcuDataMap) {\n const renderer = lView[RENDERER];\n for (const dehydratedIcuData of dehydratedIcuDataMap.values()) {\n cleanupDehydratedIcuData(renderer, i18nNodes, dehydratedIcuData);\n }\n }\n hydrationInfo.i18nNodes = undefined;\n hydrationInfo.dehydratedIcuData = undefined;\n }\n}\nfunction cleanupDehydratedIcuData(renderer, i18nNodes, dehydratedIcuData) {\n for (const node of dehydratedIcuData.node.cases[dehydratedIcuData.case]) {\n const rNode = i18nNodes.get(node.index - HEADER_OFFSET);\n if (rNode) {\n nativeRemoveNode(renderer, rNode, false);\n }\n }\n}\n\n/**\n * Removes all dehydrated views from a given LContainer:\n * both in internal data structure, as well as removing\n * corresponding DOM nodes that belong to that dehydrated view.\n */\nfunction removeDehydratedViews(lContainer) {\n const views = lContainer[DEHYDRATED_VIEWS] ?? [];\n const parentLView = lContainer[PARENT];\n const renderer = parentLView[RENDERER];\n for (const view of views) {\n removeDehydratedView(view, renderer);\n ngDevMode && ngDevMode.dehydratedViewsRemoved++;\n }\n // Reset the value to an empty array to indicate that no\n // further processing of dehydrated views is needed for\n // this view container (i.e. do not trigger the lookup process\n // once again in case a `ViewContainerRef` is created later).\n lContainer[DEHYDRATED_VIEWS] = EMPTY_ARRAY;\n}\n/**\n * Helper function to remove all nodes from a dehydrated view.\n */\nfunction removeDehydratedView(dehydratedView, renderer) {\n let nodesRemoved = 0;\n let currentRNode = dehydratedView.firstChild;\n if (currentRNode) {\n const numNodes = dehydratedView.data[NUM_ROOT_NODES];\n while (nodesRemoved < numNodes) {\n ngDevMode && validateSiblingNodeExists(currentRNode);\n const nextSibling = currentRNode.nextSibling;\n nativeRemoveNode(renderer, currentRNode, false);\n currentRNode = nextSibling;\n nodesRemoved++;\n }\n }\n}\n/**\n * Walks over all views within this LContainer invokes dehydrated views\n * cleanup function for each one.\n */\nfunction cleanupLContainer(lContainer) {\n removeDehydratedViews(lContainer);\n // The host could be an LView if this container is on a component node.\n // In this case, descend into host LView for further cleanup. See also\n // LContainer[HOST] docs for additional information.\n const hostLView = lContainer[HOST];\n if (isLView(hostLView)) {\n cleanupLView(hostLView);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n cleanupLView(lContainer[i]);\n }\n}\n/**\n * Walks over `LContainer`s and components registered within\n * this LView and invokes dehydrated views cleanup function for each one.\n */\nfunction cleanupLView(lView) {\n cleanupI18nHydrationData(lView);\n const tView = lView[TVIEW];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (isLContainer(lView[i])) {\n const lContainer = lView[i];\n cleanupLContainer(lContainer);\n } else if (isLView(lView[i])) {\n // This is a component, enter the `cleanupLView` recursively.\n cleanupLView(lView[i]);\n }\n }\n}\n/**\n * Walks over all views registered within the ApplicationRef and removes\n * all dehydrated views from all `LContainer`s along the way.\n */\nfunction cleanupDehydratedViews(appRef) {\n const viewRefs = appRef._views;\n for (const viewRef of viewRefs) {\n const lNode = getLNodeForHydration(viewRef);\n // An `lView` might be `null` if a `ViewRef` represents\n // an embedded view (not a component view).\n if (lNode !== null && lNode[HOST] !== null) {\n if (isLView(lNode)) {\n cleanupLView(lNode);\n } else {\n // Cleanup in all views within this view container\n cleanupLContainer(lNode);\n }\n ngDevMode && ngDevMode.dehydratedViewsCleanupRuns++;\n }\n }\n}\n\n/**\n * Given a current DOM node and a serialized information about the views\n * in a container, walks over the DOM structure, collecting the list of\n * dehydrated views.\n */\nfunction locateDehydratedViewsInContainer(currentRNode, serializedViews) {\n const dehydratedViews = [];\n for (const serializedView of serializedViews) {\n // Repeats a view multiple times as needed, based on the serialized information\n // (for example, for *ngFor-produced views).\n for (let i = 0; i < (serializedView[MULTIPLIER] ?? 1); i++) {\n const view = {\n data: serializedView,\n firstChild: null\n };\n if (serializedView[NUM_ROOT_NODES] > 0) {\n // Keep reference to the first node in this view,\n // so it can be accessed while invoking template instructions.\n view.firstChild = currentRNode;\n // Move over to the next node after this view, which can\n // either be a first node of the next view or an anchor comment\n // node after the last view in a container.\n currentRNode = siblingAfter(serializedView[NUM_ROOT_NODES], currentRNode);\n }\n dehydratedViews.push(view);\n }\n }\n return [currentRNode, dehydratedViews];\n}\n/**\n * Reference to a function that searches for a matching dehydrated views\n * stored on a given lContainer.\n * Returns `null` by default, when hydration is not enabled.\n */\nlet _findMatchingDehydratedViewImpl = () => null;\n/**\n * Retrieves the next dehydrated view from the LContainer and verifies that\n * it matches a given template id (from the TView that was used to create this\n * instance of a view). If the id doesn't match, that means that we are in an\n * unexpected state and can not complete the reconciliation process. Thus,\n * all dehydrated views from this LContainer are removed (including corresponding\n * DOM nodes) and the rendering is performed as if there were no dehydrated views\n * in this container.\n */\nfunction findMatchingDehydratedViewImpl(lContainer, template) {\n const views = lContainer[DEHYDRATED_VIEWS];\n if (!template || views === null || views.length === 0) {\n return null;\n }\n const view = views[0];\n // Verify whether the first dehydrated view in the container matches\n // the template id passed to this function (that originated from a TView\n // that was used to create an instance of an embedded or component views.\n if (view.data[TEMPLATE_ID] === template) {\n // If the template id matches - extract the first view and return it.\n return views.shift();\n } else {\n // Otherwise, we are at the state when reconciliation can not be completed,\n // thus we remove all dehydrated views within this container (remove them\n // from internal data structures as well as delete associated elements from\n // the DOM tree).\n removeDehydratedViews(lContainer);\n return null;\n }\n}\nfunction enableFindMatchingDehydratedViewImpl() {\n _findMatchingDehydratedViewImpl = findMatchingDehydratedViewImpl;\n}\nfunction findMatchingDehydratedView(lContainer, template) {\n return _findMatchingDehydratedViewImpl(lContainer, template);\n}\n\n/**\n * Injectable that is notified when an `LView` is made aware of changes to application state.\n */\nclass ChangeDetectionScheduler {}\n/** Token used to indicate if zoneless was enabled via provideZonelessChangeDetection(). */\nconst ZONELESS_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'Zoneless enabled' : '', {\n providedIn: 'root',\n factory: () => false\n});\n/** Token used to indicate `provideExperimentalZonelessChangeDetection` was used. */\nconst PROVIDED_ZONELESS = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'Zoneless provided' : '', {\n providedIn: 'root',\n factory: () => false\n});\nconst ZONELESS_SCHEDULER_DISABLED = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'scheduler disabled' : '');\n// TODO(atscott): Remove in v19. Scheduler should be done with runOutsideAngular.\nconst SCHEDULE_IN_ROOT_ZONE = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'run changes outside zone in root' : '');\n\n/**\n * Represents a component created by a `ComponentFactory`.\n * Provides access to the component instance and related objects,\n * and provides the means of destroying the instance.\n *\n * @publicApi\n */\nclass ComponentRef$1 {}\n/**\n * Base class for a factory that can create a component dynamically.\n * Instantiate a factory for a given type of component with `resolveComponentFactory()`.\n * Use the resulting `ComponentFactory.create()` method to create a component of that type.\n *\n * @publicApi\n *\n * @deprecated Angular no longer requires Component factories. Please use other APIs where\n * Component class can be used directly.\n */\nclass ComponentFactory$1 {}\nfunction noComponentFactoryError(component) {\n const error = Error(`No component factory found for ${stringify(component)}.`);\n error[ERROR_COMPONENT] = component;\n return error;\n}\nconst ERROR_COMPONENT = 'ngComponent';\nfunction getComponent(error) {\n return error[ERROR_COMPONENT];\n}\nclass _NullComponentFactoryResolver {\n resolveComponentFactory(component) {\n throw noComponentFactoryError(component);\n }\n}\n/**\n * A simple registry that maps `Components` to generated `ComponentFactory` classes\n * that can be used to create instances of components.\n * Use to obtain the factory for a given component type,\n * then use the factory's `create()` method to create a component of that type.\n *\n * Note: since v13, dynamic component creation via\n * [`ViewContainerRef.createComponent`](api/core/ViewContainerRef#createComponent)\n * does **not** require resolving component factory: component class can be used directly.\n *\n * @publicApi\n *\n * @deprecated Angular no longer requires Component factories. Please use other APIs where\n * Component class can be used directly.\n */\nclass ComponentFactoryResolver$1 {\n static {\n this.NULL = new _NullComponentFactoryResolver();\n }\n}\n\n/**\n * Creates and initializes a custom renderer that implements the `Renderer2` base class.\n *\n * @publicApi\n */\nclass RendererFactory2 {}\n/**\n * Extend this base class to implement custom rendering. By default, Angular\n * renders a template into DOM. You can use custom rendering to intercept\n * rendering calls, or to render to something other than DOM.\n *\n * Create your custom renderer using `RendererFactory2`.\n *\n * Use a custom renderer to bypass Angular's templating and\n * make custom UI changes that can't be expressed declaratively.\n * For example if you need to set a property or an attribute whose name is\n * not statically known, use the `setProperty()` or\n * `setAttribute()` method.\n *\n * @publicApi\n */\nclass Renderer2 {\n constructor() {\n /**\n * If null or undefined, the view engine won't call it.\n * This is used as a performance optimization for production mode.\n */\n this.destroyNode = null;\n }\n /**\n * @internal\n * @nocollapse\n */\n static {\n this.__NG_ELEMENT_ID__ = () => injectRenderer2();\n }\n}\n/** Injects a Renderer2 for the current component. */\nfunction injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];\n}\n\n/**\n * Sanitizer is used by the views to sanitize potentially dangerous values.\n *\n * @publicApi\n */\nclass Sanitizer {\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: Sanitizer,\n providedIn: 'root',\n factory: () => null\n });\n }\n}\nfunction isModuleWithProviders(value) {\n return value.ngModule !== undefined;\n}\nfunction isNgModule(value) {\n return !!getNgModuleDef(value);\n}\nfunction isPipe(value) {\n return !!getPipeDef$1(value);\n}\nfunction isDirective(value) {\n return !!getDirectiveDef(value);\n}\nfunction isComponent(value) {\n return !!getComponentDef(value);\n}\nfunction getDependencyTypeForError(type) {\n if (getComponentDef(type)) return 'component';\n if (getDirectiveDef(type)) return 'directive';\n if (getPipeDef$1(type)) return 'pipe';\n return 'type';\n}\nfunction verifyStandaloneImport(depType, importingType) {\n if (isForwardRef(depType)) {\n depType = resolveForwardRef(depType);\n if (!depType) {\n throw new Error(`Expected forwardRef function, imported from \"${stringifyForError(importingType)}\", to return a standalone entity or NgModule but got \"${stringifyForError(depType) || depType}\".`);\n }\n }\n if (getNgModuleDef(depType) == null) {\n const def = getComponentDef(depType) || getDirectiveDef(depType) || getPipeDef$1(depType);\n if (def != null) {\n // if a component, directive or pipe is imported make sure that it is standalone\n if (!def.standalone) {\n throw new Error(`The \"${stringifyForError(depType)}\" ${getDependencyTypeForError(depType)}, imported from \"${stringifyForError(importingType)}\", is not standalone. Did you forget to add the standalone: true flag?`);\n }\n } else {\n // it can be either a module with provider or an unknown (not annotated) type\n if (isModuleWithProviders(depType)) {\n throw new Error(`A module with providers was imported from \"${stringifyForError(importingType)}\". Modules with providers are not supported in standalone components imports.`);\n } else {\n throw new Error(`The \"${stringifyForError(depType)}\" type, imported from \"${stringifyForError(importingType)}\", must be a standalone component / directive / pipe or an NgModule. Did you forget to add the required @Component / @Directive / @Pipe or @NgModule annotation?`);\n }\n }\n }\n}\n\n/**\n * Indicates whether to use the runtime dependency tracker for scope calculation in JIT compilation.\n * The value \"false\" means the old code path based on patching scope info into the types will be\n * used.\n *\n * @deprecated For migration purposes only, to be removed soon.\n */\nconst USE_RUNTIME_DEPS_TRACKER_FOR_JIT = true;\n/**\n * An implementation of DepsTrackerApi which will be used for JIT and local compilation.\n */\nclass DepsTracker {\n constructor() {\n this.ownerNgModule = new Map();\n this.ngModulesWithSomeUnresolvedDecls = new Set();\n this.ngModulesScopeCache = new Map();\n this.standaloneComponentsScopeCache = new Map();\n }\n /**\n * Attempts to resolve ng module's forward ref declarations as much as possible and add them to\n * the `ownerNgModule` map. This method normally should be called after the initial parsing when\n * all the forward refs are resolved (e.g., when trying to render a component)\n */\n resolveNgModulesDecls() {\n if (this.ngModulesWithSomeUnresolvedDecls.size === 0) {\n return;\n }\n for (const moduleType of this.ngModulesWithSomeUnresolvedDecls) {\n const def = getNgModuleDef(moduleType);\n if (def?.declarations) {\n for (const decl of maybeUnwrapFn(def.declarations)) {\n if (isComponent(decl)) {\n this.ownerNgModule.set(decl, moduleType);\n }\n }\n }\n }\n this.ngModulesWithSomeUnresolvedDecls.clear();\n }\n /** @override */\n getComponentDependencies(type, rawImports) {\n this.resolveNgModulesDecls();\n const def = getComponentDef(type);\n if (def === null) {\n throw new Error(`Attempting to get component dependencies for a type that is not a component: ${type}`);\n }\n if (def.standalone) {\n const scope = this.getStandaloneComponentScope(type, rawImports);\n if (scope.compilation.isPoisoned) {\n return {\n dependencies: []\n };\n }\n return {\n dependencies: [...scope.compilation.directives, ...scope.compilation.pipes, ...scope.compilation.ngModules]\n };\n } else {\n if (!this.ownerNgModule.has(type)) {\n // This component is orphan! No need to handle the error since the component rendering\n // pipeline (e.g., view_container_ref) will check for this error based on configs.\n return {\n dependencies: []\n };\n }\n const scope = this.getNgModuleScope(this.ownerNgModule.get(type));\n if (scope.compilation.isPoisoned) {\n return {\n dependencies: []\n };\n }\n return {\n dependencies: [...scope.compilation.directives, ...scope.compilation.pipes]\n };\n }\n }\n /**\n * @override\n * This implementation does not make use of param scopeInfo since it assumes the scope info is\n * already added to the type itself through methods like {@link ɵɵsetNgModuleScope}\n */\n registerNgModule(type, scopeInfo) {\n if (!isNgModule(type)) {\n throw new Error(`Attempting to register a Type which is not NgModule as NgModule: ${type}`);\n }\n // Lazily process the NgModules later when needed.\n this.ngModulesWithSomeUnresolvedDecls.add(type);\n }\n /** @override */\n clearScopeCacheFor(type) {\n this.ngModulesScopeCache.delete(type);\n this.standaloneComponentsScopeCache.delete(type);\n }\n /** @override */\n getNgModuleScope(type) {\n if (this.ngModulesScopeCache.has(type)) {\n return this.ngModulesScopeCache.get(type);\n }\n const scope = this.computeNgModuleScope(type);\n this.ngModulesScopeCache.set(type, scope);\n return scope;\n }\n /** Compute NgModule scope afresh. */\n computeNgModuleScope(type) {\n const def = getNgModuleDef(type, true);\n const scope = {\n exported: {\n directives: new Set(),\n pipes: new Set()\n },\n compilation: {\n directives: new Set(),\n pipes: new Set()\n }\n };\n // Analyzing imports\n for (const imported of maybeUnwrapFn(def.imports)) {\n if (isNgModule(imported)) {\n const importedScope = this.getNgModuleScope(imported);\n // When this module imports another, the imported module's exported directives and pipes\n // are added to the compilation scope of this module.\n addSet(importedScope.exported.directives, scope.compilation.directives);\n addSet(importedScope.exported.pipes, scope.compilation.pipes);\n } else if (isStandalone(imported)) {\n if (isDirective(imported) || isComponent(imported)) {\n scope.compilation.directives.add(imported);\n } else if (isPipe(imported)) {\n scope.compilation.pipes.add(imported);\n } else {\n // The standalone thing is neither a component nor a directive nor a pipe ... (what?)\n throw new RuntimeError(1000 /* RuntimeErrorCode.RUNTIME_DEPS_INVALID_IMPORTED_TYPE */, 'The standalone imported type is neither a component nor a directive nor a pipe');\n }\n } else {\n // The import is neither a module nor a module-with-providers nor a standalone thing. This\n // is going to be an error. So we short circuit.\n scope.compilation.isPoisoned = true;\n break;\n }\n }\n // Analyzing declarations\n if (!scope.compilation.isPoisoned) {\n for (const decl of maybeUnwrapFn(def.declarations)) {\n // Cannot declare another NgModule or a standalone thing\n if (isNgModule(decl) || isStandalone(decl)) {\n scope.compilation.isPoisoned = true;\n break;\n }\n if (isPipe(decl)) {\n scope.compilation.pipes.add(decl);\n } else {\n // decl is either a directive or a component. The component may not yet have the ɵcmp due\n // to async compilation.\n scope.compilation.directives.add(decl);\n }\n }\n }\n // Analyzing exports\n for (const exported of maybeUnwrapFn(def.exports)) {\n if (isNgModule(exported)) {\n // When this module exports another, the exported module's exported directives and pipes\n // are added to both the compilation and exported scopes of this module.\n const exportedScope = this.getNgModuleScope(exported);\n // Based on the current logic there is no way to have poisoned exported scope. So no need to\n // check for it.\n addSet(exportedScope.exported.directives, scope.exported.directives);\n addSet(exportedScope.exported.pipes, scope.exported.pipes);\n // Some test toolings which run in JIT mode depend on this behavior that the exported scope\n // should also be present in the compilation scope, even though AoT does not support this\n // and it is also in odds with NgModule metadata definitions. Without this some tests in\n // Google will fail.\n addSet(exportedScope.exported.directives, scope.compilation.directives);\n addSet(exportedScope.exported.pipes, scope.compilation.pipes);\n } else if (isPipe(exported)) {\n scope.exported.pipes.add(exported);\n } else {\n scope.exported.directives.add(exported);\n }\n }\n return scope;\n }\n /** @override */\n getStandaloneComponentScope(type, rawImports) {\n if (this.standaloneComponentsScopeCache.has(type)) {\n return this.standaloneComponentsScopeCache.get(type);\n }\n const ans = this.computeStandaloneComponentScope(type, rawImports);\n this.standaloneComponentsScopeCache.set(type, ans);\n return ans;\n }\n computeStandaloneComponentScope(type, rawImports) {\n const ans = {\n compilation: {\n // Standalone components are always able to self-reference.\n directives: new Set([type]),\n pipes: new Set(),\n ngModules: new Set()\n }\n };\n for (const rawImport of flatten(rawImports ?? [])) {\n const imported = resolveForwardRef(rawImport);\n try {\n verifyStandaloneImport(imported, type);\n } catch (e) {\n // Short-circuit if an import is not valid\n ans.compilation.isPoisoned = true;\n return ans;\n }\n if (isNgModule(imported)) {\n ans.compilation.ngModules.add(imported);\n const importedScope = this.getNgModuleScope(imported);\n // Short-circuit if an imported NgModule has corrupted exported scope.\n if (importedScope.exported.isPoisoned) {\n ans.compilation.isPoisoned = true;\n return ans;\n }\n addSet(importedScope.exported.directives, ans.compilation.directives);\n addSet(importedScope.exported.pipes, ans.compilation.pipes);\n } else if (isPipe(imported)) {\n ans.compilation.pipes.add(imported);\n } else if (isDirective(imported) || isComponent(imported)) {\n ans.compilation.directives.add(imported);\n } else {\n // The imported thing is not module/pipe/directive/component, so we error and short-circuit\n // here\n ans.compilation.isPoisoned = true;\n return ans;\n }\n }\n return ans;\n }\n /** @override */\n isOrphanComponent(cmp) {\n const def = getComponentDef(cmp);\n if (!def || def.standalone) {\n return false;\n }\n this.resolveNgModulesDecls();\n return !this.ownerNgModule.has(cmp);\n }\n}\nfunction addSet(sourceSet, targetSet) {\n for (const m of sourceSet) {\n targetSet.add(m);\n }\n}\n/** The deps tracker to be used in the current Angular app in dev mode. */\nconst depsTracker = new DepsTracker();\nconst TEST_ONLY = {\n DepsTracker\n};\n\n/**\n * Compute the static styling (class/style) from `TAttributes`.\n *\n * This function should be called during `firstCreatePass` only.\n *\n * @param tNode The `TNode` into which the styling information should be loaded.\n * @param attrs `TAttributes` containing the styling information.\n * @param writeToHost Where should the resulting static styles be written?\n * - `false` Write to `TNode.stylesWithoutHost` / `TNode.classesWithoutHost`\n * - `true` Write to `TNode.styles` / `TNode.classes`\n */\nfunction computeStaticStyling(tNode, attrs, writeToHost) {\n ngDevMode && assertFirstCreatePass(getTView(), 'Expecting to be called in first template pass only');\n let styles = writeToHost ? tNode.styles : null;\n let classes = writeToHost ? tNode.classes : null;\n let mode = 0;\n if (attrs !== null) {\n for (let i = 0; i < attrs.length; i++) {\n const value = attrs[i];\n if (typeof value === 'number') {\n mode = value;\n } else if (mode == 1 /* AttributeMarker.Classes */) {\n classes = concatStringsWithSpace(classes, value);\n } else if (mode == 2 /* AttributeMarker.Styles */) {\n const style = value;\n const styleValue = attrs[++i];\n styles = concatStringsWithSpace(styles, style + ': ' + styleValue + ';');\n }\n }\n }\n writeToHost ? tNode.styles = styles : tNode.stylesWithoutHost = styles;\n writeToHost ? tNode.classes = classes : tNode.classesWithoutHost = classes;\n}\nclass ComponentFactoryResolver extends ComponentFactoryResolver$1 {\n /**\n * @param ngModule The NgModuleRef to which all resolved factories are bound.\n */\n constructor(ngModule) {\n super();\n this.ngModule = ngModule;\n }\n resolveComponentFactory(component) {\n ngDevMode && assertComponentType(component);\n const componentDef = getComponentDef(component);\n return new ComponentFactory(componentDef, this.ngModule);\n }\n}\nfunction toRefArray(map, isInputMap) {\n const array = [];\n for (const publicName in map) {\n if (!map.hasOwnProperty(publicName)) {\n continue;\n }\n const value = map[publicName];\n if (value === undefined) {\n continue;\n }\n const isArray = Array.isArray(value);\n const propName = isArray ? value[0] : value;\n const flags = isArray ? value[1] : InputFlags.None;\n if (isInputMap) {\n array.push({\n propName: propName,\n templateName: publicName,\n isSignal: (flags & InputFlags.SignalBased) !== 0\n });\n } else {\n array.push({\n propName: propName,\n templateName: publicName\n });\n }\n }\n return array;\n}\nfunction getNamespace(elementName) {\n const name = elementName.toLowerCase();\n return name === 'svg' ? SVG_NAMESPACE : name === 'math' ? MATH_ML_NAMESPACE : null;\n}\n/**\n * ComponentFactory interface implementation.\n */\nclass ComponentFactory extends ComponentFactory$1 {\n get inputs() {\n const componentDef = this.componentDef;\n const inputTransforms = componentDef.inputTransforms;\n const refArray = toRefArray(componentDef.inputs, true);\n if (inputTransforms !== null) {\n for (const input of refArray) {\n if (inputTransforms.hasOwnProperty(input.propName)) {\n input.transform = inputTransforms[input.propName];\n }\n }\n }\n return refArray;\n }\n get outputs() {\n return toRefArray(this.componentDef.outputs, false);\n }\n /**\n * @param componentDef The component definition.\n * @param ngModule The NgModuleRef to which the factory is bound.\n */\n constructor(componentDef, ngModule) {\n super();\n this.componentDef = componentDef;\n this.ngModule = ngModule;\n this.componentType = componentDef.type;\n this.selector = stringifyCSSSelectorList(componentDef.selectors);\n this.ngContentSelectors = componentDef.ngContentSelectors ? componentDef.ngContentSelectors : [];\n this.isBoundToModule = !!ngModule;\n }\n create(injector, projectableNodes, rootSelectorOrNode, environmentInjector) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n // Check if the component is orphan\n if (ngDevMode && (typeof ngJitMode === 'undefined' || ngJitMode) && this.componentDef.debugInfo?.forbidOrphanRendering) {\n if (depsTracker.isOrphanComponent(this.componentType)) {\n throw new RuntimeError(1001 /* RuntimeErrorCode.RUNTIME_DEPS_ORPHAN_COMPONENT */, `Orphan component found! Trying to render the component ${debugStringifyTypeForError(this.componentType)} without first loading the NgModule that declares it. It is recommended to make this component standalone in order to avoid this error. If this is not possible now, import the component's NgModule in the appropriate NgModule, or the standalone component in which you are trying to render this component. If this is a lazy import, load the NgModule lazily as well and use its module injector.`);\n }\n }\n environmentInjector = environmentInjector || this.ngModule;\n let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ? environmentInjector : environmentInjector?.injector;\n if (realEnvironmentInjector && this.componentDef.getStandaloneInjector !== null) {\n realEnvironmentInjector = this.componentDef.getStandaloneInjector(realEnvironmentInjector) || realEnvironmentInjector;\n }\n const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;\n const rendererFactory = rootViewInjector.get(RendererFactory2, null);\n if (rendererFactory === null) {\n throw new RuntimeError(407 /* RuntimeErrorCode.RENDERER_NOT_FOUND */, ngDevMode && 'Angular was not able to inject a renderer (RendererFactory2). ' + 'Likely this is due to a broken DI hierarchy. ' + 'Make sure that any injector used to create this component has a correct parent.');\n }\n const sanitizer = rootViewInjector.get(Sanitizer, null);\n const changeDetectionScheduler = rootViewInjector.get(ChangeDetectionScheduler, null);\n const environment = {\n rendererFactory,\n sanitizer,\n // We don't use inline effects (yet).\n inlineEffectRunner: null,\n changeDetectionScheduler\n };\n const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);\n // Determine a tag name used for creating host elements when this component is created\n // dynamically. Default to 'div' if this component did not specify any tag name in its\n // selector.\n const elementName = this.componentDef.selectors[0][0] || 'div';\n const hostRNode = rootSelectorOrNode ? locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation, rootViewInjector) : createElementNode(hostRenderer, elementName, getNamespace(elementName));\n let rootFlags = 512 /* LViewFlags.IsRoot */;\n if (this.componentDef.signals) {\n rootFlags |= 4096 /* LViewFlags.SignalView */;\n } else if (!this.componentDef.onPush) {\n rootFlags |= 16 /* LViewFlags.CheckAlways */;\n }\n let hydrationInfo = null;\n if (hostRNode !== null) {\n hydrationInfo = retrieveHydrationInfo(hostRNode, rootViewInjector, true /* isRootView */);\n }\n // Create the root view. Uses empty TView and ContentTemplate.\n const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null, null);\n const rootLView = createLView(null, rootTView, null, rootFlags, null, null, environment, hostRenderer, rootViewInjector, null, hydrationInfo);\n // rootView is the parent when bootstrapping\n // TODO(misko): it looks like we are entering view here but we don't really need to as\n // `renderView` does that. However as the code is written it is needed because\n // `createRootComponentView` and `createRootComponent` both read global state. Fixing those\n // issues would allow us to drop this.\n enterView(rootLView);\n let component;\n let tElementNode;\n let componentView = null;\n try {\n const rootComponentDef = this.componentDef;\n let rootDirectives;\n let hostDirectiveDefs = null;\n if (rootComponentDef.findHostDirectiveDefs) {\n rootDirectives = [];\n hostDirectiveDefs = new Map();\n rootComponentDef.findHostDirectiveDefs(rootComponentDef, rootDirectives, hostDirectiveDefs);\n rootDirectives.push(rootComponentDef);\n ngDevMode && assertNoDuplicateDirectives(rootDirectives);\n } else {\n rootDirectives = [rootComponentDef];\n }\n const hostTNode = createRootComponentTNode(rootLView, hostRNode);\n componentView = createRootComponentView(hostTNode, hostRNode, rootComponentDef, rootDirectives, rootLView, environment, hostRenderer);\n tElementNode = getTNode(rootTView, HEADER_OFFSET);\n // TODO(crisbeto): in practice `hostRNode` should always be defined, but there are some\n // tests where the renderer is mocked out and `undefined` is returned. We should update the\n // tests so that this check can be removed.\n if (hostRNode) {\n setRootNodeAttributes(hostRenderer, rootComponentDef, hostRNode, rootSelectorOrNode);\n }\n if (projectableNodes !== undefined) {\n projectNodes(tElementNode, this.ngContentSelectors, projectableNodes);\n }\n // TODO: should LifecycleHooksFeature and other host features be generated by the compiler\n // and executed here? Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref\n component = createRootComponent(componentView, rootComponentDef, rootDirectives, hostDirectiveDefs, rootLView, [LifecycleHooksFeature]);\n renderView(rootTView, rootLView, null);\n } catch (e) {\n // Stop tracking the views if creation failed since\n // the consumer won't have a way to dereference them.\n if (componentView !== null) {\n unregisterLView(componentView);\n }\n unregisterLView(rootLView);\n throw e;\n } finally {\n leaveView();\n }\n return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n}\n/**\n * Represents an instance of a Component created via a {@link ComponentFactory}.\n *\n * `ComponentRef` provides access to the Component Instance as well other objects related to this\n * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}\n * method.\n *\n */\nclass ComponentRef extends ComponentRef$1 {\n constructor(componentType, instance, location, _rootLView, _tNode) {\n super();\n this.location = location;\n this._rootLView = _rootLView;\n this._tNode = _tNode;\n this.previousInputValues = null;\n this.instance = instance;\n this.hostView = this.changeDetectorRef = new ViewRef$1(_rootLView, undefined /* _cdRefInjectingView */, false /* notifyErrorHandler */);\n this.componentType = componentType;\n }\n setInput(name, value) {\n const inputData = this._tNode.inputs;\n let dataValue;\n if (inputData !== null && (dataValue = inputData[name])) {\n this.previousInputValues ??= new Map();\n // Do not set the input if it is the same as the last value\n // This behavior matches `bindingUpdated` when binding inputs in templates.\n if (this.previousInputValues.has(name) && Object.is(this.previousInputValues.get(name), value)) {\n return;\n }\n const lView = this._rootLView;\n setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);\n this.previousInputValues.set(name, value);\n const childComponentLView = getComponentLViewByIndex(this._tNode.index, lView);\n markViewDirty(childComponentLView, 1 /* NotificationSource.SetInput */);\n } else {\n if (ngDevMode) {\n const cmpNameForError = stringifyForError(this.componentType);\n let message = `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;\n message += `Make sure that the '${name}' property is annotated with @Input() or a mapped @Input('${name}') exists.`;\n reportUnknownPropertyError(message);\n }\n }\n }\n get injector() {\n return new NodeInjector(this._tNode, this._rootLView);\n }\n destroy() {\n this.hostView.destroy();\n }\n onDestroy(callback) {\n this.hostView.onDestroy(callback);\n }\n}\n/** Creates a TNode that can be used to instantiate a root component. */\nfunction createRootComponentTNode(lView, rNode) {\n const tView = lView[TVIEW];\n const index = HEADER_OFFSET;\n ngDevMode && assertIndexInRange(lView, index);\n lView[index] = rNode;\n // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at\n // the same time we want to communicate the debug `TNode` that this is a special `TNode`\n // representing a host element.\n return getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);\n}\n/**\n * Creates the root component view and the root component node.\n *\n * @param hostRNode Render host element.\n * @param rootComponentDef ComponentDef\n * @param rootView The parent view where the host node is stored\n * @param rendererFactory Factory to be used for creating child renderers.\n * @param hostRenderer The current renderer\n * @param sanitizer The sanitizer, if provided\n *\n * @returns Component view created\n */\nfunction createRootComponentView(tNode, hostRNode, rootComponentDef, rootDirectives, rootView, environment, hostRenderer) {\n const tView = rootView[TVIEW];\n applyRootComponentStyling(rootDirectives, tNode, hostRNode, hostRenderer);\n // Hydration info is on the host element and needs to be retrieved\n // and passed to the component LView.\n let hydrationInfo = null;\n if (hostRNode !== null) {\n hydrationInfo = retrieveHydrationInfo(hostRNode, rootView[INJECTOR]);\n }\n const viewRenderer = environment.rendererFactory.createRenderer(hostRNode, rootComponentDef);\n let lViewFlags = 16 /* LViewFlags.CheckAlways */;\n if (rootComponentDef.signals) {\n lViewFlags = 4096 /* LViewFlags.SignalView */;\n } else if (rootComponentDef.onPush) {\n lViewFlags = 64 /* LViewFlags.Dirty */;\n }\n const componentView = createLView(rootView, getOrCreateComponentTView(rootComponentDef), null, lViewFlags, rootView[tNode.index], tNode, environment, viewRenderer, null, null, hydrationInfo);\n if (tView.firstCreatePass) {\n markAsComponentHost(tView, tNode, rootDirectives.length - 1);\n }\n addToViewTree(rootView, componentView);\n // Store component view at node index, with node as the HOST\n return rootView[tNode.index] = componentView;\n}\n/** Sets up the styling information on a root component. */\nfunction applyRootComponentStyling(rootDirectives, tNode, rNode, hostRenderer) {\n for (const def of rootDirectives) {\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);\n }\n if (tNode.mergedAttrs !== null) {\n computeStaticStyling(tNode, tNode.mergedAttrs, true);\n if (rNode !== null) {\n setupStaticAttributes(hostRenderer, rNode, tNode);\n }\n }\n}\n/**\n * Creates a root component and sets it up with features and host bindings.Shared by\n * renderComponent() and ViewContainerRef.createComponent().\n */\nfunction createRootComponent(componentView, rootComponentDef, rootDirectives, hostDirectiveDefs, rootLView, hostFeatures) {\n const rootTNode = getCurrentTNode();\n ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');\n const tView = rootLView[TVIEW];\n const native = getNativeByTNode(rootTNode, rootLView);\n initializeDirectives(tView, rootLView, rootTNode, rootDirectives, null, hostDirectiveDefs);\n for (let i = 0; i < rootDirectives.length; i++) {\n const directiveIndex = rootTNode.directiveStart + i;\n const directiveInstance = getNodeInjectable(rootLView, tView, directiveIndex, rootTNode);\n attachPatchData(directiveInstance, rootLView);\n }\n invokeDirectivesHostBindings(tView, rootLView, rootTNode);\n if (native) {\n attachPatchData(native, rootLView);\n }\n // We're guaranteed for the `componentOffset` to be positive here\n // since a root component always matches a component def.\n ngDevMode && assertGreaterThan(rootTNode.componentOffset, -1, 'componentOffset must be great than -1');\n const component = getNodeInjectable(rootLView, tView, rootTNode.directiveStart + rootTNode.componentOffset, rootTNode);\n componentView[CONTEXT] = rootLView[CONTEXT] = component;\n if (hostFeatures !== null) {\n for (const feature of hostFeatures) {\n feature(component, rootComponentDef);\n }\n }\n // We want to generate an empty QueryList for root content queries for backwards\n // compatibility with ViewEngine.\n executeContentQueries(tView, rootTNode, rootLView);\n return component;\n}\n/** Sets the static attributes on a root component. */\nfunction setRootNodeAttributes(hostRenderer, componentDef, hostRNode, rootSelectorOrNode) {\n if (rootSelectorOrNode) {\n // The placeholder will be replaced with the actual version at build time.\n setUpAttributes(hostRenderer, hostRNode, ['ng-version', '18.2.10']);\n } else {\n // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`\n // is not defined), also apply attributes and classes extracted from component selector.\n // Extract attributes and classes from the first selector only to match VE behavior.\n const {\n attrs,\n classes\n } = extractAttrsAndClassesFromSelector(componentDef.selectors[0]);\n if (attrs) {\n setUpAttributes(hostRenderer, hostRNode, attrs);\n }\n if (classes && classes.length > 0) {\n writeDirectClass(hostRenderer, hostRNode, classes.join(' '));\n }\n }\n}\n/** Projects the `projectableNodes` that were specified when creating a root component. */\nfunction projectNodes(tNode, ngContentSelectors, projectableNodes) {\n const projection = tNode.projection = [];\n for (let i = 0; i < ngContentSelectors.length; i++) {\n const nodesforSlot = projectableNodes[i];\n // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade\n // case). Here we do normalize passed data structure to be an array of arrays to avoid\n // complex checks down the line.\n // We also normalize the length of the passed in projectable nodes (to match the number of\n // <ng-container> slots defined by a component).\n projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);\n }\n}\n/**\n * Used to enable lifecycle hooks on the root component.\n *\n * Include this feature when calling `renderComponent` if the root component\n * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't\n * be called properly.\n *\n * Example:\n *\n * ```\n * renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});\n * ```\n */\nfunction LifecycleHooksFeature() {\n const tNode = getCurrentTNode();\n ngDevMode && assertDefined(tNode, 'TNode is required');\n registerPostOrderHooks(getLView()[TVIEW], tNode);\n}\n\n/**\n * Represents a container where one or more views can be attached to a component.\n *\n * Can contain *host views* (created by instantiating a\n * component with the `createComponent()` method), and *embedded views*\n * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).\n *\n * A view container instance can contain other view containers,\n * creating a view hierarchy.\n *\n * @usageNotes\n *\n * The example below demonstrates how the `createComponent` function can be used\n * to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef,\n * so that it gets included into change detection cycles.\n *\n * Note: the example uses standalone components, but the function can also be used for\n * non-standalone components (declared in an NgModule) as well.\n *\n * ```typescript\n * @Component({\n * standalone: true,\n * selector: 'dynamic',\n * template: `<span>This is a content of a dynamic component.</span>`,\n * })\n * class DynamicComponent {\n * vcr = inject(ViewContainerRef);\n * }\n *\n * @Component({\n * standalone: true,\n * selector: 'app',\n * template: `<main>Hi! This is the main content.</main>`,\n * })\n * class AppComponent {\n * vcr = inject(ViewContainerRef);\n *\n * ngAfterViewInit() {\n * const compRef = this.vcr.createComponent(DynamicComponent);\n * compRef.changeDetectorRef.detectChanges();\n * }\n * }\n * ```\n *\n * @see {@link ComponentRef}\n * @see {@link EmbeddedViewRef}\n *\n * @publicApi\n */\nclass ViewContainerRef {\n /**\n * @internal\n * @nocollapse\n */\n static {\n this.__NG_ELEMENT_ID__ = injectViewContainerRef;\n }\n}\n/**\n * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef\n * already exists, retrieves the existing ViewContainerRef.\n *\n * @returns The ViewContainerRef instance to use\n */\nfunction injectViewContainerRef() {\n const previousTNode = getCurrentTNode();\n return createContainerRef(previousTNode, getLView());\n}\nconst VE_ViewContainerRef = ViewContainerRef;\n// TODO(alxhub): cleaning up this indirection triggers a subtle bug in Closure in g3. Once the fix\n// for that lands, this can be cleaned up.\nconst R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {\n constructor(_lContainer, _hostTNode, _hostLView) {\n super();\n this._lContainer = _lContainer;\n this._hostTNode = _hostTNode;\n this._hostLView = _hostLView;\n }\n get element() {\n return createElementRef(this._hostTNode, this._hostLView);\n }\n get injector() {\n return new NodeInjector(this._hostTNode, this._hostLView);\n }\n /** @deprecated No replacement */\n get parentInjector() {\n const parentLocation = getParentInjectorLocation(this._hostTNode, this._hostLView);\n if (hasParentInjector(parentLocation)) {\n const parentView = getParentInjectorView(parentLocation, this._hostLView);\n const injectorIndex = getParentInjectorIndex(parentLocation);\n ngDevMode && assertNodeInjector(parentView, injectorIndex);\n const parentTNode = parentView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];\n return new NodeInjector(parentTNode, parentView);\n } else {\n return new NodeInjector(null, this._hostLView);\n }\n }\n clear() {\n while (this.length > 0) {\n this.remove(this.length - 1);\n }\n }\n get(index) {\n const viewRefs = getViewRefs(this._lContainer);\n return viewRefs !== null && viewRefs[index] || null;\n }\n get length() {\n return this._lContainer.length - CONTAINER_HEADER_OFFSET;\n }\n createEmbeddedView(templateRef, context, indexOrOptions) {\n let index;\n let injector;\n if (typeof indexOrOptions === 'number') {\n index = indexOrOptions;\n } else if (indexOrOptions != null) {\n index = indexOrOptions.index;\n injector = indexOrOptions.injector;\n }\n const dehydratedView = findMatchingDehydratedView(this._lContainer, templateRef.ssrId);\n const viewRef = templateRef.createEmbeddedViewImpl(context || {}, injector, dehydratedView);\n this.insertImpl(viewRef, index, shouldAddViewToDom(this._hostTNode, dehydratedView));\n return viewRef;\n }\n createComponent(componentFactoryOrType, indexOrOptions, injector, projectableNodes, environmentInjector) {\n const isComponentFactory = componentFactoryOrType && !isType(componentFactoryOrType);\n let index;\n // This function supports 2 signatures and we need to handle options correctly for both:\n // 1. When first argument is a Component type. This signature also requires extra\n // options to be provided as object (more ergonomic option).\n // 2. First argument is a Component factory. In this case extra options are represented as\n // positional arguments. This signature is less ergonomic and will be deprecated.\n if (isComponentFactory) {\n if (ngDevMode) {\n assertEqual(typeof indexOrOptions !== 'object', true, 'It looks like Component factory was provided as the first argument ' + 'and an options object as the second argument. This combination of arguments ' + 'is incompatible. You can either change the first argument to provide Component ' + 'type or change the second argument to be a number (representing an index at ' + \"which to insert the new component's host view into this container)\");\n }\n index = indexOrOptions;\n } else {\n if (ngDevMode) {\n assertDefined(getComponentDef(componentFactoryOrType), `Provided Component class doesn't contain Component definition. ` + `Please check whether provided class has @Component decorator.`);\n assertEqual(typeof indexOrOptions !== 'number', true, 'It looks like Component type was provided as the first argument ' + \"and a number (representing an index at which to insert the new component's \" + 'host view into this container as the second argument. This combination of arguments ' + 'is incompatible. Please use an object as the second argument instead.');\n }\n const options = indexOrOptions || {};\n if (ngDevMode && options.environmentInjector && options.ngModuleRef) {\n throwError(`Cannot pass both environmentInjector and ngModuleRef options to createComponent().`);\n }\n index = options.index;\n injector = options.injector;\n projectableNodes = options.projectableNodes;\n environmentInjector = options.environmentInjector || options.ngModuleRef;\n }\n const componentFactory = isComponentFactory ? componentFactoryOrType : new ComponentFactory(getComponentDef(componentFactoryOrType));\n const contextInjector = injector || this.parentInjector;\n // If an `NgModuleRef` is not provided explicitly, try retrieving it from the DI tree.\n if (!environmentInjector && componentFactory.ngModule == null) {\n // For the `ComponentFactory` case, entering this logic is very unlikely, since we expect that\n // an instance of a `ComponentFactory`, resolved via `ComponentFactoryResolver` would have an\n // `ngModule` field. This is possible in some test scenarios and potentially in some JIT-based\n // use-cases. For the `ComponentFactory` case we preserve backwards-compatibility and try\n // using a provided injector first, then fall back to the parent injector of this\n // `ViewContainerRef` instance.\n //\n // For the factory-less case, it's critical to establish a connection with the module\n // injector tree (by retrieving an instance of an `NgModuleRef` and accessing its injector),\n // so that a component can use DI tokens provided in MgModules. For this reason, we can not\n // rely on the provided injector, since it might be detached from the DI tree (for example, if\n // it was created via `Injector.create` without specifying a parent injector, or if an\n // injector is retrieved from an `NgModuleRef` created via `createNgModule` using an\n // NgModule outside of a module tree). Instead, we always use `ViewContainerRef`'s parent\n // injector, which is normally connected to the DI tree, which includes module injector\n // subtree.\n const _injector = isComponentFactory ? contextInjector : this.parentInjector;\n // DO NOT REFACTOR. The code here used to have a `injector.get(NgModuleRef, null) ||\n // undefined` expression which seems to cause internal google apps to fail. This is documented\n // in the following internal bug issue: go/b/142967802\n const result = _injector.get(EnvironmentInjector, null);\n if (result) {\n environmentInjector = result;\n }\n }\n const componentDef = getComponentDef(componentFactory.componentType ?? {});\n const dehydratedView = findMatchingDehydratedView(this._lContainer, componentDef?.id ?? null);\n const rNode = dehydratedView?.firstChild ?? null;\n const componentRef = componentFactory.create(contextInjector, projectableNodes, rNode, environmentInjector);\n this.insertImpl(componentRef.hostView, index, shouldAddViewToDom(this._hostTNode, dehydratedView));\n return componentRef;\n }\n insert(viewRef, index) {\n return this.insertImpl(viewRef, index, true);\n }\n insertImpl(viewRef, index, addToDOM) {\n const lView = viewRef._lView;\n if (ngDevMode && viewRef.destroyed) {\n throw new Error('Cannot insert a destroyed View in a ViewContainer!');\n }\n if (viewAttachedToContainer(lView)) {\n // If view is already attached, detach it first so we clean up references appropriately.\n const prevIdx = this.indexOf(viewRef);\n // A view might be attached either to this or a different container. The `prevIdx` for\n // those cases will be:\n // equal to -1 for views attached to this ViewContainerRef\n // >= 0 for views attached to a different ViewContainerRef\n if (prevIdx !== -1) {\n this.detach(prevIdx);\n } else {\n const prevLContainer = lView[PARENT];\n ngDevMode && assertEqual(isLContainer(prevLContainer), true, 'An attached view should have its PARENT point to a container.');\n // We need to re-create a R3ViewContainerRef instance since those are not stored on\n // LView (nor anywhere else).\n const prevVCRef = new R3ViewContainerRef(prevLContainer, prevLContainer[T_HOST], prevLContainer[PARENT]);\n prevVCRef.detach(prevVCRef.indexOf(viewRef));\n }\n }\n // Logical operation of adding `LView` to `LContainer`\n const adjustedIdx = this._adjustIndex(index);\n const lContainer = this._lContainer;\n addLViewToLContainer(lContainer, lView, adjustedIdx, addToDOM);\n viewRef.attachToViewContainerRef();\n addToArray(getOrCreateViewRefs(lContainer), adjustedIdx, viewRef);\n return viewRef;\n }\n move(viewRef, newIndex) {\n if (ngDevMode && viewRef.destroyed) {\n throw new Error('Cannot move a destroyed View in a ViewContainer!');\n }\n return this.insert(viewRef, newIndex);\n }\n indexOf(viewRef) {\n const viewRefsArr = getViewRefs(this._lContainer);\n return viewRefsArr !== null ? viewRefsArr.indexOf(viewRef) : -1;\n }\n remove(index) {\n const adjustedIdx = this._adjustIndex(index, -1);\n const detachedView = detachView(this._lContainer, adjustedIdx);\n if (detachedView) {\n // Before destroying the view, remove it from the container's array of `ViewRef`s.\n // This ensures the view container length is updated before calling\n // `destroyLView`, which could recursively call view container methods that\n // rely on an accurate container length.\n // (e.g. a method on this view container being called by a child directive's OnDestroy\n // lifecycle hook)\n removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx);\n destroyLView(detachedView[TVIEW], detachedView);\n }\n }\n detach(index) {\n const adjustedIdx = this._adjustIndex(index, -1);\n const view = detachView(this._lContainer, adjustedIdx);\n const wasDetached = view && removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx) != null;\n return wasDetached ? new ViewRef$1(view) : null;\n }\n _adjustIndex(index, shift = 0) {\n if (index == null) {\n return this.length + shift;\n }\n if (ngDevMode) {\n assertGreaterThan(index, -1, `ViewRef index must be positive, got ${index}`);\n // +1 because it's legal to insert at the end.\n assertLessThan(index, this.length + 1 + shift, 'index');\n }\n return index;\n }\n};\nfunction getViewRefs(lContainer) {\n return lContainer[VIEW_REFS];\n}\nfunction getOrCreateViewRefs(lContainer) {\n return lContainer[VIEW_REFS] || (lContainer[VIEW_REFS] = []);\n}\n/**\n * Creates a ViewContainerRef and stores it on the injector.\n *\n * @param hostTNode The node that is requesting a ViewContainerRef\n * @param hostLView The view to which the node belongs\n * @returns The ViewContainerRef instance to use\n */\nfunction createContainerRef(hostTNode, hostLView) {\n ngDevMode && assertTNodeType(hostTNode, 12 /* TNodeType.AnyContainer */ | 3 /* TNodeType.AnyRNode */);\n let lContainer;\n const slotValue = hostLView[hostTNode.index];\n if (isLContainer(slotValue)) {\n // If the host is a container, we don't need to create a new LContainer\n lContainer = slotValue;\n } else {\n // An LContainer anchor can not be `null`, but we set it here temporarily\n // and update to the actual value later in this function (see\n // `_locateOrCreateAnchorNode`).\n lContainer = createLContainer(slotValue, hostLView, null, hostTNode);\n hostLView[hostTNode.index] = lContainer;\n addToViewTree(hostLView, lContainer);\n }\n _locateOrCreateAnchorNode(lContainer, hostLView, hostTNode, slotValue);\n return new R3ViewContainerRef(lContainer, hostTNode, hostLView);\n}\n/**\n * Creates and inserts a comment node that acts as an anchor for a view container.\n *\n * If the host is a regular element, we have to insert a comment node manually which will\n * be used as an anchor when inserting elements. In this specific case we use low-level DOM\n * manipulation to insert it.\n */\nfunction insertAnchorNode(hostLView, hostTNode) {\n const renderer = hostLView[RENDERER];\n ngDevMode && ngDevMode.rendererCreateComment++;\n const commentNode = renderer.createComment(ngDevMode ? 'container' : '');\n const hostNative = getNativeByTNode(hostTNode, hostLView);\n const parentOfHostNative = nativeParentNode(renderer, hostNative);\n nativeInsertBefore(renderer, parentOfHostNative, commentNode, nativeNextSibling(renderer, hostNative), false);\n return commentNode;\n}\nlet _locateOrCreateAnchorNode = createAnchorNode;\nlet _populateDehydratedViewsInLContainer = () => false; // noop by default\n/**\n * Looks up dehydrated views that belong to a given LContainer and populates\n * this information into the `LContainer[DEHYDRATED_VIEWS]` slot. When running\n * in client-only mode, this function is a noop.\n *\n * @param lContainer LContainer that should be populated.\n * @param tNode Corresponding TNode.\n * @param hostLView LView that hosts LContainer.\n * @returns a boolean flag that indicates whether a populating operation\n * was successful. The operation might be unsuccessful in case is has completed\n * previously, we are rendering in client-only mode or this content is located\n * in a skip hydration section.\n */\nfunction populateDehydratedViewsInLContainer(lContainer, tNode, hostLView) {\n return _populateDehydratedViewsInLContainer(lContainer, tNode, hostLView);\n}\n/**\n * Regular creation mode: an anchor is created and\n * assigned to the `lContainer[NATIVE]` slot.\n */\nfunction createAnchorNode(lContainer, hostLView, hostTNode, slotValue) {\n // We already have a native element (anchor) set, return.\n if (lContainer[NATIVE]) return;\n let commentNode;\n // If the host is an element container, the native host element is guaranteed to be a\n // comment and we can reuse that comment as anchor element for the new LContainer.\n // The comment node in question is already part of the DOM structure so we don't need to append\n // it again.\n if (hostTNode.type & 8 /* TNodeType.ElementContainer */) {\n commentNode = unwrapRNode(slotValue);\n } else {\n commentNode = insertAnchorNode(hostLView, hostTNode);\n }\n lContainer[NATIVE] = commentNode;\n}\n/**\n * Hydration logic that looks up all dehydrated views in this container\n * and puts them into `lContainer[DEHYDRATED_VIEWS]` slot.\n *\n * @returns a boolean flag that indicates whether a populating operation\n * was successful. The operation might be unsuccessful in case is has completed\n * previously, we are rendering in client-only mode or this content is located\n * in a skip hydration section.\n */\nfunction populateDehydratedViewsInLContainerImpl(lContainer, tNode, hostLView) {\n // We already have a native element (anchor) set and the process\n // of finding dehydrated views happened (so the `lContainer[DEHYDRATED_VIEWS]`\n // is not null), exit early.\n if (lContainer[NATIVE] && lContainer[DEHYDRATED_VIEWS]) {\n return true;\n }\n const hydrationInfo = hostLView[HYDRATION];\n const noOffsetIndex = tNode.index - HEADER_OFFSET;\n const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock(tNode) || isDisconnectedNode$1(hydrationInfo, noOffsetIndex);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return false;\n }\n // Hydration mode, looking up an anchor node and dehydrated views in DOM.\n const currentRNode = getSegmentHead(hydrationInfo, noOffsetIndex);\n const serializedViews = hydrationInfo.data[CONTAINERS]?.[noOffsetIndex];\n ngDevMode && assertDefined(serializedViews, 'Unexpected state: no hydration info available for a given TNode, ' + 'which represents a view container.');\n const [commentNode, dehydratedViews] = locateDehydratedViewsInContainer(currentRNode, serializedViews);\n if (ngDevMode) {\n validateMatchingNode(commentNode, Node.COMMENT_NODE, null, hostLView, tNode, true);\n // Do not throw in case this node is already claimed (thus `false` as a second\n // argument). If this container is created based on an `<ng-template>`, the comment\n // node would be already claimed from the `template` instruction. If an element acts\n // as an anchor (e.g. <div #vcRef>), a separate comment node would be created/located,\n // so we need to claim it here.\n markRNodeAsClaimedByHydration(commentNode, false);\n }\n lContainer[NATIVE] = commentNode;\n lContainer[DEHYDRATED_VIEWS] = dehydratedViews;\n return true;\n}\nfunction locateOrCreateAnchorNode(lContainer, hostLView, hostTNode, slotValue) {\n if (!_populateDehydratedViewsInLContainer(lContainer, hostTNode, hostLView)) {\n // Populating dehydrated views operation returned `false`, which indicates\n // that the logic was running in client-only mode, this an anchor comment\n // node should be created for this container.\n createAnchorNode(lContainer, hostLView, hostTNode, slotValue);\n }\n}\nfunction enableLocateOrCreateContainerRefImpl() {\n _locateOrCreateAnchorNode = locateOrCreateAnchorNode;\n _populateDehydratedViewsInLContainer = populateDehydratedViewsInLContainerImpl;\n}\nclass LQuery_ {\n constructor(queryList) {\n this.queryList = queryList;\n this.matches = null;\n }\n clone() {\n return new LQuery_(this.queryList);\n }\n setDirty() {\n this.queryList.setDirty();\n }\n}\nclass LQueries_ {\n constructor(queries = []) {\n this.queries = queries;\n }\n createEmbeddedView(tView) {\n const tQueries = tView.queries;\n if (tQueries !== null) {\n const noOfInheritedQueries = tView.contentQueries !== null ? tView.contentQueries[0] : tQueries.length;\n const viewLQueries = [];\n // An embedded view has queries propagated from a declaration view at the beginning of the\n // TQueries collection and up until a first content query declared in the embedded view. Only\n // propagated LQueries are created at this point (LQuery corresponding to declared content\n // queries will be instantiated from the content query instructions for each directive).\n for (let i = 0; i < noOfInheritedQueries; i++) {\n const tQuery = tQueries.getByIndex(i);\n const parentLQuery = this.queries[tQuery.indexInDeclarationView];\n viewLQueries.push(parentLQuery.clone());\n }\n return new LQueries_(viewLQueries);\n }\n return null;\n }\n insertView(tView) {\n this.dirtyQueriesWithMatches(tView);\n }\n detachView(tView) {\n this.dirtyQueriesWithMatches(tView);\n }\n finishViewCreation(tView) {\n this.dirtyQueriesWithMatches(tView);\n }\n dirtyQueriesWithMatches(tView) {\n for (let i = 0; i < this.queries.length; i++) {\n if (getTQuery(tView, i).matches !== null) {\n this.queries[i].setDirty();\n }\n }\n }\n}\nclass TQueryMetadata_ {\n constructor(predicate, flags, read = null) {\n this.flags = flags;\n this.read = read;\n // Compiler might not be able to pre-optimize and split multiple selectors.\n if (typeof predicate === 'string') {\n this.predicate = splitQueryMultiSelectors(predicate);\n } else {\n this.predicate = predicate;\n }\n }\n}\nclass TQueries_ {\n constructor(queries = []) {\n this.queries = queries;\n }\n elementStart(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView, 'Queries should collect results on the first template pass only');\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].elementStart(tView, tNode);\n }\n }\n elementEnd(tNode) {\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].elementEnd(tNode);\n }\n }\n embeddedTView(tNode) {\n let queriesForTemplateRef = null;\n for (let i = 0; i < this.length; i++) {\n const childQueryIndex = queriesForTemplateRef !== null ? queriesForTemplateRef.length : 0;\n const tqueryClone = this.getByIndex(i).embeddedTView(tNode, childQueryIndex);\n if (tqueryClone) {\n tqueryClone.indexInDeclarationView = i;\n if (queriesForTemplateRef !== null) {\n queriesForTemplateRef.push(tqueryClone);\n } else {\n queriesForTemplateRef = [tqueryClone];\n }\n }\n }\n return queriesForTemplateRef !== null ? new TQueries_(queriesForTemplateRef) : null;\n }\n template(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView, 'Queries should collect results on the first template pass only');\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].template(tView, tNode);\n }\n }\n getByIndex(index) {\n ngDevMode && assertIndexInRange(this.queries, index);\n return this.queries[index];\n }\n get length() {\n return this.queries.length;\n }\n track(tquery) {\n this.queries.push(tquery);\n }\n}\nclass TQuery_ {\n constructor(metadata, nodeIndex = -1) {\n this.metadata = metadata;\n this.matches = null;\n this.indexInDeclarationView = -1;\n this.crossesNgTemplate = false;\n /**\n * A flag indicating if a given query still applies to nodes it is crossing. We use this flag\n * (alongside with _declarationNodeIndex) to know when to stop applying content queries to\n * elements in a template.\n */\n this._appliesToNextNode = true;\n this._declarationNodeIndex = nodeIndex;\n }\n elementStart(tView, tNode) {\n if (this.isApplyingToNode(tNode)) {\n this.matchTNode(tView, tNode);\n }\n }\n elementEnd(tNode) {\n if (this._declarationNodeIndex === tNode.index) {\n this._appliesToNextNode = false;\n }\n }\n template(tView, tNode) {\n this.elementStart(tView, tNode);\n }\n embeddedTView(tNode, childQueryIndex) {\n if (this.isApplyingToNode(tNode)) {\n this.crossesNgTemplate = true;\n // A marker indicating a `<ng-template>` element (a placeholder for query results from\n // embedded views created based on this `<ng-template>`).\n this.addMatch(-tNode.index, childQueryIndex);\n return new TQuery_(this.metadata);\n }\n return null;\n }\n isApplyingToNode(tNode) {\n if (this._appliesToNextNode && (this.metadata.flags & 1 /* QueryFlags.descendants */) !== 1 /* QueryFlags.descendants */) {\n const declarationNodeIdx = this._declarationNodeIndex;\n let parent = tNode.parent;\n // Determine if a given TNode is a \"direct\" child of a node on which a content query was\n // declared (only direct children of query's host node can match with the descendants: false\n // option). There are 3 main use-case / conditions to consider here:\n // - <needs-target><i #target></i></needs-target>: here <i #target> parent node is a query\n // host node;\n // - <needs-target><ng-template [ngIf]=\"true\"><i #target></i></ng-template></needs-target>:\n // here <i #target> parent node is null;\n // - <needs-target><ng-container><i #target></i></ng-container></needs-target>: here we need\n // to go past `<ng-container>` to determine <i #target> parent node (but we shouldn't traverse\n // up past the query's host node!).\n while (parent !== null && parent.type & 8 /* TNodeType.ElementContainer */ && parent.index !== declarationNodeIdx) {\n parent = parent.parent;\n }\n return declarationNodeIdx === (parent !== null ? parent.index : -1);\n }\n return this._appliesToNextNode;\n }\n matchTNode(tView, tNode) {\n const predicate = this.metadata.predicate;\n if (Array.isArray(predicate)) {\n for (let i = 0; i < predicate.length; i++) {\n const name = predicate[i];\n this.matchTNodeWithReadOption(tView, tNode, getIdxOfMatchingSelector(tNode, name));\n // Also try matching the name to a provider since strings can be used as DI tokens too.\n this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, name, false, false));\n }\n } else {\n if (predicate === TemplateRef) {\n if (tNode.type & 4 /* TNodeType.Container */) {\n this.matchTNodeWithReadOption(tView, tNode, -1);\n }\n } else {\n this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, predicate, false, false));\n }\n }\n }\n matchTNodeWithReadOption(tView, tNode, nodeMatchIdx) {\n if (nodeMatchIdx !== null) {\n const read = this.metadata.read;\n if (read !== null) {\n if (read === ElementRef || read === ViewContainerRef || read === TemplateRef && tNode.type & 4 /* TNodeType.Container */) {\n this.addMatch(tNode.index, -2);\n } else {\n const directiveOrProviderIdx = locateDirectiveOrProvider(tNode, tView, read, false, false);\n if (directiveOrProviderIdx !== null) {\n this.addMatch(tNode.index, directiveOrProviderIdx);\n }\n }\n } else {\n this.addMatch(tNode.index, nodeMatchIdx);\n }\n }\n }\n addMatch(tNodeIdx, matchIdx) {\n if (this.matches === null) {\n this.matches = [tNodeIdx, matchIdx];\n } else {\n this.matches.push(tNodeIdx, matchIdx);\n }\n }\n}\n/**\n * Iterates over local names for a given node and returns directive index\n * (or -1 if a local name points to an element).\n *\n * @param tNode static data of a node to check\n * @param selector selector to match\n * @returns directive index, -1 or null if a selector didn't match any of the local names\n */\nfunction getIdxOfMatchingSelector(tNode, selector) {\n const localNames = tNode.localNames;\n if (localNames !== null) {\n for (let i = 0; i < localNames.length; i += 2) {\n if (localNames[i] === selector) {\n return localNames[i + 1];\n }\n }\n }\n return null;\n}\nfunction createResultByTNodeType(tNode, currentView) {\n if (tNode.type & (3 /* TNodeType.AnyRNode */ | 8 /* TNodeType.ElementContainer */)) {\n return createElementRef(tNode, currentView);\n } else if (tNode.type & 4 /* TNodeType.Container */) {\n return createTemplateRef(tNode, currentView);\n }\n return null;\n}\nfunction createResultForNode(lView, tNode, matchingIdx, read) {\n if (matchingIdx === -1) {\n // if read token and / or strategy is not specified, detect it using appropriate tNode type\n return createResultByTNodeType(tNode, lView);\n } else if (matchingIdx === -2) {\n // read a special token from a node injector\n return createSpecialToken(lView, tNode, read);\n } else {\n // read a token\n return getNodeInjectable(lView, lView[TVIEW], matchingIdx, tNode);\n }\n}\nfunction createSpecialToken(lView, tNode, read) {\n if (read === ElementRef) {\n return createElementRef(tNode, lView);\n } else if (read === TemplateRef) {\n return createTemplateRef(tNode, lView);\n } else if (read === ViewContainerRef) {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);\n return createContainerRef(tNode, lView);\n } else {\n ngDevMode && throwError(`Special token to read should be one of ElementRef, TemplateRef or ViewContainerRef but got ${stringify(read)}.`);\n }\n}\n/**\n * A helper function that creates query results for a given view. This function is meant to do the\n * processing once and only once for a given view instance (a set of results for a given view\n * doesn't change).\n */\nfunction materializeViewResults(tView, lView, tQuery, queryIndex) {\n const lQuery = lView[QUERIES].queries[queryIndex];\n if (lQuery.matches === null) {\n const tViewData = tView.data;\n const tQueryMatches = tQuery.matches;\n const result = [];\n for (let i = 0; tQueryMatches !== null && i < tQueryMatches.length; i += 2) {\n const matchedNodeIdx = tQueryMatches[i];\n if (matchedNodeIdx < 0) {\n // we at the <ng-template> marker which might have results in views created based on this\n // <ng-template> - those results will be in separate views though, so here we just leave\n // null as a placeholder\n result.push(null);\n } else {\n ngDevMode && assertIndexInRange(tViewData, matchedNodeIdx);\n const tNode = tViewData[matchedNodeIdx];\n result.push(createResultForNode(lView, tNode, tQueryMatches[i + 1], tQuery.metadata.read));\n }\n }\n lQuery.matches = result;\n }\n return lQuery.matches;\n}\n/**\n * A helper function that collects (already materialized) query results from a tree of views,\n * starting with a provided LView.\n */\nfunction collectQueryResults(tView, lView, queryIndex, result) {\n const tQuery = tView.queries.getByIndex(queryIndex);\n const tQueryMatches = tQuery.matches;\n if (tQueryMatches !== null) {\n const lViewResults = materializeViewResults(tView, lView, tQuery, queryIndex);\n for (let i = 0; i < tQueryMatches.length; i += 2) {\n const tNodeIdx = tQueryMatches[i];\n if (tNodeIdx > 0) {\n result.push(lViewResults[i / 2]);\n } else {\n const childQueryIndex = tQueryMatches[i + 1];\n const declarationLContainer = lView[-tNodeIdx];\n ngDevMode && assertLContainer(declarationLContainer);\n // collect matches for views inserted in this container\n for (let i = CONTAINER_HEADER_OFFSET; i < declarationLContainer.length; i++) {\n const embeddedLView = declarationLContainer[i];\n if (embeddedLView[DECLARATION_LCONTAINER] === embeddedLView[PARENT]) {\n collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);\n }\n }\n // collect matches for views created from this declaration container and inserted into\n // different containers\n if (declarationLContainer[MOVED_VIEWS] !== null) {\n const embeddedLViews = declarationLContainer[MOVED_VIEWS];\n for (let i = 0; i < embeddedLViews.length; i++) {\n const embeddedLView = embeddedLViews[i];\n collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);\n }\n }\n }\n }\n }\n return result;\n}\nfunction loadQueryInternal(lView, queryIndex) {\n ngDevMode && assertDefined(lView[QUERIES], 'LQueries should be defined when trying to load a query');\n ngDevMode && assertIndexInRange(lView[QUERIES].queries, queryIndex);\n return lView[QUERIES].queries[queryIndex].queryList;\n}\n/**\n * Creates a new instance of LQuery and returns its index in the collection of LQuery objects.\n *\n * @returns index in the collection of LQuery objects\n */\nfunction createLQuery(tView, lView, flags) {\n const queryList = new QueryList((flags & 4 /* QueryFlags.emitDistinctChangesOnly */) === 4 /* QueryFlags.emitDistinctChangesOnly */);\n storeCleanupWithContext(tView, lView, queryList, queryList.destroy);\n const lQueries = (lView[QUERIES] ??= new LQueries_()).queries;\n return lQueries.push(new LQuery_(queryList)) - 1;\n}\nfunction createViewQuery(predicate, flags, read) {\n ngDevMode && assertNumber(flags, 'Expecting flags');\n const tView = getTView();\n if (tView.firstCreatePass) {\n createTQuery(tView, new TQueryMetadata_(predicate, flags, read), -1);\n if ((flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */) {\n tView.staticViewQueries = true;\n }\n }\n return createLQuery(tView, getLView(), flags);\n}\nfunction createContentQuery(directiveIndex, predicate, flags, read) {\n ngDevMode && assertNumber(flags, 'Expecting flags');\n const tView = getTView();\n if (tView.firstCreatePass) {\n const tNode = getCurrentTNode();\n createTQuery(tView, new TQueryMetadata_(predicate, flags, read), tNode.index);\n saveContentQueryAndDirectiveIndex(tView, directiveIndex);\n if ((flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */) {\n tView.staticContentQueries = true;\n }\n }\n return createLQuery(tView, getLView(), flags);\n}\n/** Splits multiple selectors in the locator. */\nfunction splitQueryMultiSelectors(locator) {\n return locator.split(',').map(s => s.trim());\n}\nfunction createTQuery(tView, metadata, nodeIndex) {\n if (tView.queries === null) tView.queries = new TQueries_();\n tView.queries.track(new TQuery_(metadata, nodeIndex));\n}\nfunction saveContentQueryAndDirectiveIndex(tView, directiveIndex) {\n const tViewContentQueries = tView.contentQueries || (tView.contentQueries = []);\n const lastSavedDirectiveIndex = tViewContentQueries.length ? tViewContentQueries[tViewContentQueries.length - 1] : -1;\n if (directiveIndex !== lastSavedDirectiveIndex) {\n tViewContentQueries.push(tView.queries.length - 1, directiveIndex);\n }\n}\nfunction getTQuery(tView, index) {\n ngDevMode && assertDefined(tView.queries, 'TQueries must be defined to retrieve a TQuery');\n return tView.queries.getByIndex(index);\n}\n/**\n * A helper function collecting results from all the views where a given query was active.\n * @param lView\n * @param queryIndex\n */\nfunction getQueryResults(lView, queryIndex) {\n const tView = lView[TVIEW];\n const tQuery = getTQuery(tView, queryIndex);\n return tQuery.crossesNgTemplate ? collectQueryResults(tView, lView, queryIndex, []) : materializeViewResults(tView, lView, tQuery, queryIndex);\n}\nconst markedFeatures = new Set();\n// tslint:disable:ban\n/**\n * A guarded `performance.mark` for feature marking.\n *\n * This method exists because while all supported browser and node.js version supported by Angular\n * support performance.mark API. This is not the case for other environments such as JSDOM and\n * Cloudflare workers.\n */\nfunction performanceMarkFeature(feature) {\n if (markedFeatures.has(feature)) {\n return;\n }\n markedFeatures.add(feature);\n performance?.mark?.('mark_feature_usage', {\n detail: {\n feature\n }\n });\n}\n\n/**\n * Checks if the given `value` is a reactive `Signal`.\n */\nfunction isSignal(value) {\n return typeof value === 'function' && value[SIGNAL$1] !== undefined;\n}\n\n/** Symbol used distinguish `WritableSignal` from other non-writable signals and functions. */\nconst ɵWRITABLE_SIGNAL = /* @__PURE__ */Symbol('WRITABLE_SIGNAL');\n/**\n * Utility function used during template type checking to extract the value from a `WritableSignal`.\n * @codeGenApi\n */\nfunction ɵunwrapWritableSignal(value) {\n // Note: the function uses `WRITABLE_SIGNAL` as a brand instead of `WritableSignal<T>`,\n // because the latter incorrectly unwraps non-signal getter functions.\n return null;\n}\n/**\n * Create a `Signal` that can be set or updated directly.\n */\nfunction signal(initialValue, options) {\n performanceMarkFeature('NgSignals');\n const signalFn = createSignal$1(initialValue);\n const node = signalFn[SIGNAL$1];\n if (options?.equal) {\n node.equal = options.equal;\n }\n signalFn.set = newValue => signalSetFn$1(node, newValue);\n signalFn.update = updateFn => signalUpdateFn$1(node, updateFn);\n signalFn.asReadonly = signalAsReadonlyFn.bind(signalFn);\n if (ngDevMode) {\n signalFn.toString = () => `[Signal: ${signalFn()}]`;\n }\n return signalFn;\n}\nfunction signalAsReadonlyFn() {\n const node = this[SIGNAL$1];\n if (node.readonlyFn === undefined) {\n const readonlyFn = () => this();\n readonlyFn[SIGNAL$1] = node;\n node.readonlyFn = readonlyFn;\n }\n return node.readonlyFn;\n}\n/**\n * Checks if the given `value` is a writeable signal.\n */\nfunction isWritableSignal(value) {\n return isSignal(value) && typeof value.set === 'function';\n}\n\n/**\n * A signal factory function in charge of creating a new computed signal capturing query\n * results. This centralized creation function is used by all types of queries (child / children,\n * required / optional).\n *\n * @param firstOnly indicates if all or only the first result should be returned\n * @param required indicates if at least one result is required\n * @returns a read-only signal with query results\n */\nfunction createQuerySignalFn(firstOnly, required) {\n let node;\n const signalFn = createComputed$1(() => {\n // A dedicated signal that increments its value every time a query changes its dirty status. By\n // using this signal we can implement a query as computed and avoid creation of a specialized\n // reactive node type. Please note that a query gets marked dirty under the following\n // circumstances:\n // - a view (where a query is active) finished its first creation pass;\n // - a new view is inserted / deleted and it impacts query results.\n node._dirtyCounter();\n const value = refreshSignalQuery(node, firstOnly);\n if (required && value === undefined) {\n throw new RuntimeError(-951 /* RuntimeErrorCode.REQUIRED_QUERY_NO_VALUE */, ngDevMode && 'Child query result is required but no value is available.');\n }\n return value;\n });\n node = signalFn[SIGNAL$1];\n node._dirtyCounter = signal(0);\n node._flatValue = undefined;\n if (ngDevMode) {\n signalFn.toString = () => `[Query Signal]`;\n }\n return signalFn;\n}\nfunction createSingleResultOptionalQuerySignalFn() {\n return createQuerySignalFn( /* firstOnly */true, /* required */false);\n}\nfunction createSingleResultRequiredQuerySignalFn() {\n return createQuerySignalFn( /* firstOnly */true, /* required */true);\n}\nfunction createMultiResultQuerySignalFn() {\n return createQuerySignalFn( /* firstOnly */false, /* required */false);\n}\nfunction bindQueryToSignal(target, queryIndex) {\n const node = target[SIGNAL$1];\n node._lView = getLView();\n node._queryIndex = queryIndex;\n node._queryList = loadQueryInternal(node._lView, queryIndex);\n node._queryList.onDirty(() => node._dirtyCounter.update(v => v + 1));\n}\nfunction refreshSignalQuery(node, firstOnly) {\n const lView = node._lView;\n const queryIndex = node._queryIndex;\n // There are 2 conditions under which we want to return \"empty\" results instead of the ones\n // collected by a query:\n //\n // 1) a given query wasn't created yet (this is a period of time between the directive creation\n // and execution of the query creation function) - in this case a query doesn't exist yet and we\n // don't have any results to return.\n //\n // 2) we are in the process of constructing a view (the first\n // creation pass didn't finish) and a query might have partial results, but we don't want to\n // return those - instead we do delay results collection until all nodes had a chance of matching\n // and we can present consistent, \"atomic\" (on a view level) results.\n if (lView === undefined || queryIndex === undefined || lView[FLAGS] & 4 /* LViewFlags.CreationMode */) {\n return firstOnly ? undefined : EMPTY_ARRAY;\n }\n const queryList = loadQueryInternal(lView, queryIndex);\n const results = getQueryResults(lView, queryIndex);\n queryList.reset(results, unwrapElementRef);\n if (firstOnly) {\n return queryList.first;\n } else {\n // TODO: remove access to the private _changesDetected field by abstracting / removing usage of\n // QueryList in the signal-based queries (perf follow-up)\n const resultChanged = queryList._changesDetected;\n if (resultChanged || node._flatValue === undefined) {\n return node._flatValue = queryList.toArray();\n }\n return node._flatValue;\n }\n}\nfunction viewChildFn(locator, opts) {\n ngDevMode && assertInInjectionContext(viewChild);\n return createSingleResultOptionalQuerySignalFn();\n}\nfunction viewChildRequiredFn(locator, opts) {\n ngDevMode && assertInInjectionContext(viewChild);\n return createSingleResultRequiredQuerySignalFn();\n}\n/**\n * Initializes a view child query.\n *\n * Consider using `viewChild.required` for queries that should always match.\n *\n * @usageNotes\n * Create a child query in your component by declaring a\n * class field and initializing it with the `viewChild()` function.\n *\n * ```ts\n * @Component({template: '<div #el></div><my-component #cmp />'})\n * export class TestComponent {\n * divEl = viewChild<ElementRef>('el'); // Signal<ElementRef|undefined>\n * divElRequired = viewChild.required<ElementRef>('el'); // Signal<ElementRef>\n * cmp = viewChild(MyComponent); // Signal<MyComponent|undefined>\n * cmpRequired = viewChild.required(MyComponent); // Signal<MyComponent>\n * }\n * ```\n *\n * @developerPreview\n * @initializerApiFunction\n */\nconst viewChild = (() => {\n // Note: This may be considered a side-effect, but nothing will depend on\n // this assignment, unless this `viewChild` constant export is accessed. It's a\n // self-contained side effect that is local to the user facing `viewChild` export.\n viewChildFn.required = viewChildRequiredFn;\n return viewChildFn;\n})();\n/**\n * Initializes a view children query.\n *\n * Query results are represented as a signal of a read-only collection containing all matched\n * elements.\n *\n * @usageNotes\n * Create a children query in your component by declaring a\n * class field and initializing it with the `viewChildren()` function.\n *\n * ```ts\n * @Component({...})\n * export class TestComponent {\n * divEls = viewChildren<ElementRef>('el'); // Signal<ReadonlyArray<ElementRef>>\n * }\n * ```\n *\n * @initializerApiFunction\n * @developerPreview\n */\nfunction viewChildren(locator, opts) {\n ngDevMode && assertInInjectionContext(viewChildren);\n return createMultiResultQuerySignalFn();\n}\nfunction contentChildFn(locator, opts) {\n ngDevMode && assertInInjectionContext(contentChild);\n return createSingleResultOptionalQuerySignalFn();\n}\nfunction contentChildRequiredFn(locator, opts) {\n ngDevMode && assertInInjectionContext(contentChildren);\n return createSingleResultRequiredQuerySignalFn();\n}\n/**\n * Initializes a content child query. Consider using `contentChild.required` for queries that should\n * always match.\n *\n * @usageNotes\n * Create a child query in your component by declaring a\n * class field and initializing it with the `contentChild()` function.\n *\n * ```ts\n * @Component({...})\n * export class TestComponent {\n * headerEl = contentChild<ElementRef>('h'); // Signal<ElementRef|undefined>\n * headerElElRequired = contentChild.required<ElementRef>('h'); // Signal<ElementRef>\n * header = contentChild(MyHeader); // Signal<MyHeader|undefined>\n * headerRequired = contentChild.required(MyHeader); // Signal<MyHeader>\n * }\n * ```\n *\n * @initializerApiFunction\n * @developerPreview\n */\nconst contentChild = (() => {\n // Note: This may be considered a side-effect, but nothing will depend on\n // this assignment, unless this `viewChild` constant export is accessed. It's a\n // self-contained side effect that is local to the user facing `viewChild` export.\n contentChildFn.required = contentChildRequiredFn;\n return contentChildFn;\n})();\n/**\n * Initializes a content children query.\n *\n * Query results are represented as a signal of a read-only collection containing all matched\n * elements.\n *\n * @usageNotes\n * Create a children query in your component by declaring a\n * class field and initializing it with the `contentChildren()` function.\n *\n * ```ts\n * @Component({...})\n * export class TestComponent {\n * headerEl = contentChildren<ElementRef>('h'); // Signal<ReadonlyArray<ElementRef>>\n * }\n * ```\n *\n * @initializerApiFunction\n * @developerPreview\n */\nfunction contentChildren(locator, opts) {\n return createMultiResultQuerySignalFn();\n}\n\n/**\n * Creates a model signal.\n *\n * @param initialValue The initial value.\n * Can be set to {@link REQUIRED_UNSET_VALUE} for required model signals.\n * @param options Additional options for the model.\n */\nfunction createModelSignal(initialValue) {\n const node = Object.create(INPUT_SIGNAL_NODE);\n const emitterRef = new OutputEmitterRef();\n node.value = initialValue;\n function getter() {\n producerAccessed$1(node);\n assertModelSet(node.value);\n return node.value;\n }\n getter[SIGNAL$1] = node;\n getter.asReadonly = signalAsReadonlyFn.bind(getter);\n // TODO: Should we throw an error when updating a destroyed model?\n getter.set = newValue => {\n if (!node.equal(node.value, newValue)) {\n signalSetFn$1(node, newValue);\n emitterRef.emit(newValue);\n }\n };\n getter.update = updateFn => {\n assertModelSet(node.value);\n getter.set(updateFn(node.value));\n };\n getter.subscribe = emitterRef.subscribe.bind(emitterRef);\n getter.destroyRef = emitterRef.destroyRef;\n if (ngDevMode) {\n getter.toString = () => `[Model Signal: ${getter()}]`;\n }\n return getter;\n}\n/** Asserts that a model's value is set. */\nfunction assertModelSet(value) {\n if (value === REQUIRED_UNSET_VALUE) {\n throw new RuntimeError(952 /* RuntimeErrorCode.REQUIRED_MODEL_NO_VALUE */, ngDevMode && 'Model is required but no value is available yet.');\n }\n}\nfunction modelFunction(initialValue) {\n ngDevMode && assertInInjectionContext(model);\n return createModelSignal(initialValue);\n}\nfunction modelRequiredFunction() {\n ngDevMode && assertInInjectionContext(model);\n return createModelSignal(REQUIRED_UNSET_VALUE);\n}\n/**\n * `model` declares a writeable signal that is exposed as an input/output\n * pair on the containing directive.\n *\n * The input name is taken either from the class member or from the `alias` option.\n * The output name is generated by taking the input name and appending `Change`.\n *\n * @usageNotes\n *\n * To use `model()`, import the function from `@angular/core`.\n *\n * ```\n * import {model} from '@angular/core`;\n * ```\n *\n * Inside your component, introduce a new class member and initialize\n * it with a call to `model` or `model.required`.\n *\n * ```ts\n * @Directive({\n * ...\n * })\n * export class MyDir {\n * firstName = model<string>(); // ModelSignal<string|undefined>\n * lastName = model.required<string>(); // ModelSignal<string>\n * age = model(0); // ModelSignal<number>\n * }\n * ```\n *\n * Inside your component template, you can display the value of a `model`\n * by calling the signal.\n *\n * ```html\n * <span>{{firstName()}}</span>\n * ```\n *\n * Updating the `model` is equivalent to updating a writable signal.\n *\n * ```ts\n * updateName(newFirstName: string): void {\n * this.firstName.set(newFirstName);\n * }\n * ```\n *\n * @developerPreview\n * @initializerApiFunction\n */\nconst model = (() => {\n // Note: This may be considered a side-effect, but nothing will depend on\n // this assignment, unless this `model` constant export is accessed. It's a\n // self-contained side effect that is local to the user facing `model` export.\n modelFunction.required = modelRequiredFunction;\n return modelFunction;\n})();\n\n// Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not\n// explicitly set.\nconst emitDistinctChangesOnlyDefaultValue = true;\n/**\n * Base class for query metadata.\n *\n * @see {@link ContentChildren}\n * @see {@link ContentChild}\n * @see {@link ViewChildren}\n * @see {@link ViewChild}\n *\n * @publicApi\n */\nclass Query {}\n/**\n * ContentChildren decorator and metadata.\n *\n *\n * @Annotation\n * @publicApi\n */\nconst ContentChildren = makePropDecorator('ContentChildren', (selector, opts = {}) => ({\n selector,\n first: false,\n isViewQuery: false,\n descendants: false,\n emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue,\n ...opts\n}), Query);\n/**\n * ContentChild decorator and metadata.\n *\n *\n * @Annotation\n *\n * @publicApi\n */\nconst ContentChild = makePropDecorator('ContentChild', (selector, opts = {}) => ({\n selector,\n first: true,\n isViewQuery: false,\n descendants: true,\n ...opts\n}), Query);\n/**\n * ViewChildren decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst ViewChildren = makePropDecorator('ViewChildren', (selector, opts = {}) => ({\n selector,\n first: false,\n isViewQuery: true,\n descendants: true,\n emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue,\n ...opts\n}), Query);\n/**\n * ViewChild decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst ViewChild = makePropDecorator('ViewChild', (selector, opts) => ({\n selector,\n first: true,\n isViewQuery: true,\n descendants: true,\n ...opts\n}), Query);\n\n/**\n * Used to resolve resource URLs on `@Component` when used with JIT compilation.\n *\n * Example:\n * ```\n * @Component({\n * selector: 'my-comp',\n * templateUrl: 'my-comp.html', // This requires asynchronous resolution\n * })\n * class MyComponent{\n * }\n *\n * // Calling `renderComponent` will fail because `renderComponent` is a synchronous process\n * // and `MyComponent`'s `@Component.templateUrl` needs to be resolved asynchronously.\n *\n * // Calling `resolveComponentResources()` will resolve `@Component.templateUrl` into\n * // `@Component.template`, which allows `renderComponent` to proceed in a synchronous manner.\n *\n * // Use browser's `fetch()` function as the default resource resolution strategy.\n * resolveComponentResources(fetch).then(() => {\n * // After resolution all URLs have been converted into `template` strings.\n * renderComponent(MyComponent);\n * });\n *\n * ```\n *\n * NOTE: In AOT the resolution happens during compilation, and so there should be no need\n * to call this method outside JIT mode.\n *\n * @param resourceResolver a function which is responsible for returning a `Promise` to the\n * contents of the resolved URL. Browser's `fetch()` method is a good default implementation.\n */\nfunction resolveComponentResources(resourceResolver) {\n // Store all promises which are fetching the resources.\n const componentResolved = [];\n // Cache so that we don't fetch the same resource more than once.\n const urlMap = new Map();\n function cachedResourceResolve(url) {\n let promise = urlMap.get(url);\n if (!promise) {\n const resp = resourceResolver(url);\n urlMap.set(url, promise = resp.then(unwrapResponse));\n }\n return promise;\n }\n componentResourceResolutionQueue.forEach((component, type) => {\n const promises = [];\n if (component.templateUrl) {\n promises.push(cachedResourceResolve(component.templateUrl).then(template => {\n component.template = template;\n }));\n }\n const styles = typeof component.styles === 'string' ? [component.styles] : component.styles || [];\n component.styles = styles;\n if (component.styleUrl && component.styleUrls?.length) {\n throw new Error('@Component cannot define both `styleUrl` and `styleUrls`. ' + 'Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple');\n } else if (component.styleUrls?.length) {\n const styleOffset = component.styles.length;\n const styleUrls = component.styleUrls;\n component.styleUrls.forEach((styleUrl, index) => {\n styles.push(''); // pre-allocate array.\n promises.push(cachedResourceResolve(styleUrl).then(style => {\n styles[styleOffset + index] = style;\n styleUrls.splice(styleUrls.indexOf(styleUrl), 1);\n if (styleUrls.length == 0) {\n component.styleUrls = undefined;\n }\n }));\n });\n } else if (component.styleUrl) {\n promises.push(cachedResourceResolve(component.styleUrl).then(style => {\n styles.push(style);\n component.styleUrl = undefined;\n }));\n }\n const fullyResolved = Promise.all(promises).then(() => componentDefResolved(type));\n componentResolved.push(fullyResolved);\n });\n clearResolutionOfComponentResourcesQueue();\n return Promise.all(componentResolved).then(() => undefined);\n}\nlet componentResourceResolutionQueue = new Map();\n// Track when existing ɵcmp for a Type is waiting on resources.\nconst componentDefPendingResolution = new Set();\nfunction maybeQueueResolutionOfComponentResources(type, metadata) {\n if (componentNeedsResolution(metadata)) {\n componentResourceResolutionQueue.set(type, metadata);\n componentDefPendingResolution.add(type);\n }\n}\nfunction isComponentDefPendingResolution(type) {\n return componentDefPendingResolution.has(type);\n}\nfunction componentNeedsResolution(component) {\n return !!(component.templateUrl && !component.hasOwnProperty('template') || component.styleUrls && component.styleUrls.length || component.styleUrl);\n}\nfunction clearResolutionOfComponentResourcesQueue() {\n const old = componentResourceResolutionQueue;\n componentResourceResolutionQueue = new Map();\n return old;\n}\nfunction restoreComponentResolutionQueue(queue) {\n componentDefPendingResolution.clear();\n queue.forEach((_, type) => componentDefPendingResolution.add(type));\n componentResourceResolutionQueue = queue;\n}\nfunction isComponentResourceResolutionQueueEmpty() {\n return componentResourceResolutionQueue.size === 0;\n}\nfunction unwrapResponse(response) {\n return typeof response == 'string' ? response : response.text();\n}\nfunction componentDefResolved(type) {\n componentDefPendingResolution.delete(type);\n}\n\n/**\n * Map of module-id to the corresponding NgModule.\n */\nconst modules = new Map();\n/**\n * Whether to check for duplicate NgModule registrations.\n *\n * This can be disabled for testing.\n */\nlet checkForDuplicateNgModules = true;\nfunction assertSameOrNotExisting(id, type, incoming) {\n if (type && type !== incoming && checkForDuplicateNgModules) {\n throw new Error(`Duplicate module registered for ${id} - ${stringify(type)} vs ${stringify(type.name)}`);\n }\n}\n/**\n * Adds the given NgModule type to Angular's NgModule registry.\n *\n * This is generated as a side-effect of NgModule compilation. Note that the `id` is passed in\n * explicitly and not read from the NgModule definition. This is for two reasons: it avoids a\n * megamorphic read, and in JIT there's a chicken-and-egg problem where the NgModule may not be\n * fully resolved when it's registered.\n *\n * @codeGenApi\n */\nfunction registerNgModuleType(ngModuleType, id) {\n const existing = modules.get(id) || null;\n assertSameOrNotExisting(id, existing, ngModuleType);\n modules.set(id, ngModuleType);\n}\nfunction clearModulesForTest() {\n modules.clear();\n}\nfunction getRegisteredNgModuleType(id) {\n return modules.get(id);\n}\n/**\n * Control whether the NgModule registration system enforces that each NgModule type registered has\n * a unique id.\n *\n * This is useful for testing as the NgModule registry cannot be properly reset between tests with\n * Angular's current API.\n */\nfunction setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {\n checkForDuplicateNgModules = !allowDuplicates;\n}\n\n/**\n * Validation function invoked at runtime for each binding that might potentially\n * represent a security-sensitive attribute of an <iframe>.\n * See `IFRAME_SECURITY_SENSITIVE_ATTRS` in the\n * `packages/compiler/src/schema/dom_security_schema.ts` script for the full list\n * of such attributes.\n *\n * @codeGenApi\n */\nfunction ɵɵvalidateIframeAttribute(attrValue, tagName, attrName) {\n const lView = getLView();\n const tNode = getSelectedTNode();\n const element = getNativeByTNode(tNode, lView);\n // Restrict any dynamic bindings of security-sensitive attributes/properties\n // on an <iframe> for security reasons.\n if (tNode.type === 2 /* TNodeType.Element */ && tagName.toLowerCase() === 'iframe') {\n const iframe = element;\n // Unset previously applied `src` and `srcdoc` if we come across a situation when\n // a security-sensitive attribute is set later via an attribute/property binding.\n iframe.src = '';\n iframe.srcdoc = trustedHTMLFromString('');\n // Also remove the <iframe> from the document.\n nativeRemoveNode(lView[RENDERER], iframe);\n const errorMessage = ngDevMode && `Angular has detected that the \\`${attrName}\\` was applied ` + `as a binding to an <iframe>${getTemplateLocationDetails(lView)}. ` + `For security reasons, the \\`${attrName}\\` can be set on an <iframe> ` + `as a static attribute only. \\n` + `To fix this, switch the \\`${attrName}\\` binding to a static attribute ` + `in a template or in host bindings section.`;\n throw new RuntimeError(-910 /* RuntimeErrorCode.UNSAFE_IFRAME_ATTRS */, errorMessage);\n }\n return attrValue;\n}\nfunction getSuperType(type) {\n return Object.getPrototypeOf(type.prototype).constructor;\n}\n/**\n * Merges the definition from a super class to a sub class.\n * @param definition The definition that is a SubClass of another directive of component\n *\n * @codeGenApi\n */\nfunction ɵɵInheritDefinitionFeature(definition) {\n let superType = getSuperType(definition.type);\n let shouldInheritFields = true;\n const inheritanceChain = [definition];\n while (superType) {\n let superDef = undefined;\n if (isComponentDef(definition)) {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵcmp || superType.ɵdir;\n } else {\n if (superType.ɵcmp) {\n throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode && `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);\n }\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵdir;\n }\n if (superDef) {\n if (shouldInheritFields) {\n inheritanceChain.push(superDef);\n // Some fields in the definition may be empty, if there were no values to put in them that\n // would've justified object creation. Unwrap them if necessary.\n const writeableDef = definition;\n writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);\n writeableDef.inputTransforms = maybeUnwrapEmpty(definition.inputTransforms);\n writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);\n writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);\n // Merge hostBindings\n const superHostBindings = superDef.hostBindings;\n superHostBindings && inheritHostBindings(definition, superHostBindings);\n // Merge queries\n const superViewQuery = superDef.viewQuery;\n const superContentQueries = superDef.contentQueries;\n superViewQuery && inheritViewQuery(definition, superViewQuery);\n superContentQueries && inheritContentQueries(definition, superContentQueries);\n // Merge inputs and outputs\n mergeInputsWithTransforms(definition, superDef);\n fillProperties(definition.outputs, superDef.outputs);\n // Merge animations metadata.\n // If `superDef` is a Component, the `data` field is present (defaults to an empty object).\n if (isComponentDef(superDef) && superDef.data.animation) {\n // If super def is a Component, the `definition` is also a Component, since Directives can\n // not inherit Components (we throw an error above and cannot reach this code).\n const defData = definition.data;\n defData.animation = (defData.animation || []).concat(superDef.data.animation);\n }\n }\n // Run parent features\n const features = superDef.features;\n if (features) {\n for (let i = 0; i < features.length; i++) {\n const feature = features[i];\n if (feature && feature.ngInherit) {\n feature(definition);\n }\n // If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this\n // def already has all the necessary information inherited from its super class(es), so we\n // can stop merging fields from super classes. However we need to iterate through the\n // prototype chain to look for classes that might contain other \"features\" (like\n // NgOnChanges), which we should invoke for the original `definition`. We set the\n // `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance\n // logic and only invoking functions from the \"features\" list.\n if (feature === ɵɵInheritDefinitionFeature) {\n shouldInheritFields = false;\n }\n }\n }\n }\n superType = Object.getPrototypeOf(superType);\n }\n mergeHostAttrsAcrossInheritance(inheritanceChain);\n}\nfunction mergeInputsWithTransforms(target, source) {\n for (const key in source.inputs) {\n if (!source.inputs.hasOwnProperty(key)) {\n continue;\n }\n if (target.inputs.hasOwnProperty(key)) {\n continue;\n }\n const value = source.inputs[key];\n if (value === undefined) {\n continue;\n }\n target.inputs[key] = value;\n target.declaredInputs[key] = source.declaredInputs[key];\n // If the input is inherited, and we have a transform for it, we also inherit it.\n // Note that transforms should not be inherited if the input has its own metadata\n // in the `source` directive itself already (i.e. the input is re-declared/overridden).\n if (source.inputTransforms !== null) {\n // Note: transforms are stored with their minified names.\n // Perf: only access the minified name when there are source transforms.\n const minifiedName = Array.isArray(value) ? value[0] : value;\n if (!source.inputTransforms.hasOwnProperty(minifiedName)) {\n continue;\n }\n target.inputTransforms ??= {};\n target.inputTransforms[minifiedName] = source.inputTransforms[minifiedName];\n }\n }\n}\n/**\n * Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.\n *\n * @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing\n * sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child\n * type.\n */\nfunction mergeHostAttrsAcrossInheritance(inheritanceChain) {\n let hostVars = 0;\n let hostAttrs = null;\n // We process the inheritance order from the base to the leaves here.\n for (let i = inheritanceChain.length - 1; i >= 0; i--) {\n const def = inheritanceChain[i];\n // For each `hostVars`, we need to add the superclass amount.\n def.hostVars = hostVars += def.hostVars;\n // for each `hostAttrs` we need to merge it with superclass.\n def.hostAttrs = mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));\n }\n}\nfunction maybeUnwrapEmpty(value) {\n if (value === EMPTY_OBJ) {\n return {};\n } else if (value === EMPTY_ARRAY) {\n return [];\n } else {\n return value;\n }\n}\nfunction inheritViewQuery(definition, superViewQuery) {\n const prevViewQuery = definition.viewQuery;\n if (prevViewQuery) {\n definition.viewQuery = (rf, ctx) => {\n superViewQuery(rf, ctx);\n prevViewQuery(rf, ctx);\n };\n } else {\n definition.viewQuery = superViewQuery;\n }\n}\nfunction inheritContentQueries(definition, superContentQueries) {\n const prevContentQueries = definition.contentQueries;\n if (prevContentQueries) {\n definition.contentQueries = (rf, ctx, directiveIndex) => {\n superContentQueries(rf, ctx, directiveIndex);\n prevContentQueries(rf, ctx, directiveIndex);\n };\n } else {\n definition.contentQueries = superContentQueries;\n }\n}\nfunction inheritHostBindings(definition, superHostBindings) {\n const prevHostBindings = definition.hostBindings;\n if (prevHostBindings) {\n definition.hostBindings = (rf, ctx) => {\n superHostBindings(rf, ctx);\n prevHostBindings(rf, ctx);\n };\n } else {\n definition.hostBindings = superHostBindings;\n }\n}\n\n/**\n * Fields which exist on either directive or component definitions, and need to be copied from\n * parent to child classes by the `ɵɵCopyDefinitionFeature`.\n */\nconst COPY_DIRECTIVE_FIELDS = [\n// The child class should use the providers of its parent.\n'providersResolver'\n// Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such\n// as inputs, outputs, and host binding functions.\n];\n/**\n * Fields which exist only on component definitions, and need to be copied from parent to child\n * classes by the `ɵɵCopyDefinitionFeature`.\n *\n * The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,\n * since those should go in `COPY_DIRECTIVE_FIELDS` above.\n */\nconst COPY_COMPONENT_FIELDS = [\n// The child class should use the template function of its parent, including all template\n// semantics.\n'template', 'decls', 'consts', 'vars', 'onPush', 'ngContentSelectors',\n// The child class should use the CSS styles of its parent, including all styling semantics.\n'styles', 'encapsulation',\n// The child class should be checked by the runtime in the same way as its parent.\n'schemas'];\n/**\n * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a\n * definition.\n *\n * This exists primarily to support ngcc migration of an existing View Engine pattern, where an\n * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it\n * generates a skeleton definition on the child class, and applies this feature.\n *\n * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,\n * including things like the component template function.\n *\n * @param definition The definition of a child class which inherits from a parent class with its\n * own definition.\n *\n * @codeGenApi\n */\nfunction ɵɵCopyDefinitionFeature(definition) {\n let superType = getSuperType(definition.type);\n let superDef = undefined;\n if (isComponentDef(definition)) {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵcmp;\n } else {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵdir;\n }\n // Needed because `definition` fields are readonly.\n const defAny = definition;\n // Copy over any fields that apply to either directives or components.\n for (const field of COPY_DIRECTIVE_FIELDS) {\n defAny[field] = superDef[field];\n }\n if (isComponentDef(superDef)) {\n // Copy over any component-specific fields.\n for (const field of COPY_COMPONENT_FIELDS) {\n defAny[field] = superDef[field];\n }\n }\n}\n\n/**\n * This feature adds the host directives behavior to a directive definition by patching a\n * function onto it. The expectation is that the runtime will invoke the function during\n * directive matching.\n *\n * For example:\n * ```ts\n * class ComponentWithHostDirective {\n * static ɵcmp = defineComponent({\n * type: ComponentWithHostDirective,\n * features: [ɵɵHostDirectivesFeature([\n * SimpleHostDirective,\n * {directive: AdvancedHostDirective, inputs: ['foo: alias'], outputs: ['bar']},\n * ])]\n * });\n * }\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵHostDirectivesFeature(rawHostDirectives) {\n const feature = definition => {\n const resolved = (Array.isArray(rawHostDirectives) ? rawHostDirectives : rawHostDirectives()).map(dir => {\n return typeof dir === 'function' ? {\n directive: resolveForwardRef(dir),\n inputs: EMPTY_OBJ,\n outputs: EMPTY_OBJ\n } : {\n directive: resolveForwardRef(dir.directive),\n inputs: bindingArrayToMap(dir.inputs),\n outputs: bindingArrayToMap(dir.outputs)\n };\n });\n if (definition.hostDirectives === null) {\n definition.findHostDirectiveDefs = findHostDirectiveDefs;\n definition.hostDirectives = resolved;\n } else {\n definition.hostDirectives.unshift(...resolved);\n }\n };\n feature.ngInherit = true;\n return feature;\n}\nfunction findHostDirectiveDefs(currentDef, matchedDefs, hostDirectiveDefs) {\n if (currentDef.hostDirectives !== null) {\n for (const hostDirectiveConfig of currentDef.hostDirectives) {\n const hostDirectiveDef = getDirectiveDef(hostDirectiveConfig.directive);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n validateHostDirective(hostDirectiveConfig, hostDirectiveDef);\n }\n // We need to patch the `declaredInputs` so that\n // `ngOnChanges` can map the properties correctly.\n patchDeclaredInputs(hostDirectiveDef.declaredInputs, hostDirectiveConfig.inputs);\n // Host directives execute before the host so that its host bindings can be overwritten.\n findHostDirectiveDefs(hostDirectiveDef, matchedDefs, hostDirectiveDefs);\n hostDirectiveDefs.set(hostDirectiveDef, hostDirectiveConfig);\n matchedDefs.push(hostDirectiveDef);\n }\n }\n}\n/**\n * Converts an array in the form of `['publicName', 'alias', 'otherPublicName', 'otherAlias']` into\n * a map in the form of `{publicName: 'alias', otherPublicName: 'otherAlias'}`.\n */\nfunction bindingArrayToMap(bindings) {\n if (bindings === undefined || bindings.length === 0) {\n return EMPTY_OBJ;\n }\n const result = {};\n for (let i = 0; i < bindings.length; i += 2) {\n result[bindings[i]] = bindings[i + 1];\n }\n return result;\n}\n/**\n * `ngOnChanges` has some leftover legacy ViewEngine behavior where the keys inside the\n * `SimpleChanges` event refer to the *declared* name of the input, not its public name or its\n * minified name. E.g. in `@Input('alias') foo: string`, the name in the `SimpleChanges` object\n * will always be `foo`, and not `alias` or the minified name of `foo` in apps using property\n * minification.\n *\n * This is achieved through the `DirectiveDef.declaredInputs` map that is constructed when the\n * definition is declared. When a property is written to the directive instance, the\n * `NgOnChangesFeature` will try to remap the property name being written to using the\n * `declaredInputs`.\n *\n * Since the host directive input remapping happens during directive matching, `declaredInputs`\n * won't contain the new alias that the input is available under. This function addresses the\n * issue by patching the host directive aliases to the `declaredInputs`. There is *not* a risk of\n * this patching accidentally introducing new inputs to the host directive, because `declaredInputs`\n * is used *only* by the `NgOnChangesFeature` when determining what name is used in the\n * `SimpleChanges` object which won't be reached if an input doesn't exist.\n */\nfunction patchDeclaredInputs(declaredInputs, exposedInputs) {\n for (const publicName in exposedInputs) {\n if (exposedInputs.hasOwnProperty(publicName)) {\n const remappedPublicName = exposedInputs[publicName];\n const privateName = declaredInputs[publicName];\n // We *technically* shouldn't be able to hit this case because we can't have multiple\n // inputs on the same property and we have validations against conflicting aliases in\n // `validateMappings`. If we somehow did, it would lead to `ngOnChanges` being invoked\n // with the wrong name so we have a non-user-friendly assertion here just in case.\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && declaredInputs.hasOwnProperty(remappedPublicName)) {\n assertEqual(declaredInputs[remappedPublicName], declaredInputs[publicName], `Conflicting host directive input alias ${publicName}.`);\n }\n declaredInputs[remappedPublicName] = privateName;\n }\n }\n}\n/**\n * Verifies that the host directive has been configured correctly.\n * @param hostDirectiveConfig Host directive configuration object.\n * @param directiveDef Directive definition of the host directive.\n */\nfunction validateHostDirective(hostDirectiveConfig, directiveDef) {\n const type = hostDirectiveConfig.directive;\n if (directiveDef === null) {\n if (getComponentDef(type) !== null) {\n throw new RuntimeError(310 /* RuntimeErrorCode.HOST_DIRECTIVE_COMPONENT */, `Host directive ${type.name} cannot be a component.`);\n }\n throw new RuntimeError(307 /* RuntimeErrorCode.HOST_DIRECTIVE_UNRESOLVABLE */, `Could not resolve metadata for host directive ${type.name}. ` + `Make sure that the ${type.name} class is annotated with an @Directive decorator.`);\n }\n if (!directiveDef.standalone) {\n throw new RuntimeError(308 /* RuntimeErrorCode.HOST_DIRECTIVE_NOT_STANDALONE */, `Host directive ${directiveDef.type.name} must be standalone.`);\n }\n validateMappings('input', directiveDef, hostDirectiveConfig.inputs);\n validateMappings('output', directiveDef, hostDirectiveConfig.outputs);\n}\n/**\n * Checks that the host directive inputs/outputs configuration is valid.\n * @param bindingType Kind of binding that is being validated. Used in the error message.\n * @param def Definition of the host directive that is being validated against.\n * @param hostDirectiveBindings Host directive mapping object that shold be validated.\n */\nfunction validateMappings(bindingType, def, hostDirectiveBindings) {\n const className = def.type.name;\n const bindings = bindingType === 'input' ? def.inputs : def.outputs;\n for (const publicName in hostDirectiveBindings) {\n if (hostDirectiveBindings.hasOwnProperty(publicName)) {\n if (!bindings.hasOwnProperty(publicName)) {\n throw new RuntimeError(311 /* RuntimeErrorCode.HOST_DIRECTIVE_UNDEFINED_BINDING */, `Directive ${className} does not have an ${bindingType} with a public name of ${publicName}.`);\n }\n const remappedPublicName = hostDirectiveBindings[publicName];\n if (bindings.hasOwnProperty(remappedPublicName) && remappedPublicName !== publicName) {\n throw new RuntimeError(312 /* RuntimeErrorCode.HOST_DIRECTIVE_CONFLICTING_ALIAS */, `Cannot alias ${bindingType} ${publicName} of host directive ${className} to ${remappedPublicName}, because it already has a different ${bindingType} with the same public name.`);\n }\n }\n }\n}\n\n/**\n * Decorates the directive definition with support for input transform functions.\n *\n * If the directive uses inheritance, the feature should be included before the\n * `InheritDefinitionFeature` to ensure that the `inputTransforms` field is populated.\n *\n * @codeGenApi\n */\nfunction ɵɵInputTransformsFeature(definition) {\n const inputs = definition.inputConfig;\n const inputTransforms = {};\n for (const minifiedKey in inputs) {\n if (inputs.hasOwnProperty(minifiedKey)) {\n // Note: the private names are used for the keys, rather than the public ones, because public\n // names can be re-aliased in host directives which would invalidate the lookup.\n const value = inputs[minifiedKey];\n if (Array.isArray(value) && value[3]) {\n inputTransforms[minifiedKey] = value[3];\n }\n }\n }\n definition.inputTransforms = inputTransforms;\n}\n\n/**\n * Represents an instance of an `NgModule` created by an `NgModuleFactory`.\n * Provides access to the `NgModule` instance and related objects.\n *\n * @publicApi\n */\nclass NgModuleRef$1 {}\n/**\n * @publicApi\n *\n * @deprecated\n * This class was mostly used as a part of ViewEngine-based JIT API and is no longer needed in Ivy\n * JIT mode. Angular provides APIs that accept NgModule classes directly (such as\n * [PlatformRef.bootstrapModule](api/core/PlatformRef#bootstrapModule) and\n * [createNgModule](api/core/createNgModule)), consider switching to those APIs instead of\n * using factory-based ones.\n */\nclass NgModuleFactory$1 {}\n\n/**\n * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.\n *\n * @param ngModule NgModule class.\n * @param parentInjector Optional injector instance to use as a parent for the module injector. If\n * not provided, `NullInjector` will be used instead.\n * @returns NgModuleRef that represents an NgModule instance.\n *\n * @publicApi\n */\nfunction createNgModule(ngModule, parentInjector) {\n return new NgModuleRef(ngModule, parentInjector ?? null, []);\n}\n/**\n * The `createNgModule` function alias for backwards-compatibility.\n * Please avoid using it directly and use `createNgModule` instead.\n *\n * @deprecated Use `createNgModule` instead.\n */\nconst createNgModuleRef = createNgModule;\nclass NgModuleRef extends NgModuleRef$1 {\n constructor(ngModuleType, _parent, additionalProviders, runInjectorInitializers = true) {\n super();\n this.ngModuleType = ngModuleType;\n this._parent = _parent;\n // tslint:disable-next-line:require-internal-with-underscore\n this._bootstrapComponents = [];\n this.destroyCbs = [];\n // When bootstrapping a module we have a dependency graph that looks like this:\n // ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the\n // module being resolved tries to inject the ComponentFactoryResolver, it'll create a\n // circular dependency which will result in a runtime error, because the injector doesn't\n // exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves\n // and providing it, rather than letting the injector resolve it.\n this.componentFactoryResolver = new ComponentFactoryResolver(this);\n const ngModuleDef = getNgModuleDef(ngModuleType);\n ngDevMode && assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);\n this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);\n this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [{\n provide: NgModuleRef$1,\n useValue: this\n }, {\n provide: ComponentFactoryResolver$1,\n useValue: this.componentFactoryResolver\n }, ...additionalProviders], stringify(ngModuleType), new Set(['environment']));\n // We need to resolve the injector types separately from the injector creation, because\n // the module might be trying to use this ref in its constructor for DI which will cause a\n // circular error that will eventually error out, because the injector isn't created yet.\n if (runInjectorInitializers) {\n this.resolveInjectorInitializers();\n }\n }\n resolveInjectorInitializers() {\n this._r3Injector.resolveInjectorInitializers();\n this.instance = this._r3Injector.get(this.ngModuleType);\n }\n get injector() {\n return this._r3Injector;\n }\n destroy() {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n const injector = this._r3Injector;\n !injector.destroyed && injector.destroy();\n this.destroyCbs.forEach(fn => fn());\n this.destroyCbs = null;\n }\n onDestroy(callback) {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs.push(callback);\n }\n}\nclass NgModuleFactory extends NgModuleFactory$1 {\n constructor(moduleType) {\n super();\n this.moduleType = moduleType;\n }\n create(parentInjector) {\n return new NgModuleRef(this.moduleType, parentInjector, []);\n }\n}\nfunction createNgModuleRefWithProviders(moduleType, parentInjector, additionalProviders) {\n return new NgModuleRef(moduleType, parentInjector, additionalProviders, false);\n}\nclass EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {\n constructor(config) {\n super();\n this.componentFactoryResolver = new ComponentFactoryResolver(this);\n this.instance = null;\n const injector = new R3Injector([...config.providers, {\n provide: NgModuleRef$1,\n useValue: this\n }, {\n provide: ComponentFactoryResolver$1,\n useValue: this.componentFactoryResolver\n }], config.parent || getNullInjector(), config.debugName, new Set(['environment']));\n this.injector = injector;\n if (config.runEnvironmentInitializers) {\n injector.resolveInjectorInitializers();\n }\n }\n destroy() {\n this.injector.destroy();\n }\n onDestroy(callback) {\n this.injector.onDestroy(callback);\n }\n}\n/**\n * Create a new environment injector.\n *\n * @param providers An array of providers.\n * @param parent A parent environment injector.\n * @param debugName An optional name for this injector instance, which will be used in error\n * messages.\n *\n * @publicApi\n */\nfunction createEnvironmentInjector(providers, parent, debugName = null) {\n const adapter = new EnvironmentNgModuleRefAdapter({\n providers,\n parent,\n debugName,\n runEnvironmentInitializers: true\n });\n return adapter.injector;\n}\n\n/**\n * A service used by the framework to create and cache injector instances.\n *\n * This service is used to create a single injector instance for each defer\n * block definition, to avoid creating an injector for each defer block instance\n * of a certain type.\n */\nclass CachedInjectorService {\n constructor() {\n this.cachedInjectors = new Map();\n }\n getOrCreateInjector(key, parentInjector, providers, debugName) {\n if (!this.cachedInjectors.has(key)) {\n const injector = providers.length > 0 ? createEnvironmentInjector(providers, parentInjector, debugName) : null;\n this.cachedInjectors.set(key, injector);\n }\n return this.cachedInjectors.get(key);\n }\n ngOnDestroy() {\n try {\n for (const injector of this.cachedInjectors.values()) {\n if (injector !== null) {\n injector.destroy();\n }\n }\n } finally {\n this.cachedInjectors.clear();\n }\n }\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: CachedInjectorService,\n providedIn: 'environment',\n factory: () => new CachedInjectorService()\n });\n }\n}\nfunction isIterable(obj) {\n return obj !== null && typeof obj === 'object' && obj[Symbol.iterator] !== undefined;\n}\nfunction isListLikeIterable(obj) {\n if (!isJsObject(obj)) return false;\n return Array.isArray(obj) || !(obj instanceof Map) &&\n // JS Map are iterables but return entries as [k, v]\n Symbol.iterator in obj; // JS Iterable have a Symbol.iterator prop\n}\nfunction areIterablesEqual(a, b, comparator) {\n const iterator1 = a[Symbol.iterator]();\n const iterator2 = b[Symbol.iterator]();\n while (true) {\n const item1 = iterator1.next();\n const item2 = iterator2.next();\n if (item1.done && item2.done) return true;\n if (item1.done || item2.done) return false;\n if (!comparator(item1.value, item2.value)) return false;\n }\n}\nfunction iterateListLike(obj, fn) {\n if (Array.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n } else {\n const iterator = obj[Symbol.iterator]();\n let item;\n while (!(item = iterator.next()).done) {\n fn(item.value);\n }\n }\n}\nfunction isJsObject(o) {\n return o !== null && (typeof o === 'function' || typeof o === 'object');\n}\nfunction devModeEqual(a, b) {\n const isListLikeIterableA = isListLikeIterable(a);\n const isListLikeIterableB = isListLikeIterable(b);\n if (isListLikeIterableA && isListLikeIterableB) {\n return areIterablesEqual(a, b, devModeEqual);\n } else {\n const isAObject = a && (typeof a === 'object' || typeof a === 'function');\n const isBObject = b && (typeof b === 'object' || typeof b === 'function');\n if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {\n return true;\n } else {\n return Object.is(a, b);\n }\n }\n}\n\n// TODO(misko): consider inlining\n/** Updates binding and returns the value. */\nfunction updateBinding(lView, bindingIndex, value) {\n return lView[bindingIndex] = value;\n}\n/** Gets the current binding value. */\nfunction getBinding(lView, bindingIndex) {\n ngDevMode && assertIndexInRange(lView, bindingIndex);\n ngDevMode && assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');\n return lView[bindingIndex];\n}\n/**\n * Updates binding if changed, then returns whether it was updated.\n *\n * This function also checks the `CheckNoChangesMode` and throws if changes are made.\n * Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE\n * behavior.\n *\n * @param lView current `LView`\n * @param bindingIndex The binding in the `LView` to check\n * @param value New value to check against `lView[bindingIndex]`\n * @returns `true` if the bindings has changed. (Throws if binding has changed during\n * `CheckNoChangesMode`)\n */\nfunction bindingUpdated(lView, bindingIndex, value) {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n ngDevMode && assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);\n const oldValue = lView[bindingIndex];\n if (Object.is(oldValue, value)) {\n return false;\n } else {\n if (ngDevMode && isInCheckNoChangesMode()) {\n // View engine didn't report undefined values as changed on the first checkNoChanges pass\n // (before the change detection was run).\n const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;\n if (!devModeEqual(oldValueToCompare, value)) {\n const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);\n throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName, lView);\n }\n // There was a change, but the `devModeEqual` decided that the change is exempt from an error.\n // For this reason we exit as if no change. The early exit is needed to prevent the changed\n // value to be written into `LView` (If we would write the new value that we would not see it\n // as change on next CD.)\n return false;\n }\n lView[bindingIndex] = value;\n return true;\n }\n}\n/** Updates 2 bindings if changed, then returns whether either was updated. */\nfunction bindingUpdated2(lView, bindingIndex, exp1, exp2) {\n const different = bindingUpdated(lView, bindingIndex, exp1);\n return bindingUpdated(lView, bindingIndex + 1, exp2) || different;\n}\n/** Updates 3 bindings if changed, then returns whether any was updated. */\nfunction bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n}\n/** Updates 4 bindings if changed, then returns whether any was updated. */\nfunction bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;\n}\n\n/**\n * Checks whether a TNode is considered detached, i.e. not present in the\n * translated i18n template. We should not attempt hydration for such nodes\n * and instead, use a regular \"creation mode\".\n */\nfunction isDetachedByI18n(tNode) {\n return (tNode.flags & 32 /* TNodeFlags.isDetached */) === 32 /* TNodeFlags.isDetached */;\n}\nfunction templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, tagName, attrs, localRefsIndex) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && ngDevMode.firstCreatePass++;\n const tViewConsts = tView.consts;\n // TODO(pk): refactor getOrCreateTNode to have the \"create\" only version\n const tNode = getOrCreateTNode(tView, index, 4 /* TNodeType.Container */, tagName || null, attrs || null);\n resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));\n registerPostOrderHooks(tView, tNode);\n const embeddedTView = tNode.tView = createTView(2 /* TViewType.Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts, null /* ssrId */);\n if (tView.queries !== null) {\n tView.queries.template(tView, tNode);\n embeddedTView.queries = tView.queries.embeddedTView(tNode);\n }\n return tNode;\n}\n/**\n * Creates an LContainer for an embedded view.\n *\n * @param declarationLView LView in which the template was declared.\n * @param declarationTView TView in which the template wa declared.\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n */\nfunction declareTemplate(declarationLView, declarationTView, index, templateFn, decls, vars, tagName, attrs, localRefsIndex, localRefExtractor) {\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = declarationTView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, declarationTView, declarationLView, templateFn, decls, vars, tagName, attrs, localRefsIndex) : declarationTView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n const comment = _locateOrCreateContainerAnchor(declarationTView, declarationLView, tNode, index);\n if (wasLastNodeCreated()) {\n appendChild(declarationTView, declarationLView, comment, tNode);\n }\n attachPatchData(comment, declarationLView);\n const lContainer = createLContainer(comment, declarationLView, comment, tNode);\n declarationLView[adjustedIndex] = lContainer;\n addToViewTree(declarationLView, lContainer);\n // If hydration is enabled, looks up dehydrated views in the DOM\n // using hydration annotation info and stores those views on LContainer.\n // In client-only mode, this function is a noop.\n populateDehydratedViewsInLContainer(lContainer, tNode, declarationLView);\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(declarationTView, declarationLView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(declarationLView, tNode, localRefExtractor);\n }\n return tNode;\n}\n/**\n * Creates an LContainer for an ng-template (dynamically-inserted view), e.g.\n *\n * <ng-template #foo>\n * <div></div>\n * </ng-template>\n *\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n *\n * @codeGenApi\n */\nfunction ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const attrs = getConstant(tView.consts, attrsIndex);\n declareTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, localRefsIndex, localRefExtractor);\n return ɵɵtemplate;\n}\nlet _locateOrCreateContainerAnchor = createContainerAnchorImpl;\n/**\n * Regular creation mode for LContainers and their anchor (comment) nodes.\n */\nfunction createContainerAnchorImpl(tView, lView, tNode, index) {\n lastNodeWasCreated(true);\n return lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n}\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode for LContainers and their\n * anchor (comment) nodes.\n */\nfunction locateOrCreateContainerAnchorImpl(tView, lView, tNode, index) {\n const hydrationInfo = lView[HYDRATION];\n const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1() || isDetachedByI18n(tNode) || isDisconnectedNode$1(hydrationInfo, index);\n lastNodeWasCreated(isNodeCreationMode);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createContainerAnchorImpl(tView, lView, tNode, index);\n }\n const ssrId = hydrationInfo.data[TEMPLATES]?.[index] ?? null;\n // Apply `ssrId` value to the underlying TView if it was not previously set.\n //\n // There might be situations when the same component is present in a template\n // multiple times and some instances are opted-out of using hydration via\n // `ngSkipHydration` attribute. In this scenario, at the time a TView is created,\n // the `ssrId` might be `null` (if the first component is opted-out of hydration).\n // The code below makes sure that the `ssrId` is applied to the TView if it's still\n // `null` and verifies we never try to override it with a different value.\n if (ssrId !== null && tNode.tView !== null) {\n if (tNode.tView.ssrId === null) {\n tNode.tView.ssrId = ssrId;\n } else {\n ngDevMode && assertEqual(tNode.tView.ssrId, ssrId, 'Unexpected value of the `ssrId` for this TView');\n }\n }\n // Hydration mode, looking up existing elements in DOM.\n const currentRNode = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateNodeExists(currentRNode, lView, tNode);\n setSegmentHead(hydrationInfo, index, currentRNode);\n const viewContainerSize = calcSerializedContainerSize(hydrationInfo, index);\n const comment = siblingAfter(viewContainerSize, currentRNode);\n if (ngDevMode) {\n validateMatchingNode(comment, Node.COMMENT_NODE, null, lView, tNode);\n markRNodeAsClaimedByHydration(comment);\n }\n return comment;\n}\nfunction enableLocateOrCreateContainerAnchorImpl() {\n _locateOrCreateContainerAnchor = locateOrCreateContainerAnchorImpl;\n}\n\n/**\n * Describes the state of defer block dependency loading.\n */\nvar DeferDependenciesLoadingState;\n(function (DeferDependenciesLoadingState) {\n /** Initial state, dependency loading is not yet triggered */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"NOT_STARTED\"] = 0] = \"NOT_STARTED\";\n /** Dependency loading is in progress */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"IN_PROGRESS\"] = 1] = \"IN_PROGRESS\";\n /** Dependency loading has completed successfully */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"COMPLETE\"] = 2] = \"COMPLETE\";\n /** Dependency loading has failed */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"FAILED\"] = 3] = \"FAILED\";\n})(DeferDependenciesLoadingState || (DeferDependenciesLoadingState = {}));\n/** Slot index where `minimum` parameter value is stored. */\nconst MINIMUM_SLOT = 0;\n/** Slot index where `after` parameter value is stored. */\nconst LOADING_AFTER_SLOT = 1;\n/**\n * Describes the current state of this defer block instance.\n *\n * @publicApi\n */\nvar DeferBlockState;\n(function (DeferBlockState) {\n /** The placeholder block content is rendered */\n DeferBlockState[DeferBlockState[\"Placeholder\"] = 0] = \"Placeholder\";\n /** The loading block content is rendered */\n DeferBlockState[DeferBlockState[\"Loading\"] = 1] = \"Loading\";\n /** The main content block content is rendered */\n DeferBlockState[DeferBlockState[\"Complete\"] = 2] = \"Complete\";\n /** The error block content is rendered */\n DeferBlockState[DeferBlockState[\"Error\"] = 3] = \"Error\";\n})(DeferBlockState || (DeferBlockState = {}));\n/**\n * Describes the initial state of this defer block instance.\n *\n * Note: this state is internal only and *must* be represented\n * with a number lower than any value in the `DeferBlockState` enum.\n */\nvar DeferBlockInternalState;\n(function (DeferBlockInternalState) {\n /** Initial state. Nothing is rendered yet. */\n DeferBlockInternalState[DeferBlockInternalState[\"Initial\"] = -1] = \"Initial\";\n})(DeferBlockInternalState || (DeferBlockInternalState = {}));\nconst NEXT_DEFER_BLOCK_STATE = 0;\n// Note: it's *important* to keep the state in this slot, because this slot\n// is used by runtime logic to differentiate between LViews, LContainers and\n// other types (see `isLView` and `isLContainer` functions). In case of defer\n// blocks, this slot would always be a number.\nconst DEFER_BLOCK_STATE = 1;\nconst STATE_IS_FROZEN_UNTIL = 2;\nconst LOADING_AFTER_CLEANUP_FN = 3;\nconst TRIGGER_CLEANUP_FNS = 4;\nconst PREFETCH_TRIGGER_CLEANUP_FNS = 5;\n/**\n * Options for configuring defer blocks behavior.\n * @publicApi\n */\nvar DeferBlockBehavior;\n(function (DeferBlockBehavior) {\n /**\n * Manual triggering mode for defer blocks. Provides control over when defer blocks render\n * and which state they render.\n */\n DeferBlockBehavior[DeferBlockBehavior[\"Manual\"] = 0] = \"Manual\";\n /**\n * Playthrough mode for defer blocks. This mode behaves like defer blocks would in a browser.\n * This is the default behavior in test environments.\n */\n DeferBlockBehavior[DeferBlockBehavior[\"Playthrough\"] = 1] = \"Playthrough\";\n})(DeferBlockBehavior || (DeferBlockBehavior = {}));\n\n/*!\n * @license\n * Copyright Google LLC 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.dev/license\n */\n/**\n * Registers a cleanup function associated with a prefetching trigger\n * or a regular trigger of a defer block.\n */\nfunction storeTriggerCleanupFn(type, lDetails, cleanupFn) {\n const key = type === 1 /* TriggerType.Prefetch */ ? PREFETCH_TRIGGER_CLEANUP_FNS : TRIGGER_CLEANUP_FNS;\n if (lDetails[key] === null) {\n lDetails[key] = [];\n }\n lDetails[key].push(cleanupFn);\n}\n/**\n * Invokes registered cleanup functions either for prefetch or for regular triggers.\n */\nfunction invokeTriggerCleanupFns(type, lDetails) {\n const key = type === 1 /* TriggerType.Prefetch */ ? PREFETCH_TRIGGER_CLEANUP_FNS : TRIGGER_CLEANUP_FNS;\n const cleanupFns = lDetails[key];\n if (cleanupFns !== null) {\n for (const cleanupFn of cleanupFns) {\n cleanupFn();\n }\n lDetails[key] = null;\n }\n}\n/**\n * Invokes registered cleanup functions for both prefetch and regular triggers.\n */\nfunction invokeAllTriggerCleanupFns(lDetails) {\n invokeTriggerCleanupFns(1 /* TriggerType.Prefetch */, lDetails);\n invokeTriggerCleanupFns(0 /* TriggerType.Regular */, lDetails);\n}\n\n/**\n * Asserts that the current stack frame is not within a reactive context. Useful\n * to disallow certain code from running inside a reactive context (see {@link toSignal}).\n *\n * @param debugFn a reference to the function making the assertion (used for the error message).\n *\n * @publicApi\n */\nfunction assertNotInReactiveContext(debugFn, extraContext) {\n // Taking a `Function` instead of a string name here prevents the un-minified name of the function\n // from being retained in the bundle regardless of minification.\n if (getActiveConsumer$1() !== null) {\n throw new RuntimeError(-602 /* RuntimeErrorCode.ASSERTION_NOT_INSIDE_REACTIVE_CONTEXT */, ngDevMode && `${debugFn.name}() cannot be called from within a reactive context.${extraContext ? ` ${extraContext}` : ''}`);\n }\n}\n\n/**\n * The phase to run an `afterRender` or `afterNextRender` callback in.\n *\n * Callbacks in the same phase run in the order they are registered. Phases run in the\n * following order after each render:\n *\n * 1. `AfterRenderPhase.EarlyRead`\n * 2. `AfterRenderPhase.Write`\n * 3. `AfterRenderPhase.MixedReadWrite`\n * 4. `AfterRenderPhase.Read`\n *\n * Angular is unable to verify or enforce that phases are used correctly, and instead\n * relies on each developer to follow the guidelines documented for each value and\n * carefully choose the appropriate one, refactoring their code if necessary. By doing\n * so, Angular is better able to minimize the performance degradation associated with\n * manual DOM access, ensuring the best experience for the end users of your application\n * or library.\n *\n * @deprecated Specify the phase for your callback to run in by passing a spec-object as the first\n * parameter to `afterRender` or `afterNextRender` instead of a function.\n */\nvar AfterRenderPhase;\n(function (AfterRenderPhase) {\n /**\n * Use `AfterRenderPhase.EarlyRead` for callbacks that only need to **read** from the\n * DOM before a subsequent `AfterRenderPhase.Write` callback, for example to perform\n * custom layout that the browser doesn't natively support. Prefer the\n * `AfterRenderPhase.EarlyRead` phase if reading can wait until after the write phase.\n * **Never** write to the DOM in this phase.\n *\n * <div class=\"alert is-important\">\n *\n * Using this value can degrade performance.\n * Instead, prefer using built-in browser functionality when possible.\n *\n * </div>\n */\n AfterRenderPhase[AfterRenderPhase[\"EarlyRead\"] = 0] = \"EarlyRead\";\n /**\n * Use `AfterRenderPhase.Write` for callbacks that only **write** to the DOM. **Never**\n * read from the DOM in this phase.\n */\n AfterRenderPhase[AfterRenderPhase[\"Write\"] = 1] = \"Write\";\n /**\n * Use `AfterRenderPhase.MixedReadWrite` for callbacks that read from or write to the\n * DOM, that haven't been refactored to use a different phase. **Never** use this phase if\n * it is possible to divide the work among the other phases instead.\n *\n * <div class=\"alert is-critical\">\n *\n * Using this value can **significantly** degrade performance.\n * Instead, prefer dividing work into the appropriate phase callbacks.\n *\n * </div>\n */\n AfterRenderPhase[AfterRenderPhase[\"MixedReadWrite\"] = 2] = \"MixedReadWrite\";\n /**\n * Use `AfterRenderPhase.Read` for callbacks that only **read** from the DOM. **Never**\n * write to the DOM in this phase.\n */\n AfterRenderPhase[AfterRenderPhase[\"Read\"] = 3] = \"Read\";\n})(AfterRenderPhase || (AfterRenderPhase = {}));\nclass AfterRenderManager {\n constructor() {\n this.impl = null;\n }\n execute() {\n this.impl?.execute();\n }\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: AfterRenderManager,\n providedIn: 'root',\n factory: () => new AfterRenderManager()\n });\n }\n}\nclass AfterRenderImpl {\n constructor() {\n this.ngZone = inject(NgZone);\n this.scheduler = inject(ChangeDetectionScheduler);\n this.errorHandler = inject(ErrorHandler, {\n optional: true\n });\n /** Current set of active sequences. */\n this.sequences = new Set();\n /** Tracks registrations made during the current set of executions. */\n this.deferredRegistrations = new Set();\n /** Whether the `AfterRenderManager` is currently executing hooks. */\n this.executing = false;\n }\n static {\n this.PHASES = [AfterRenderPhase.EarlyRead, AfterRenderPhase.Write, AfterRenderPhase.MixedReadWrite, AfterRenderPhase.Read];\n }\n /**\n * Run the sequence of phases of hooks, once through. As a result of executing some hooks, more\n * might be scheduled.\n */\n execute() {\n this.executing = true;\n for (const phase of AfterRenderImpl.PHASES) {\n for (const sequence of this.sequences) {\n if (sequence.erroredOrDestroyed || !sequence.hooks[phase]) {\n continue;\n }\n try {\n sequence.pipelinedValue = this.ngZone.runOutsideAngular(() => sequence.hooks[phase](sequence.pipelinedValue));\n } catch (err) {\n sequence.erroredOrDestroyed = true;\n this.errorHandler?.handleError(err);\n }\n }\n }\n this.executing = false;\n // Cleanup step to reset sequence state and also collect one-shot sequences for removal.\n for (const sequence of this.sequences) {\n sequence.afterRun();\n if (sequence.once) {\n this.sequences.delete(sequence);\n // Destroy the sequence so its on destroy callbacks can be cleaned up\n // immediately, instead of waiting until the injector is destroyed.\n sequence.destroy();\n }\n }\n for (const sequence of this.deferredRegistrations) {\n this.sequences.add(sequence);\n }\n if (this.deferredRegistrations.size > 0) {\n this.scheduler.notify(7 /* NotificationSource.DeferredRenderHook */);\n }\n this.deferredRegistrations.clear();\n }\n register(sequence) {\n if (!this.executing) {\n this.sequences.add(sequence);\n // Trigger an `ApplicationRef.tick()` if one is not already pending/running, because we have a\n // new render hook that needs to run.\n this.scheduler.notify(6 /* NotificationSource.RenderHook */);\n } else {\n this.deferredRegistrations.add(sequence);\n }\n }\n unregister(sequence) {\n if (this.executing && this.sequences.has(sequence)) {\n // We can't remove an `AfterRenderSequence` in the middle of iteration.\n // Instead, mark it as destroyed so it doesn't run any more, and mark it as one-shot so it'll\n // be removed at the end of the current execution.\n sequence.erroredOrDestroyed = true;\n sequence.pipelinedValue = undefined;\n sequence.once = true;\n } else {\n // It's safe to directly remove this sequence.\n this.sequences.delete(sequence);\n this.deferredRegistrations.delete(sequence);\n }\n }\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: AfterRenderImpl,\n providedIn: 'root',\n factory: () => new AfterRenderImpl()\n });\n }\n}\nclass AfterRenderSequence {\n constructor(impl, hooks, once, destroyRef) {\n this.impl = impl;\n this.hooks = hooks;\n this.once = once;\n /**\n * Whether this sequence errored or was destroyed during this execution, and hooks should no\n * longer run for it.\n */\n this.erroredOrDestroyed = false;\n /**\n * The value returned by the last hook execution (if any), ready to be pipelined into the next\n * one.\n */\n this.pipelinedValue = undefined;\n this.unregisterOnDestroy = destroyRef?.onDestroy(() => this.destroy());\n }\n afterRun() {\n this.erroredOrDestroyed = false;\n this.pipelinedValue = undefined;\n }\n destroy() {\n this.impl.unregister(this);\n this.unregisterOnDestroy?.();\n }\n}\nfunction afterRender(callbackOrSpec, options) {\n ngDevMode && assertNotInReactiveContext(afterRender, 'Call `afterRender` outside of a reactive context. For example, schedule the render ' + 'callback inside the component constructor`.');\n !options?.injector && assertInInjectionContext(afterRender);\n const injector = options?.injector ?? inject(Injector);\n if (!isPlatformBrowser(injector)) {\n return NOOP_AFTER_RENDER_REF;\n }\n performanceMarkFeature('NgAfterRender');\n return afterRenderImpl(callbackOrSpec, injector, options, /* once */false);\n}\nfunction afterNextRender(callbackOrSpec, options) {\n !options?.injector && assertInInjectionContext(afterNextRender);\n const injector = options?.injector ?? inject(Injector);\n if (!isPlatformBrowser(injector)) {\n return NOOP_AFTER_RENDER_REF;\n }\n performanceMarkFeature('NgAfterNextRender');\n return afterRenderImpl(callbackOrSpec, injector, options, /* once */true);\n}\nfunction getHooks(callbackOrSpec, phase) {\n if (callbackOrSpec instanceof Function) {\n const hooks = [undefined, undefined, undefined, undefined];\n hooks[phase] = callbackOrSpec;\n return hooks;\n } else {\n return [callbackOrSpec.earlyRead, callbackOrSpec.write, callbackOrSpec.mixedReadWrite, callbackOrSpec.read];\n }\n}\n/**\n * Shared implementation for `afterRender` and `afterNextRender`.\n */\nfunction afterRenderImpl(callbackOrSpec, injector, options, once) {\n const manager = injector.get(AfterRenderManager);\n // Lazily initialize the handler implementation, if necessary. This is so that it can be\n // tree-shaken if `afterRender` and `afterNextRender` aren't used.\n manager.impl ??= injector.get(AfterRenderImpl);\n const hooks = options?.phase ?? AfterRenderPhase.MixedReadWrite;\n const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;\n const sequence = new AfterRenderSequence(manager.impl, getHooks(callbackOrSpec, hooks), once, destroyRef);\n manager.impl.register(sequence);\n return sequence;\n}\n/** `AfterRenderRef` that does nothing. */\nconst NOOP_AFTER_RENDER_REF = {\n destroy() {}\n};\n\n/**\n * Calculates a data slot index for defer block info (either static or\n * instance-specific), given an index of a defer instruction.\n */\nfunction getDeferBlockDataIndex(deferBlockIndex) {\n // Instance state is located at the *next* position\n // after the defer block slot in an LView or TView.data.\n return deferBlockIndex + 1;\n}\n/** Retrieves a defer block state from an LView, given a TNode that represents a block. */\nfunction getLDeferBlockDetails(lView, tNode) {\n const tView = lView[TVIEW];\n const slotIndex = getDeferBlockDataIndex(tNode.index);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n return lView[slotIndex];\n}\n/** Stores a defer block instance state in LView. */\nfunction setLDeferBlockDetails(lView, deferBlockIndex, lDetails) {\n const tView = lView[TVIEW];\n const slotIndex = getDeferBlockDataIndex(deferBlockIndex);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n lView[slotIndex] = lDetails;\n}\n/** Retrieves static info about a defer block, given a TView and a TNode that represents a block. */\nfunction getTDeferBlockDetails(tView, tNode) {\n const slotIndex = getDeferBlockDataIndex(tNode.index);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n return tView.data[slotIndex];\n}\n/** Stores a defer block static info in `TView.data`. */\nfunction setTDeferBlockDetails(tView, deferBlockIndex, deferBlockConfig) {\n const slotIndex = getDeferBlockDataIndex(deferBlockIndex);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n tView.data[slotIndex] = deferBlockConfig;\n}\nfunction getTemplateIndexForState(newState, hostLView, tNode) {\n const tView = hostLView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n switch (newState) {\n case DeferBlockState.Complete:\n return tDetails.primaryTmplIndex;\n case DeferBlockState.Loading:\n return tDetails.loadingTmplIndex;\n case DeferBlockState.Error:\n return tDetails.errorTmplIndex;\n case DeferBlockState.Placeholder:\n return tDetails.placeholderTmplIndex;\n default:\n ngDevMode && throwError(`Unexpected defer block state: ${newState}`);\n return null;\n }\n}\n/**\n * Returns a minimum amount of time that a given state should be rendered for,\n * taking into account `minimum` parameter value. If the `minimum` value is\n * not specified - returns `null`.\n */\nfunction getMinimumDurationForState(tDetails, currentState) {\n if (currentState === DeferBlockState.Placeholder) {\n return tDetails.placeholderBlockConfig?.[MINIMUM_SLOT] ?? null;\n } else if (currentState === DeferBlockState.Loading) {\n return tDetails.loadingBlockConfig?.[MINIMUM_SLOT] ?? null;\n }\n return null;\n}\n/** Retrieves the value of the `after` parameter on the @loading block. */\nfunction getLoadingBlockAfter(tDetails) {\n return tDetails.loadingBlockConfig?.[LOADING_AFTER_SLOT] ?? null;\n}\n/**\n * Adds downloaded dependencies into a directive or a pipe registry,\n * making sure that a dependency doesn't yet exist in the registry.\n */\nfunction addDepsToRegistry(currentDeps, newDeps) {\n if (!currentDeps || currentDeps.length === 0) {\n return newDeps;\n }\n const currentDepSet = new Set(currentDeps);\n for (const dep of newDeps) {\n currentDepSet.add(dep);\n }\n // If `currentDeps` is the same length, there were no new deps and can\n // return the original array.\n return currentDeps.length === currentDepSet.size ? currentDeps : Array.from(currentDepSet);\n}\n/** Retrieves a TNode that represents main content of a defer block. */\nfunction getPrimaryBlockTNode(tView, tDetails) {\n const adjustedIndex = tDetails.primaryTmplIndex + HEADER_OFFSET;\n return getTNode(tView, adjustedIndex);\n}\n/**\n * Asserts whether all dependencies for a defer block are loaded.\n * Always run this function (in dev mode) before rendering a defer\n * block in completed state.\n */\nfunction assertDeferredDependenciesLoaded(tDetails) {\n assertEqual(tDetails.loadingState, DeferDependenciesLoadingState.COMPLETE, 'Expecting all deferred dependencies to be loaded.');\n}\n/**\n * Determines if a given value matches the expected structure of a defer block\n *\n * We can safely rely on the primaryTmplIndex because every defer block requires\n * that a primary template exists. All the other template options are optional.\n */\nfunction isTDeferBlockDetails(value) {\n return value !== null && typeof value === 'object' && typeof value.primaryTmplIndex === 'number';\n}\n\n/*!\n * @license\n * Copyright Google LLC 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.dev/license\n */\n/** Configuration object used to register passive and capturing events. */\nconst eventListenerOptions = {\n passive: true,\n capture: true\n};\n/** Keeps track of the currently-registered `on hover` triggers. */\nconst hoverTriggers = new WeakMap();\n/** Keeps track of the currently-registered `on interaction` triggers. */\nconst interactionTriggers = new WeakMap();\n/** Currently-registered `viewport` triggers. */\nconst viewportTriggers = new WeakMap();\n/** Names of the events considered as interaction events. */\nconst interactionEventNames = ['click', 'keydown'];\n/** Names of the events considered as hover events. */\nconst hoverEventNames = ['mouseenter', 'focusin'];\n/** `IntersectionObserver` used to observe `viewport` triggers. */\nlet intersectionObserver = null;\n/** Number of elements currently observed with `viewport` triggers. */\nlet observedViewportElements = 0;\n/** Object keeping track of registered callbacks for a deferred block trigger. */\nclass DeferEventEntry {\n constructor() {\n this.callbacks = new Set();\n this.listener = () => {\n for (const callback of this.callbacks) {\n callback();\n }\n };\n }\n}\n/**\n * Registers an interaction trigger.\n * @param trigger Element that is the trigger.\n * @param callback Callback to be invoked when the trigger is interacted with.\n */\nfunction onInteraction(trigger, callback) {\n let entry = interactionTriggers.get(trigger);\n // If this is the first entry for this element, add the listeners.\n if (!entry) {\n // Note that managing events centrally like this lends itself well to using global\n // event delegation. It currently does delegation at the element level, rather than the\n // document level, because:\n // 1. Global delegation is the most effective when there are a lot of events being registered\n // at the same time. Deferred blocks are unlikely to be used in such a way.\n // 2. Matching events to their target isn't free. For each `click` and `keydown` event we\n // would have look through all the triggers and check if the target either is the element\n // itself or it's contained within the element. Given that `click` and `keydown` are some\n // of the most common events, this may end up introducing a lot of runtime overhead.\n // 3. We're still registering only two events per element, no matter how many deferred blocks\n // are referencing it.\n entry = new DeferEventEntry();\n interactionTriggers.set(trigger, entry);\n for (const name of interactionEventNames) {\n trigger.addEventListener(name, entry.listener, eventListenerOptions);\n }\n }\n entry.callbacks.add(callback);\n return () => {\n const {\n callbacks,\n listener\n } = entry;\n callbacks.delete(callback);\n if (callbacks.size === 0) {\n interactionTriggers.delete(trigger);\n for (const name of interactionEventNames) {\n trigger.removeEventListener(name, listener, eventListenerOptions);\n }\n }\n };\n}\n/**\n * Registers a hover trigger.\n * @param trigger Element that is the trigger.\n * @param callback Callback to be invoked when the trigger is hovered over.\n */\nfunction onHover(trigger, callback) {\n let entry = hoverTriggers.get(trigger);\n // If this is the first entry for this element, add the listener.\n if (!entry) {\n entry = new DeferEventEntry();\n hoverTriggers.set(trigger, entry);\n for (const name of hoverEventNames) {\n trigger.addEventListener(name, entry.listener, eventListenerOptions);\n }\n }\n entry.callbacks.add(callback);\n return () => {\n const {\n callbacks,\n listener\n } = entry;\n callbacks.delete(callback);\n if (callbacks.size === 0) {\n for (const name of hoverEventNames) {\n trigger.removeEventListener(name, listener, eventListenerOptions);\n }\n hoverTriggers.delete(trigger);\n }\n };\n}\n/**\n * Registers a viewport trigger.\n * @param trigger Element that is the trigger.\n * @param callback Callback to be invoked when the trigger comes into the viewport.\n * @param injector Injector that can be used by the trigger to resolve DI tokens.\n */\nfunction onViewport(trigger, callback, injector) {\n const ngZone = injector.get(NgZone);\n let entry = viewportTriggers.get(trigger);\n intersectionObserver = intersectionObserver || ngZone.runOutsideAngular(() => {\n return new IntersectionObserver(entries => {\n for (const current of entries) {\n // Only invoke the callbacks if the specific element is intersecting.\n if (current.isIntersecting && viewportTriggers.has(current.target)) {\n ngZone.run(viewportTriggers.get(current.target).listener);\n }\n }\n });\n });\n if (!entry) {\n entry = new DeferEventEntry();\n ngZone.runOutsideAngular(() => intersectionObserver.observe(trigger));\n viewportTriggers.set(trigger, entry);\n observedViewportElements++;\n }\n entry.callbacks.add(callback);\n return () => {\n // It's possible that a different cleanup callback fully removed this element already.\n if (!viewportTriggers.has(trigger)) {\n return;\n }\n entry.callbacks.delete(callback);\n if (entry.callbacks.size === 0) {\n intersectionObserver?.unobserve(trigger);\n viewportTriggers.delete(trigger);\n observedViewportElements--;\n }\n if (observedViewportElements === 0) {\n intersectionObserver?.disconnect();\n intersectionObserver = null;\n }\n };\n}\n/**\n * Helper function to get the LView in which a deferred block's trigger is rendered.\n * @param deferredHostLView LView in which the deferred block is defined.\n * @param deferredTNode TNode defining the deferred block.\n * @param walkUpTimes Number of times to go up in the view hierarchy to find the trigger's view.\n * A negative value means that the trigger is inside the block's placeholder, while an undefined\n * value means that the trigger is in the same LView as the deferred block.\n */\nfunction getTriggerLView(deferredHostLView, deferredTNode, walkUpTimes) {\n // The trigger is in the same view, we don't need to traverse.\n if (walkUpTimes == null) {\n return deferredHostLView;\n }\n // A positive value or zero means that the trigger is in a parent view.\n if (walkUpTimes >= 0) {\n return walkUpViews(walkUpTimes, deferredHostLView);\n }\n // If the value is negative, it means that the trigger is inside the placeholder.\n const deferredContainer = deferredHostLView[deferredTNode.index];\n ngDevMode && assertLContainer(deferredContainer);\n const triggerLView = deferredContainer[CONTAINER_HEADER_OFFSET] ?? null;\n // We need to null check, because the placeholder might not have been rendered yet.\n if (ngDevMode && triggerLView !== null) {\n const lDetails = getLDeferBlockDetails(deferredHostLView, deferredTNode);\n const renderedState = lDetails[DEFER_BLOCK_STATE];\n assertEqual(renderedState, DeferBlockState.Placeholder, 'Expected a placeholder to be rendered in this defer block.');\n assertLView(triggerLView);\n }\n return triggerLView;\n}\n/**\n * Gets the element that a deferred block's trigger is pointing to.\n * @param triggerLView LView in which the trigger is defined.\n * @param triggerIndex Index at which the trigger element should've been rendered.\n */\nfunction getTriggerElement(triggerLView, triggerIndex) {\n const element = getNativeByIndex(HEADER_OFFSET + triggerIndex, triggerLView);\n ngDevMode && assertElement(element);\n return element;\n}\n/**\n * Registers a DOM-node based trigger.\n * @param initialLView LView in which the defer block is rendered.\n * @param tNode TNode representing the defer block.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to go up/down in the view hierarchy to find the trigger.\n * @param registerFn Function that will register the DOM events.\n * @param callback Callback to be invoked when the trigger receives the event that should render\n * the deferred block.\n * @param type Trigger type to distinguish between regular and prefetch triggers.\n */\nfunction registerDomTrigger(initialLView, tNode, triggerIndex, walkUpTimes, registerFn, callback, type) {\n const injector = initialLView[INJECTOR];\n const zone = injector.get(NgZone);\n function pollDomTrigger() {\n // If the initial view was destroyed, we don't need to do anything.\n if (isDestroyed(initialLView)) {\n return;\n }\n const lDetails = getLDeferBlockDetails(initialLView, tNode);\n const renderedState = lDetails[DEFER_BLOCK_STATE];\n // If the block was loaded before the trigger was resolved, we don't need to do anything.\n if (renderedState !== DeferBlockInternalState.Initial && renderedState !== DeferBlockState.Placeholder) {\n return;\n }\n const triggerLView = getTriggerLView(initialLView, tNode, walkUpTimes);\n // Keep polling until we resolve the trigger's LView.\n if (!triggerLView) {\n afterNextRender({\n read: pollDomTrigger\n }, {\n injector\n });\n return;\n }\n // It's possible that the trigger's view was destroyed before we resolved the trigger element.\n if (isDestroyed(triggerLView)) {\n return;\n }\n const element = getTriggerElement(triggerLView, triggerIndex);\n const cleanup = registerFn(element, () => {\n // `pollDomTrigger` runs outside the zone (because of `afterNextRender`) and registers its\n // listeners outside the zone, so we jump back into the zone prior to running the callback.\n zone.run(() => {\n if (initialLView !== triggerLView) {\n removeLViewOnDestroy(triggerLView, cleanup);\n }\n callback();\n });\n }, injector);\n // The trigger and deferred block might be in different LViews.\n // For the main LView the cleanup would happen as a part of\n // `storeTriggerCleanupFn` logic. For trigger LView we register\n // a cleanup function there to remove event handlers in case an\n // LView gets destroyed before a trigger is invoked.\n if (initialLView !== triggerLView) {\n storeLViewOnDestroy(triggerLView, cleanup);\n }\n storeTriggerCleanupFn(type, lDetails, cleanup);\n }\n // Begin polling for the trigger.\n afterNextRender({\n read: pollDomTrigger\n }, {\n injector\n });\n}\n\n/**\n * Helper function to schedule a callback to be invoked when a browser becomes idle.\n *\n * @param callback A function to be invoked when a browser becomes idle.\n * @param lView LView that hosts an instance of a defer block.\n */\nfunction onIdle(callback, lView) {\n const injector = lView[INJECTOR];\n const scheduler = injector.get(IdleScheduler);\n const cleanupFn = () => scheduler.remove(callback);\n scheduler.add(callback);\n return cleanupFn;\n}\n/**\n * Use shims for the `requestIdleCallback` and `cancelIdleCallback` functions for\n * environments where those functions are not available (e.g. Node.js and Safari).\n *\n * Note: we wrap the `requestIdleCallback` call into a function, so that it can be\n * overridden/mocked in test environment and picked up by the runtime code.\n */\nconst _requestIdleCallback = () => typeof requestIdleCallback !== 'undefined' ? requestIdleCallback : setTimeout;\nconst _cancelIdleCallback = () => typeof requestIdleCallback !== 'undefined' ? cancelIdleCallback : clearTimeout;\n/**\n * Helper service to schedule `requestIdleCallback`s for batches of defer blocks,\n * to avoid calling `requestIdleCallback` for each defer block (e.g. if\n * defer blocks are defined inside a for loop).\n */\nclass IdleScheduler {\n constructor() {\n // Indicates whether current callbacks are being invoked.\n this.executingCallbacks = false;\n // Currently scheduled idle callback id.\n this.idleId = null;\n // Set of callbacks to be invoked next.\n this.current = new Set();\n // Set of callbacks collected while invoking current set of callbacks.\n // Those callbacks are scheduled for the next idle period.\n this.deferred = new Set();\n this.ngZone = inject(NgZone);\n this.requestIdleCallbackFn = _requestIdleCallback().bind(globalThis);\n this.cancelIdleCallbackFn = _cancelIdleCallback().bind(globalThis);\n }\n add(callback) {\n const target = this.executingCallbacks ? this.deferred : this.current;\n target.add(callback);\n if (this.idleId === null) {\n this.scheduleIdleCallback();\n }\n }\n remove(callback) {\n const {\n current,\n deferred\n } = this;\n current.delete(callback);\n deferred.delete(callback);\n // If the last callback was removed and there is a pending\n // idle callback - cancel it.\n if (current.size === 0 && deferred.size === 0) {\n this.cancelIdleCallback();\n }\n }\n scheduleIdleCallback() {\n const callback = () => {\n this.cancelIdleCallback();\n this.executingCallbacks = true;\n for (const callback of this.current) {\n callback();\n }\n this.current.clear();\n this.executingCallbacks = false;\n // If there are any callbacks added during an invocation\n // of the current ones - make them \"current\" and schedule\n // a new idle callback.\n if (this.deferred.size > 0) {\n for (const callback of this.deferred) {\n this.current.add(callback);\n }\n this.deferred.clear();\n this.scheduleIdleCallback();\n }\n };\n // Ensure that the callback runs in the NgZone since\n // the `requestIdleCallback` is not currently patched by Zone.js.\n this.idleId = this.requestIdleCallbackFn(() => this.ngZone.run(callback));\n }\n cancelIdleCallback() {\n if (this.idleId !== null) {\n this.cancelIdleCallbackFn(this.idleId);\n this.idleId = null;\n }\n }\n ngOnDestroy() {\n this.cancelIdleCallback();\n this.current.clear();\n this.deferred.clear();\n }\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: IdleScheduler,\n providedIn: 'root',\n factory: () => new IdleScheduler()\n });\n }\n}\n\n/**\n * Returns a function that captures a provided delay.\n * Invoking the returned function schedules a trigger.\n */\nfunction onTimer(delay) {\n return (callback, lView) => scheduleTimerTrigger(delay, callback, lView);\n}\n/**\n * Schedules a callback to be invoked after a given timeout.\n *\n * @param delay A number of ms to wait until firing a callback.\n * @param callback A function to be invoked after a timeout.\n * @param lView LView that hosts an instance of a defer block.\n */\nfunction scheduleTimerTrigger(delay, callback, lView) {\n const injector = lView[INJECTOR];\n const scheduler = injector.get(TimerScheduler);\n const cleanupFn = () => scheduler.remove(callback);\n scheduler.add(delay, callback);\n return cleanupFn;\n}\n/**\n * Helper service to schedule `setTimeout`s for batches of defer blocks,\n * to avoid calling `setTimeout` for each defer block (e.g. if defer blocks\n * are created inside a for loop).\n */\nclass TimerScheduler {\n constructor() {\n // Indicates whether current callbacks are being invoked.\n this.executingCallbacks = false;\n // Currently scheduled `setTimeout` id.\n this.timeoutId = null;\n // When currently scheduled timer would fire.\n this.invokeTimerAt = null;\n // List of callbacks to be invoked.\n // For each callback we also store a timestamp on when the callback\n // should be invoked. We store timestamps and callback functions\n // in a flat array to avoid creating new objects for each entry.\n // [timestamp1, callback1, timestamp2, callback2, ...]\n this.current = [];\n // List of callbacks collected while invoking current set of callbacks.\n // Those callbacks are added to the \"current\" queue at the end of\n // the current callback invocation. The shape of this list is the same\n // as the shape of the `current` list.\n this.deferred = [];\n }\n add(delay, callback) {\n const target = this.executingCallbacks ? this.deferred : this.current;\n this.addToQueue(target, Date.now() + delay, callback);\n this.scheduleTimer();\n }\n remove(callback) {\n const {\n current,\n deferred\n } = this;\n const callbackIndex = this.removeFromQueue(current, callback);\n if (callbackIndex === -1) {\n // Try cleaning up deferred queue only in case\n // we didn't find a callback in the \"current\" queue.\n this.removeFromQueue(deferred, callback);\n }\n // If the last callback was removed and there is a pending timeout - cancel it.\n if (current.length === 0 && deferred.length === 0) {\n this.clearTimeout();\n }\n }\n addToQueue(target, invokeAt, callback) {\n let insertAtIndex = target.length;\n for (let i = 0; i < target.length; i += 2) {\n const invokeQueuedCallbackAt = target[i];\n if (invokeQueuedCallbackAt > invokeAt) {\n // We've reached a first timer that is scheduled\n // for a later time than what we are trying to insert.\n // This is the location at which we need to insert,\n // no need to iterate further.\n insertAtIndex = i;\n break;\n }\n }\n arrayInsert2(target, insertAtIndex, invokeAt, callback);\n }\n removeFromQueue(target, callback) {\n let index = -1;\n for (let i = 0; i < target.length; i += 2) {\n const queuedCallback = target[i + 1];\n if (queuedCallback === callback) {\n index = i;\n break;\n }\n }\n if (index > -1) {\n // Remove 2 elements: a timestamp slot and\n // the following slot with a callback function.\n arraySplice(target, index, 2);\n }\n return index;\n }\n scheduleTimer() {\n const callback = () => {\n this.clearTimeout();\n this.executingCallbacks = true;\n // Clone the current state of the queue, since it might be altered\n // as we invoke callbacks.\n const current = [...this.current];\n // Invoke callbacks that were scheduled to run before the current time.\n const now = Date.now();\n for (let i = 0; i < current.length; i += 2) {\n const invokeAt = current[i];\n const callback = current[i + 1];\n if (invokeAt <= now) {\n callback();\n } else {\n // We've reached a timer that should not be invoked yet.\n break;\n }\n }\n // The state of the queue might've changed after callbacks invocation,\n // run the cleanup logic based on the *current* state of the queue.\n let lastCallbackIndex = -1;\n for (let i = 0; i < this.current.length; i += 2) {\n const invokeAt = this.current[i];\n if (invokeAt <= now) {\n // Add +1 to account for a callback function that\n // goes after the timestamp in events array.\n lastCallbackIndex = i + 1;\n } else {\n // We've reached a timer that should not be invoked yet.\n break;\n }\n }\n if (lastCallbackIndex >= 0) {\n arraySplice(this.current, 0, lastCallbackIndex + 1);\n }\n this.executingCallbacks = false;\n // If there are any callbacks added during an invocation\n // of the current ones - move them over to the \"current\"\n // queue.\n if (this.deferred.length > 0) {\n for (let i = 0; i < this.deferred.length; i += 2) {\n const invokeAt = this.deferred[i];\n const callback = this.deferred[i + 1];\n this.addToQueue(this.current, invokeAt, callback);\n }\n this.deferred.length = 0;\n }\n this.scheduleTimer();\n };\n // Avoid running timer callbacks more than once per\n // average frame duration. This is needed for better\n // batching and to avoid kicking off excessive change\n // detection cycles.\n const FRAME_DURATION_MS = 16; // 1000ms / 60fps\n if (this.current.length > 0) {\n const now = Date.now();\n // First element in the queue points at the timestamp\n // of the first (earliest) event.\n const invokeAt = this.current[0];\n if (this.timeoutId === null ||\n // Reschedule a timer in case a queue contains an item with\n // an earlier timestamp and the delta is more than an average\n // frame duration.\n this.invokeTimerAt && this.invokeTimerAt - invokeAt > FRAME_DURATION_MS) {\n // There was a timeout already, but an earlier event was added\n // into the queue. In this case we drop an old timer and setup\n // a new one with an updated (smaller) timeout.\n this.clearTimeout();\n const timeout = Math.max(invokeAt - now, FRAME_DURATION_MS);\n this.invokeTimerAt = invokeAt;\n this.timeoutId = setTimeout(callback, timeout);\n }\n }\n }\n clearTimeout() {\n if (this.timeoutId !== null) {\n clearTimeout(this.timeoutId);\n this.timeoutId = null;\n }\n }\n ngOnDestroy() {\n this.clearTimeout();\n this.current.length = 0;\n this.deferred.length = 0;\n }\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: TimerScheduler,\n providedIn: 'root',\n factory: () => new TimerScheduler()\n });\n }\n}\n\n/**\n * **INTERNAL**, avoid referencing it in application code.\n * *\n * Injector token that allows to provide `DeferBlockDependencyInterceptor` class\n * implementation.\n *\n * This token is only injected in devMode\n */\nconst DEFER_BLOCK_DEPENDENCY_INTERCEPTOR = new InjectionToken('DEFER_BLOCK_DEPENDENCY_INTERCEPTOR');\n/**\n * **INTERNAL**, token used for configuring defer block behavior.\n */\nconst DEFER_BLOCK_CONFIG = new InjectionToken(ngDevMode ? 'DEFER_BLOCK_CONFIG' : '');\n/**\n * Returns whether defer blocks should be triggered.\n *\n * Currently, defer blocks are not triggered on the server,\n * only placeholder content is rendered (if provided).\n */\nfunction shouldTriggerDeferBlock(injector) {\n const config = injector.get(DEFER_BLOCK_CONFIG, null, {\n optional: true\n });\n if (config?.behavior === DeferBlockBehavior.Manual) {\n return false;\n }\n return isPlatformBrowser(injector);\n}\n/**\n * Reference to the timer-based scheduler implementation of defer block state\n * rendering method. It's used to make timer-based scheduling tree-shakable.\n * If `minimum` or `after` parameters are used, compiler generates an extra\n * argument for the `ɵɵdefer` instruction, which references a timer-based\n * implementation.\n */\nlet applyDeferBlockStateWithSchedulingImpl = null;\n/**\n * Enables timer-related scheduling if `after` or `minimum` parameters are setup\n * on the `@loading` or `@placeholder` blocks.\n */\nfunction ɵɵdeferEnableTimerScheduling(tView, tDetails, placeholderConfigIndex, loadingConfigIndex) {\n const tViewConsts = tView.consts;\n if (placeholderConfigIndex != null) {\n tDetails.placeholderBlockConfig = getConstant(tViewConsts, placeholderConfigIndex);\n }\n if (loadingConfigIndex != null) {\n tDetails.loadingBlockConfig = getConstant(tViewConsts, loadingConfigIndex);\n }\n // Enable implementation that supports timer-based scheduling.\n if (applyDeferBlockStateWithSchedulingImpl === null) {\n applyDeferBlockStateWithSchedulingImpl = applyDeferBlockStateWithScheduling;\n }\n}\n/**\n * Creates runtime data structures for defer blocks.\n *\n * @param index Index of the `defer` instruction.\n * @param primaryTmplIndex Index of the template with the primary block content.\n * @param dependencyResolverFn Function that contains dependencies for this defer block.\n * @param loadingTmplIndex Index of the template with the loading block content.\n * @param placeholderTmplIndex Index of the template with the placeholder block content.\n * @param errorTmplIndex Index of the template with the error block content.\n * @param loadingConfigIndex Index in the constants array of the configuration of the loading.\n * block.\n * @param placeholderConfigIndex Index in the constants array of the configuration of the\n * placeholder block.\n * @param enableTimerScheduling Function that enables timer-related scheduling if `after`\n * or `minimum` parameters are setup on the `@loading` or `@placeholder` blocks.\n *\n * @codeGenApi\n */\nfunction ɵɵdefer(index, primaryTmplIndex, dependencyResolverFn, loadingTmplIndex, placeholderTmplIndex, errorTmplIndex, loadingConfigIndex, placeholderConfigIndex, enableTimerScheduling) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = declareTemplate(lView, tView, index, null, 0, 0);\n if (tView.firstCreatePass) {\n performanceMarkFeature('NgDefer');\n const tDetails = {\n primaryTmplIndex,\n loadingTmplIndex: loadingTmplIndex ?? null,\n placeholderTmplIndex: placeholderTmplIndex ?? null,\n errorTmplIndex: errorTmplIndex ?? null,\n placeholderBlockConfig: null,\n loadingBlockConfig: null,\n dependencyResolverFn: dependencyResolverFn ?? null,\n loadingState: DeferDependenciesLoadingState.NOT_STARTED,\n loadingPromise: null,\n providers: null\n };\n enableTimerScheduling?.(tView, tDetails, placeholderConfigIndex, loadingConfigIndex);\n setTDeferBlockDetails(tView, adjustedIndex, tDetails);\n }\n const lContainer = lView[adjustedIndex];\n // If hydration is enabled, looks up dehydrated views in the DOM\n // using hydration annotation info and stores those views on LContainer.\n // In client-only mode, this function is a noop.\n populateDehydratedViewsInLContainer(lContainer, tNode, lView);\n // Init instance-specific defer details and store it.\n const lDetails = [null,\n // NEXT_DEFER_BLOCK_STATE\n DeferBlockInternalState.Initial,\n // DEFER_BLOCK_STATE\n null,\n // STATE_IS_FROZEN_UNTIL\n null,\n // LOADING_AFTER_CLEANUP_FN\n null,\n // TRIGGER_CLEANUP_FNS\n null // PREFETCH_TRIGGER_CLEANUP_FNS\n ];\n setLDeferBlockDetails(lView, adjustedIndex, lDetails);\n const cleanupTriggersFn = () => invokeAllTriggerCleanupFns(lDetails);\n // When defer block is triggered - unsubscribe from LView destroy cleanup.\n storeTriggerCleanupFn(0 /* TriggerType.Regular */, lDetails, () => removeLViewOnDestroy(lView, cleanupTriggersFn));\n storeLViewOnDestroy(lView, cleanupTriggersFn);\n}\n/**\n * Loads defer block dependencies when a trigger value becomes truthy.\n * @codeGenApi\n */\nfunction ɵɵdeferWhen(rawValue) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, rawValue)) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n const value = Boolean(rawValue); // handle truthy or falsy values\n const tNode = getSelectedTNode();\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const renderedState = lDetails[DEFER_BLOCK_STATE];\n if (value === false && renderedState === DeferBlockInternalState.Initial) {\n // If nothing is rendered yet, render a placeholder (if defined).\n renderPlaceholder(lView, tNode);\n } else if (value === true && (renderedState === DeferBlockInternalState.Initial || renderedState === DeferBlockState.Placeholder)) {\n // The `when` condition has changed to `true`, trigger defer block loading\n // if the block is either in initial (nothing is rendered) or a placeholder\n // state.\n triggerDeferBlock(lView, tNode);\n }\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n}\n/**\n * Prefetches the deferred content when a value becomes truthy.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchWhen(rawValue) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, rawValue)) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n const value = Boolean(rawValue); // handle truthy or falsy values\n const tView = lView[TVIEW];\n const tNode = getSelectedTNode();\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (value === true && tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n // If loading has not been started yet, trigger it now.\n triggerPrefetching(tDetails, lView, tNode);\n }\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n}\n/**\n * Sets up logic to handle the `on idle` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnIdle() {\n scheduleDelayedTrigger(onIdle);\n}\n/**\n * Sets up logic to handle the `prefetch on idle` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnIdle() {\n scheduleDelayedPrefetching(onIdle);\n}\n/**\n * Sets up logic to handle the `on immediate` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnImmediate() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const injector = lView[INJECTOR];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n // Render placeholder block only if loading template is not present and we're on\n // the client to avoid content flickering, since it would be immediately replaced\n // by the loading block.\n if (!shouldTriggerDeferBlock(injector) || tDetails.loadingTmplIndex === null) {\n renderPlaceholder(lView, tNode);\n }\n triggerDeferBlock(lView, tNode);\n}\n/**\n * Sets up logic to handle the `prefetch on immediate` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnImmediate() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n triggerResourceLoading(tDetails, lView, tNode);\n }\n}\n/**\n * Creates runtime data structures for the `on timer` deferred trigger.\n * @param delay Amount of time to wait before loading the content.\n * @codeGenApi\n */\nfunction ɵɵdeferOnTimer(delay) {\n scheduleDelayedTrigger(onTimer(delay));\n}\n/**\n * Creates runtime data structures for the `prefetch on timer` deferred trigger.\n * @param delay Amount of time to wait before prefetching the content.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnTimer(delay) {\n scheduleDelayedPrefetching(onTimer(delay));\n}\n/**\n * Creates runtime data structures for the `on hover` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnHover(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n renderPlaceholder(lView, tNode);\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onHover, () => triggerDeferBlock(lView, tNode), 0 /* TriggerType.Regular */);\n}\n/**\n * Creates runtime data structures for the `prefetch on hover` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnHover(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onHover, () => triggerPrefetching(tDetails, lView, tNode), 1 /* TriggerType.Prefetch */);\n }\n}\n/**\n * Creates runtime data structures for the `on interaction` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnInteraction(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n renderPlaceholder(lView, tNode);\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onInteraction, () => triggerDeferBlock(lView, tNode), 0 /* TriggerType.Regular */);\n}\n/**\n * Creates runtime data structures for the `prefetch on interaction` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnInteraction(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onInteraction, () => triggerPrefetching(tDetails, lView, tNode), 1 /* TriggerType.Prefetch */);\n }\n}\n/**\n * Creates runtime data structures for the `on viewport` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnViewport(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n renderPlaceholder(lView, tNode);\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onViewport, () => triggerDeferBlock(lView, tNode), 0 /* TriggerType.Regular */);\n}\n/**\n * Creates runtime data structures for the `prefetch on viewport` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnViewport(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onViewport, () => triggerPrefetching(tDetails, lView, tNode), 1 /* TriggerType.Prefetch */);\n }\n}\n/********** Helper functions **********/\n/**\n * Schedules triggering of a defer block for `on idle` and `on timer` conditions.\n */\nfunction scheduleDelayedTrigger(scheduleFn) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n renderPlaceholder(lView, tNode);\n // Only trigger the scheduled trigger on the browser\n // since we don't want to delay the server response.\n if (isPlatformBrowser(lView[INJECTOR])) {\n const cleanupFn = scheduleFn(() => triggerDeferBlock(lView, tNode), lView);\n const lDetails = getLDeferBlockDetails(lView, tNode);\n storeTriggerCleanupFn(0 /* TriggerType.Regular */, lDetails, cleanupFn);\n }\n}\n/**\n * Schedules prefetching for `on idle` and `on timer` triggers.\n *\n * @param scheduleFn A function that does the scheduling.\n */\nfunction scheduleDelayedPrefetching(scheduleFn) {\n const lView = getLView();\n // Only trigger the scheduled trigger on the browser\n // since we don't want to delay the server response.\n if (isPlatformBrowser(lView[INJECTOR])) {\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const prefetch = () => triggerPrefetching(tDetails, lView, tNode);\n const cleanupFn = scheduleFn(prefetch, lView);\n storeTriggerCleanupFn(1 /* TriggerType.Prefetch */, lDetails, cleanupFn);\n }\n }\n}\n/**\n * Transitions a defer block to the new state. Updates the necessary\n * data structures and renders corresponding block.\n *\n * @param newState New state that should be applied to the defer block.\n * @param tNode TNode that represents a defer block.\n * @param lContainer Represents an instance of a defer block.\n * @param skipTimerScheduling Indicates that `@loading` and `@placeholder` block\n * should be rendered immediately, even if they have `after` or `minimum` config\n * options setup. This flag to needed for testing APIs to transition defer block\n * between states via `DeferFixture.render` method.\n */\nfunction renderDeferBlockState(newState, tNode, lContainer, skipTimerScheduling = false) {\n const hostLView = lContainer[PARENT];\n const hostTView = hostLView[TVIEW];\n // Check if this view is not destroyed. Since the loading process was async,\n // the view might end up being destroyed by the time rendering happens.\n if (isDestroyed(hostLView)) return;\n // Make sure this TNode belongs to TView that represents host LView.\n ngDevMode && assertTNodeForLView(tNode, hostLView);\n const lDetails = getLDeferBlockDetails(hostLView, tNode);\n ngDevMode && assertDefined(lDetails, 'Expected a defer block state defined');\n const currentState = lDetails[DEFER_BLOCK_STATE];\n if (isValidStateChange(currentState, newState) && isValidStateChange(lDetails[NEXT_DEFER_BLOCK_STATE] ?? -1, newState)) {\n const injector = hostLView[INJECTOR];\n const tDetails = getTDeferBlockDetails(hostTView, tNode);\n // Skips scheduling on the server since it can delay the server response.\n const needsScheduling = !skipTimerScheduling && isPlatformBrowser(injector) && (getLoadingBlockAfter(tDetails) !== null || getMinimumDurationForState(tDetails, DeferBlockState.Loading) !== null || getMinimumDurationForState(tDetails, DeferBlockState.Placeholder));\n if (ngDevMode && needsScheduling) {\n assertDefined(applyDeferBlockStateWithSchedulingImpl, 'Expected scheduling function to be defined');\n }\n const applyStateFn = needsScheduling ? applyDeferBlockStateWithSchedulingImpl : applyDeferBlockState;\n try {\n applyStateFn(newState, lDetails, lContainer, tNode, hostLView);\n } catch (error) {\n handleError(hostLView, error);\n }\n }\n}\n/**\n * Checks whether there is a cached injector associated with a given defer block\n * declaration and returns if it exists. If there is no cached injector present -\n * creates a new injector and stores in the cache.\n */\nfunction getOrCreateEnvironmentInjector(parentInjector, tDetails, providers) {\n return parentInjector.get(CachedInjectorService).getOrCreateInjector(tDetails, parentInjector, providers, ngDevMode ? 'DeferBlock Injector' : '');\n}\n/**\n * Creates a new injector, which contains providers collected from dependencies (NgModules) of\n * defer-loaded components. This function detects different types of parent injectors and creates\n * a new injector based on that.\n */\nfunction createDeferBlockInjector(parentInjector, tDetails, providers) {\n // Check if the parent injector is an instance of a `ChainedInjector`.\n //\n // In this case, we retain the shape of the injector and use a newly created\n // `EnvironmentInjector` as a parent in the `ChainedInjector`. That is needed to\n // make sure that the primary injector gets consulted first (since it's typically\n // a NodeInjector) and `EnvironmentInjector` tree is consulted after that.\n if (parentInjector instanceof ChainedInjector) {\n const origInjector = parentInjector.injector;\n // Guaranteed to be an environment injector\n const parentEnvInjector = parentInjector.parentInjector;\n const envInjector = getOrCreateEnvironmentInjector(parentEnvInjector, tDetails, providers);\n return new ChainedInjector(origInjector, envInjector);\n }\n const parentEnvInjector = parentInjector.get(EnvironmentInjector);\n // If the `parentInjector` is *not* an `EnvironmentInjector` - we need to create\n // a new `ChainedInjector` with the following setup:\n //\n // - the provided `parentInjector` becomes a primary injector\n // - an existing (real) `EnvironmentInjector` becomes a parent injector for\n // a newly-created one, which contains extra providers\n //\n // So the final order in which injectors would be consulted in this case would look like this:\n //\n // 1. Provided `parentInjector`\n // 2. Newly-created `EnvironmentInjector` with extra providers\n // 3. `EnvironmentInjector` from the `parentInjector`\n if (parentEnvInjector !== parentInjector) {\n const envInjector = getOrCreateEnvironmentInjector(parentEnvInjector, tDetails, providers);\n return new ChainedInjector(parentInjector, envInjector);\n }\n // The `parentInjector` is an instance of an `EnvironmentInjector`.\n // No need for special handling, we can use `parentInjector` as a\n // parent injector directly.\n return getOrCreateEnvironmentInjector(parentInjector, tDetails, providers);\n}\n/**\n * Applies changes to the DOM to reflect a given state.\n */\nfunction applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView) {\n const stateTmplIndex = getTemplateIndexForState(newState, hostLView, tNode);\n if (stateTmplIndex !== null) {\n lDetails[DEFER_BLOCK_STATE] = newState;\n const hostTView = hostLView[TVIEW];\n const adjustedIndex = stateTmplIndex + HEADER_OFFSET;\n const activeBlockTNode = getTNode(hostTView, adjustedIndex);\n // There is only 1 view that can be present in an LContainer that\n // represents a defer block, so always refer to the first one.\n const viewIndex = 0;\n removeLViewFromLContainer(lContainer, viewIndex);\n let injector;\n if (newState === DeferBlockState.Complete) {\n // When we render a defer block in completed state, there might be\n // newly loaded standalone components used within the block, which may\n // import NgModules with providers. In order to make those providers\n // available for components declared in that NgModule, we create an instance\n // of an environment injector to host those providers and pass this injector\n // to the logic that creates a view.\n const tDetails = getTDeferBlockDetails(hostTView, tNode);\n const providers = tDetails.providers;\n if (providers && providers.length > 0) {\n injector = createDeferBlockInjector(hostLView[INJECTOR], tDetails, providers);\n }\n }\n const dehydratedView = findMatchingDehydratedView(lContainer, activeBlockTNode.tView.ssrId);\n const embeddedLView = createAndRenderEmbeddedLView(hostLView, activeBlockTNode, null, {\n dehydratedView,\n injector\n });\n addLViewToLContainer(lContainer, embeddedLView, viewIndex, shouldAddViewToDom(activeBlockTNode, dehydratedView));\n markViewDirty(embeddedLView, 2 /* NotificationSource.DeferBlockStateUpdate */);\n }\n}\n/**\n * Extends the `applyDeferBlockState` with timer-based scheduling.\n * This function becomes available on a page if there are defer blocks\n * that use `after` or `minimum` parameters in the `@loading` or\n * `@placeholder` blocks.\n */\nfunction applyDeferBlockStateWithScheduling(newState, lDetails, lContainer, tNode, hostLView) {\n const now = Date.now();\n const hostTView = hostLView[TVIEW];\n const tDetails = getTDeferBlockDetails(hostTView, tNode);\n if (lDetails[STATE_IS_FROZEN_UNTIL] === null || lDetails[STATE_IS_FROZEN_UNTIL] <= now) {\n lDetails[STATE_IS_FROZEN_UNTIL] = null;\n const loadingAfter = getLoadingBlockAfter(tDetails);\n const inLoadingAfterPhase = lDetails[LOADING_AFTER_CLEANUP_FN] !== null;\n if (newState === DeferBlockState.Loading && loadingAfter !== null && !inLoadingAfterPhase) {\n // Trying to render loading, but it has an `after` config,\n // so schedule an update action after a timeout.\n lDetails[NEXT_DEFER_BLOCK_STATE] = newState;\n const cleanupFn = scheduleDeferBlockUpdate(loadingAfter, lDetails, tNode, lContainer, hostLView);\n lDetails[LOADING_AFTER_CLEANUP_FN] = cleanupFn;\n } else {\n // If we transition to a complete or an error state and there is a pending\n // operation to render loading after a timeout - invoke a cleanup operation,\n // which stops the timer.\n if (newState > DeferBlockState.Loading && inLoadingAfterPhase) {\n lDetails[LOADING_AFTER_CLEANUP_FN]();\n lDetails[LOADING_AFTER_CLEANUP_FN] = null;\n lDetails[NEXT_DEFER_BLOCK_STATE] = null;\n }\n applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView);\n const duration = getMinimumDurationForState(tDetails, newState);\n if (duration !== null) {\n lDetails[STATE_IS_FROZEN_UNTIL] = now + duration;\n scheduleDeferBlockUpdate(duration, lDetails, tNode, lContainer, hostLView);\n }\n }\n } else {\n // We are still rendering the previous state.\n // Update the `NEXT_DEFER_BLOCK_STATE`, which would be\n // picked up once it's time to transition to the next state.\n lDetails[NEXT_DEFER_BLOCK_STATE] = newState;\n }\n}\n/**\n * Schedules an update operation after a specified timeout.\n */\nfunction scheduleDeferBlockUpdate(timeout, lDetails, tNode, lContainer, hostLView) {\n const callback = () => {\n const nextState = lDetails[NEXT_DEFER_BLOCK_STATE];\n lDetails[STATE_IS_FROZEN_UNTIL] = null;\n lDetails[NEXT_DEFER_BLOCK_STATE] = null;\n if (nextState !== null) {\n renderDeferBlockState(nextState, tNode, lContainer);\n }\n };\n return scheduleTimerTrigger(timeout, callback, hostLView);\n}\n/**\n * Checks whether we can transition to the next state.\n *\n * We transition to the next state if the previous state was represented\n * with a number that is less than the next state. For example, if the current\n * state is \"loading\" (represented as `1`), we should not show a placeholder\n * (represented as `0`), but we can show a completed state (represented as `2`)\n * or an error state (represented as `3`).\n */\nfunction isValidStateChange(currentState, newState) {\n return currentState < newState;\n}\n/**\n * Trigger prefetching of dependencies for a defer block.\n *\n * @param tDetails Static information about this defer block.\n * @param lView LView of a host view.\n */\nfunction triggerPrefetching(tDetails, lView, tNode) {\n if (lView[INJECTOR] && shouldTriggerDeferBlock(lView[INJECTOR])) {\n triggerResourceLoading(tDetails, lView, tNode);\n }\n}\n/**\n * Trigger loading of defer block dependencies if the process hasn't started yet.\n *\n * @param tDetails Static information about this defer block.\n * @param lView LView of a host view.\n */\nfunction triggerResourceLoading(tDetails, lView, tNode) {\n const injector = lView[INJECTOR];\n const tView = lView[TVIEW];\n if (tDetails.loadingState !== DeferDependenciesLoadingState.NOT_STARTED) {\n // If the loading status is different from initial one, it means that\n // the loading of dependencies is in progress and there is nothing to do\n // in this function. All details can be obtained from the `tDetails` object.\n return tDetails.loadingPromise ?? Promise.resolve();\n }\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const primaryBlockTNode = getPrimaryBlockTNode(tView, tDetails);\n // Switch from NOT_STARTED -> IN_PROGRESS state.\n tDetails.loadingState = DeferDependenciesLoadingState.IN_PROGRESS;\n // Prefetching is triggered, cleanup all registered prefetch triggers.\n invokeTriggerCleanupFns(1 /* TriggerType.Prefetch */, lDetails);\n let dependenciesFn = tDetails.dependencyResolverFn;\n if (ngDevMode) {\n // Check if dependency function interceptor is configured.\n const deferDependencyInterceptor = injector.get(DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, null, {\n optional: true\n });\n if (deferDependencyInterceptor) {\n dependenciesFn = deferDependencyInterceptor.intercept(dependenciesFn);\n }\n }\n // Indicate that an application is not stable and has a pending task.\n const pendingTasks = injector.get(PendingTasks);\n const taskId = pendingTasks.add();\n // The `dependenciesFn` might be `null` when all dependencies within\n // a given defer block were eagerly referenced elsewhere in a file,\n // thus no dynamic `import()`s were produced.\n if (!dependenciesFn) {\n tDetails.loadingPromise = Promise.resolve().then(() => {\n tDetails.loadingPromise = null;\n tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;\n pendingTasks.remove(taskId);\n });\n return tDetails.loadingPromise;\n }\n // Start downloading of defer block dependencies.\n tDetails.loadingPromise = Promise.allSettled(dependenciesFn()).then(results => {\n let failed = false;\n const directiveDefs = [];\n const pipeDefs = [];\n for (const result of results) {\n if (result.status === 'fulfilled') {\n const dependency = result.value;\n const directiveDef = getComponentDef(dependency) || getDirectiveDef(dependency);\n if (directiveDef) {\n directiveDefs.push(directiveDef);\n } else {\n const pipeDef = getPipeDef$1(dependency);\n if (pipeDef) {\n pipeDefs.push(pipeDef);\n }\n }\n } else {\n failed = true;\n break;\n }\n }\n // Loading is completed, we no longer need the loading Promise\n // and a pending task should also be removed.\n tDetails.loadingPromise = null;\n pendingTasks.remove(taskId);\n if (failed) {\n tDetails.loadingState = DeferDependenciesLoadingState.FAILED;\n if (tDetails.errorTmplIndex === null) {\n const templateLocation = ngDevMode ? getTemplateLocationDetails(lView) : '';\n const error = new RuntimeError(750 /* RuntimeErrorCode.DEFER_LOADING_FAILED */, ngDevMode && 'Loading dependencies for `@defer` block failed, ' + `but no \\`@error\\` block was configured${templateLocation}. ` + 'Consider using the `@error` block to render an error state.');\n handleError(lView, error);\n }\n } else {\n tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;\n // Update directive and pipe registries to add newly downloaded dependencies.\n const primaryBlockTView = primaryBlockTNode.tView;\n if (directiveDefs.length > 0) {\n primaryBlockTView.directiveRegistry = addDepsToRegistry(primaryBlockTView.directiveRegistry, directiveDefs);\n // Extract providers from all NgModules imported by standalone components\n // used within this defer block.\n const directiveTypes = directiveDefs.map(def => def.type);\n const providers = internalImportProvidersFrom(false, ...directiveTypes);\n tDetails.providers = providers;\n }\n if (pipeDefs.length > 0) {\n primaryBlockTView.pipeRegistry = addDepsToRegistry(primaryBlockTView.pipeRegistry, pipeDefs);\n }\n }\n });\n return tDetails.loadingPromise;\n}\n/** Utility function to render placeholder content (if present) */\nfunction renderPlaceholder(lView, tNode) {\n const lContainer = lView[tNode.index];\n ngDevMode && assertLContainer(lContainer);\n renderDeferBlockState(DeferBlockState.Placeholder, tNode, lContainer);\n}\n/**\n * Subscribes to the \"loading\" Promise and renders corresponding defer sub-block,\n * based on the loading results.\n *\n * @param lContainer Represents an instance of a defer block.\n * @param tNode Represents defer block info shared across all instances.\n */\nfunction renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer) {\n ngDevMode && assertDefined(tDetails.loadingPromise, 'Expected loading Promise to exist on this defer block');\n tDetails.loadingPromise.then(() => {\n if (tDetails.loadingState === DeferDependenciesLoadingState.COMPLETE) {\n ngDevMode && assertDeferredDependenciesLoaded(tDetails);\n // Everything is loaded, show the primary block content\n renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer);\n } else if (tDetails.loadingState === DeferDependenciesLoadingState.FAILED) {\n renderDeferBlockState(DeferBlockState.Error, tNode, lContainer);\n }\n });\n}\n/**\n * Attempts to trigger loading of defer block dependencies.\n * If the block is already in a loading, completed or an error state -\n * no additional actions are taken.\n */\nfunction triggerDeferBlock(lView, tNode) {\n const tView = lView[TVIEW];\n const lContainer = lView[tNode.index];\n const injector = lView[INJECTOR];\n ngDevMode && assertLContainer(lContainer);\n if (!shouldTriggerDeferBlock(injector)) return;\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const tDetails = getTDeferBlockDetails(tView, tNode);\n // Defer block is triggered, cleanup all registered trigger functions.\n invokeAllTriggerCleanupFns(lDetails);\n switch (tDetails.loadingState) {\n case DeferDependenciesLoadingState.NOT_STARTED:\n renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer);\n triggerResourceLoading(tDetails, lView, tNode);\n // The `loadingState` might have changed to \"loading\".\n if (tDetails.loadingState === DeferDependenciesLoadingState.IN_PROGRESS) {\n renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer);\n }\n break;\n case DeferDependenciesLoadingState.IN_PROGRESS:\n renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer);\n renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer);\n break;\n case DeferDependenciesLoadingState.COMPLETE:\n ngDevMode && assertDeferredDependenciesLoaded(tDetails);\n renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer);\n break;\n case DeferDependenciesLoadingState.FAILED:\n renderDeferBlockState(DeferBlockState.Error, tNode, lContainer);\n break;\n default:\n if (ngDevMode) {\n throwError('Unknown defer block state');\n }\n }\n}\n\n/**\n * Updates the value of or removes a bound attribute on an Element.\n *\n * Used in the case of `[attr.title]=\"value\"`\n *\n * @param name name The name of the attribute.\n * @param value value The attribute is removed when value is `null` or `undefined`.\n * Otherwise the attribute value is set to the stringified value.\n * @param sanitizer An optional function used to sanitize the value.\n * @param namespace Optional namespace to use when setting the attribute.\n *\n * @codeGenApi\n */\nfunction ɵɵattribute(name, value, sanitizer, namespace) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);\n }\n return ɵɵattribute;\n}\n\n/**\n * Create interpolation bindings with a variable number of expressions.\n *\n * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.\n * Those are faster because there is no need to create an array of expressions and iterate over it.\n *\n * `values`:\n * - has static text at even indexes,\n * - has evaluated expressions at odd indexes.\n *\n * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nfunction interpolationV(lView, values) {\n ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');\n ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');\n let isBindingUpdated = false;\n let bindingIndex = getBindingIndex();\n for (let i = 1; i < values.length; i += 2) {\n // Check if bindings (odd indexes) have changed\n isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;\n }\n setBindingIndex(bindingIndex);\n if (!isBindingUpdated) {\n return NO_CHANGE;\n }\n // Build the updated content\n let content = values[0];\n for (let i = 1; i < values.length; i += 2) {\n content += renderStringify(values[i]) + values[i + 1];\n }\n return content;\n}\n/**\n * Creates an interpolation binding with 1 expression.\n *\n * @param prefix static value used for concatenation only.\n * @param v0 value checked for change.\n * @param suffix static value used for concatenation only.\n */\nfunction interpolation1(lView, prefix, v0, suffix) {\n const different = bindingUpdated(lView, nextBindingIndex(), v0);\n return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 2 expressions.\n */\nfunction interpolation2(lView, prefix, v0, i0, v1, suffix) {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated2(lView, bindingIndex, v0, v1);\n incrementBindingIndex(2);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 3 expressions.\n */\nfunction interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);\n incrementBindingIndex(3);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix : NO_CHANGE;\n}\n/**\n * Create an interpolation binding with 4 expressions.\n */\nfunction interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n incrementBindingIndex(4);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 5 expressions.\n */\nfunction interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated(lView, bindingIndex + 4, v4) || different;\n incrementBindingIndex(5);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 6 expressions.\n */\nfunction interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;\n incrementBindingIndex(6);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 7 expressions.\n */\nfunction interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;\n incrementBindingIndex(7);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + i5 + renderStringify(v6) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 8 expressions.\n */\nfunction interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;\n incrementBindingIndex(8);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix : NO_CHANGE;\n}\n\n/**\n *\n * Update an interpolated attribute on an element with single bound value surrounded by text.\n *\n * Used when the value passed to a property has 1 interpolated value in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);\n }\n return ɵɵattributeInterpolate1;\n}\n/**\n *\n * Update an interpolated attribute on an element with 2 bound values surrounded by text.\n *\n * Used when the value passed to a property has 2 interpolated values in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}-{{v1}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);\n }\n return ɵɵattributeInterpolate2;\n}\n/**\n *\n * Update an interpolated attribute on an element with 3 bound values surrounded by text.\n *\n * Used when the value passed to a property has 3 interpolated values in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate3(\n * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);\n }\n return ɵɵattributeInterpolate3;\n}\n/**\n *\n * Update an interpolated attribute on an element with 4 bound values surrounded by text.\n *\n * Used when the value passed to a property has 4 interpolated values in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate4(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);\n }\n return ɵɵattributeInterpolate4;\n}\n/**\n *\n * Update an interpolated attribute on an element with 5 bound values surrounded by text.\n *\n * Used when the value passed to a property has 5 interpolated values in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate5(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);\n }\n return ɵɵattributeInterpolate5;\n}\n/**\n *\n * Update an interpolated attribute on an element with 6 bound values surrounded by text.\n *\n * Used when the value passed to a property has 6 interpolated values in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate6(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate6(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);\n }\n return ɵɵattributeInterpolate6;\n}\n/**\n *\n * Update an interpolated attribute on an element with 7 bound values surrounded by text.\n *\n * Used when the value passed to a property has 7 interpolated values in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate7(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate7(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);\n }\n return ɵɵattributeInterpolate7;\n}\n/**\n *\n * Update an interpolated attribute on an element with 8 bound values surrounded by text.\n *\n * Used when the value passed to a property has 8 interpolated values in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate8(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param i6 Static value used for concatenation only.\n * @param v7 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate8(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);\n }\n return ɵɵattributeInterpolate8;\n}\n/**\n * Update an interpolated attribute on an element with 9 or more bound values surrounded by text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div\n * title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolateV(\n * 'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n * 'suffix']);\n * ```\n *\n * @param attrName The name of the attribute to update.\n * @param values The collection of values and the strings in-between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolateV(attrName, values, sanitizer, namespace) {\n const lView = getLView();\n const interpolated = interpolationV(lView, values);\n if (interpolated !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolated, sanitizer, namespace);\n if (ngDevMode) {\n const interpolationInBetween = [values[0]]; // prefix\n for (let i = 2; i < values.length; i += 2) {\n interpolationInBetween.push(values[i]);\n }\n storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - interpolationInBetween.length + 1, ...interpolationInBetween);\n }\n }\n return ɵɵattributeInterpolateV;\n}\nfunction toTStylingRange(prev, next) {\n ngDevMode && assertNumberInRange(prev, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n return prev << 17 /* StylingRange.PREV_SHIFT */ | next << 2 /* StylingRange.NEXT_SHIFT */;\n}\nfunction getTStylingRangePrev(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return tStylingRange >> 17 /* StylingRange.PREV_SHIFT */ & 32767 /* StylingRange.UNSIGNED_MASK */;\n}\nfunction getTStylingRangePrevDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange & 2 /* StylingRange.PREV_DUPLICATE */) == 2 /* StylingRange.PREV_DUPLICATE */;\n}\nfunction setTStylingRangePrev(tStylingRange, previous) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n ngDevMode && assertNumberInRange(previous, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n return tStylingRange & ~4294836224 /* StylingRange.PREV_MASK */ | previous << 17 /* StylingRange.PREV_SHIFT */;\n}\nfunction setTStylingRangePrevDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return tStylingRange | 2 /* StylingRange.PREV_DUPLICATE */;\n}\nfunction getTStylingRangeNext(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange & 131068 /* StylingRange.NEXT_MASK */) >> 2 /* StylingRange.NEXT_SHIFT */;\n}\nfunction setTStylingRangeNext(tStylingRange, next) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n return tStylingRange & ~131068 /* StylingRange.NEXT_MASK */ |\n //\n next << 2 /* StylingRange.NEXT_SHIFT */;\n}\nfunction getTStylingRangeNextDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange & 1 /* StylingRange.NEXT_DUPLICATE */) === 1 /* StylingRange.NEXT_DUPLICATE */;\n}\nfunction setTStylingRangeNextDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return tStylingRange | 1 /* StylingRange.NEXT_DUPLICATE */;\n}\nfunction getTStylingRangeTail(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n const next = getTStylingRangeNext(tStylingRange);\n return next === 0 ? getTStylingRangePrev(tStylingRange) : next;\n}\n\n/**\n * NOTE: The word `styling` is used interchangeably as style or class styling.\n *\n * This file contains code to link styling instructions together so that they can be replayed in\n * priority order. The file exists because Ivy styling instruction execution order does not match\n * that of the priority order. The purpose of this code is to create a linked list so that the\n * instructions can be traversed in priority order when computing the styles.\n *\n * Assume we are dealing with the following code:\n * ```\n * @Component({\n * template: `\n * <my-cmp [style]=\" {color: '#001'} \"\n * [style.color]=\" #002 \"\n * dir-style-color-1\n * dir-style-color-2> `\n * })\n * class ExampleComponent {\n * static ngComp = ... {\n * ...\n * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n * ɵɵstyleMap({color: '#001'});\n * ɵɵstyleProp('color', '#002');\n * ...\n * }\n * }\n *\n * @Directive({\n * selector: `[dir-style-color-1]',\n * })\n * class Style1Directive {\n * @HostBinding('style') style = {color: '#005'};\n * @HostBinding('style.color') color = '#006';\n *\n * static ngDir = ... {\n * ...\n * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n * ɵɵstyleMap({color: '#005'});\n * ɵɵstyleProp('color', '#006');\n * ...\n * }\n * }\n *\n * @Directive({\n * selector: `[dir-style-color-2]',\n * })\n * class Style2Directive {\n * @HostBinding('style') style = {color: '#007'};\n * @HostBinding('style.color') color = '#008';\n *\n * static ngDir = ... {\n * ...\n * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n * ɵɵstyleMap({color: '#007'});\n * ɵɵstyleProp('color', '#008');\n * ...\n * }\n * }\n *\n * @Directive({\n * selector: `my-cmp',\n * })\n * class MyComponent {\n * @HostBinding('style') style = {color: '#003'};\n * @HostBinding('style.color') color = '#004';\n *\n * static ngComp = ... {\n * ...\n * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n * ɵɵstyleMap({color: '#003'});\n * ɵɵstyleProp('color', '#004');\n * ...\n * }\n * }\n * ```\n *\n * The Order of instruction execution is:\n *\n * NOTE: the comment binding location is for illustrative purposes only.\n *\n * ```\n * // Template: (ExampleComponent)\n * ɵɵstyleMap({color: '#001'}); // Binding index: 10\n * ɵɵstyleProp('color', '#002'); // Binding index: 12\n * // MyComponent\n * ɵɵstyleMap({color: '#003'}); // Binding index: 20\n * ɵɵstyleProp('color', '#004'); // Binding index: 22\n * // Style1Directive\n * ɵɵstyleMap({color: '#005'}); // Binding index: 24\n * ɵɵstyleProp('color', '#006'); // Binding index: 26\n * // Style2Directive\n * ɵɵstyleMap({color: '#007'}); // Binding index: 28\n * ɵɵstyleProp('color', '#008'); // Binding index: 30\n * ```\n *\n * The correct priority order of concatenation is:\n *\n * ```\n * // MyComponent\n * ɵɵstyleMap({color: '#003'}); // Binding index: 20\n * ɵɵstyleProp('color', '#004'); // Binding index: 22\n * // Style1Directive\n * ɵɵstyleMap({color: '#005'}); // Binding index: 24\n * ɵɵstyleProp('color', '#006'); // Binding index: 26\n * // Style2Directive\n * ɵɵstyleMap({color: '#007'}); // Binding index: 28\n * ɵɵstyleProp('color', '#008'); // Binding index: 30\n * // Template: (ExampleComponent)\n * ɵɵstyleMap({color: '#001'}); // Binding index: 10\n * ɵɵstyleProp('color', '#002'); // Binding index: 12\n * ```\n *\n * What color should be rendered?\n *\n * Once the items are correctly sorted in the list, the answer is simply the last item in the\n * concatenation list which is `#002`.\n *\n * To do so we keep a linked list of all of the bindings which pertain to this element.\n * Notice that the bindings are inserted in the order of execution, but the `TView.data` allows\n * us to traverse them in the order of priority.\n *\n * |Idx|`TView.data`|`LView` | Notes\n * |---|------------|-----------------|--------------\n * |...| | |\n * |10 |`null` |`{color: '#001'}`| `ɵɵstyleMap('color', {color: '#001'})`\n * |11 |`30 | 12` | ... |\n * |12 |`color` |`'#002'` | `ɵɵstyleProp('color', '#002')`\n * |13 |`10 | 0` | ... |\n * |...| | |\n * |20 |`null` |`{color: '#003'}`| `ɵɵstyleMap('color', {color: '#003'})`\n * |21 |`0 | 22` | ... |\n * |22 |`color` |`'#004'` | `ɵɵstyleProp('color', '#004')`\n * |23 |`20 | 24` | ... |\n * |24 |`null` |`{color: '#005'}`| `ɵɵstyleMap('color', {color: '#005'})`\n * |25 |`22 | 26` | ... |\n * |26 |`color` |`'#006'` | `ɵɵstyleProp('color', '#006')`\n * |27 |`24 | 28` | ... |\n * |28 |`null` |`{color: '#007'}`| `ɵɵstyleMap('color', {color: '#007'})`\n * |29 |`26 | 30` | ... |\n * |30 |`color` |`'#008'` | `ɵɵstyleProp('color', '#008')`\n * |31 |`28 | 10` | ... |\n *\n * The above data structure allows us to re-concatenate the styling no matter which data binding\n * changes.\n *\n * NOTE: in addition to keeping track of next/previous index the `TView.data` also stores prev/next\n * duplicate bit. The duplicate bit if true says there either is a binding with the same name or\n * there is a map (which may contain the name). This information is useful in knowing if other\n * styles with higher priority need to be searched for overwrites.\n *\n * NOTE: See `should support example in 'tnode_linked_list.ts' documentation` in\n * `tnode_linked_list_spec.ts` for working example.\n */\nlet __unused_const_as_closure_does_not_like_standalone_comment_blocks__;\n/**\n * Insert new `tStyleValue` at `TData` and link existing style bindings such that we maintain linked\n * list of styles and compute the duplicate flag.\n *\n * Note: this function is executed during `firstUpdatePass` only to populate the `TView.data`.\n *\n * The function works by keeping track of `tStylingRange` which contains two pointers pointing to\n * the head/tail of the template portion of the styles.\n * - if `isHost === false` (we are template) then insertion is at tail of `TStylingRange`\n * - if `isHost === true` (we are host binding) then insertion is at head of `TStylingRange`\n *\n * @param tData The `TData` to insert into.\n * @param tNode `TNode` associated with the styling element.\n * @param tStylingKey See `TStylingKey`.\n * @param index location of where `tStyleValue` should be stored (and linked into list.)\n * @param isHostBinding `true` if the insertion is for a `hostBinding`. (insertion is in front of\n * template.)\n * @param isClassBinding True if the associated `tStylingKey` as a `class` styling.\n * `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.)\n */\nfunction insertTStylingBinding(tData, tNode, tStylingKeyWithStatic, index, isHostBinding, isClassBinding) {\n ngDevMode && assertFirstUpdatePass(getTView());\n let tBindings = isClassBinding ? tNode.classBindings : tNode.styleBindings;\n let tmplHead = getTStylingRangePrev(tBindings);\n let tmplTail = getTStylingRangeNext(tBindings);\n tData[index] = tStylingKeyWithStatic;\n let isKeyDuplicateOfStatic = false;\n let tStylingKey;\n if (Array.isArray(tStylingKeyWithStatic)) {\n // We are case when the `TStylingKey` contains static fields as well.\n const staticKeyValueArray = tStylingKeyWithStatic;\n tStylingKey = staticKeyValueArray[1]; // unwrap.\n // We need to check if our key is present in the static so that we can mark it as duplicate.\n if (tStylingKey === null || keyValueArrayIndexOf(staticKeyValueArray, tStylingKey) > 0) {\n // tStylingKey is present in the statics, need to mark it as duplicate.\n isKeyDuplicateOfStatic = true;\n }\n } else {\n tStylingKey = tStylingKeyWithStatic;\n }\n if (isHostBinding) {\n // We are inserting host bindings\n // If we don't have template bindings then `tail` is 0.\n const hasTemplateBindings = tmplTail !== 0;\n // This is important to know because that means that the `head` can't point to the first\n // template bindings (there are none.) Instead the head points to the tail of the template.\n if (hasTemplateBindings) {\n // template head's \"prev\" will point to last host binding or to 0 if no host bindings yet\n const previousNode = getTStylingRangePrev(tData[tmplHead + 1]);\n tData[index + 1] = toTStylingRange(previousNode, tmplHead);\n // if a host binding has already been registered, we need to update the next of that host\n // binding to point to this one\n if (previousNode !== 0) {\n // We need to update the template-tail value to point to us.\n tData[previousNode + 1] = setTStylingRangeNext(tData[previousNode + 1], index);\n }\n // The \"previous\" of the template binding head should point to this host binding\n tData[tmplHead + 1] = setTStylingRangePrev(tData[tmplHead + 1], index);\n } else {\n tData[index + 1] = toTStylingRange(tmplHead, 0);\n // if a host binding has already been registered, we need to update the next of that host\n // binding to point to this one\n if (tmplHead !== 0) {\n // We need to update the template-tail value to point to us.\n tData[tmplHead + 1] = setTStylingRangeNext(tData[tmplHead + 1], index);\n }\n // if we don't have template, the head points to template-tail, and needs to be advanced.\n tmplHead = index;\n }\n } else {\n // We are inserting in template section.\n // We need to set this binding's \"previous\" to the current template tail\n tData[index + 1] = toTStylingRange(tmplTail, 0);\n ngDevMode && assertEqual(tmplHead !== 0 && tmplTail === 0, false, 'Adding template bindings after hostBindings is not allowed.');\n if (tmplHead === 0) {\n tmplHead = index;\n } else {\n // We need to update the previous value \"next\" to point to this binding\n tData[tmplTail + 1] = setTStylingRangeNext(tData[tmplTail + 1], index);\n }\n tmplTail = index;\n }\n // Now we need to update / compute the duplicates.\n // Starting with our location search towards head (least priority)\n if (isKeyDuplicateOfStatic) {\n tData[index + 1] = setTStylingRangePrevDuplicate(tData[index + 1]);\n }\n markDuplicates(tData, tStylingKey, index, true);\n markDuplicates(tData, tStylingKey, index, false);\n markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding);\n tBindings = toTStylingRange(tmplHead, tmplTail);\n if (isClassBinding) {\n tNode.classBindings = tBindings;\n } else {\n tNode.styleBindings = tBindings;\n }\n}\n/**\n * Look into the residual styling to see if the current `tStylingKey` is duplicate of residual.\n *\n * @param tNode `TNode` where the residual is stored.\n * @param tStylingKey `TStylingKey` to store.\n * @param tData `TData` associated with the current `LView`.\n * @param index location of where `tStyleValue` should be stored (and linked into list.)\n * @param isClassBinding True if the associated `tStylingKey` as a `class` styling.\n * `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.)\n */\nfunction markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding) {\n const residual = isClassBinding ? tNode.residualClasses : tNode.residualStyles;\n if (residual != null /* or undefined */ && typeof tStylingKey == 'string' && keyValueArrayIndexOf(residual, tStylingKey) >= 0) {\n // We have duplicate in the residual so mark ourselves as duplicate.\n tData[index + 1] = setTStylingRangeNextDuplicate(tData[index + 1]);\n }\n}\n/**\n * Marks `TStyleValue`s as duplicates if another style binding in the list has the same\n * `TStyleValue`.\n *\n * NOTE: this function is intended to be called twice once with `isPrevDir` set to `true` and once\n * with it set to `false` to search both the previous as well as next items in the list.\n *\n * No duplicate case\n * ```\n * [style.color]\n * [style.width.px] <<- index\n * [style.height.px]\n * ```\n *\n * In the above case adding `[style.width.px]` to the existing `[style.color]` produces no\n * duplicates because `width` is not found in any other part of the linked list.\n *\n * Duplicate case\n * ```\n * [style.color]\n * [style.width.em]\n * [style.width.px] <<- index\n * ```\n * In the above case adding `[style.width.px]` will produce a duplicate with `[style.width.em]`\n * because `width` is found in the chain.\n *\n * Map case 1\n * ```\n * [style.width.px]\n * [style.color]\n * [style] <<- index\n * ```\n * In the above case adding `[style]` will produce a duplicate with any other bindings because\n * `[style]` is a Map and as such is fully dynamic and could produce `color` or `width`.\n *\n * Map case 2\n * ```\n * [style]\n * [style.width.px]\n * [style.color] <<- index\n * ```\n * In the above case adding `[style.color]` will produce a duplicate because there is already a\n * `[style]` binding which is a Map and as such is fully dynamic and could produce `color` or\n * `width`.\n *\n * NOTE: Once `[style]` (Map) is added into the system all things are mapped as duplicates.\n * NOTE: We use `style` as example, but same logic is applied to `class`es as well.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tStylingKey `TStylingKeyPrimitive` which contains the value to compare to other keys in\n * the linked list.\n * @param index Starting location in the linked list to search from\n * @param isPrevDir Direction.\n * - `true` for previous (lower priority);\n * - `false` for next (higher priority).\n */\nfunction markDuplicates(tData, tStylingKey, index, isPrevDir) {\n const tStylingAtIndex = tData[index + 1];\n const isMap = tStylingKey === null;\n let cursor = isPrevDir ? getTStylingRangePrev(tStylingAtIndex) : getTStylingRangeNext(tStylingAtIndex);\n let foundDuplicate = false;\n // We keep iterating as long as we have a cursor\n // AND either:\n // - we found what we are looking for, OR\n // - we are a map in which case we have to continue searching even after we find what we were\n // looking for since we are a wild card and everything needs to be flipped to duplicate.\n while (cursor !== 0 && (foundDuplicate === false || isMap)) {\n ngDevMode && assertIndexInRange(tData, cursor);\n const tStylingValueAtCursor = tData[cursor];\n const tStyleRangeAtCursor = tData[cursor + 1];\n if (isStylingMatch(tStylingValueAtCursor, tStylingKey)) {\n foundDuplicate = true;\n tData[cursor + 1] = isPrevDir ? setTStylingRangeNextDuplicate(tStyleRangeAtCursor) : setTStylingRangePrevDuplicate(tStyleRangeAtCursor);\n }\n cursor = isPrevDir ? getTStylingRangePrev(tStyleRangeAtCursor) : getTStylingRangeNext(tStyleRangeAtCursor);\n }\n if (foundDuplicate) {\n // if we found a duplicate, than mark ourselves.\n tData[index + 1] = isPrevDir ? setTStylingRangePrevDuplicate(tStylingAtIndex) : setTStylingRangeNextDuplicate(tStylingAtIndex);\n }\n}\n/**\n * Determines if two `TStylingKey`s are a match.\n *\n * When computing whether a binding contains a duplicate, we need to compare if the instruction\n * `TStylingKey` has a match.\n *\n * Here are examples of `TStylingKey`s which match given `tStylingKeyCursor` is:\n * - `color`\n * - `color` // Match another color\n * - `null` // That means that `tStylingKey` is a `classMap`/`styleMap` instruction\n * - `['', 'color', 'other', true]` // wrapped `color` so match\n * - `['', null, 'other', true]` // wrapped `null` so match\n * - `['', 'width', 'color', 'value']` // wrapped static value contains a match on `'color'`\n * - `null` // `tStylingKeyCursor` always match as it is `classMap`/`styleMap` instruction\n *\n * @param tStylingKeyCursor\n * @param tStylingKey\n */\nfunction isStylingMatch(tStylingKeyCursor, tStylingKey) {\n ngDevMode && assertNotEqual(Array.isArray(tStylingKey), true, \"Expected that 'tStylingKey' has been unwrapped\");\n if (tStylingKeyCursor === null ||\n // If the cursor is `null` it means that we have map at that\n // location so we must assume that we have a match.\n tStylingKey == null ||\n // If `tStylingKey` is `null` then it is a map therefor assume that it\n // contains a match.\n (Array.isArray(tStylingKeyCursor) ? tStylingKeyCursor[1] : tStylingKeyCursor) === tStylingKey // If the keys match explicitly than we are a match.\n ) {\n return true;\n } else if (Array.isArray(tStylingKeyCursor) && typeof tStylingKey === 'string') {\n // if we did not find a match, but `tStylingKeyCursor` is `KeyValueArray` that means cursor has\n // statics and we need to check those as well.\n return keyValueArrayIndexOf(tStylingKeyCursor, tStylingKey) >= 0; // see if we are matching the key\n }\n return false;\n}\n\n// Global state of the parser. (This makes parser non-reentrant, but that is not an issue)\nconst parserState = {\n textEnd: 0,\n key: 0,\n keyEnd: 0,\n value: 0,\n valueEnd: 0\n};\n/**\n * Retrieves the last parsed `key` of style.\n * @param text the text to substring the key from.\n */\nfunction getLastParsedKey(text) {\n return text.substring(parserState.key, parserState.keyEnd);\n}\n/**\n * Retrieves the last parsed `value` of style.\n * @param text the text to substring the key from.\n */\nfunction getLastParsedValue(text) {\n return text.substring(parserState.value, parserState.valueEnd);\n}\n/**\n * Initializes `className` string for parsing and parses the first token.\n *\n * This function is intended to be used in this format:\n * ```\n * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n * const key = getLastParsedKey();\n * ...\n * }\n * ```\n * @param text `className` to parse\n * @returns index where the next invocation of `parseClassNameNext` should resume.\n */\nfunction parseClassName(text) {\n resetParserState(text);\n return parseClassNameNext(text, consumeWhitespace(text, 0, parserState.textEnd));\n}\n/**\n * Parses next `className` token.\n *\n * This function is intended to be used in this format:\n * ```\n * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n * const key = getLastParsedKey();\n * ...\n * }\n * ```\n *\n * @param text `className` to parse\n * @param index where the parsing should resume.\n * @returns index where the next invocation of `parseClassNameNext` should resume.\n */\nfunction parseClassNameNext(text, index) {\n const end = parserState.textEnd;\n if (end === index) {\n return -1;\n }\n index = parserState.keyEnd = consumeClassToken(text, parserState.key = index, end);\n return consumeWhitespace(text, index, end);\n}\n/**\n * Initializes `cssText` string for parsing and parses the first key/values.\n *\n * This function is intended to be used in this format:\n * ```\n * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) {\n * const key = getLastParsedKey();\n * const value = getLastParsedValue();\n * ...\n * }\n * ```\n * @param text `cssText` to parse\n * @returns index where the next invocation of `parseStyleNext` should resume.\n */\nfunction parseStyle(text) {\n resetParserState(text);\n return parseStyleNext(text, consumeWhitespace(text, 0, parserState.textEnd));\n}\n/**\n * Parses the next `cssText` key/values.\n *\n * This function is intended to be used in this format:\n * ```\n * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) {\n * const key = getLastParsedKey();\n * const value = getLastParsedValue();\n * ...\n * }\n *\n * @param text `cssText` to parse\n * @param index where the parsing should resume.\n * @returns index where the next invocation of `parseStyleNext` should resume.\n */\nfunction parseStyleNext(text, startIndex) {\n const end = parserState.textEnd;\n let index = parserState.key = consumeWhitespace(text, startIndex, end);\n if (end === index) {\n // we reached an end so just quit\n return -1;\n }\n index = parserState.keyEnd = consumeStyleKey(text, index, end);\n index = consumeSeparator(text, index, end, 58 /* CharCode.COLON */);\n index = parserState.value = consumeWhitespace(text, index, end);\n index = parserState.valueEnd = consumeStyleValue(text, index, end);\n return consumeSeparator(text, index, end, 59 /* CharCode.SEMI_COLON */);\n}\n/**\n * Reset the global state of the styling parser.\n * @param text The styling text to parse.\n */\nfunction resetParserState(text) {\n parserState.key = 0;\n parserState.keyEnd = 0;\n parserState.value = 0;\n parserState.valueEnd = 0;\n parserState.textEnd = text.length;\n}\n/**\n * Returns index of next non-whitespace character.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index of next non-whitespace character (May be the same as `start` if no whitespace at\n * that location.)\n */\nfunction consumeWhitespace(text, startIndex, endIndex) {\n while (startIndex < endIndex && text.charCodeAt(startIndex) <= 32 /* CharCode.SPACE */) {\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Returns index of last char in class token.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last char in class token.\n */\nfunction consumeClassToken(text, startIndex, endIndex) {\n while (startIndex < endIndex && text.charCodeAt(startIndex) > 32 /* CharCode.SPACE */) {\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Consumes all of the characters belonging to style key and token.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last style key character.\n */\nfunction consumeStyleKey(text, startIndex, endIndex) {\n let ch;\n while (startIndex < endIndex && ((ch = text.charCodeAt(startIndex)) === 45 /* CharCode.DASH */ || ch === 95 /* CharCode.UNDERSCORE */ || (ch & -33 /* CharCode.UPPER_CASE */) >= 65 /* CharCode.A */ && (ch & -33 /* CharCode.UPPER_CASE */) <= 90 /* CharCode.Z */ || ch >= 48 /* CharCode.ZERO */ && ch <= 57 /* CharCode.NINE */)) {\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Consumes all whitespace and the separator `:` after the style key.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after separator and surrounding whitespace.\n */\nfunction consumeSeparator(text, startIndex, endIndex, separator) {\n startIndex = consumeWhitespace(text, startIndex, endIndex);\n if (startIndex < endIndex) {\n if (ngDevMode && text.charCodeAt(startIndex) !== separator) {\n malformedStyleError(text, String.fromCharCode(separator), startIndex);\n }\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Consumes style value honoring `url()` and `\"\"` text.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last style value character.\n */\nfunction consumeStyleValue(text, startIndex, endIndex) {\n let ch1 = -1; // 1st previous character\n let ch2 = -1; // 2nd previous character\n let ch3 = -1; // 3rd previous character\n let i = startIndex;\n let lastChIndex = i;\n while (i < endIndex) {\n const ch = text.charCodeAt(i++);\n if (ch === 59 /* CharCode.SEMI_COLON */) {\n return lastChIndex;\n } else if (ch === 34 /* CharCode.DOUBLE_QUOTE */ || ch === 39 /* CharCode.SINGLE_QUOTE */) {\n lastChIndex = i = consumeQuotedText(text, ch, i, endIndex);\n } else if (startIndex === i - 4 &&\n // We have seen only 4 characters so far \"URL(\" (Ignore \"foo_URL()\")\n ch3 === 85 /* CharCode.U */ && ch2 === 82 /* CharCode.R */ && ch1 === 76 /* CharCode.L */ && ch === 40 /* CharCode.OPEN_PAREN */) {\n lastChIndex = i = consumeQuotedText(text, 41 /* CharCode.CLOSE_PAREN */, i, endIndex);\n } else if (ch > 32 /* CharCode.SPACE */) {\n // if we have a non-whitespace character then capture its location\n lastChIndex = i;\n }\n ch3 = ch2;\n ch2 = ch1;\n ch1 = ch & -33 /* CharCode.UPPER_CASE */;\n }\n return lastChIndex;\n}\n/**\n * Consumes all of the quoted characters.\n *\n * @param text Text to scan\n * @param quoteCharCode CharCode of either `\"` or `'` quote or `)` for `url(...)`.\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after quoted characters.\n */\nfunction consumeQuotedText(text, quoteCharCode, startIndex, endIndex) {\n let ch1 = -1; // 1st previous character\n let index = startIndex;\n while (index < endIndex) {\n const ch = text.charCodeAt(index++);\n if (ch == quoteCharCode && ch1 !== 92 /* CharCode.BACK_SLASH */) {\n return index;\n }\n if (ch == 92 /* CharCode.BACK_SLASH */ && ch1 === 92 /* CharCode.BACK_SLASH */) {\n // two back slashes cancel each other out. For example `\"\\\\\"` should properly end the\n // quotation. (It should not assume that the last `\"` is escaped.)\n ch1 = 0;\n } else {\n ch1 = ch;\n }\n }\n throw ngDevMode ? malformedStyleError(text, String.fromCharCode(quoteCharCode), endIndex) : new Error();\n}\nfunction malformedStyleError(text, expecting, index) {\n ngDevMode && assertEqual(typeof text === 'string', true, 'String expected here');\n throw throwError(`Malformed style at location ${index} in string '` + text.substring(0, index) + '[>>' + text.substring(index, index + 1) + '<<]' + text.slice(index + 1) + `'. Expecting '${expecting}'.`);\n}\n\n/**\n * Update a property on a selected element.\n *\n * Operates on the element selected by index via the {@link select} instruction.\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled\n *\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @returns This function returns itself so that it may be chained\n * (e.g. `property('name', ctx.name)('title', ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵproperty(propName, value, sanitizer) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, false);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵproperty;\n}\n/**\n * Given `<div style=\"...\" my-dir>` and `MyDir` with `@Input('style')` we need to write to\n * directive input.\n */\nfunction setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased) {\n const inputs = tNode.inputs;\n const property = isClassBased ? 'class' : 'style';\n // We support both 'class' and `className` hence the fallback.\n setInputsForProperty(tView, lView, inputs[property], property, value);\n}\n\n/**\n * Update a style binding on an element with the provided value.\n *\n * If the style value is falsy then it will be removed from the element\n * (or assigned a different value depending if there are any styles placed\n * on the element with `styleMap` or any static styles that are\n * present from when the element was created with `styling`).\n *\n * Note that the styling element is updated as part of `stylingApply`.\n *\n * @param prop A valid CSS property.\n * @param value New value to write (`null` or an empty string to remove).\n * @param suffix Optional suffix. Used with scalar values to add unit such as `px`.\n *\n * Note that this will apply the provided style value to the host element if this function is called\n * within a host binding function.\n *\n * @codeGenApi\n */\nfunction ɵɵstyleProp(prop, value, suffix) {\n checkStylingProperty(prop, value, suffix, false);\n return ɵɵstyleProp;\n}\n/**\n * Update a class binding on an element with the provided value.\n *\n * This instruction is meant to handle the `[class.foo]=\"exp\"` case and,\n * therefore, the class binding itself must already be allocated using\n * `styling` within the creation block.\n *\n * @param prop A valid CSS class (only one).\n * @param value A true/false value which will turn the class on or off.\n *\n * Note that this will apply the provided class value to the host element if this function\n * is called within a host binding function.\n *\n * @codeGenApi\n */\nfunction ɵɵclassProp(className, value) {\n checkStylingProperty(className, value, null, true);\n return ɵɵclassProp;\n}\n/**\n * Update style bindings using an object literal on an element.\n *\n * This instruction is meant to apply styling via the `[style]=\"exp\"` template bindings.\n * When styles are applied to the element they will then be updated with respect to\n * any styles/classes set via `styleProp`. If any styles are set to falsy\n * then they will be removed from the element.\n *\n * Note that the styling instruction will not be applied until `stylingApply` is called.\n *\n * @param styles A key/value style map of the styles that will be applied to the given element.\n * Any missing styles (that have already been applied to the element beforehand) will be\n * removed (unset) from the element's styling.\n *\n * Note that this will apply the provided styleMap value to the host element if this function\n * is called within a host binding.\n *\n * @codeGenApi\n */\nfunction ɵɵstyleMap(styles) {\n checkStylingMap(styleKeyValueArraySet, styleStringParser, styles, false);\n}\n/**\n * Parse text as style and add values to KeyValueArray.\n *\n * This code is pulled out to a separate function so that it can be tree shaken away if it is not\n * needed. It is only referenced from `ɵɵstyleMap`.\n *\n * @param keyValueArray KeyValueArray to add parsed values to.\n * @param text text to parse.\n */\nfunction styleStringParser(keyValueArray, text) {\n for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i)) {\n styleKeyValueArraySet(keyValueArray, getLastParsedKey(text), getLastParsedValue(text));\n }\n}\n/**\n * Update class bindings using an object literal or class-string on an element.\n *\n * This instruction is meant to apply styling via the `[class]=\"exp\"` template bindings.\n * When classes are applied to the element they will then be updated with\n * respect to any styles/classes set via `classProp`. If any\n * classes are set to falsy then they will be removed from the element.\n *\n * Note that the styling instruction will not be applied until `stylingApply` is called.\n * Note that this will the provided classMap value to the host element if this function is called\n * within a host binding.\n *\n * @param classes A key/value map or string of CSS classes that will be added to the\n * given element. Any missing classes (that have already been applied to the element\n * beforehand) will be removed (unset) from the element's list of CSS classes.\n *\n * @codeGenApi\n */\nfunction ɵɵclassMap(classes) {\n checkStylingMap(classKeyValueArraySet, classStringParser, classes, true);\n}\n/**\n * Parse text as class and add values to KeyValueArray.\n *\n * This code is pulled out to a separate function so that it can be tree shaken away if it is not\n * needed. It is only referenced from `ɵɵclassMap`.\n *\n * @param keyValueArray KeyValueArray to add parsed values to.\n * @param text text to parse.\n */\nfunction classStringParser(keyValueArray, text) {\n for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n keyValueArraySet(keyValueArray, getLastParsedKey(text), true);\n }\n}\n/**\n * Common code between `ɵɵclassProp` and `ɵɵstyleProp`.\n *\n * @param prop property name.\n * @param value binding value.\n * @param suffix suffix for the property (e.g. `em` or `px`)\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nfunction checkStylingProperty(prop, value, suffix, isClassBased) {\n const lView = getLView();\n const tView = getTView();\n // Styling instructions use 2 slots per binding.\n // 1. one for the value / TStylingKey\n // 2. one for the intermittent-value / TStylingRange\n const bindingIndex = incrementBindingIndex(2);\n if (tView.firstUpdatePass) {\n stylingFirstUpdatePass(tView, prop, bindingIndex, isClassBased);\n }\n if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {\n const tNode = tView.data[getSelectedIndex()];\n updateStyling(tView, tNode, lView, lView[RENDERER], prop, lView[bindingIndex + 1] = normalizeSuffix(value, suffix), isClassBased, bindingIndex);\n }\n}\n/**\n * Common code between `ɵɵclassMap` and `ɵɵstyleMap`.\n *\n * @param keyValueArraySet (See `keyValueArraySet` in \"util/array_utils\") Gets passed in as a\n * function so that `style` can be processed. This is done for tree shaking purposes.\n * @param stringParser Parser used to parse `value` if `string`. (Passed in as `style` and `class`\n * have different parsers.)\n * @param value bound value from application\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nfunction checkStylingMap(keyValueArraySet, stringParser, value, isClassBased) {\n const tView = getTView();\n const bindingIndex = incrementBindingIndex(2);\n if (tView.firstUpdatePass) {\n stylingFirstUpdatePass(tView, null, bindingIndex, isClassBased);\n }\n const lView = getLView();\n if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {\n // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the\n // if so as not to read unnecessarily.\n const tNode = tView.data[getSelectedIndex()];\n if (hasStylingInputShadow(tNode, isClassBased) && !isInHostBindings(tView, bindingIndex)) {\n if (ngDevMode) {\n // verify that if we are shadowing then `TData` is appropriately marked so that we skip\n // processing this binding in styling resolution.\n const tStylingKey = tView.data[bindingIndex];\n assertEqual(Array.isArray(tStylingKey) ? tStylingKey[1] : tStylingKey, false, \"Styling linked list shadow input should be marked as 'false'\");\n }\n // VE does not concatenate the static portion like we are doing here.\n // Instead VE just ignores the static completely if dynamic binding is present.\n // Because of locality we have already set the static portion because we don't know if there\n // is a dynamic portion until later. If we would ignore the static portion it would look like\n // the binding has removed it. This would confuse `[ngStyle]`/`[ngClass]` to do the wrong\n // thing as it would think that the static portion was removed. For this reason we\n // concatenate it so that `[ngStyle]`/`[ngClass]` can continue to work on changed.\n let staticPrefix = isClassBased ? tNode.classesWithoutHost : tNode.stylesWithoutHost;\n ngDevMode && isClassBased === false && staticPrefix !== null && assertEqual(staticPrefix.endsWith(';'), true, \"Expecting static portion to end with ';'\");\n if (staticPrefix !== null) {\n // We want to make sure that falsy values of `value` become empty strings.\n value = concatStringsWithSpace(staticPrefix, value ? value : '');\n }\n // Given `<div [style] my-dir>` such that `my-dir` has `@Input('style')`.\n // This takes over the `[style]` binding. (Same for `[class]`)\n setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased);\n } else {\n updateStylingMap(tView, tNode, lView, lView[RENDERER], lView[bindingIndex + 1], lView[bindingIndex + 1] = toStylingKeyValueArray(keyValueArraySet, stringParser, value), isClassBased, bindingIndex);\n }\n }\n}\n/**\n * Determines when the binding is in `hostBindings` section\n *\n * @param tView Current `TView`\n * @param bindingIndex index of binding which we would like if it is in `hostBindings`\n */\nfunction isInHostBindings(tView, bindingIndex) {\n // All host bindings are placed after the expando section.\n return bindingIndex >= tView.expandoStartIndex;\n}\n/**\n * Collects the necessary information to insert the binding into a linked list of style bindings\n * using `insertTStylingBinding`.\n *\n * @param tView `TView` where the binding linked list will be stored.\n * @param tStylingKey Property/key of the binding.\n * @param bindingIndex Index of binding associated with the `prop`\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nfunction stylingFirstUpdatePass(tView, tStylingKey, bindingIndex, isClassBased) {\n ngDevMode && assertFirstUpdatePass(tView);\n const tData = tView.data;\n if (tData[bindingIndex + 1] === null) {\n // The above check is necessary because we don't clear first update pass until first successful\n // (no exception) template execution. This prevents the styling instruction from double adding\n // itself to the list.\n // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the\n // if so as not to read unnecessarily.\n const tNode = tData[getSelectedIndex()];\n ngDevMode && assertDefined(tNode, 'TNode expected');\n const isHostBindings = isInHostBindings(tView, bindingIndex);\n if (hasStylingInputShadow(tNode, isClassBased) && tStylingKey === null && !isHostBindings) {\n // `tStylingKey === null` implies that we are either `[style]` or `[class]` binding.\n // If there is a directive which uses `@Input('style')` or `@Input('class')` than\n // we need to neutralize this binding since that directive is shadowing it.\n // We turn this into a noop by setting the key to `false`\n tStylingKey = false;\n }\n tStylingKey = wrapInStaticStylingKey(tData, tNode, tStylingKey, isClassBased);\n insertTStylingBinding(tData, tNode, tStylingKey, bindingIndex, isHostBindings, isClassBased);\n }\n}\n/**\n * Adds static styling information to the binding if applicable.\n *\n * The linked list of styles not only stores the list and keys, but also stores static styling\n * information on some of the keys. This function determines if the key should contain the styling\n * information and computes it.\n *\n * See `TStylingStatic` for more details.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param stylingKey `TStylingKeyPrimitive` which may need to be wrapped into `TStylingKey`\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction wrapInStaticStylingKey(tData, tNode, stylingKey, isClassBased) {\n const hostDirectiveDef = getCurrentDirectiveDef(tData);\n let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;\n if (hostDirectiveDef === null) {\n // We are in template node.\n // If template node already had styling instruction then it has already collected the static\n // styling and there is no need to collect them again. We know that we are the first styling\n // instruction because the `TNode.*Bindings` points to 0 (nothing has been inserted yet).\n const isFirstStylingInstructionInTemplate = (isClassBased ? tNode.classBindings : tNode.styleBindings) === 0;\n if (isFirstStylingInstructionInTemplate) {\n // It would be nice to be able to get the statics from `mergeAttrs`, however, at this point\n // they are already merged and it would not be possible to figure which property belongs where\n // in the priority.\n stylingKey = collectStylingFromDirectives(null, tData, tNode, stylingKey, isClassBased);\n stylingKey = collectStylingFromTAttrs(stylingKey, tNode.attrs, isClassBased);\n // We know that if we have styling binding in template we can't have residual.\n residual = null;\n }\n } else {\n // We are in host binding node and there was no binding instruction in template node.\n // This means that we need to compute the residual.\n const directiveStylingLast = tNode.directiveStylingLast;\n const isFirstStylingInstructionInHostBinding = directiveStylingLast === -1 || tData[directiveStylingLast] !== hostDirectiveDef;\n if (isFirstStylingInstructionInHostBinding) {\n stylingKey = collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased);\n if (residual === null) {\n // - If `null` than either:\n // - Template styling instruction already ran and it has consumed the static\n // styling into its `TStylingKey` and so there is no need to update residual. Instead\n // we need to update the `TStylingKey` associated with the first template node\n // instruction. OR\n // - Some other styling instruction ran and determined that there are no residuals\n let templateStylingKey = getTemplateHeadTStylingKey(tData, tNode, isClassBased);\n if (templateStylingKey !== undefined && Array.isArray(templateStylingKey)) {\n // Only recompute if `templateStylingKey` had static values. (If no static value found\n // then there is nothing to do since this operation can only produce less static keys, not\n // more.)\n templateStylingKey = collectStylingFromDirectives(null, tData, tNode, templateStylingKey[1] /* unwrap previous statics */, isClassBased);\n templateStylingKey = collectStylingFromTAttrs(templateStylingKey, tNode.attrs, isClassBased);\n setTemplateHeadTStylingKey(tData, tNode, isClassBased, templateStylingKey);\n }\n } else {\n // We only need to recompute residual if it is not `null`.\n // - If existing residual (implies there was no template styling). This means that some of\n // the statics may have moved from the residual to the `stylingKey` and so we have to\n // recompute.\n // - If `undefined` this is the first time we are running.\n residual = collectResidual(tData, tNode, isClassBased);\n }\n }\n }\n if (residual !== undefined) {\n isClassBased ? tNode.residualClasses = residual : tNode.residualStyles = residual;\n }\n return stylingKey;\n}\n/**\n * Retrieve the `TStylingKey` for the template styling instruction.\n *\n * This is needed since `hostBinding` styling instructions are inserted after the template\n * instruction. While the template instruction needs to update the residual in `TNode` the\n * `hostBinding` instructions need to update the `TStylingKey` of the template instruction because\n * the template instruction is downstream from the `hostBindings` instructions.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @return `TStylingKey` if found or `undefined` if not found.\n */\nfunction getTemplateHeadTStylingKey(tData, tNode, isClassBased) {\n const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;\n if (getTStylingRangeNext(bindings) === 0) {\n // There does not seem to be a styling instruction in the `template`.\n return undefined;\n }\n return tData[getTStylingRangePrev(bindings)];\n}\n/**\n * Update the `TStylingKey` of the first template instruction in `TNode`.\n *\n * Logically `hostBindings` styling instructions are of lower priority than that of the template.\n * However, they execute after the template styling instructions. This means that they get inserted\n * in front of the template styling instructions.\n *\n * If we have a template styling instruction and a new `hostBindings` styling instruction is\n * executed it means that it may need to steal static fields from the template instruction. This\n * method allows us to update the first template instruction `TStylingKey` with a new value.\n *\n * Assume:\n * ```\n * <div my-dir style=\"color: red\" [style.color]=\"tmplExp\"></div>\n *\n * @Directive({\n * host: {\n * 'style': 'width: 100px',\n * '[style.color]': 'dirExp',\n * }\n * })\n * class MyDir {}\n * ```\n *\n * when `[style.color]=\"tmplExp\"` executes it creates this data structure.\n * ```\n * ['', 'color', 'color', 'red', 'width', '100px'],\n * ```\n *\n * The reason for this is that the template instruction does not know if there are styling\n * instructions and must assume that there are none and must collect all of the static styling.\n * (both\n * `color' and 'width`)\n *\n * When `'[style.color]': 'dirExp',` executes we need to insert a new data into the linked list.\n * ```\n * ['', 'color', 'width', '100px'], // newly inserted\n * ['', 'color', 'color', 'red', 'width', '100px'], // this is wrong\n * ```\n *\n * Notice that the template statics is now wrong as it incorrectly contains `width` so we need to\n * update it like so:\n * ```\n * ['', 'color', 'width', '100px'],\n * ['', 'color', 'color', 'red'], // UPDATE\n * ```\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param tStylingKey New `TStylingKey` which is replacing the old one.\n */\nfunction setTemplateHeadTStylingKey(tData, tNode, isClassBased, tStylingKey) {\n const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;\n ngDevMode && assertNotEqual(getTStylingRangeNext(bindings), 0, 'Expecting to have at least one template styling binding.');\n tData[getTStylingRangePrev(bindings)] = tStylingKey;\n}\n/**\n * Collect all static values after the current `TNode.directiveStylingLast` index.\n *\n * Collect the remaining styling information which has not yet been collected by an existing\n * styling instruction.\n *\n * @param tData `TData` where the `DirectiveDefs` are stored.\n * @param tNode `TNode` which contains the directive range.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectResidual(tData, tNode, isClassBased) {\n let residual = undefined;\n const directiveEnd = tNode.directiveEnd;\n ngDevMode && assertNotEqual(tNode.directiveStylingLast, -1, 'By the time this function gets called at least one hostBindings-node styling instruction must have executed.');\n // We add `1 + tNode.directiveStart` because we need to skip the current directive (as we are\n // collecting things after the last `hostBindings` directive which had a styling instruction.)\n for (let i = 1 + tNode.directiveStylingLast; i < directiveEnd; i++) {\n const attrs = tData[i].hostAttrs;\n residual = collectStylingFromTAttrs(residual, attrs, isClassBased);\n }\n return collectStylingFromTAttrs(residual, tNode.attrs, isClassBased);\n}\n/**\n * Collect the static styling information with lower priority than `hostDirectiveDef`.\n *\n * (This is opposite of residual styling.)\n *\n * @param hostDirectiveDef `DirectiveDef` for which we want to collect lower priority static\n * styling. (Or `null` if template styling)\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param stylingKey Existing `TStylingKey` to update or wrap.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased) {\n // We need to loop because there can be directives which have `hostAttrs` but don't have\n // `hostBindings` so this loop catches up to the current directive..\n let currentDirective = null;\n const directiveEnd = tNode.directiveEnd;\n let directiveStylingLast = tNode.directiveStylingLast;\n if (directiveStylingLast === -1) {\n directiveStylingLast = tNode.directiveStart;\n } else {\n directiveStylingLast++;\n }\n while (directiveStylingLast < directiveEnd) {\n currentDirective = tData[directiveStylingLast];\n ngDevMode && assertDefined(currentDirective, 'expected to be defined');\n stylingKey = collectStylingFromTAttrs(stylingKey, currentDirective.hostAttrs, isClassBased);\n if (currentDirective === hostDirectiveDef) break;\n directiveStylingLast++;\n }\n if (hostDirectiveDef !== null) {\n // we only advance the styling cursor if we are collecting data from host bindings.\n // Template executes before host bindings and so if we would update the index,\n // host bindings would not get their statics.\n tNode.directiveStylingLast = directiveStylingLast;\n }\n return stylingKey;\n}\n/**\n * Convert `TAttrs` into `TStylingStatic`.\n *\n * @param stylingKey existing `TStylingKey` to update or wrap.\n * @param attrs `TAttributes` to process.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectStylingFromTAttrs(stylingKey, attrs, isClassBased) {\n const desiredMarker = isClassBased ? 1 /* AttributeMarker.Classes */ : 2 /* AttributeMarker.Styles */;\n let currentMarker = -1 /* AttributeMarker.ImplicitAttributes */;\n if (attrs !== null) {\n for (let i = 0; i < attrs.length; i++) {\n const item = attrs[i];\n if (typeof item === 'number') {\n currentMarker = item;\n } else {\n if (currentMarker === desiredMarker) {\n if (!Array.isArray(stylingKey)) {\n stylingKey = stylingKey === undefined ? [] : ['', stylingKey];\n }\n keyValueArraySet(stylingKey, item, isClassBased ? true : attrs[++i]);\n }\n }\n }\n }\n return stylingKey === undefined ? null : stylingKey;\n}\n/**\n * Convert user input to `KeyValueArray`.\n *\n * This function takes user input which could be `string`, Object literal, or iterable and converts\n * it into a consistent representation. The output of this is `KeyValueArray` (which is an array\n * where\n * even indexes contain keys and odd indexes contain values for those keys).\n *\n * The advantage of converting to `KeyValueArray` is that we can perform diff in an input\n * independent\n * way.\n * (ie we can compare `foo bar` to `['bar', 'baz'] and determine a set of changes which need to be\n * applied)\n *\n * The fact that `KeyValueArray` is sorted is very important because it allows us to compute the\n * difference in linear fashion without the need to allocate any additional data.\n *\n * For example if we kept this as a `Map` we would have to iterate over previous `Map` to determine\n * which values need to be deleted, over the new `Map` to determine additions, and we would have to\n * keep additional `Map` to keep track of duplicates or items which have not yet been visited.\n *\n * @param keyValueArraySet (See `keyValueArraySet` in \"util/array_utils\") Gets passed in as a\n * function so that `style` can be processed. This is done\n * for tree shaking purposes.\n * @param stringParser The parser is passed in so that it will be tree shakable. See\n * `styleStringParser` and `classStringParser`\n * @param value The value to parse/convert to `KeyValueArray`\n */\nfunction toStylingKeyValueArray(keyValueArraySet, stringParser, value) {\n if (value == null /*|| value === undefined */ || value === '') return EMPTY_ARRAY;\n const styleKeyValueArray = [];\n const unwrappedValue = unwrapSafeValue(value);\n if (Array.isArray(unwrappedValue)) {\n for (let i = 0; i < unwrappedValue.length; i++) {\n keyValueArraySet(styleKeyValueArray, unwrappedValue[i], true);\n }\n } else if (typeof unwrappedValue === 'object') {\n for (const key in unwrappedValue) {\n if (unwrappedValue.hasOwnProperty(key)) {\n keyValueArraySet(styleKeyValueArray, key, unwrappedValue[key]);\n }\n }\n } else if (typeof unwrappedValue === 'string') {\n stringParser(styleKeyValueArray, unwrappedValue);\n } else {\n ngDevMode && throwError('Unsupported styling type ' + typeof unwrappedValue + ': ' + unwrappedValue);\n }\n return styleKeyValueArray;\n}\n/**\n * Set a `value` for a `key`.\n *\n * See: `keyValueArraySet` for details\n *\n * @param keyValueArray KeyValueArray to add to.\n * @param key Style key to add.\n * @param value The value to set.\n */\nfunction styleKeyValueArraySet(keyValueArray, key, value) {\n keyValueArraySet(keyValueArray, key, unwrapSafeValue(value));\n}\n/**\n * Class-binding-specific function for setting the `value` for a `key`.\n *\n * See: `keyValueArraySet` for details\n *\n * @param keyValueArray KeyValueArray to add to.\n * @param key Style key to add.\n * @param value The value to set.\n */\nfunction classKeyValueArraySet(keyValueArray, key, value) {\n // We use `classList.add` to eventually add the CSS classes to the DOM node. Any value passed into\n // `add` is stringified and added to the `class` attribute, e.g. even null, undefined or numbers\n // will be added. Stringify the key here so that our internal data structure matches the value in\n // the DOM. The only exceptions are empty strings and strings that contain spaces for which\n // the browser throws an error. We ignore such values, because the error is somewhat cryptic.\n const stringKey = String(key);\n if (stringKey !== '' && !stringKey.includes(' ')) {\n keyValueArraySet(keyValueArray, stringKey, value);\n }\n}\n/**\n * Update map based styling.\n *\n * Map based styling could be anything which contains more than one binding. For example `string`,\n * or object literal. Dealing with all of these types would complicate the logic so\n * instead this function expects that the complex input is first converted into normalized\n * `KeyValueArray`. The advantage of normalization is that we get the values sorted, which makes it\n * very cheap to compute deltas between the previous and current value.\n *\n * @param tView Associated `TView.data` contains the linked list of binding priorities.\n * @param tNode `TNode` where the binding is located.\n * @param lView `LView` contains the values associated with other styling binding at this `TNode`.\n * @param renderer Renderer to use if any updates.\n * @param oldKeyValueArray Previous value represented as `KeyValueArray`\n * @param newKeyValueArray Current value represented as `KeyValueArray`\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param bindingIndex Binding index of the binding.\n */\nfunction updateStylingMap(tView, tNode, lView, renderer, oldKeyValueArray, newKeyValueArray, isClassBased, bindingIndex) {\n if (oldKeyValueArray === NO_CHANGE) {\n // On first execution the oldKeyValueArray is NO_CHANGE => treat it as empty KeyValueArray.\n oldKeyValueArray = EMPTY_ARRAY;\n }\n let oldIndex = 0;\n let newIndex = 0;\n let oldKey = 0 < oldKeyValueArray.length ? oldKeyValueArray[0] : null;\n let newKey = 0 < newKeyValueArray.length ? newKeyValueArray[0] : null;\n while (oldKey !== null || newKey !== null) {\n ngDevMode && assertLessThan(oldIndex, 999, 'Are we stuck in infinite loop?');\n ngDevMode && assertLessThan(newIndex, 999, 'Are we stuck in infinite loop?');\n const oldValue = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex + 1] : undefined;\n const newValue = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex + 1] : undefined;\n let setKey = null;\n let setValue = undefined;\n if (oldKey === newKey) {\n // UPDATE: Keys are equal => new value is overwriting old value.\n oldIndex += 2;\n newIndex += 2;\n if (oldValue !== newValue) {\n setKey = newKey;\n setValue = newValue;\n }\n } else if (newKey === null || oldKey !== null && oldKey < newKey) {\n // DELETE: oldKey key is missing or we did not find the oldKey in the newValue\n // (because the keyValueArray is sorted and `newKey` is found later alphabetically).\n // `\"background\" < \"color\"` so we need to delete `\"background\"` because it is not found in the\n // new array.\n oldIndex += 2;\n setKey = oldKey;\n } else {\n // CREATE: newKey's is earlier alphabetically than oldKey's (or no oldKey) => we have new key.\n // `\"color\" > \"background\"` so we need to add `color` because it is in new array but not in\n // old array.\n ngDevMode && assertDefined(newKey, 'Expecting to have a valid key');\n newIndex += 2;\n setKey = newKey;\n setValue = newValue;\n }\n if (setKey !== null) {\n updateStyling(tView, tNode, lView, renderer, setKey, setValue, isClassBased, bindingIndex);\n }\n oldKey = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex] : null;\n newKey = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex] : null;\n }\n}\n/**\n * Update a simple (property name) styling.\n *\n * This function takes `prop` and updates the DOM to that value. The function takes the binding\n * value as well as binding priority into consideration to determine which value should be written\n * to DOM. (For example it may be determined that there is a higher priority overwrite which blocks\n * the DOM write, or if the value goes to `undefined` a lower priority overwrite may be consulted.)\n *\n * @param tView Associated `TView.data` contains the linked list of binding priorities.\n * @param tNode `TNode` where the binding is located.\n * @param lView `LView` contains the values associated with other styling binding at this `TNode`.\n * @param renderer Renderer to use if any updates.\n * @param prop Either style property name or a class name.\n * @param value Either style value for `prop` or `true`/`false` if `prop` is class.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param bindingIndex Binding index of the binding.\n */\nfunction updateStyling(tView, tNode, lView, renderer, prop, value, isClassBased, bindingIndex) {\n if (!(tNode.type & 3 /* TNodeType.AnyRNode */)) {\n // It is possible to have styling on non-elements (such as ng-container).\n // This is rare, but it does happen. In such a case, just ignore the binding.\n return;\n }\n const tData = tView.data;\n const tRange = tData[bindingIndex + 1];\n const higherPriorityValue = getTStylingRangeNextDuplicate(tRange) ? findStylingValue(tData, tNode, lView, prop, getTStylingRangeNext(tRange), isClassBased) : undefined;\n if (!isStylingValuePresent(higherPriorityValue)) {\n // We don't have a next duplicate, or we did not find a duplicate value.\n if (!isStylingValuePresent(value)) {\n // We should delete current value or restore to lower priority value.\n if (getTStylingRangePrevDuplicate(tRange)) {\n // We have a possible prev duplicate, let's retrieve it.\n value = findStylingValue(tData, null, lView, prop, bindingIndex, isClassBased);\n }\n }\n const rNode = getNativeByIndex(getSelectedIndex(), lView);\n applyStyling(renderer, isClassBased, rNode, prop, value);\n }\n}\n/**\n * Search for styling value with higher priority which is overwriting current value, or a\n * value of lower priority to which we should fall back if the value is `undefined`.\n *\n * When value is being applied at a location, related values need to be consulted.\n * - If there is a higher priority binding, we should be using that one instead.\n * For example `<div [style]=\"{color:exp1}\" [style.color]=\"exp2\">` change to `exp1`\n * requires that we check `exp2` to see if it is set to value other than `undefined`.\n * - If there is a lower priority binding and we are changing to `undefined`\n * For example `<div [style]=\"{color:exp1}\" [style.color]=\"exp2\">` change to `exp2` to\n * `undefined` requires that we check `exp1` (and static values) and use that as new value.\n *\n * NOTE: The styling stores two values.\n * 1. The raw value which came from the application is stored at `index + 0` location. (This value\n * is used for dirty checking).\n * 2. The normalized value is stored at `index + 1`.\n *\n * @param tData `TData` used for traversing the priority.\n * @param tNode `TNode` to use for resolving static styling. Also controls search direction.\n * - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true.\n * If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value.\n * - `null` search prev and go all the way to end. Return last value where\n * `isStylingValuePresent(value)` is true.\n * @param lView `LView` used for retrieving the actual values.\n * @param prop Property which we are interested in.\n * @param index Starting index in the linked list of styling bindings where the search should start.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction findStylingValue(tData, tNode, lView, prop, index, isClassBased) {\n // `TNode` to use for resolving static styling. Also controls search direction.\n // - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true.\n // If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value.\n // - `null` search prev and go all the way to end. Return last value where\n // `isStylingValuePresent(value)` is true.\n const isPrevDirection = tNode === null;\n let value = undefined;\n while (index > 0) {\n const rawKey = tData[index];\n const containsStatics = Array.isArray(rawKey);\n // Unwrap the key if we contain static values.\n const key = containsStatics ? rawKey[1] : rawKey;\n const isStylingMap = key === null;\n let valueAtLViewIndex = lView[index + 1];\n if (valueAtLViewIndex === NO_CHANGE) {\n // In firstUpdatePass the styling instructions create a linked list of styling.\n // On subsequent passes it is possible for a styling instruction to try to read a binding\n // which\n // has not yet executed. In that case we will find `NO_CHANGE` and we should assume that\n // we have `undefined` (or empty array in case of styling-map instruction) instead. This\n // allows the resolution to apply the value (which may later be overwritten when the\n // binding actually executes.)\n valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : undefined;\n }\n let currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) : key === prop ? valueAtLViewIndex : undefined;\n if (containsStatics && !isStylingValuePresent(currentValue)) {\n currentValue = keyValueArrayGet(rawKey, prop);\n }\n if (isStylingValuePresent(currentValue)) {\n value = currentValue;\n if (isPrevDirection) {\n return value;\n }\n }\n const tRange = tData[index + 1];\n index = isPrevDirection ? getTStylingRangePrev(tRange) : getTStylingRangeNext(tRange);\n }\n if (tNode !== null) {\n // in case where we are going in next direction AND we did not find anything, we need to\n // consult residual styling\n let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;\n if (residual != null /** OR residual !=== undefined */) {\n value = keyValueArrayGet(residual, prop);\n }\n }\n return value;\n}\n/**\n * Determines if the binding value should be used (or if the value is 'undefined' and hence priority\n * resolution should be used.)\n *\n * @param value Binding style value.\n */\nfunction isStylingValuePresent(value) {\n // Currently only `undefined` value is considered non-binding. That is `undefined` says I don't\n // have an opinion as to what this binding should be and you should consult other bindings by\n // priority to determine the valid value.\n // This is extracted into a single function so that we have a single place to control this.\n return value !== undefined;\n}\n/**\n * Normalizes and/or adds a suffix to the value.\n *\n * If value is `null`/`undefined` no suffix is added\n * @param value\n * @param suffix\n */\nfunction normalizeSuffix(value, suffix) {\n if (value == null || value === '') {\n // do nothing\n // Do not add the suffix if the value is going to be empty.\n // As it produce invalid CSS, which the browsers will automatically omit but Domino will not.\n // Example: `\"left\": \"px;\"` instead of `\"left\": \"\"`.\n } else if (typeof suffix === 'string') {\n value = value + suffix;\n } else if (typeof value === 'object') {\n value = stringify(unwrapSafeValue(value));\n }\n return value;\n}\n/**\n * Tests if the `TNode` has input shadow.\n *\n * An input shadow is when a directive steals (shadows) the input by using `@Input('style')` or\n * `@Input('class')` as input.\n *\n * @param tNode `TNode` which we would like to see if it has shadow.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction hasStylingInputShadow(tNode, isClassBased) {\n return (tNode.flags & (isClassBased ? 8 /* TNodeFlags.hasClassInput */ : 16 /* TNodeFlags.hasStyleInput */)) !== 0;\n}\n\n/**\n *\n * Update an interpolated class on an element with single bound value surrounded by text.\n *\n * Used when the value passed to a property has 1 interpolated value in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate1('prefix', v0, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate1(prefix, v0, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n *\n * Update an interpolated class on an element with 2 bound values surrounded by text.\n *\n * Used when the value passed to a property has 2 interpolated values in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}-{{v1}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate2('prefix', v0, '-', v1, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate2(prefix, v0, i0, v1, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n *\n * Update an interpolated class on an element with 3 bound values surrounded by text.\n *\n * Used when the value passed to a property has 3 interpolated values in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate3(\n * 'prefix', v0, '-', v1, '-', v2, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n *\n * Update an interpolated class on an element with 4 bound values surrounded by text.\n *\n * Used when the value passed to a property has 4 interpolated values in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate4(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n *\n * Update an interpolated class on an element with 5 bound values surrounded by text.\n *\n * Used when the value passed to a property has 5 interpolated values in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate5(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n *\n * Update an interpolated class on an element with 6 bound values surrounded by text.\n *\n * Used when the value passed to a property has 6 interpolated values in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate6(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n *\n * Update an interpolated class on an element with 7 bound values surrounded by text.\n *\n * Used when the value passed to a property has 7 interpolated values in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate7(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n *\n * Update an interpolated class on an element with 8 bound values surrounded by text.\n *\n * Used when the value passed to a property has 8 interpolated values in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate8(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param i6 Static value used for concatenation only.\n * @param v7 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n * Update an interpolated class on an element with 9 or more bound values surrounded by text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div\n * class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolateV(\n * ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n * 'suffix']);\n * ```\n *.\n * @param values The collection of values and the strings in-between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolateV(values) {\n const lView = getLView();\n const interpolatedValue = interpolationV(lView, values);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n\n/*!\n * @license\n * Copyright Google LLC 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.dev/license\n */\n/**\n * Instruction that returns the component instance in which the current instruction is executing.\n * This is a constant-time version of `nextContent` for the case where we know that we need the\n * component instance specifically, rather than the context of a particular template.\n *\n * @codeGenApi\n */\nfunction ɵɵcomponentInstance() {\n const instance = getLView()[DECLARATION_COMPONENT_VIEW][CONTEXT];\n ngDevMode && assertDefined(instance, 'Expected component instance to be defined');\n return instance;\n}\n\n/**\n * A type representing the live collection to be reconciled with any new (incoming) collection. This\n * is an adapter class that makes it possible to work with different internal data structures,\n * regardless of the actual values of the incoming collection.\n */\nclass LiveCollection {\n destroy(item) {\n // noop by default\n }\n updateValue(index, value) {\n // noop by default\n }\n // operations below could be implemented on top of the operations defined so far, but having\n // them explicitly allow clear expression of intent and potentially more performant\n // implementations\n swap(index1, index2) {\n const startIdx = Math.min(index1, index2);\n const endIdx = Math.max(index1, index2);\n const endItem = this.detach(endIdx);\n if (endIdx - startIdx > 1) {\n const startItem = this.detach(startIdx);\n this.attach(startIdx, endItem);\n this.attach(endIdx, startItem);\n } else {\n this.attach(startIdx, endItem);\n }\n }\n move(prevIndex, newIdx) {\n this.attach(newIdx, this.detach(prevIndex));\n }\n}\nfunction valuesMatching(liveIdx, liveValue, newIdx, newValue, trackBy) {\n if (liveIdx === newIdx && Object.is(liveValue, newValue)) {\n // matching and no value identity to update\n return 1;\n } else if (Object.is(trackBy(liveIdx, liveValue), trackBy(newIdx, newValue))) {\n // matching but requires value identity update\n return -1;\n }\n return 0;\n}\nfunction recordDuplicateKeys(keyToIdx, key, idx) {\n const idxSoFar = keyToIdx.get(key);\n if (idxSoFar !== undefined) {\n idxSoFar.add(idx);\n } else {\n keyToIdx.set(key, new Set([idx]));\n }\n}\n/**\n * The live collection reconciliation algorithm that perform various in-place operations, so it\n * reflects the content of the new (incoming) collection.\n *\n * The reconciliation algorithm has 2 code paths:\n * - \"fast\" path that don't require any memory allocation;\n * - \"slow\" path that requires additional memory allocation for intermediate data structures used to\n * collect additional information about the live collection.\n * It might happen that the algorithm switches between the two modes in question in a single\n * reconciliation path - generally it tries to stay on the \"fast\" path as much as possible.\n *\n * The overall complexity of the algorithm is O(n + m) for speed and O(n) for memory (where n is the\n * length of the live collection and m is the length of the incoming collection). Given the problem\n * at hand the complexity / performance constraints makes it impossible to perform the absolute\n * minimum of operation to reconcile the 2 collections. The algorithm makes different tradeoffs to\n * stay within reasonable performance bounds and may apply sub-optimal number of operations in\n * certain situations.\n *\n * @param liveCollection the current, live collection;\n * @param newCollection the new, incoming collection;\n * @param trackByFn key generation function that determines equality between items in the life and\n * incoming collection;\n */\nfunction reconcile(liveCollection, newCollection, trackByFn) {\n let detachedItems = undefined;\n let liveKeysInTheFuture = undefined;\n let liveStartIdx = 0;\n let liveEndIdx = liveCollection.length - 1;\n const duplicateKeys = ngDevMode ? new Map() : undefined;\n if (Array.isArray(newCollection)) {\n let newEndIdx = newCollection.length - 1;\n while (liveStartIdx <= liveEndIdx && liveStartIdx <= newEndIdx) {\n // compare from the beginning\n const liveStartValue = liveCollection.at(liveStartIdx);\n const newStartValue = newCollection[liveStartIdx];\n if (ngDevMode) {\n recordDuplicateKeys(duplicateKeys, trackByFn(liveStartIdx, newStartValue), liveStartIdx);\n }\n const isStartMatching = valuesMatching(liveStartIdx, liveStartValue, liveStartIdx, newStartValue, trackByFn);\n if (isStartMatching !== 0) {\n if (isStartMatching < 0) {\n liveCollection.updateValue(liveStartIdx, newStartValue);\n }\n liveStartIdx++;\n continue;\n }\n // compare from the end\n // TODO(perf): do _all_ the matching from the end\n const liveEndValue = liveCollection.at(liveEndIdx);\n const newEndValue = newCollection[newEndIdx];\n if (ngDevMode) {\n recordDuplicateKeys(duplicateKeys, trackByFn(newEndIdx, newEndValue), newEndIdx);\n }\n const isEndMatching = valuesMatching(liveEndIdx, liveEndValue, newEndIdx, newEndValue, trackByFn);\n if (isEndMatching !== 0) {\n if (isEndMatching < 0) {\n liveCollection.updateValue(liveEndIdx, newEndValue);\n }\n liveEndIdx--;\n newEndIdx--;\n continue;\n }\n // Detect swap and moves:\n const liveStartKey = trackByFn(liveStartIdx, liveStartValue);\n const liveEndKey = trackByFn(liveEndIdx, liveEndValue);\n const newStartKey = trackByFn(liveStartIdx, newStartValue);\n if (Object.is(newStartKey, liveEndKey)) {\n const newEndKey = trackByFn(newEndIdx, newEndValue);\n // detect swap on both ends;\n if (Object.is(newEndKey, liveStartKey)) {\n liveCollection.swap(liveStartIdx, liveEndIdx);\n liveCollection.updateValue(liveEndIdx, newEndValue);\n newEndIdx--;\n liveEndIdx--;\n } else {\n // the new item is the same as the live item with the end pointer - this is a move forward\n // to an earlier index;\n liveCollection.move(liveEndIdx, liveStartIdx);\n }\n liveCollection.updateValue(liveStartIdx, newStartValue);\n liveStartIdx++;\n continue;\n }\n // Fallback to the slow path: we need to learn more about the content of the live and new\n // collections.\n detachedItems ??= new UniqueValueMultiKeyMap();\n liveKeysInTheFuture ??= initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);\n // Check if I'm inserting a previously detached item: if so, attach it here\n if (attachPreviouslyDetached(liveCollection, detachedItems, liveStartIdx, newStartKey)) {\n liveCollection.updateValue(liveStartIdx, newStartValue);\n liveStartIdx++;\n liveEndIdx++;\n } else if (!liveKeysInTheFuture.has(newStartKey)) {\n // Check if we seen a new item that doesn't exist in the old collection and must be INSERTED\n const newItem = liveCollection.create(liveStartIdx, newCollection[liveStartIdx]);\n liveCollection.attach(liveStartIdx, newItem);\n liveStartIdx++;\n liveEndIdx++;\n } else {\n // We know that the new item exists later on in old collection but we don't know its index\n // and as the consequence can't move it (don't know where to find it). Detach the old item,\n // hoping that it unlocks the fast path again.\n detachedItems.set(liveStartKey, liveCollection.detach(liveStartIdx));\n liveEndIdx--;\n }\n }\n // Final cleanup steps:\n // - more items in the new collection => insert\n while (liveStartIdx <= newEndIdx) {\n createOrAttach(liveCollection, detachedItems, trackByFn, liveStartIdx, newCollection[liveStartIdx]);\n liveStartIdx++;\n }\n } else if (newCollection != null) {\n // iterable - immediately fallback to the slow path\n const newCollectionIterator = newCollection[Symbol.iterator]();\n let newIterationResult = newCollectionIterator.next();\n while (!newIterationResult.done && liveStartIdx <= liveEndIdx) {\n const liveValue = liveCollection.at(liveStartIdx);\n const newValue = newIterationResult.value;\n if (ngDevMode) {\n recordDuplicateKeys(duplicateKeys, trackByFn(liveStartIdx, newValue), liveStartIdx);\n }\n const isStartMatching = valuesMatching(liveStartIdx, liveValue, liveStartIdx, newValue, trackByFn);\n if (isStartMatching !== 0) {\n // found a match - move on, but update value\n if (isStartMatching < 0) {\n liveCollection.updateValue(liveStartIdx, newValue);\n }\n liveStartIdx++;\n newIterationResult = newCollectionIterator.next();\n } else {\n detachedItems ??= new UniqueValueMultiKeyMap();\n liveKeysInTheFuture ??= initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);\n // Check if I'm inserting a previously detached item: if so, attach it here\n const newKey = trackByFn(liveStartIdx, newValue);\n if (attachPreviouslyDetached(liveCollection, detachedItems, liveStartIdx, newKey)) {\n liveCollection.updateValue(liveStartIdx, newValue);\n liveStartIdx++;\n liveEndIdx++;\n newIterationResult = newCollectionIterator.next();\n } else if (!liveKeysInTheFuture.has(newKey)) {\n liveCollection.attach(liveStartIdx, liveCollection.create(liveStartIdx, newValue));\n liveStartIdx++;\n liveEndIdx++;\n newIterationResult = newCollectionIterator.next();\n } else {\n // it is a move forward - detach the current item without advancing in collections\n const liveKey = trackByFn(liveStartIdx, liveValue);\n detachedItems.set(liveKey, liveCollection.detach(liveStartIdx));\n liveEndIdx--;\n }\n }\n }\n // this is a new item as we run out of the items in the old collection - create or attach a\n // previously detached one\n while (!newIterationResult.done) {\n createOrAttach(liveCollection, detachedItems, trackByFn, liveCollection.length, newIterationResult.value);\n newIterationResult = newCollectionIterator.next();\n }\n }\n // Cleanups common to the array and iterable:\n // - more items in the live collection => delete starting from the end;\n while (liveStartIdx <= liveEndIdx) {\n liveCollection.destroy(liveCollection.detach(liveEndIdx--));\n }\n // - destroy items that were detached but never attached again.\n detachedItems?.forEach(item => {\n liveCollection.destroy(item);\n });\n // report duplicate keys (dev mode only)\n if (ngDevMode) {\n let duplicatedKeysMsg = [];\n for (const [key, idxSet] of duplicateKeys) {\n if (idxSet.size > 1) {\n const idx = [...idxSet].sort((a, b) => a - b);\n for (let i = 1; i < idx.length; i++) {\n duplicatedKeysMsg.push(`key \"${stringifyForError(key)}\" at index \"${idx[i - 1]}\" and \"${idx[i]}\"`);\n }\n }\n }\n if (duplicatedKeysMsg.length > 0) {\n const message = formatRuntimeError(-955 /* RuntimeErrorCode.LOOP_TRACK_DUPLICATE_KEYS */, 'The provided track expression resulted in duplicated keys for a given collection. ' + 'Adjust the tracking expression such that it uniquely identifies all the items in the collection. ' + 'Duplicated keys were: \\n' + duplicatedKeysMsg.join(', \\n') + '.');\n // tslint:disable-next-line:no-console\n console.warn(message);\n }\n }\n}\nfunction attachPreviouslyDetached(prevCollection, detachedItems, index, key) {\n if (detachedItems !== undefined && detachedItems.has(key)) {\n prevCollection.attach(index, detachedItems.get(key));\n detachedItems.delete(key);\n return true;\n }\n return false;\n}\nfunction createOrAttach(liveCollection, detachedItems, trackByFn, index, value) {\n if (!attachPreviouslyDetached(liveCollection, detachedItems, index, trackByFn(index, value))) {\n const newItem = liveCollection.create(index, value);\n liveCollection.attach(index, newItem);\n } else {\n liveCollection.updateValue(index, value);\n }\n}\nfunction initLiveItemsInTheFuture(liveCollection, start, end, trackByFn) {\n const keys = new Set();\n for (let i = start; i <= end; i++) {\n keys.add(trackByFn(i, liveCollection.at(i)));\n }\n return keys;\n}\n/**\n * A specific, partial implementation of the Map interface with the following characteristics:\n * - allows multiple values for a given key;\n * - maintain FIFO order for multiple values corresponding to a given key;\n * - assumes that all values are unique.\n *\n * The implementation aims at having the minimal overhead for cases where keys are _not_ duplicated\n * (the most common case in the list reconciliation algorithm). To achieve this, the first value for\n * a given key is stored in a regular map. Then, when more values are set for a given key, we\n * maintain a form of linked list in a separate map. To maintain this linked list we assume that all\n * values (in the entire collection) are unique.\n */\nclass UniqueValueMultiKeyMap {\n constructor() {\n // A map from a key to the first value corresponding to this key.\n this.kvMap = new Map();\n // A map that acts as a linked list of values - each value maps to the next value in this \"linked\n // list\" (this only works if values are unique). Allocated lazily to avoid memory consumption when\n // there are no duplicated values.\n this._vMap = undefined;\n }\n has(key) {\n return this.kvMap.has(key);\n }\n delete(key) {\n if (!this.has(key)) return false;\n const value = this.kvMap.get(key);\n if (this._vMap !== undefined && this._vMap.has(value)) {\n this.kvMap.set(key, this._vMap.get(value));\n this._vMap.delete(value);\n } else {\n this.kvMap.delete(key);\n }\n return true;\n }\n get(key) {\n return this.kvMap.get(key);\n }\n set(key, value) {\n if (this.kvMap.has(key)) {\n let prevValue = this.kvMap.get(key);\n ngDevMode && assertNotSame(prevValue, value, `Detected a duplicated value ${value} for the key ${key}`);\n if (this._vMap === undefined) {\n this._vMap = new Map();\n }\n const vMap = this._vMap;\n while (vMap.has(prevValue)) {\n prevValue = vMap.get(prevValue);\n }\n vMap.set(prevValue, value);\n } else {\n this.kvMap.set(key, value);\n }\n }\n forEach(cb) {\n for (let [key, value] of this.kvMap) {\n cb(value, key);\n if (this._vMap !== undefined) {\n const vMap = this._vMap;\n while (vMap.has(value)) {\n value = vMap.get(value);\n cb(value, key);\n }\n }\n }\n }\n}\n\n/**\n * The conditional instruction represents the basic building block on the runtime side to support\n * built-in \"if\" and \"switch\". On the high level this instruction is responsible for adding and\n * removing views selected by a conditional expression.\n *\n * @param matchingTemplateIndex Index of a template TNode representing a conditional view to be\n * inserted; -1 represents a special case when there is no view to insert.\n * @param contextValue Value that should be exposed as the context of the conditional.\n * @codeGenApi\n */\nfunction ɵɵconditional(matchingTemplateIndex, contextValue) {\n performanceMarkFeature('NgControlFlow');\n const hostLView = getLView();\n const bindingIndex = nextBindingIndex();\n const prevMatchingTemplateIndex = hostLView[bindingIndex] !== NO_CHANGE ? hostLView[bindingIndex] : -1;\n const prevContainer = prevMatchingTemplateIndex !== -1 ? getLContainer(hostLView, HEADER_OFFSET + prevMatchingTemplateIndex) : undefined;\n const viewInContainerIdx = 0;\n if (bindingUpdated(hostLView, bindingIndex, matchingTemplateIndex)) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n // The index of the view to show changed - remove the previously displayed one\n // (it is a noop if there are no active views in a container).\n if (prevContainer !== undefined) {\n removeLViewFromLContainer(prevContainer, viewInContainerIdx);\n }\n // Index -1 is a special case where none of the conditions evaluates to\n // a truthy value and as the consequence we've got no view to show.\n if (matchingTemplateIndex !== -1) {\n const nextLContainerIndex = HEADER_OFFSET + matchingTemplateIndex;\n const nextContainer = getLContainer(hostLView, nextLContainerIndex);\n const templateTNode = getExistingTNode(hostLView[TVIEW], nextLContainerIndex);\n const dehydratedView = findMatchingDehydratedView(nextContainer, templateTNode.tView.ssrId);\n const embeddedLView = createAndRenderEmbeddedLView(hostLView, templateTNode, contextValue, {\n dehydratedView\n });\n addLViewToLContainer(nextContainer, embeddedLView, viewInContainerIdx, shouldAddViewToDom(templateTNode, dehydratedView));\n }\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n } else if (prevContainer !== undefined) {\n // We might keep displaying the same template but the actual value of the expression could have\n // changed - re-bind in context.\n const lView = getLViewFromLContainer(prevContainer, viewInContainerIdx);\n if (lView !== undefined) {\n lView[CONTEXT] = contextValue;\n }\n }\n}\nclass RepeaterContext {\n constructor(lContainer, $implicit, $index) {\n this.lContainer = lContainer;\n this.$implicit = $implicit;\n this.$index = $index;\n }\n get $count() {\n return this.lContainer.length - CONTAINER_HEADER_OFFSET;\n }\n}\n/**\n * A built-in trackBy function used for situations where users specified collection index as a\n * tracking expression. Having this function body in the runtime avoids unnecessary code generation.\n *\n * @param index\n * @returns\n */\nfunction ɵɵrepeaterTrackByIndex(index) {\n return index;\n}\n/**\n * A built-in trackBy function used for situations where users specified collection item reference\n * as a tracking expression. Having this function body in the runtime avoids unnecessary code\n * generation.\n *\n * @param index\n * @returns\n */\nfunction ɵɵrepeaterTrackByIdentity(_, value) {\n return value;\n}\nclass RepeaterMetadata {\n constructor(hasEmptyBlock, trackByFn, liveCollection) {\n this.hasEmptyBlock = hasEmptyBlock;\n this.trackByFn = trackByFn;\n this.liveCollection = liveCollection;\n }\n}\n/**\n * The repeaterCreate instruction runs in the creation part of the template pass and initializes\n * internal data structures required by the update pass of the built-in repeater logic. Repeater\n * metadata are allocated in the data part of LView with the following layout:\n * - LView[HEADER_OFFSET + index] - metadata\n * - LView[HEADER_OFFSET + index + 1] - reference to a template function rendering an item\n * - LView[HEADER_OFFSET + index + 2] - optional reference to a template function rendering an empty\n * block\n *\n * @param index Index at which to store the metadata of the repeater.\n * @param templateFn Reference to the template of the main repeater block.\n * @param decls The number of nodes, local refs, and pipes for the main block.\n * @param vars The number of bindings for the main block.\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param trackByFn Reference to the tracking function.\n * @param trackByUsesComponentInstance Whether the tracking function has any references to the\n * component instance. If it doesn't, we can avoid rebinding it.\n * @param emptyTemplateFn Reference to the template function of the empty block.\n * @param emptyDecls The number of nodes, local refs, and pipes for the empty block.\n * @param emptyVars The number of bindings for the empty block.\n * @param emptyTagName The name of the empty block container element, if applicable\n * @param emptyAttrsIndex Index of the empty block template attributes in the `consts` array.\n *\n * @codeGenApi\n */\nfunction ɵɵrepeaterCreate(index, templateFn, decls, vars, tagName, attrsIndex, trackByFn, trackByUsesComponentInstance, emptyTemplateFn, emptyDecls, emptyVars, emptyTagName, emptyAttrsIndex) {\n performanceMarkFeature('NgControlFlow');\n ngDevMode && assertFunction(trackByFn, `A track expression must be a function, was ${typeof trackByFn} instead.`);\n const lView = getLView();\n const tView = getTView();\n const hasEmptyBlock = emptyTemplateFn !== undefined;\n const hostLView = getLView();\n const boundTrackBy = trackByUsesComponentInstance ?\n // We only want to bind when necessary, because it produces a\n // new function. For pure functions it's not necessary.\n trackByFn.bind(hostLView[DECLARATION_COMPONENT_VIEW][CONTEXT]) : trackByFn;\n const metadata = new RepeaterMetadata(hasEmptyBlock, boundTrackBy);\n hostLView[HEADER_OFFSET + index] = metadata;\n declareTemplate(lView, tView, index + 1, templateFn, decls, vars, tagName, getConstant(tView.consts, attrsIndex));\n if (hasEmptyBlock) {\n ngDevMode && assertDefined(emptyDecls, 'Missing number of declarations for the empty repeater block.');\n ngDevMode && assertDefined(emptyVars, 'Missing number of bindings for the empty repeater block.');\n declareTemplate(lView, tView, index + 2, emptyTemplateFn, emptyDecls, emptyVars, emptyTagName, getConstant(tView.consts, emptyAttrsIndex));\n }\n}\nfunction isViewExpensiveToRecreate(lView) {\n // assumption: anything more than a text node with a binding is considered \"expensive\"\n return lView.length - HEADER_OFFSET > 2;\n}\nclass OperationsCounter {\n constructor() {\n this.created = 0;\n this.destroyed = 0;\n }\n reset() {\n this.created = 0;\n this.destroyed = 0;\n }\n recordCreate() {\n this.created++;\n }\n recordDestroy() {\n this.destroyed++;\n }\n /**\n * A method indicating if the entire collection was re-created as part of the reconciliation pass.\n * Used to warn developers about the usage of a tracking function that might result in excessive\n * amount of view creation / destroy operations.\n *\n * @returns boolean value indicating if a live collection was re-created\n */\n wasReCreated(collectionLen) {\n return collectionLen > 0 && this.created === this.destroyed && this.created === collectionLen;\n }\n}\nclass LiveCollectionLContainerImpl extends LiveCollection {\n constructor(lContainer, hostLView, templateTNode) {\n super();\n this.lContainer = lContainer;\n this.hostLView = hostLView;\n this.templateTNode = templateTNode;\n this.operationsCounter = ngDevMode ? new OperationsCounter() : undefined;\n /**\n Property indicating if indexes in the repeater context need to be updated following the live\n collection changes. Index updates are necessary if and only if views are inserted / removed in\n the middle of LContainer. Adds and removals at the end don't require index updates.\n */\n this.needsIndexUpdate = false;\n }\n get length() {\n return this.lContainer.length - CONTAINER_HEADER_OFFSET;\n }\n at(index) {\n return this.getLView(index)[CONTEXT].$implicit;\n }\n attach(index, lView) {\n const dehydratedView = lView[HYDRATION];\n this.needsIndexUpdate ||= index !== this.length;\n addLViewToLContainer(this.lContainer, lView, index, shouldAddViewToDom(this.templateTNode, dehydratedView));\n }\n detach(index) {\n this.needsIndexUpdate ||= index !== this.length - 1;\n return detachExistingView(this.lContainer, index);\n }\n create(index, value) {\n const dehydratedView = findMatchingDehydratedView(this.lContainer, this.templateTNode.tView.ssrId);\n const embeddedLView = createAndRenderEmbeddedLView(this.hostLView, this.templateTNode, new RepeaterContext(this.lContainer, value, index), {\n dehydratedView\n });\n this.operationsCounter?.recordCreate();\n return embeddedLView;\n }\n destroy(lView) {\n destroyLView(lView[TVIEW], lView);\n this.operationsCounter?.recordDestroy();\n }\n updateValue(index, value) {\n this.getLView(index)[CONTEXT].$implicit = value;\n }\n reset() {\n this.needsIndexUpdate = false;\n this.operationsCounter?.reset();\n }\n updateIndexes() {\n if (this.needsIndexUpdate) {\n for (let i = 0; i < this.length; i++) {\n this.getLView(i)[CONTEXT].$index = i;\n }\n }\n }\n getLView(index) {\n return getExistingLViewFromLContainer(this.lContainer, index);\n }\n}\n/**\n * The repeater instruction does update-time diffing of a provided collection (against the\n * collection seen previously) and maps changes in the collection to views structure (by adding,\n * removing or moving views as needed).\n * @param collection - the collection instance to be checked for changes\n * @codeGenApi\n */\nfunction ɵɵrepeater(collection) {\n const prevConsumer = setActiveConsumer$1(null);\n const metadataSlotIdx = getSelectedIndex();\n try {\n const hostLView = getLView();\n const hostTView = hostLView[TVIEW];\n const metadata = hostLView[metadataSlotIdx];\n const containerIndex = metadataSlotIdx + 1;\n const lContainer = getLContainer(hostLView, containerIndex);\n if (metadata.liveCollection === undefined) {\n const itemTemplateTNode = getExistingTNode(hostTView, containerIndex);\n metadata.liveCollection = new LiveCollectionLContainerImpl(lContainer, hostLView, itemTemplateTNode);\n } else {\n metadata.liveCollection.reset();\n }\n const liveCollection = metadata.liveCollection;\n reconcile(liveCollection, collection, metadata.trackByFn);\n // Warn developers about situations where the entire collection was re-created as part of the\n // reconciliation pass. Note that this warning might be \"overreacting\" and report cases where\n // the collection re-creation is the intended behavior. Still, the assumption is that most of\n // the time it is undesired.\n if (ngDevMode && metadata.trackByFn === ɵɵrepeaterTrackByIdentity && liveCollection.operationsCounter?.wasReCreated(liveCollection.length) && isViewExpensiveToRecreate(getExistingLViewFromLContainer(lContainer, 0))) {\n const message = formatRuntimeError(-956 /* RuntimeErrorCode.LOOP_TRACK_RECREATE */, `The configured tracking expression (track by identity) caused re-creation of the entire collection of size ${liveCollection.length}. ` + 'This is an expensive operation requiring destruction and subsequent creation of DOM nodes, directives, components etc. ' + 'Please review the \"track expression\" and make sure that it uniquely identifies items in a collection.');\n console.warn(message);\n }\n // moves in the container might caused context's index to get out of order, re-adjust if needed\n liveCollection.updateIndexes();\n // handle empty blocks\n if (metadata.hasEmptyBlock) {\n const bindingIndex = nextBindingIndex();\n const isCollectionEmpty = liveCollection.length === 0;\n if (bindingUpdated(hostLView, bindingIndex, isCollectionEmpty)) {\n const emptyTemplateIndex = metadataSlotIdx + 2;\n const lContainerForEmpty = getLContainer(hostLView, emptyTemplateIndex);\n if (isCollectionEmpty) {\n const emptyTemplateTNode = getExistingTNode(hostTView, emptyTemplateIndex);\n const dehydratedView = findMatchingDehydratedView(lContainerForEmpty, emptyTemplateTNode.tView.ssrId);\n const embeddedLView = createAndRenderEmbeddedLView(hostLView, emptyTemplateTNode, undefined, {\n dehydratedView\n });\n addLViewToLContainer(lContainerForEmpty, embeddedLView, 0, shouldAddViewToDom(emptyTemplateTNode, dehydratedView));\n } else {\n removeLViewFromLContainer(lContainerForEmpty, 0);\n }\n }\n }\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n}\nfunction getLContainer(lView, index) {\n const lContainer = lView[index];\n ngDevMode && assertLContainer(lContainer);\n return lContainer;\n}\nfunction detachExistingView(lContainer, index) {\n const existingLView = detachView(lContainer, index);\n ngDevMode && assertLView(existingLView);\n return existingLView;\n}\nfunction getExistingLViewFromLContainer(lContainer, index) {\n const existingLView = getLViewFromLContainer(lContainer, index);\n ngDevMode && assertLView(existingLView);\n return existingLView;\n}\nfunction getExistingTNode(tView, index) {\n const tNode = getTNode(tView, index);\n ngDevMode && assertTNode(tNode);\n return tNode;\n}\nfunction elementStartFirstCreatePass(index, tView, lView, name, attrsIndex, localRefsIndex) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && ngDevMode.firstCreatePass++;\n const tViewConsts = tView.consts;\n const attrs = getConstant(tViewConsts, attrsIndex);\n const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, name, attrs);\n resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));\n if (tNode.attrs !== null) {\n computeStaticStyling(tNode, tNode.attrs, false);\n }\n if (tNode.mergedAttrs !== null) {\n computeStaticStyling(tNode, tNode.mergedAttrs, true);\n }\n if (tView.queries !== null) {\n tView.queries.elementStart(tView, tNode);\n }\n return tNode;\n}\n/**\n * Create DOM element. The instruction must later be followed by `elementEnd()` call.\n *\n * @param index Index of the element in the LView array\n * @param name Name of the DOM Node\n * @param attrsIndex Index of the element's attributes in the `consts` array.\n * @param localRefsIndex Index of the element's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * Attributes and localRefs are passed as an array of strings where elements with an even index\n * hold an attribute name and elements with an odd index hold an attribute value, ex.:\n * ['id', 'warning5', 'class', 'alert']\n *\n * @codeGenApi\n */\nfunction ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = HEADER_OFFSET + index;\n ngDevMode && assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings');\n ngDevMode && assertIndexInRange(lView, adjustedIndex);\n const renderer = lView[RENDERER];\n const tNode = tView.firstCreatePass ? elementStartFirstCreatePass(adjustedIndex, tView, lView, name, attrsIndex, localRefsIndex) : tView.data[adjustedIndex];\n const native = _locateOrCreateElementNode(tView, lView, tNode, renderer, name, index);\n lView[adjustedIndex] = native;\n const hasDirectives = isDirectiveHost(tNode);\n if (ngDevMode && tView.firstCreatePass) {\n validateElementIsKnown(native, lView, tNode.value, tView.schemas, hasDirectives);\n }\n setCurrentTNode(tNode, true);\n setupStaticAttributes(renderer, native, tNode);\n if (!isDetachedByI18n(tNode) && wasLastNodeCreated()) {\n // In the i18n case, the translation may have removed this element, so only add it if it is not\n // detached. See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n appendChild(tView, lView, native, tNode);\n }\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n if (hasDirectives) {\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n if (localRefsIndex !== null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n return ɵɵelementStart;\n}\n/**\n * Mark the end of the element.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelementEnd() {\n let currentTNode = getCurrentTNode();\n ngDevMode && assertDefined(currentTNode, 'No parent node to close.');\n if (isCurrentTNodeParent()) {\n setCurrentTNodeAsNotParent();\n } else {\n ngDevMode && assertHasParent(getCurrentTNode());\n currentTNode = currentTNode.parent;\n setCurrentTNode(currentTNode, false);\n }\n const tNode = currentTNode;\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);\n if (isSkipHydrationRootTNode(tNode)) {\n leaveSkipHydrationBlock();\n }\n decreaseElementDepthCount();\n const tView = getTView();\n if (tView.firstCreatePass) {\n registerPostOrderHooks(tView, currentTNode);\n if (isContentQueryHost(currentTNode)) {\n tView.queries.elementEnd(currentTNode);\n }\n }\n if (tNode.classesWithoutHost != null && hasClassInput(tNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.classesWithoutHost, true);\n }\n if (tNode.stylesWithoutHost != null && hasStyleInput(tNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.stylesWithoutHost, false);\n }\n return ɵɵelementEnd;\n}\n/**\n * Creates an empty element using {@link elementStart} and {@link elementEnd}\n *\n * @param index Index of the element in the data array\n * @param name Name of the DOM Node\n * @param attrsIndex Index of the element's attributes in the `consts` array.\n * @param localRefsIndex Index of the element's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelement(index, name, attrsIndex, localRefsIndex) {\n ɵɵelementStart(index, name, attrsIndex, localRefsIndex);\n ɵɵelementEnd();\n return ɵɵelement;\n}\nlet _locateOrCreateElementNode = (tView, lView, tNode, renderer, name, index) => {\n lastNodeWasCreated(true);\n return createElementNode(renderer, name, getNamespace$1());\n};\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode of element nodes.\n */\nfunction locateOrCreateElementNodeImpl(tView, lView, tNode, renderer, name, index) {\n const hydrationInfo = lView[HYDRATION];\n const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1() || isDetachedByI18n(tNode) || isDisconnectedNode$1(hydrationInfo, index);\n lastNodeWasCreated(isNodeCreationMode);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createElementNode(renderer, name, getNamespace$1());\n }\n // Hydration mode, looking up an existing element in DOM.\n const native = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateMatchingNode(native, Node.ELEMENT_NODE, name, lView, tNode);\n ngDevMode && markRNodeAsClaimedByHydration(native);\n // This element might also be an anchor of a view container.\n if (getSerializedContainerViews(hydrationInfo, index)) {\n // Important note: this element acts as an anchor, but it's **not** a part\n // of the embedded view, so we start the segment **after** this element, taking\n // a reference to the next sibling. For example, the following template:\n // `<div #vcrTarget>` is represented in the DOM as `<div></div>...<!--container-->`,\n // so while processing a `<div>` instruction, point to the next sibling as a\n // start of a segment.\n ngDevMode && validateNodeExists(native.nextSibling, lView, tNode);\n setSegmentHead(hydrationInfo, index, native.nextSibling);\n }\n // Checks if the skip hydration attribute is present during hydration so we know to\n // skip attempting to hydrate this block. We check both TNode and RElement for an\n // attribute: the RElement case is needed for i18n cases, when we add it to host\n // elements during the annotation phase (after all internal data structures are setup).\n if (hydrationInfo && (hasSkipHydrationAttrOnTNode(tNode) || hasSkipHydrationAttrOnRElement(native))) {\n if (isComponentHost(tNode)) {\n enterSkipHydrationBlock(tNode);\n // Since this isn't hydratable, we need to empty the node\n // so there's no duplicate content after render\n clearElementContents(native);\n ngDevMode && markRNodeAsSkippedByHydration(native);\n } else if (ngDevMode) {\n // If this is not a component host, throw an error.\n // Hydration can be skipped on per-component basis only.\n throw invalidSkipHydrationHost(native);\n }\n }\n return native;\n}\nfunction enableLocateOrCreateElementNodeImpl() {\n _locateOrCreateElementNode = locateOrCreateElementNodeImpl;\n}\nfunction elementContainerStartFirstCreatePass(index, tView, lView, attrsIndex, localRefsIndex) {\n ngDevMode && ngDevMode.firstCreatePass++;\n const tViewConsts = tView.consts;\n const attrs = getConstant(tViewConsts, attrsIndex);\n const tNode = getOrCreateTNode(tView, index, 8 /* TNodeType.ElementContainer */, 'ng-container', attrs);\n // While ng-container doesn't necessarily support styling, we use the style context to identify\n // and execute directives on the ng-container.\n if (attrs !== null) {\n computeStaticStyling(tNode, attrs, true);\n }\n const localRefs = getConstant(tViewConsts, localRefsIndex);\n resolveDirectives(tView, lView, tNode, localRefs);\n if (tView.queries !== null) {\n tView.queries.elementStart(tView, tNode);\n }\n return tNode;\n}\n/**\n * Creates a logical container for other nodes (<ng-container>) backed by a comment node in the DOM.\n * The instruction must later be followed by `elementContainerEnd()` call.\n *\n * @param index Index of the element in the LView array\n * @param attrsIndex Index of the container attributes in the `consts` array.\n * @param localRefsIndex Index of the container's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * Even if this instruction accepts a set of attributes no actual attribute values are propagated to\n * the DOM (as a comment node can't have attributes). Attributes are here only for directive\n * matching purposes and setting initial inputs of directives.\n *\n * @codeGenApi\n */\nfunction ɵɵelementContainerStart(index, attrsIndex, localRefsIndex) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n ngDevMode && assertIndexInRange(lView, adjustedIndex);\n ngDevMode && assertEqual(getBindingIndex(), tView.bindingStartIndex, 'element containers should be created before any bindings');\n const tNode = tView.firstCreatePass ? elementContainerStartFirstCreatePass(adjustedIndex, tView, lView, attrsIndex, localRefsIndex) : tView.data[adjustedIndex];\n setCurrentTNode(tNode, true);\n const comment = _locateOrCreateElementContainerNode(tView, lView, tNode, index);\n lView[adjustedIndex] = comment;\n if (wasLastNodeCreated()) {\n appendChild(tView, lView, comment, tNode);\n }\n attachPatchData(comment, lView);\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n return ɵɵelementContainerStart;\n}\n/**\n * Mark the end of the <ng-container>.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelementContainerEnd() {\n let currentTNode = getCurrentTNode();\n const tView = getTView();\n if (isCurrentTNodeParent()) {\n setCurrentTNodeAsNotParent();\n } else {\n ngDevMode && assertHasParent(currentTNode);\n currentTNode = currentTNode.parent;\n setCurrentTNode(currentTNode, false);\n }\n ngDevMode && assertTNodeType(currentTNode, 8 /* TNodeType.ElementContainer */);\n if (tView.firstCreatePass) {\n registerPostOrderHooks(tView, currentTNode);\n if (isContentQueryHost(currentTNode)) {\n tView.queries.elementEnd(currentTNode);\n }\n }\n return ɵɵelementContainerEnd;\n}\n/**\n * Creates an empty logical container using {@link elementContainerStart}\n * and {@link elementContainerEnd}\n *\n * @param index Index of the element in the LView array\n * @param attrsIndex Index of the container attributes in the `consts` array.\n * @param localRefsIndex Index of the container's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelementContainer(index, attrsIndex, localRefsIndex) {\n ɵɵelementContainerStart(index, attrsIndex, localRefsIndex);\n ɵɵelementContainerEnd();\n return ɵɵelementContainer;\n}\nlet _locateOrCreateElementContainerNode = (tView, lView, tNode, index) => {\n lastNodeWasCreated(true);\n return createCommentNode(lView[RENDERER], ngDevMode ? 'ng-container' : '');\n};\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode of comment nodes that\n * represent <ng-container>'s anchor.\n */\nfunction locateOrCreateElementContainerNode(tView, lView, tNode, index) {\n let comment;\n const hydrationInfo = lView[HYDRATION];\n const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1() || isDisconnectedNode$1(hydrationInfo, index) || isDetachedByI18n(tNode);\n lastNodeWasCreated(isNodeCreationMode);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createCommentNode(lView[RENDERER], ngDevMode ? 'ng-container' : '');\n }\n // Hydration mode, looking up existing elements in DOM.\n const currentRNode = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateNodeExists(currentRNode, lView, tNode);\n const ngContainerSize = getNgContainerSize(hydrationInfo, index);\n ngDevMode && assertNumber(ngContainerSize, 'Unexpected state: hydrating an <ng-container>, ' + 'but no hydration info is available.');\n setSegmentHead(hydrationInfo, index, currentRNode);\n comment = siblingAfter(ngContainerSize, currentRNode);\n if (ngDevMode) {\n validateMatchingNode(comment, Node.COMMENT_NODE, null, lView, tNode);\n markRNodeAsClaimedByHydration(comment);\n }\n return comment;\n}\nfunction enableLocateOrCreateElementContainerNodeImpl() {\n _locateOrCreateElementContainerNode = locateOrCreateElementContainerNode;\n}\n\n/**\n * Returns the current OpaqueViewState instance.\n *\n * Used in conjunction with the restoreView() instruction to save a snapshot\n * of the current view and restore it when listeners are invoked. This allows\n * walking the declaration view tree in listeners to get vars from parent views.\n *\n * @codeGenApi\n */\nfunction ɵɵgetCurrentView() {\n return getLView();\n}\n\n/**\n * Update a property on a host element. Only applies to native node properties, not inputs.\n *\n * Operates on the element selected by index via the {@link select} instruction.\n *\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @returns This function returns itself so that it may be chained\n * (e.g. `property('name', ctx.name)('title', ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵhostProperty(propName, value, sanitizer) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, true);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵhostProperty;\n}\n/**\n * Updates a synthetic host binding (e.g. `[@foo]`) on a component or directive.\n *\n * This instruction is for compatibility purposes and is designed to ensure that a\n * synthetic host binding (e.g. `@HostBinding('@foo')`) properly gets rendered in\n * the component's renderer. Normally all host bindings are evaluated with the parent\n * component's renderer, but, in the case of animation @triggers, they need to be\n * evaluated with the sub component's renderer (because that's where the animation\n * triggers are defined).\n *\n * Do not use this instruction as a replacement for `elementProperty`. This instruction\n * only exists to ensure compatibility with the ViewEngine's host binding behavior.\n *\n * @param index The index of the element to update in the data array\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n *\n * @codeGenApi\n */\nfunction ɵɵsyntheticHostProperty(propName, value, sanitizer) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n const currentDef = getCurrentDirectiveDef(tView.data);\n const renderer = loadComponentRenderer(currentDef, tNode, lView);\n elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, true);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵsyntheticHostProperty;\n}\n\n/**\n * NOTE: changes to the `ngI18nClosureMode` name must be synced with `compiler-cli/src/tooling.ts`.\n */\nif (typeof ngI18nClosureMode === 'undefined') {\n // These property accesses can be ignored because ngI18nClosureMode will be set to false\n // when optimizing code and the whole if statement will be dropped.\n // Make sure to refer to ngI18nClosureMode as ['ngI18nClosureMode'] for closure.\n // NOTE: we need to have it in IIFE so that the tree-shaker is happy.\n (function () {\n // tslint:disable-next-line:no-toplevel-property-access\n _global['ngI18nClosureMode'] =\n // TODO(FW-1250): validate that this actually, you know, works.\n // tslint:disable-next-line:no-toplevel-property-access\n typeof goog !== 'undefined' && typeof goog.getMsg === 'function';\n })();\n}\n\n// THIS CODE IS GENERATED - DO NOT MODIFY.\nconst u = undefined;\nfunction plural(val) {\n const n = val,\n i = Math.floor(Math.abs(val)),\n v = val.toString().replace(/^[^.]*\\.?/, '').length;\n if (i === 1 && v === 0) return 1;\n return 5;\n}\nvar localeEn = [\"en\", [[\"a\", \"p\"], [\"AM\", \"PM\"], u], [[\"AM\", \"PM\"], u, u], [[\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"], [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"]], u, [[\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"], [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]], u, [[\"B\", \"A\"], [\"BC\", \"AD\"], [\"Before Christ\", \"Anno Domini\"]], 0, [6, 0], [\"M/d/yy\", \"MMM d, y\", \"MMMM d, y\", \"EEEE, MMMM d, y\"], [\"h:mm a\", \"h:mm:ss a\", \"h:mm:ss a z\", \"h:mm:ss a zzzz\"], [\"{1}, {0}\", u, \"{1} 'at' {0}\", u], [\".\", \",\", \";\", \"%\", \"+\", \"-\", \"E\", \"×\", \"‰\", \"∞\", \"NaN\", \":\"], [\"#,##0.###\", \"#,##0%\", \"¤#,##0.00\", \"#E0\"], \"USD\", \"$\", \"US Dollar\", {}, \"ltr\", plural];\n\n/**\n * This const is used to store the locale data registered with `registerLocaleData`\n */\nlet LOCALE_DATA = {};\n/**\n * Register locale data to be used internally by Angular. See the\n * [\"I18n guide\"](guide/i18n/format-data-locale) to know how to import additional locale\n * data.\n *\n * The signature `registerLocaleData(data: any, extraData?: any)` is deprecated since v5.1\n */\nfunction registerLocaleData(data, localeId, extraData) {\n if (typeof localeId !== 'string') {\n extraData = localeId;\n localeId = data[LocaleDataIndex.LocaleId];\n }\n localeId = localeId.toLowerCase().replace(/_/g, '-');\n LOCALE_DATA[localeId] = data;\n if (extraData) {\n LOCALE_DATA[localeId][LocaleDataIndex.ExtraData] = extraData;\n }\n}\n/**\n * Finds the locale data for a given locale.\n *\n * @param locale The locale code.\n * @returns The locale data.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n */\nfunction findLocaleData(locale) {\n const normalizedLocale = normalizeLocale(locale);\n let match = getLocaleData(normalizedLocale);\n if (match) {\n return match;\n }\n // let's try to find a parent locale\n const parentLocale = normalizedLocale.split('-')[0];\n match = getLocaleData(parentLocale);\n if (match) {\n return match;\n }\n if (parentLocale === 'en') {\n return localeEn;\n }\n throw new RuntimeError(701 /* RuntimeErrorCode.MISSING_LOCALE_DATA */, ngDevMode && `Missing locale data for the locale \"${locale}\".`);\n}\n/**\n * Retrieves the default currency code for the given locale.\n *\n * The default is defined as the first currency which is still in use.\n *\n * @param locale The code of the locale whose currency code we want.\n * @returns The code of the default currency for the given locale.\n *\n */\nfunction getLocaleCurrencyCode(locale) {\n const data = findLocaleData(locale);\n return data[LocaleDataIndex.CurrencyCode] || null;\n}\n/**\n * Retrieves the plural function used by ICU expressions to determine the plural case to use\n * for a given locale.\n * @param locale A locale code for the locale format rules to use.\n * @returns The plural function for the locale.\n * @see {@link NgPlural}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n */\nfunction getLocalePluralCase(locale) {\n const data = findLocaleData(locale);\n return data[LocaleDataIndex.PluralCase];\n}\n/**\n * Helper function to get the given `normalizedLocale` from `LOCALE_DATA`\n * or from the global `ng.common.locale`.\n */\nfunction getLocaleData(normalizedLocale) {\n if (!(normalizedLocale in LOCALE_DATA)) {\n LOCALE_DATA[normalizedLocale] = _global.ng && _global.ng.common && _global.ng.common.locales && _global.ng.common.locales[normalizedLocale];\n }\n return LOCALE_DATA[normalizedLocale];\n}\n/**\n * Helper function to remove all the locale data from `LOCALE_DATA`.\n */\nfunction unregisterAllLocaleData() {\n LOCALE_DATA = {};\n}\n/**\n * Index of each type of locale data from the locale data array\n */\nvar LocaleDataIndex;\n(function (LocaleDataIndex) {\n LocaleDataIndex[LocaleDataIndex[\"LocaleId\"] = 0] = \"LocaleId\";\n LocaleDataIndex[LocaleDataIndex[\"DayPeriodsFormat\"] = 1] = \"DayPeriodsFormat\";\n LocaleDataIndex[LocaleDataIndex[\"DayPeriodsStandalone\"] = 2] = \"DayPeriodsStandalone\";\n LocaleDataIndex[LocaleDataIndex[\"DaysFormat\"] = 3] = \"DaysFormat\";\n LocaleDataIndex[LocaleDataIndex[\"DaysStandalone\"] = 4] = \"DaysStandalone\";\n LocaleDataIndex[LocaleDataIndex[\"MonthsFormat\"] = 5] = \"MonthsFormat\";\n LocaleDataIndex[LocaleDataIndex[\"MonthsStandalone\"] = 6] = \"MonthsStandalone\";\n LocaleDataIndex[LocaleDataIndex[\"Eras\"] = 7] = \"Eras\";\n LocaleDataIndex[LocaleDataIndex[\"FirstDayOfWeek\"] = 8] = \"FirstDayOfWeek\";\n LocaleDataIndex[LocaleDataIndex[\"WeekendRange\"] = 9] = \"WeekendRange\";\n LocaleDataIndex[LocaleDataIndex[\"DateFormat\"] = 10] = \"DateFormat\";\n LocaleDataIndex[LocaleDataIndex[\"TimeFormat\"] = 11] = \"TimeFormat\";\n LocaleDataIndex[LocaleDataIndex[\"DateTimeFormat\"] = 12] = \"DateTimeFormat\";\n LocaleDataIndex[LocaleDataIndex[\"NumberSymbols\"] = 13] = \"NumberSymbols\";\n LocaleDataIndex[LocaleDataIndex[\"NumberFormats\"] = 14] = \"NumberFormats\";\n LocaleDataIndex[LocaleDataIndex[\"CurrencyCode\"] = 15] = \"CurrencyCode\";\n LocaleDataIndex[LocaleDataIndex[\"CurrencySymbol\"] = 16] = \"CurrencySymbol\";\n LocaleDataIndex[LocaleDataIndex[\"CurrencyName\"] = 17] = \"CurrencyName\";\n LocaleDataIndex[LocaleDataIndex[\"Currencies\"] = 18] = \"Currencies\";\n LocaleDataIndex[LocaleDataIndex[\"Directionality\"] = 19] = \"Directionality\";\n LocaleDataIndex[LocaleDataIndex[\"PluralCase\"] = 20] = \"PluralCase\";\n LocaleDataIndex[LocaleDataIndex[\"ExtraData\"] = 21] = \"ExtraData\";\n})(LocaleDataIndex || (LocaleDataIndex = {}));\n/**\n * Returns the canonical form of a locale name - lowercase with `_` replaced with `-`.\n */\nfunction normalizeLocale(locale) {\n return locale.toLowerCase().replace(/_/g, '-');\n}\nconst pluralMapping = ['zero', 'one', 'two', 'few', 'many'];\n/**\n * Returns the plural case based on the locale\n */\nfunction getPluralCase(value, locale) {\n const plural = getLocalePluralCase(locale)(parseInt(value, 10));\n const result = pluralMapping[plural];\n return result !== undefined ? result : 'other';\n}\n/**\n * The locale id that the application is using by default (for translations and ICU expressions).\n */\nconst DEFAULT_LOCALE_ID = 'en-US';\n/**\n * USD currency code that the application uses by default for CurrencyPipe when no\n * DEFAULT_CURRENCY_CODE is provided.\n */\nconst USD_CURRENCY_CODE = 'USD';\n\n/**\n * Marks that the next string is an element name.\n *\n * See `I18nMutateOpCodes` documentation.\n */\nconst ELEMENT_MARKER = {\n marker: 'element'\n};\n/**\n * Marks that the next string is comment text need for ICU.\n *\n * See `I18nMutateOpCodes` documentation.\n */\nconst ICU_MARKER = {\n marker: 'ICU'\n};\n/**\n * See `I18nCreateOpCodes`\n */\nvar I18nCreateOpCode;\n(function (I18nCreateOpCode) {\n /**\n * Number of bits to shift index so that it can be combined with the `APPEND_EAGERLY` and\n * `COMMENT`.\n */\n I18nCreateOpCode[I18nCreateOpCode[\"SHIFT\"] = 2] = \"SHIFT\";\n /**\n * Should the node be appended to parent immediately after creation.\n */\n I18nCreateOpCode[I18nCreateOpCode[\"APPEND_EAGERLY\"] = 1] = \"APPEND_EAGERLY\";\n /**\n * If set the node should be comment (rather than a text) node.\n */\n I18nCreateOpCode[I18nCreateOpCode[\"COMMENT\"] = 2] = \"COMMENT\";\n})(I18nCreateOpCode || (I18nCreateOpCode = {}));\n\n/**\n * The locale id that the application is currently using (for translations and ICU expressions).\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n */\nlet LOCALE_ID$1 = DEFAULT_LOCALE_ID;\n/**\n * Sets the locale id that will be used for translations and ICU expressions.\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n *\n * @param localeId\n */\nfunction setLocaleId(localeId) {\n ngDevMode && assertDefined(localeId, `Expected localeId to be defined`);\n if (typeof localeId === 'string') {\n LOCALE_ID$1 = localeId.toLowerCase().replace(/_/g, '-');\n }\n}\n/**\n * Gets the locale id that will be used for translations and ICU expressions.\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n */\nfunction getLocaleId() {\n return LOCALE_ID$1;\n}\n\n/**\n * Keep track of which input bindings in `ɵɵi18nExp` have changed.\n *\n * This is used to efficiently update expressions in i18n only when the corresponding input has\n * changed.\n *\n * 1) Each bit represents which of the `ɵɵi18nExp` has changed.\n * 2) There are 32 bits allowed in JS.\n * 3) Bit 32 is special as it is shared for all changes past 32. (In other words if you have more\n * than 32 `ɵɵi18nExp` then all changes past 32nd `ɵɵi18nExp` will be mapped to same bit. This means\n * that we may end up changing more than we need to. But i18n expressions with 32 bindings is rare\n * so in practice it should not be an issue.)\n */\nlet changeMask = 0b0;\n/**\n * Keeps track of which bit needs to be updated in `changeMask`\n *\n * This value gets incremented on every call to `ɵɵi18nExp`\n */\nlet changeMaskCounter = 0;\n/**\n * Keep track of which input bindings in `ɵɵi18nExp` have changed.\n *\n * `setMaskBit` gets invoked by each call to `ɵɵi18nExp`.\n *\n * @param hasChange did `ɵɵi18nExp` detect a change.\n */\nfunction setMaskBit(hasChange) {\n if (hasChange) {\n changeMask = changeMask | 1 << Math.min(changeMaskCounter, 31);\n }\n changeMaskCounter++;\n}\nfunction applyI18n(tView, lView, index) {\n if (changeMaskCounter > 0) {\n ngDevMode && assertDefined(tView, `tView should be defined`);\n const tI18n = tView.data[index];\n // When `index` points to an `ɵɵi18nAttributes` then we have an array otherwise `TI18n`\n const updateOpCodes = Array.isArray(tI18n) ? tI18n : tI18n.update;\n const bindingsStartIndex = getBindingIndex() - changeMaskCounter - 1;\n applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask);\n }\n // Reset changeMask & maskBit to default for the next update cycle\n changeMask = 0b0;\n changeMaskCounter = 0;\n}\nfunction createNodeWithoutHydration(lView, textOrName, nodeType) {\n const renderer = lView[RENDERER];\n switch (nodeType) {\n case Node.COMMENT_NODE:\n return createCommentNode(renderer, textOrName);\n case Node.TEXT_NODE:\n return createTextNode(renderer, textOrName);\n case Node.ELEMENT_NODE:\n return createElementNode(renderer, textOrName, null);\n }\n}\nlet _locateOrCreateNode = (lView, index, textOrName, nodeType) => {\n lastNodeWasCreated(true);\n return createNodeWithoutHydration(lView, textOrName, nodeType);\n};\nfunction locateOrCreateNodeImpl(lView, index, textOrName, nodeType) {\n const hydrationInfo = lView[HYDRATION];\n const noOffsetIndex = index - HEADER_OFFSET;\n const isNodeCreationMode = !isI18nHydrationSupportEnabled() || !hydrationInfo || isInSkipHydrationBlock$1() || isDisconnectedNode$1(hydrationInfo, noOffsetIndex);\n lastNodeWasCreated(isNodeCreationMode);\n if (isNodeCreationMode) {\n return createNodeWithoutHydration(lView, textOrName, nodeType);\n }\n const native = locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex);\n // TODO: Improve error handling\n //\n // Other hydration paths use validateMatchingNode() in order to provide\n // detailed information in development mode about the expected DOM.\n // However, not every node in an i18n block has a TNode. Instead, we\n // need to be able to use the AST to generate a similar message.\n ngDevMode && assertDefined(native, 'expected native element');\n ngDevMode && assertEqual(native.nodeType, nodeType, 'expected matching nodeType');\n ngDevMode && nodeType === Node.ELEMENT_NODE && assertEqual(native.tagName.toLowerCase(), textOrName.toLowerCase(), 'expecting matching tagName');\n ngDevMode && markRNodeAsClaimedByHydration(native);\n return native;\n}\nfunction enableLocateOrCreateI18nNodeImpl() {\n _locateOrCreateNode = locateOrCreateNodeImpl;\n}\n/**\n * Apply `I18nCreateOpCodes` op-codes as stored in `TI18n.create`.\n *\n * Creates text (and comment) nodes which are internationalized.\n *\n * @param lView Current lView\n * @param createOpCodes Set of op-codes to apply\n * @param parentRNode Parent node (so that direct children can be added eagerly) or `null` if it is\n * a root node.\n * @param insertInFrontOf DOM node that should be used as an anchor.\n */\nfunction applyCreateOpCodes(lView, createOpCodes, parentRNode, insertInFrontOf) {\n const renderer = lView[RENDERER];\n for (let i = 0; i < createOpCodes.length; i++) {\n const opCode = createOpCodes[i++];\n const text = createOpCodes[i];\n const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;\n const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;\n const index = opCode >>> I18nCreateOpCode.SHIFT;\n let rNode = lView[index];\n let lastNodeWasCreated = false;\n if (rNode === null) {\n // We only create new DOM nodes if they don't already exist: If ICU switches case back to a\n // case which was already instantiated, no need to create new DOM nodes.\n rNode = lView[index] = _locateOrCreateNode(lView, index, text, isComment ? Node.COMMENT_NODE : Node.TEXT_NODE);\n lastNodeWasCreated = wasLastNodeCreated();\n }\n if (appendNow && parentRNode !== null && lastNodeWasCreated) {\n nativeInsertBefore(renderer, parentRNode, rNode, insertInFrontOf, false);\n }\n }\n}\n/**\n * Apply `I18nMutateOpCodes` OpCodes.\n *\n * @param tView Current `TView`\n * @param mutableOpCodes Mutable OpCodes to process\n * @param lView Current `LView`\n * @param anchorRNode place where the i18n node should be inserted.\n */\nfunction applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {\n ngDevMode && assertDomNode(anchorRNode);\n const renderer = lView[RENDERER];\n // `rootIdx` represents the node into which all inserts happen.\n let rootIdx = null;\n // `rootRNode` represents the real node into which we insert. This can be different from\n // `lView[rootIdx]` if we have projection.\n // - null we don't have a parent (as can be the case in when we are inserting into a root of\n // LView which has no parent.)\n // - `RElement` The element representing the root after taking projection into account.\n let rootRNode;\n for (let i = 0; i < mutableOpCodes.length; i++) {\n const opCode = mutableOpCodes[i];\n if (typeof opCode == 'string') {\n const textNodeIndex = mutableOpCodes[++i];\n if (lView[textNodeIndex] === null) {\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n ngDevMode && assertIndexInRange(lView, textNodeIndex);\n lView[textNodeIndex] = _locateOrCreateNode(lView, textNodeIndex, opCode, Node.TEXT_NODE);\n }\n } else if (typeof opCode == 'number') {\n switch (opCode & 1 /* IcuCreateOpCode.MASK_INSTRUCTION */) {\n case 0 /* IcuCreateOpCode.AppendChild */:\n const parentIdx = getParentFromIcuCreateOpCode(opCode);\n if (rootIdx === null) {\n // The first operation should save the `rootIdx` because the first operation\n // must insert into the root. (Only subsequent operations can insert into a dynamic\n // parent)\n rootIdx = parentIdx;\n rootRNode = nativeParentNode(renderer, anchorRNode);\n }\n let insertInFrontOf;\n let parentRNode;\n if (parentIdx === rootIdx) {\n insertInFrontOf = anchorRNode;\n parentRNode = rootRNode;\n } else {\n insertInFrontOf = null;\n parentRNode = unwrapRNode(lView[parentIdx]);\n }\n // FIXME(misko): Refactor with `processI18nText`\n if (parentRNode !== null) {\n // This can happen if the `LView` we are adding to is not attached to a parent `LView`.\n // In such a case there is no \"root\" we can attach to. This is fine, as we still need to\n // create the elements. When the `LView` gets later added to a parent these \"root\" nodes\n // get picked up and added.\n ngDevMode && assertDomNode(parentRNode);\n const refIdx = getRefFromIcuCreateOpCode(opCode);\n ngDevMode && assertGreaterThan(refIdx, HEADER_OFFSET, 'Missing ref');\n // `unwrapRNode` is not needed here as all of these point to RNodes as part of the i18n\n // which can't have components.\n const child = lView[refIdx];\n ngDevMode && assertDomNode(child);\n nativeInsertBefore(renderer, parentRNode, child, insertInFrontOf, false);\n const tIcu = getTIcu(tView, refIdx);\n if (tIcu !== null && typeof tIcu === 'object') {\n // If we just added a comment node which has ICU then that ICU may have already been\n // rendered and therefore we need to re-add it here.\n ngDevMode && assertTIcu(tIcu);\n const caseIndex = getCurrentICUCaseIndex(tIcu, lView);\n if (caseIndex !== null) {\n applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, lView[tIcu.anchorIdx]);\n }\n }\n }\n break;\n case 1 /* IcuCreateOpCode.Attr */:\n const elementNodeIndex = opCode >>> 1 /* IcuCreateOpCode.SHIFT_REF */;\n const attrName = mutableOpCodes[++i];\n const attrValue = mutableOpCodes[++i];\n // This code is used for ICU expressions only, since we don't support\n // directives/components in ICUs, we don't need to worry about inputs here\n setElementAttribute(renderer, getNativeByIndex(elementNodeIndex, lView), null, null, attrName, attrValue, null);\n break;\n default:\n if (ngDevMode) {\n throw new RuntimeError(700 /* RuntimeErrorCode.INVALID_I18N_STRUCTURE */, `Unable to determine the type of mutate operation for \"${opCode}\"`);\n }\n }\n } else {\n switch (opCode) {\n case ICU_MARKER:\n const commentValue = mutableOpCodes[++i];\n const commentNodeIndex = mutableOpCodes[++i];\n if (lView[commentNodeIndex] === null) {\n ngDevMode && assertEqual(typeof commentValue, 'string', `Expected \"${commentValue}\" to be a comment node value`);\n ngDevMode && ngDevMode.rendererCreateComment++;\n ngDevMode && assertIndexInExpandoRange(lView, commentNodeIndex);\n const commentRNode = lView[commentNodeIndex] = _locateOrCreateNode(lView, commentNodeIndex, commentValue, Node.COMMENT_NODE);\n // FIXME(misko): Attaching patch data is only needed for the root (Also add tests)\n attachPatchData(commentRNode, lView);\n }\n break;\n case ELEMENT_MARKER:\n const tagName = mutableOpCodes[++i];\n const elementNodeIndex = mutableOpCodes[++i];\n if (lView[elementNodeIndex] === null) {\n ngDevMode && assertEqual(typeof tagName, 'string', `Expected \"${tagName}\" to be an element node tag name`);\n ngDevMode && ngDevMode.rendererCreateElement++;\n ngDevMode && assertIndexInExpandoRange(lView, elementNodeIndex);\n const elementRNode = lView[elementNodeIndex] = _locateOrCreateNode(lView, elementNodeIndex, tagName, Node.ELEMENT_NODE);\n // FIXME(misko): Attaching patch data is only needed for the root (Also add tests)\n attachPatchData(elementRNode, lView);\n }\n break;\n default:\n ngDevMode && throwError(`Unable to determine the type of mutate operation for \"${opCode}\"`);\n }\n }\n }\n}\n/**\n * Apply `I18nUpdateOpCodes` OpCodes\n *\n * @param tView Current `TView`\n * @param lView Current `LView`\n * @param updateOpCodes OpCodes to process\n * @param bindingsStartIndex Location of the first `ɵɵi18nApply`\n * @param changeMask Each bit corresponds to a `ɵɵi18nExp` (Counting backwards from\n * `bindingsStartIndex`)\n */\nfunction applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask) {\n for (let i = 0; i < updateOpCodes.length; i++) {\n // bit code to check if we should apply the next update\n const checkBit = updateOpCodes[i];\n // Number of opCodes to skip until next set of update codes\n const skipCodes = updateOpCodes[++i];\n if (checkBit & changeMask) {\n // The value has been updated since last checked\n let value = '';\n for (let j = i + 1; j <= i + skipCodes; j++) {\n const opCode = updateOpCodes[j];\n if (typeof opCode == 'string') {\n value += opCode;\n } else if (typeof opCode == 'number') {\n if (opCode < 0) {\n // Negative opCode represent `i18nExp` values offset.\n value += renderStringify(lView[bindingsStartIndex - opCode]);\n } else {\n const nodeIndex = opCode >>> 2 /* I18nUpdateOpCode.SHIFT_REF */;\n switch (opCode & 3 /* I18nUpdateOpCode.MASK_OPCODE */) {\n case 1 /* I18nUpdateOpCode.Attr */:\n const propName = updateOpCodes[++j];\n const sanitizeFn = updateOpCodes[++j];\n const tNodeOrTagName = tView.data[nodeIndex];\n ngDevMode && assertDefined(tNodeOrTagName, 'Experting TNode or string');\n if (typeof tNodeOrTagName === 'string') {\n // IF we don't have a `TNode`, then we are an element in ICU (as ICU content does\n // not have TNode), in which case we know that there are no directives, and hence\n // we use attribute setting.\n setElementAttribute(lView[RENDERER], lView[nodeIndex], null, tNodeOrTagName, propName, value, sanitizeFn);\n } else {\n elementPropertyInternal(tView, tNodeOrTagName, lView, propName, value, lView[RENDERER], sanitizeFn, false);\n }\n break;\n case 0 /* I18nUpdateOpCode.Text */:\n const rText = lView[nodeIndex];\n rText !== null && updateTextNode(lView[RENDERER], rText, value);\n break;\n case 2 /* I18nUpdateOpCode.IcuSwitch */:\n applyIcuSwitchCase(tView, getTIcu(tView, nodeIndex), lView, value);\n break;\n case 3 /* I18nUpdateOpCode.IcuUpdate */:\n applyIcuUpdateCase(tView, getTIcu(tView, nodeIndex), bindingsStartIndex, lView);\n break;\n }\n }\n }\n }\n } else {\n const opCode = updateOpCodes[i + 1];\n if (opCode > 0 && (opCode & 3 /* I18nUpdateOpCode.MASK_OPCODE */) === 3 /* I18nUpdateOpCode.IcuUpdate */) {\n // Special case for the `icuUpdateCase`. It could be that the mask did not match, but\n // we still need to execute `icuUpdateCase` because the case has changed recently due to\n // previous `icuSwitchCase` instruction. (`icuSwitchCase` and `icuUpdateCase` always come in\n // pairs.)\n const nodeIndex = opCode >>> 2 /* I18nUpdateOpCode.SHIFT_REF */;\n const tIcu = getTIcu(tView, nodeIndex);\n const currentIndex = lView[tIcu.currentCaseLViewIndex];\n if (currentIndex < 0) {\n applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView);\n }\n }\n }\n i += skipCodes;\n }\n}\n/**\n * Apply OpCodes associated with updating an existing ICU.\n *\n * @param tView Current `TView`\n * @param tIcu Current `TIcu`\n * @param bindingsStartIndex Location of the first `ɵɵi18nApply`\n * @param lView Current `LView`\n */\nfunction applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView) {\n ngDevMode && assertIndexInRange(lView, tIcu.currentCaseLViewIndex);\n let activeCaseIndex = lView[tIcu.currentCaseLViewIndex];\n if (activeCaseIndex !== null) {\n let mask = changeMask;\n if (activeCaseIndex < 0) {\n // Clear the flag.\n // Negative number means that the ICU was freshly created and we need to force the update.\n activeCaseIndex = lView[tIcu.currentCaseLViewIndex] = ~activeCaseIndex;\n // -1 is same as all bits on, which simulates creation since it marks all bits dirty\n mask = -1;\n }\n applyUpdateOpCodes(tView, lView, tIcu.update[activeCaseIndex], bindingsStartIndex, mask);\n }\n}\n/**\n * Apply OpCodes associated with switching a case on ICU.\n *\n * This involves tearing down existing case and than building up a new case.\n *\n * @param tView Current `TView`\n * @param tIcu Current `TIcu`\n * @param lView Current `LView`\n * @param value Value of the case to update to.\n */\nfunction applyIcuSwitchCase(tView, tIcu, lView, value) {\n // Rebuild a new case for this ICU\n const caseIndex = getCaseIndex(tIcu, value);\n let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);\n if (activeCaseIndex !== caseIndex) {\n applyIcuSwitchCaseRemove(tView, tIcu, lView);\n lView[tIcu.currentCaseLViewIndex] = caseIndex === null ? null : ~caseIndex;\n if (caseIndex !== null) {\n // Add the nodes for the new case\n const anchorRNode = lView[tIcu.anchorIdx];\n if (anchorRNode) {\n ngDevMode && assertDomNode(anchorRNode);\n applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, anchorRNode);\n }\n claimDehydratedIcuCase(lView, tIcu.anchorIdx, caseIndex);\n }\n }\n}\n/**\n * Apply OpCodes associated with tearing ICU case.\n *\n * This involves tearing down existing case and than building up a new case.\n *\n * @param tView Current `TView`\n * @param tIcu Current `TIcu`\n * @param lView Current `LView`\n */\nfunction applyIcuSwitchCaseRemove(tView, tIcu, lView) {\n let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);\n if (activeCaseIndex !== null) {\n const removeCodes = tIcu.remove[activeCaseIndex];\n for (let i = 0; i < removeCodes.length; i++) {\n const nodeOrIcuIndex = removeCodes[i];\n if (nodeOrIcuIndex > 0) {\n // Positive numbers are `RNode`s.\n const rNode = getNativeByIndex(nodeOrIcuIndex, lView);\n rNode !== null && nativeRemoveNode(lView[RENDERER], rNode);\n } else {\n // Negative numbers are ICUs\n applyIcuSwitchCaseRemove(tView, getTIcu(tView, ~nodeOrIcuIndex), lView);\n }\n }\n }\n}\n/**\n * Returns the index of the current case of an ICU expression depending on the main binding value\n *\n * @param icuExpression\n * @param bindingValue The value of the main binding used by this ICU expression\n */\nfunction getCaseIndex(icuExpression, bindingValue) {\n let index = icuExpression.cases.indexOf(bindingValue);\n if (index === -1) {\n switch (icuExpression.type) {\n case 1 /* IcuType.plural */:\n {\n const resolvedCase = getPluralCase(bindingValue, getLocaleId());\n index = icuExpression.cases.indexOf(resolvedCase);\n if (index === -1 && resolvedCase !== 'other') {\n index = icuExpression.cases.indexOf('other');\n }\n break;\n }\n case 0 /* IcuType.select */:\n {\n index = icuExpression.cases.indexOf('other');\n break;\n }\n }\n }\n return index === -1 ? null : index;\n}\n\n/**\n * Converts `I18nCreateOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nCreateOpCodes.debug` property if `ngDevMode` is enabled.\n * This function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nCreateOpCodes` if attached as a method.\n * @param opcodes `I18nCreateOpCodes` if invoked as a function.\n */\nfunction i18nCreateOpCodesToString(opcodes) {\n const createOpCodes = opcodes || (Array.isArray(this) ? this : []);\n let lines = [];\n for (let i = 0; i < createOpCodes.length; i++) {\n const opCode = createOpCodes[i++];\n const text = createOpCodes[i];\n const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;\n const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;\n const index = opCode >>> I18nCreateOpCode.SHIFT;\n lines.push(`lView[${index}] = document.${isComment ? 'createComment' : 'createText'}(${JSON.stringify(text)});`);\n if (appendNow) {\n lines.push(`parent.appendChild(lView[${index}]);`);\n }\n }\n return lines;\n}\n/**\n * Converts `I18nUpdateOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nUpdateOpCodes.debug` property if `ngDevMode` is enabled.\n * This function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nUpdateOpCodes` if attached as a method.\n * @param opcodes `I18nUpdateOpCodes` if invoked as a function.\n */\nfunction i18nUpdateOpCodesToString(opcodes) {\n const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));\n let lines = [];\n function consumeOpCode(value) {\n const ref = value >>> 2 /* I18nUpdateOpCode.SHIFT_REF */;\n const opCode = value & 3 /* I18nUpdateOpCode.MASK_OPCODE */;\n switch (opCode) {\n case 0 /* I18nUpdateOpCode.Text */:\n return `(lView[${ref}] as Text).textContent = $$$`;\n case 1 /* I18nUpdateOpCode.Attr */:\n const attrName = parser.consumeString();\n const sanitizationFn = parser.consumeFunction();\n const value = sanitizationFn ? `(${sanitizationFn})($$$)` : '$$$';\n return `(lView[${ref}] as Element).setAttribute('${attrName}', ${value})`;\n case 2 /* I18nUpdateOpCode.IcuSwitch */:\n return `icuSwitchCase(${ref}, $$$)`;\n case 3 /* I18nUpdateOpCode.IcuUpdate */:\n return `icuUpdateCase(${ref})`;\n }\n throw new Error('unexpected OpCode');\n }\n while (parser.hasMore()) {\n let mask = parser.consumeNumber();\n let size = parser.consumeNumber();\n const end = parser.i + size;\n const statements = [];\n let statement = '';\n while (parser.i < end) {\n let value = parser.consumeNumberOrString();\n if (typeof value === 'string') {\n statement += value;\n } else if (value < 0) {\n // Negative numbers are ref indexes\n // Here `i` refers to current binding index. It is to signify that the value is relative,\n // rather than absolute.\n statement += '${lView[i' + value + ']}';\n } else {\n // Positive numbers are operations.\n const opCodeText = consumeOpCode(value);\n statements.push(opCodeText.replace('$$$', '`' + statement + '`') + ';');\n statement = '';\n }\n }\n lines.push(`if (mask & 0b${mask.toString(2)}) { ${statements.join(' ')} }`);\n }\n return lines;\n}\n/**\n * Converts `I18nCreateOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nCreateOpCodes.debug` if `ngDevMode` is enabled. This\n * function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nCreateOpCodes` if attached as a method.\n * @param opcodes `I18nCreateOpCodes` if invoked as a function.\n */\nfunction icuCreateOpCodesToString(opcodes) {\n const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));\n let lines = [];\n function consumeOpCode(opCode) {\n const parent = getParentFromIcuCreateOpCode(opCode);\n const ref = getRefFromIcuCreateOpCode(opCode);\n switch (getInstructionFromIcuCreateOpCode(opCode)) {\n case 0 /* IcuCreateOpCode.AppendChild */:\n return `(lView[${parent}] as Element).appendChild(lView[${lastRef}])`;\n case 1 /* IcuCreateOpCode.Attr */:\n return `(lView[${ref}] as Element).setAttribute(\"${parser.consumeString()}\", \"${parser.consumeString()}\")`;\n }\n throw new Error('Unexpected OpCode: ' + getInstructionFromIcuCreateOpCode(opCode));\n }\n let lastRef = -1;\n while (parser.hasMore()) {\n let value = parser.consumeNumberStringOrMarker();\n if (value === ICU_MARKER) {\n const text = parser.consumeString();\n lastRef = parser.consumeNumber();\n lines.push(`lView[${lastRef}] = document.createComment(\"${text}\")`);\n } else if (value === ELEMENT_MARKER) {\n const text = parser.consumeString();\n lastRef = parser.consumeNumber();\n lines.push(`lView[${lastRef}] = document.createElement(\"${text}\")`);\n } else if (typeof value === 'string') {\n lastRef = parser.consumeNumber();\n lines.push(`lView[${lastRef}] = document.createTextNode(\"${value}\")`);\n } else if (typeof value === 'number') {\n const line = consumeOpCode(value);\n line && lines.push(line);\n } else {\n throw new Error('Unexpected value');\n }\n }\n return lines;\n}\n/**\n * Converts `I18nRemoveOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nRemoveOpCodes.debug` if `ngDevMode` is enabled. This\n * function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nRemoveOpCodes` if attached as a method.\n * @param opcodes `I18nRemoveOpCodes` if invoked as a function.\n */\nfunction i18nRemoveOpCodesToString(opcodes) {\n const removeCodes = opcodes || (Array.isArray(this) ? this : []);\n let lines = [];\n for (let i = 0; i < removeCodes.length; i++) {\n const nodeOrIcuIndex = removeCodes[i];\n if (nodeOrIcuIndex > 0) {\n // Positive numbers are `RNode`s.\n lines.push(`remove(lView[${nodeOrIcuIndex}])`);\n } else {\n // Negative numbers are ICUs\n lines.push(`removeNestedICU(${~nodeOrIcuIndex})`);\n }\n }\n return lines;\n}\nclass OpCodeParser {\n constructor(codes) {\n this.i = 0;\n this.codes = codes;\n }\n hasMore() {\n return this.i < this.codes.length;\n }\n consumeNumber() {\n let value = this.codes[this.i++];\n assertNumber(value, 'expecting number in OpCode');\n return value;\n }\n consumeString() {\n let value = this.codes[this.i++];\n assertString(value, 'expecting string in OpCode');\n return value;\n }\n consumeFunction() {\n let value = this.codes[this.i++];\n if (value === null || typeof value === 'function') {\n return value;\n }\n throw new Error('expecting function in OpCode');\n }\n consumeNumberOrString() {\n let value = this.codes[this.i++];\n if (typeof value === 'string') {\n return value;\n }\n assertNumber(value, 'expecting number or string in OpCode');\n return value;\n }\n consumeNumberStringOrMarker() {\n let value = this.codes[this.i++];\n if (typeof value === 'string' || typeof value === 'number' || value == ICU_MARKER || value == ELEMENT_MARKER) {\n return value;\n }\n assertNumber(value, 'expecting number, string, ICU_MARKER or ELEMENT_MARKER in OpCode');\n return value;\n }\n}\nconst BINDING_REGEXP = /<2F>(\\d+):?\\d*<2A>/gi;\nconst ICU_REGEXP = /({\\s*<2A>\\d+:?\\d*<2A>\\s*,\\s*\\S{6}\\s*,[\\s\\S]*})/gi;\nconst NESTED_ICU = /<2F>(\\d+)<29>/;\nconst ICU_BLOCK_REGEXP = /^\\s*(<28>\\d+:?\\d*<2A>)\\s*,\\s*(select|plural)\\s*,/;\nconst MARKER = `<60>`;\nconst SUBTEMPLATE_REGEXP = /<2F>\\/?\\*(\\d+:\\d+)<29>/gi;\nconst PH_REGEXP = /<2F>(\\/?[#*]\\d+):?\\d*<2A>/gi;\n/**\n * Angular uses the special entity &ngsp; as a placeholder for non-removable space.\n * It's replaced by the 0xE500 PUA (Private Use Areas) unicode character and later on replaced by a\n * space.\n * We are re-implementing the same idea since translations might contain this special character.\n */\nconst NGSP_UNICODE_REGEXP = /\\uE500/g;\nfunction replaceNgsp(value) {\n return value.replace(NGSP_UNICODE_REGEXP, ' ');\n}\n/**\n * Patch a `debug` property getter on top of the existing object.\n *\n * NOTE: always call this method with `ngDevMode && attachDebugObject(...)`\n *\n * @param obj Object to patch\n * @param debugGetter Getter returning a value to patch\n */\nfunction attachDebugGetter(obj, debugGetter) {\n if (ngDevMode) {\n Object.defineProperty(obj, 'debug', {\n get: debugGetter,\n enumerable: false\n });\n } else {\n throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');\n }\n}\n/**\n * Create dynamic nodes from i18n translation block.\n *\n * - Text nodes are created synchronously\n * - TNodes are linked into tree lazily\n *\n * @param tView Current `TView`\n * @parentTNodeIndex index to the parent TNode of this i18n block\n * @param lView Current `LView`\n * @param index Index of `ɵɵi18nStart` instruction.\n * @param message Message to translate.\n * @param subTemplateIndex Index into the sub template of message translation. (ie in case of\n * `ngIf`) (-1 otherwise)\n */\nfunction i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message, subTemplateIndex) {\n const rootTNode = getCurrentParentTNode();\n const createOpCodes = [];\n const updateOpCodes = [];\n const existingTNodeStack = [[]];\n const astStack = [[]];\n if (ngDevMode) {\n attachDebugGetter(createOpCodes, i18nCreateOpCodesToString);\n attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n }\n message = getTranslationForTemplate(message, subTemplateIndex);\n const msgParts = replaceNgsp(message).split(PH_REGEXP);\n for (let i = 0; i < msgParts.length; i++) {\n let value = msgParts[i];\n if ((i & 1) === 0) {\n // Even indexes are text (including bindings & ICU expressions)\n const parts = i18nParseTextIntoPartsAndICU(value);\n for (let j = 0; j < parts.length; j++) {\n let part = parts[j];\n if ((j & 1) === 0) {\n // `j` is odd therefore `part` is string\n const text = part;\n ngDevMode && assertString(text, 'Parsed ICU part should be string');\n if (text !== '') {\n i18nStartFirstCreatePassProcessTextNode(astStack[0], tView, rootTNode, existingTNodeStack[0], createOpCodes, updateOpCodes, lView, text);\n }\n } else {\n // `j` is Even therefor `part` is an `ICUExpression`\n const icuExpression = part;\n // Verify that ICU expression has the right shape. Translations might contain invalid\n // constructions (while original messages were correct), so ICU parsing at runtime may\n // not succeed (thus `icuExpression` remains a string).\n // Note: we intentionally retain the error here by not using `ngDevMode`, because\n // the value can change based on the locale and users aren't guaranteed to hit\n // an invalid string while they're developing.\n if (typeof icuExpression !== 'object') {\n throw new Error(`Unable to parse ICU expression in \"${message}\" message.`);\n }\n const icuContainerTNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodeStack[0], lView, createOpCodes, ngDevMode ? `ICU ${index}:${icuExpression.mainBinding}` : '', true);\n const icuNodeIndex = icuContainerTNode.index;\n ngDevMode && assertGreaterThanOrEqual(icuNodeIndex, HEADER_OFFSET, 'Index must be in absolute LView offset');\n icuStart(astStack[0], tView, lView, updateOpCodes, parentTNodeIndex, icuExpression, icuNodeIndex);\n }\n }\n } else {\n // Odd indexes are placeholders (elements and sub-templates)\n // At this point value is something like: '/#1:2' (originally coming from '<27>/#1:2<>')\n const isClosing = value.charCodeAt(0) === 47 /* CharCode.SLASH */;\n const type = value.charCodeAt(isClosing ? 1 : 0);\n ngDevMode && assertOneOf(type, 42 /* CharCode.STAR */, 35 /* CharCode.HASH */);\n const index = HEADER_OFFSET + Number.parseInt(value.substring(isClosing ? 2 : 1));\n if (isClosing) {\n existingTNodeStack.shift();\n astStack.shift();\n setCurrentTNode(getCurrentParentTNode(), false);\n } else {\n const tNode = createTNodePlaceholder(tView, existingTNodeStack[0], index);\n existingTNodeStack.unshift([]);\n setCurrentTNode(tNode, true);\n const placeholderNode = {\n kind: 2 /* I18nNodeKind.PLACEHOLDER */,\n index,\n children: [],\n type: type === 35 /* CharCode.HASH */ ? 0 /* I18nPlaceholderType.ELEMENT */ : 1 /* I18nPlaceholderType.SUBTEMPLATE */\n };\n astStack[0].push(placeholderNode);\n astStack.unshift(placeholderNode.children);\n }\n }\n }\n tView.data[index] = {\n create: createOpCodes,\n update: updateOpCodes,\n ast: astStack[0],\n parentTNodeIndex\n };\n}\n/**\n * Allocate space in i18n Range add create OpCode instruction to create a text or comment node.\n *\n * @param tView Current `TView` needed to allocate space in i18n range.\n * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will be\n * added as part of the `i18nStart` instruction or as part of the `TNode.insertBeforeIndex`.\n * @param existingTNodes internal state for `addTNodeAndUpdateInsertBeforeIndex`.\n * @param lView Current `LView` needed to allocate space in i18n range.\n * @param createOpCodes Array storing `I18nCreateOpCodes` where new opCodes will be added.\n * @param text Text to be added when the `Text` or `Comment` node will be created.\n * @param isICU true if a `Comment` node for ICU (instead of `Text`) node should be created.\n */\nfunction createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, text, isICU) {\n const i18nNodeIdx = allocExpando(tView, lView, 1, null);\n let opCode = i18nNodeIdx << I18nCreateOpCode.SHIFT;\n let parentTNode = getCurrentParentTNode();\n if (rootTNode === parentTNode) {\n // FIXME(misko): A null `parentTNode` should represent when we fall of the `LView` boundary.\n // (there is no parent), but in some circumstances (because we are inconsistent about how we set\n // `previousOrParentTNode`) it could point to `rootTNode` So this is a work around.\n parentTNode = null;\n }\n if (parentTNode === null) {\n // If we don't have a parent that means that we can eagerly add nodes.\n // If we have a parent than these nodes can't be added now (as the parent has not been created\n // yet) and instead the `parentTNode` is responsible for adding it. See\n // `TNode.insertBeforeIndex`\n opCode |= I18nCreateOpCode.APPEND_EAGERLY;\n }\n if (isICU) {\n opCode |= I18nCreateOpCode.COMMENT;\n ensureIcuContainerVisitorLoaded(loadIcuContainerVisitor);\n }\n createOpCodes.push(opCode, text === null ? '' : text);\n // We store `{{?}}` so that when looking at debug `TNodeType.template` we can see where the\n // bindings are.\n const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 /* TNodeType.Icu */ : 1 /* TNodeType.Text */, text === null ? ngDevMode ? '{{?}}' : '' : text, null);\n addTNodeAndUpdateInsertBeforeIndex(existingTNodes, tNode);\n const tNodeIdx = tNode.index;\n setCurrentTNode(tNode, false /* Text nodes are self closing */);\n if (parentTNode !== null && rootTNode !== parentTNode) {\n // We are a child of deeper node (rather than a direct child of `i18nStart` instruction.)\n // We have to make sure to add ourselves to the parent.\n setTNodeInsertBeforeIndex(parentTNode, tNodeIdx);\n }\n return tNode;\n}\n/**\n * Processes text node in i18n block.\n *\n * Text nodes can have:\n * - Create instruction in `createOpCodes` for creating the text node.\n * - Allocate spec for text node in i18n range of `LView`\n * - If contains binding:\n * - bindings => allocate space in i18n range of `LView` to store the binding value.\n * - populate `updateOpCodes` with update instructions.\n *\n * @param tView Current `TView`\n * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will\n * be added as part of the `i18nStart` instruction or as part of the\n * `TNode.insertBeforeIndex`.\n * @param existingTNodes internal state for `addTNodeAndUpdateInsertBeforeIndex`.\n * @param createOpCodes Location where the creation OpCodes will be stored.\n * @param lView Current `LView`\n * @param text The translated text (which may contain binding)\n */\nfunction i18nStartFirstCreatePassProcessTextNode(ast, tView, rootTNode, existingTNodes, createOpCodes, updateOpCodes, lView, text) {\n const hasBinding = text.match(BINDING_REGEXP);\n const tNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, hasBinding ? null : text, false);\n const index = tNode.index;\n if (hasBinding) {\n generateBindingUpdateOpCodes(updateOpCodes, text, index, null, 0, null);\n }\n ast.push({\n kind: 0 /* I18nNodeKind.TEXT */,\n index\n });\n}\n/**\n * See `i18nAttributes` above.\n */\nfunction i18nAttributesFirstPass(tView, index, values) {\n const previousElement = getCurrentTNode();\n const previousElementIndex = previousElement.index;\n const updateOpCodes = [];\n if (ngDevMode) {\n attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n }\n if (tView.firstCreatePass && tView.data[index] === null) {\n for (let i = 0; i < values.length; i += 2) {\n const attrName = values[i];\n const message = values[i + 1];\n if (message !== '') {\n // Check if attribute value contains an ICU and throw an error if that's the case.\n // ICUs in element attributes are not supported.\n // Note: we intentionally retain the error here by not using `ngDevMode`, because\n // the `value` can change based on the locale and users aren't guaranteed to hit\n // an invalid string while they're developing.\n if (ICU_REGEXP.test(message)) {\n throw new Error(`ICU expressions are not supported in attributes. Message: \"${message}\".`);\n }\n // i18n attributes that hit this code path are guaranteed to have bindings, because\n // the compiler treats static i18n attributes as regular attribute bindings.\n // Since this may not be the first i18n attribute on this element we need to pass in how\n // many previous bindings there have already been.\n generateBindingUpdateOpCodes(updateOpCodes, message, previousElementIndex, attrName, countBindings(updateOpCodes), null);\n }\n }\n tView.data[index] = updateOpCodes;\n }\n}\n/**\n * Generate the OpCodes to update the bindings of a string.\n *\n * @param updateOpCodes Place where the update opcodes will be stored.\n * @param str The string containing the bindings.\n * @param destinationNode Index of the destination node which will receive the binding.\n * @param attrName Name of the attribute, if the string belongs to an attribute.\n * @param sanitizeFn Sanitization function used to sanitize the string after update, if necessary.\n * @param bindingStart The lView index of the next expression that can be bound via an opCode.\n * @returns The mask value for these bindings\n */\nfunction generateBindingUpdateOpCodes(updateOpCodes, str, destinationNode, attrName, bindingStart, sanitizeFn) {\n ngDevMode && assertGreaterThanOrEqual(destinationNode, HEADER_OFFSET, 'Index must be in absolute LView offset');\n const maskIndex = updateOpCodes.length; // Location of mask\n const sizeIndex = maskIndex + 1; // location of size for skipping\n updateOpCodes.push(null, null); // Alloc space for mask and size\n const startIndex = maskIndex + 2; // location of first allocation.\n if (ngDevMode) {\n attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n }\n const textParts = str.split(BINDING_REGEXP);\n let mask = 0;\n for (let j = 0; j < textParts.length; j++) {\n const textValue = textParts[j];\n if (j & 1) {\n // Odd indexes are bindings\n const bindingIndex = bindingStart + parseInt(textValue, 10);\n updateOpCodes.push(-1 - bindingIndex);\n mask = mask | toMaskBit(bindingIndex);\n } else if (textValue !== '') {\n // Even indexes are text\n updateOpCodes.push(textValue);\n }\n }\n updateOpCodes.push(destinationNode << 2 /* I18nUpdateOpCode.SHIFT_REF */ | (attrName ? 1 /* I18nUpdateOpCode.Attr */ : 0 /* I18nUpdateOpCode.Text */));\n if (attrName) {\n updateOpCodes.push(attrName, sanitizeFn);\n }\n updateOpCodes[maskIndex] = mask;\n updateOpCodes[sizeIndex] = updateOpCodes.length - startIndex;\n return mask;\n}\n/**\n * Count the number of bindings in the given `opCodes`.\n *\n * It could be possible to speed this up, by passing the number of bindings found back from\n * `generateBindingUpdateOpCodes()` to `i18nAttributesFirstPass()` but this would then require more\n * complexity in the code and/or transient objects to be created.\n *\n * Since this function is only called once when the template is instantiated, is trivial in the\n * first instance (since `opCodes` will be an empty array), and it is not common for elements to\n * contain multiple i18n bound attributes, it seems like this is a reasonable compromise.\n */\nfunction countBindings(opCodes) {\n let count = 0;\n for (let i = 0; i < opCodes.length; i++) {\n const opCode = opCodes[i];\n // Bindings are negative numbers.\n if (typeof opCode === 'number' && opCode < 0) {\n count++;\n }\n }\n return count;\n}\n/**\n * Convert binding index to mask bit.\n *\n * Each index represents a single bit on the bit-mask. Because bit-mask only has 32 bits, we make\n * the 32nd bit share all masks for all bindings higher than 32. Since it is extremely rare to\n * have more than 32 bindings this will be hit very rarely. The downside of hitting this corner\n * case is that we will execute binding code more often than necessary. (penalty of performance)\n */\nfunction toMaskBit(bindingIndex) {\n return 1 << Math.min(bindingIndex, 31);\n}\n/**\n * Removes everything inside the sub-templates of a message.\n */\nfunction removeInnerTemplateTranslation(message) {\n let match;\n let res = '';\n let index = 0;\n let inTemplate = false;\n let tagMatched;\n while ((match = SUBTEMPLATE_REGEXP.exec(message)) !== null) {\n if (!inTemplate) {\n res += message.substring(index, match.index + match[0].length);\n tagMatched = match[1];\n inTemplate = true;\n } else {\n if (match[0] === `${MARKER}/*${tagMatched}${MARKER}`) {\n index = match.index;\n inTemplate = false;\n }\n }\n }\n ngDevMode && assertEqual(inTemplate, false, `Tag mismatch: unable to find the end of the sub-template in the translation \"${message}\"`);\n res += message.slice(index);\n return res;\n}\n/**\n * Extracts a part of a message and removes the rest.\n *\n * This method is used for extracting a part of the message associated with a template. A\n * translated message can span multiple templates.\n *\n * Example:\n * ```\n * <div i18n>Translate <span *ngIf>me</span>!</div>\n * ```\n *\n * @param message The message to crop\n * @param subTemplateIndex Index of the sub-template to extract. If undefined it returns the\n * external template and removes all sub-templates.\n */\nfunction getTranslationForTemplate(message, subTemplateIndex) {\n if (isRootTemplateMessage(subTemplateIndex)) {\n // We want the root template message, ignore all sub-templates\n return removeInnerTemplateTranslation(message);\n } else {\n // We want a specific sub-template\n const start = message.indexOf(`:${subTemplateIndex}${MARKER}`) + 2 + subTemplateIndex.toString().length;\n const end = message.search(new RegExp(`${MARKER}\\\\/\\\\*\\\\d+:${subTemplateIndex}${MARKER}`));\n return removeInnerTemplateTranslation(message.substring(start, end));\n }\n}\n/**\n * Generate the OpCodes for ICU expressions.\n *\n * @param icuExpression\n * @param index Index where the anchor is stored and an optional `TIcuContainerNode`\n * - `lView[anchorIdx]` points to a `Comment` node representing the anchor for the ICU.\n * - `tView.data[anchorIdx]` points to the `TIcuContainerNode` if ICU is root (`null` otherwise)\n */\nfunction icuStart(ast, tView, lView, updateOpCodes, parentIdx, icuExpression, anchorIdx) {\n ngDevMode && assertDefined(icuExpression, 'ICU expression must be defined');\n let bindingMask = 0;\n const tIcu = {\n type: icuExpression.type,\n currentCaseLViewIndex: allocExpando(tView, lView, 1, null),\n anchorIdx,\n cases: [],\n create: [],\n remove: [],\n update: []\n };\n addUpdateIcuSwitch(updateOpCodes, icuExpression, anchorIdx);\n setTIcu(tView, anchorIdx, tIcu);\n const values = icuExpression.values;\n const cases = [];\n for (let i = 0; i < values.length; i++) {\n // Each value is an array of strings & other ICU expressions\n const valueArr = values[i];\n const nestedIcus = [];\n for (let j = 0; j < valueArr.length; j++) {\n const value = valueArr[j];\n if (typeof value !== 'string') {\n // It is an nested ICU expression\n const icuIndex = nestedIcus.push(value) - 1;\n // Replace nested ICU expression by a comment node\n valueArr[j] = `<!--<2D>${icuIndex}<7D>-->`;\n }\n }\n const caseAst = [];\n cases.push(caseAst);\n bindingMask = parseIcuCase(caseAst, tView, tIcu, lView, updateOpCodes, parentIdx, icuExpression.cases[i], valueArr.join(''), nestedIcus) | bindingMask;\n }\n if (bindingMask) {\n addUpdateIcuUpdate(updateOpCodes, bindingMask, anchorIdx);\n }\n ast.push({\n kind: 3 /* I18nNodeKind.ICU */,\n index: anchorIdx,\n cases,\n currentCaseLViewIndex: tIcu.currentCaseLViewIndex\n });\n}\n/**\n * Parses text containing an ICU expression and produces a JSON object for it.\n * Original code from closure library, modified for Angular.\n *\n * @param pattern Text containing an ICU expression that needs to be parsed.\n *\n */\nfunction parseICUBlock(pattern) {\n const cases = [];\n const values = [];\n let icuType = 1 /* IcuType.plural */;\n let mainBinding = 0;\n pattern = pattern.replace(ICU_BLOCK_REGEXP, function (str, binding, type) {\n if (type === 'select') {\n icuType = 0 /* IcuType.select */;\n } else {\n icuType = 1 /* IcuType.plural */;\n }\n mainBinding = parseInt(binding.slice(1), 10);\n return '';\n });\n const parts = i18nParseTextIntoPartsAndICU(pattern);\n // Looking for (key block)+ sequence. One of the keys has to be \"other\".\n for (let pos = 0; pos < parts.length;) {\n let key = parts[pos++].trim();\n if (icuType === 1 /* IcuType.plural */) {\n // Key can be \"=x\", we just want \"x\"\n key = key.replace(/\\s*(?:=)?(\\w+)\\s*/, '$1');\n }\n if (key.length) {\n cases.push(key);\n }\n const blocks = i18nParseTextIntoPartsAndICU(parts[pos++]);\n if (cases.length > values.length) {\n values.push(blocks);\n }\n }\n // TODO(ocombe): support ICU expressions in attributes, see #21615\n return {\n type: icuType,\n mainBinding: mainBinding,\n cases,\n values\n };\n}\n/**\n * Breaks pattern into strings and top level {...} blocks.\n * Can be used to break a message into text and ICU expressions, or to break an ICU expression\n * into keys and cases. Original code from closure library, modified for Angular.\n *\n * @param pattern (sub)Pattern to be broken.\n * @returns An `Array<string|IcuExpression>` where:\n * - odd positions: `string` => text between ICU expressions\n * - even positions: `ICUExpression` => ICU expression parsed into `ICUExpression` record.\n */\nfunction i18nParseTextIntoPartsAndICU(pattern) {\n if (!pattern) {\n return [];\n }\n let prevPos = 0;\n const braceStack = [];\n const results = [];\n const braces = /[{}]/g;\n // lastIndex doesn't get set to 0 so we have to.\n braces.lastIndex = 0;\n let match;\n while (match = braces.exec(pattern)) {\n const pos = match.index;\n if (match[0] == '}') {\n braceStack.pop();\n if (braceStack.length == 0) {\n // End of the block.\n const block = pattern.substring(prevPos, pos);\n if (ICU_BLOCK_REGEXP.test(block)) {\n results.push(parseICUBlock(block));\n } else {\n results.push(block);\n }\n prevPos = pos + 1;\n }\n } else {\n if (braceStack.length == 0) {\n const substring = pattern.substring(prevPos, pos);\n results.push(substring);\n prevPos = pos + 1;\n }\n braceStack.push('{');\n }\n }\n const substring = pattern.substring(prevPos);\n results.push(substring);\n return results;\n}\n/**\n * Parses a node, its children and its siblings, and generates the mutate & update OpCodes.\n *\n */\nfunction parseIcuCase(ast, tView, tIcu, lView, updateOpCodes, parentIdx, caseName, unsafeCaseHtml, nestedIcus) {\n const create = [];\n const remove = [];\n const update = [];\n if (ngDevMode) {\n attachDebugGetter(create, icuCreateOpCodesToString);\n attachDebugGetter(remove, i18nRemoveOpCodesToString);\n attachDebugGetter(update, i18nUpdateOpCodesToString);\n }\n tIcu.cases.push(caseName);\n tIcu.create.push(create);\n tIcu.remove.push(remove);\n tIcu.update.push(update);\n const inertBodyHelper = getInertBodyHelper(getDocument());\n const inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeCaseHtml);\n ngDevMode && assertDefined(inertBodyElement, 'Unable to generate inert body element');\n const inertRootNode = getTemplateContent(inertBodyElement) || inertBodyElement;\n if (inertRootNode) {\n return walkIcuTree(ast, tView, tIcu, lView, updateOpCodes, create, remove, update, inertRootNode, parentIdx, nestedIcus, 0);\n } else {\n return 0;\n }\n}\nfunction walkIcuTree(ast, tView, tIcu, lView, sharedUpdateOpCodes, create, remove, update, parentNode, parentIdx, nestedIcus, depth) {\n let bindingMask = 0;\n let currentNode = parentNode.firstChild;\n while (currentNode) {\n const newIndex = allocExpando(tView, lView, 1, null);\n switch (currentNode.nodeType) {\n case Node.ELEMENT_NODE:\n const element = currentNode;\n const tagName = element.tagName.toLowerCase();\n if (VALID_ELEMENTS.hasOwnProperty(tagName)) {\n addCreateNodeAndAppend(create, ELEMENT_MARKER, tagName, parentIdx, newIndex);\n tView.data[newIndex] = tagName;\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const attr = elAttrs.item(i);\n const lowerAttrName = attr.name.toLowerCase();\n const hasBinding = !!attr.value.match(BINDING_REGEXP);\n // we assume the input string is safe, unless it's using a binding\n if (hasBinding) {\n if (VALID_ATTRS.hasOwnProperty(lowerAttrName)) {\n if (URI_ATTRS[lowerAttrName]) {\n generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, _sanitizeUrl);\n } else {\n generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, null);\n }\n } else {\n ngDevMode && console.warn(`WARNING: ignoring unsafe attribute value ` + `${lowerAttrName} on element ${tagName} ` + `(see ${XSS_SECURITY_URL})`);\n }\n } else {\n addCreateAttribute(create, newIndex, attr);\n }\n }\n const elementNode = {\n kind: 1 /* I18nNodeKind.ELEMENT */,\n index: newIndex,\n children: []\n };\n ast.push(elementNode);\n // Parse the children of this node (if any)\n bindingMask = walkIcuTree(elementNode.children, tView, tIcu, lView, sharedUpdateOpCodes, create, remove, update, currentNode, newIndex, nestedIcus, depth + 1) | bindingMask;\n addRemoveNode(remove, newIndex, depth);\n }\n break;\n case Node.TEXT_NODE:\n const value = currentNode.textContent || '';\n const hasBinding = value.match(BINDING_REGEXP);\n addCreateNodeAndAppend(create, null, hasBinding ? '' : value, parentIdx, newIndex);\n addRemoveNode(remove, newIndex, depth);\n if (hasBinding) {\n bindingMask = generateBindingUpdateOpCodes(update, value, newIndex, null, 0, null) | bindingMask;\n }\n ast.push({\n kind: 0 /* I18nNodeKind.TEXT */,\n index: newIndex\n });\n break;\n case Node.COMMENT_NODE:\n // Check if the comment node is a placeholder for a nested ICU\n const isNestedIcu = NESTED_ICU.exec(currentNode.textContent || '');\n if (isNestedIcu) {\n const nestedIcuIndex = parseInt(isNestedIcu[1], 10);\n const icuExpression = nestedIcus[nestedIcuIndex];\n // Create the comment node that will anchor the ICU expression\n addCreateNodeAndAppend(create, ICU_MARKER, ngDevMode ? `nested ICU ${nestedIcuIndex}` : '', parentIdx, newIndex);\n icuStart(ast, tView, lView, sharedUpdateOpCodes, parentIdx, icuExpression, newIndex);\n addRemoveNestedIcu(remove, newIndex, depth);\n }\n break;\n }\n currentNode = currentNode.nextSibling;\n }\n return bindingMask;\n}\nfunction addRemoveNode(remove, index, depth) {\n if (depth === 0) {\n remove.push(index);\n }\n}\nfunction addRemoveNestedIcu(remove, index, depth) {\n if (depth === 0) {\n remove.push(~index); // remove ICU at `index`\n remove.push(index); // remove ICU comment at `index`\n }\n}\nfunction addUpdateIcuSwitch(update, icuExpression, index) {\n update.push(toMaskBit(icuExpression.mainBinding), 2, -1 - icuExpression.mainBinding, index << 2 /* I18nUpdateOpCode.SHIFT_REF */ | 2 /* I18nUpdateOpCode.IcuSwitch */);\n}\nfunction addUpdateIcuUpdate(update, bindingMask, index) {\n update.push(bindingMask, 1, index << 2 /* I18nUpdateOpCode.SHIFT_REF */ | 3 /* I18nUpdateOpCode.IcuUpdate */);\n}\nfunction addCreateNodeAndAppend(create, marker, text, appendToParentIdx, createAtIdx) {\n if (marker !== null) {\n create.push(marker);\n }\n create.push(text, createAtIdx, icuCreateOpCode(0 /* IcuCreateOpCode.AppendChild */, appendToParentIdx, createAtIdx));\n}\nfunction addCreateAttribute(create, newIndex, attr) {\n create.push(newIndex << 1 /* IcuCreateOpCode.SHIFT_REF */ | 1 /* IcuCreateOpCode.Attr */, attr.name, attr.value);\n}\n\n// i18nPostprocess consts\nconst ROOT_TEMPLATE_ID = 0;\nconst PP_MULTI_VALUE_PLACEHOLDERS_REGEXP = /\\[(<28>.+?<3F>?)\\]/;\nconst PP_PLACEHOLDERS_REGEXP = /\\[(<28>.+?<3F>?)\\]|(<28>\\/?\\*\\d+:\\d+<2B>)/g;\nconst PP_ICU_VARS_REGEXP = /({\\s*)(VAR_(PLURAL|SELECT)(_\\d+)?)(\\s*,)/g;\nconst PP_ICU_PLACEHOLDERS_REGEXP = /{([A-Z0-9_]+)}/g;\nconst PP_ICUS_REGEXP = /<2F>I18N_EXP_(ICU(_\\d+)?)<29>/g;\nconst PP_CLOSE_TEMPLATE_REGEXP = /\\/\\*/;\nconst PP_TEMPLATE_ID_REGEXP = /\\d+\\:(\\d+)/;\n/**\n * Handles message string post-processing for internationalization.\n *\n * Handles message string post-processing by transforming it from intermediate\n * format (that might contain some markers that we need to replace) to the final\n * form, consumable by i18nStart instruction. Post processing steps include:\n *\n * 1. Resolve all multi-value cases (like [<5B>*1:1<><31>#2:1<>|<7C>#4:1<>|<7C>5<EFBFBD>])\n * 2. Replace all ICU vars (like \"VAR_PLURAL\")\n * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n * 4. Replace all ICU references with corresponding values (like <20>ICU_EXP_ICU_1<5F>)\n * in case multiple ICUs have the same placeholder name\n *\n * @param message Raw translation string for post processing\n * @param replacements Set of replacements that should be applied\n *\n * @returns Transformed string that can be consumed by i18nStart instruction\n *\n * @codeGenApi\n */\nfunction i18nPostprocess(message, replacements = {}) {\n /**\n * Step 1: resolve all multi-value placeholders like [<5B>#5<>|<7C>*1:1<><31>#2:1<>|<7C>#4:1<>]\n *\n * Note: due to the way we process nested templates (BFS), multi-value placeholders are typically\n * grouped by templates, for example: [<5B>#5<>|<7C>#6<>|<7C>#1:1<>|<7C>#3:2<>] where <20>#5<> and <20>#6<> belong to root\n * template, <20>#1:1<> belong to nested template with index 1 and <20>#1:2<> - nested template with index\n * 3. However in real templates the order might be different: i.e. <20>#1:1<> and/or <20>#3:2<> may go in\n * front of <20>#6<>. The post processing step restores the right order by keeping track of the\n * template id stack and looks for placeholders that belong to the currently active template.\n */\n let result = message;\n if (PP_MULTI_VALUE_PLACEHOLDERS_REGEXP.test(message)) {\n const matches = {};\n const templateIdsStack = [ROOT_TEMPLATE_ID];\n result = result.replace(PP_PLACEHOLDERS_REGEXP, (m, phs, tmpl) => {\n const content = phs || tmpl;\n const placeholders = matches[content] || [];\n if (!placeholders.length) {\n content.split('|').forEach(placeholder => {\n const match = placeholder.match(PP_TEMPLATE_ID_REGEXP);\n const templateId = match ? parseInt(match[1], 10) : ROOT_TEMPLATE_ID;\n const isCloseTemplateTag = PP_CLOSE_TEMPLATE_REGEXP.test(placeholder);\n placeholders.push([templateId, isCloseTemplateTag, placeholder]);\n });\n matches[content] = placeholders;\n }\n if (!placeholders.length) {\n throw new Error(`i18n postprocess: unmatched placeholder - ${content}`);\n }\n const currentTemplateId = templateIdsStack[templateIdsStack.length - 1];\n let idx = 0;\n // find placeholder index that matches current template id\n for (let i = 0; i < placeholders.length; i++) {\n if (placeholders[i][0] === currentTemplateId) {\n idx = i;\n break;\n }\n }\n // update template id stack based on the current tag extracted\n const [templateId, isCloseTemplateTag, placeholder] = placeholders[idx];\n if (isCloseTemplateTag) {\n templateIdsStack.pop();\n } else if (currentTemplateId !== templateId) {\n templateIdsStack.push(templateId);\n }\n // remove processed tag from the list\n placeholders.splice(idx, 1);\n return placeholder;\n });\n }\n // return current result if no replacements specified\n if (!Object.keys(replacements).length) {\n return result;\n }\n /**\n * Step 2: replace all ICU vars (like \"VAR_PLURAL\")\n */\n result = result.replace(PP_ICU_VARS_REGEXP, (match, start, key, _type, _idx, end) => {\n return replacements.hasOwnProperty(key) ? `${start}${replacements[key]}${end}` : match;\n });\n /**\n * Step 3: replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n */\n result = result.replace(PP_ICU_PLACEHOLDERS_REGEXP, (match, key) => {\n return replacements.hasOwnProperty(key) ? replacements[key] : match;\n });\n /**\n * Step 4: replace all ICU references with corresponding values (like <20>ICU_EXP_ICU_1<5F>) in case\n * multiple ICUs have the same placeholder name\n */\n result = result.replace(PP_ICUS_REGEXP, (match, key) => {\n if (replacements.hasOwnProperty(key)) {\n const list = replacements[key];\n if (!list.length) {\n throw new Error(`i18n postprocess: unmatched ICU - ${match} with key: ${key}`);\n }\n return list.shift();\n }\n return match;\n });\n return result;\n}\n\n/**\n * Marks a block of text as translatable.\n *\n * The instructions `i18nStart` and `i18nEnd` mark the translation block in the template.\n * The translation `message` is the value which is locale specific. The translation string may\n * contain placeholders which associate inner elements and sub-templates within the translation.\n *\n * The translation `message` placeholders are:\n * - `<60>{index}(:{block})<29>`: *Binding Placeholder*: Marks a location where an expression will be\n * interpolated into. The placeholder `index` points to the expression binding index. An optional\n * `block` that matches the sub-template in which it was declared.\n * - `<60>#{index}(:{block})<29>`/`<60>/#{index}(:{block})<29>`: *Element Placeholder*: Marks the beginning\n * and end of DOM element that were embedded in the original translation block. The placeholder\n * `index` points to the element index in the template instructions set. An optional `block` that\n * matches the sub-template in which it was declared.\n * - `<60>*{index}:{block}<7D>`/`<60>/*{index}:{block}<7D>`: *Sub-template Placeholder*: Sub-templates must be\n * split up and translated separately in each angular template function. The `index` points to the\n * `template` instruction index. A `block` that matches the sub-template in which it was declared.\n *\n * @param index A unique index of the translation in the static block.\n * @param messageIndex An index of the translation message from the `def.consts` array.\n * @param subTemplateIndex Optional sub-template index in the `message`.\n *\n * @codeGenApi\n */\nfunction ɵɵi18nStart(index, messageIndex, subTemplateIndex = -1) {\n const tView = getTView();\n const lView = getLView();\n const adjustedIndex = HEADER_OFFSET + index;\n ngDevMode && assertDefined(tView, `tView should be defined`);\n const message = getConstant(tView.consts, messageIndex);\n const parentTNode = getCurrentParentTNode();\n if (tView.firstCreatePass) {\n i18nStartFirstCreatePass(tView, parentTNode === null ? 0 : parentTNode.index, lView, adjustedIndex, message, subTemplateIndex);\n }\n // Set a flag that this LView has i18n blocks.\n // The flag is later used to determine whether this component should\n // be hydrated (currently hydration is not supported for i18n blocks).\n if (tView.type === 2 /* TViewType.Embedded */) {\n // Annotate host component's LView (not embedded view's LView),\n // since hydration can be skipped on per-component basis only.\n const componentLView = lView[DECLARATION_COMPONENT_VIEW];\n componentLView[FLAGS] |= 32 /* LViewFlags.HasI18n */;\n } else {\n lView[FLAGS] |= 32 /* LViewFlags.HasI18n */;\n }\n const tI18n = tView.data[adjustedIndex];\n const sameViewParentTNode = parentTNode === lView[T_HOST] ? null : parentTNode;\n const parentRNode = getClosestRElement(tView, sameViewParentTNode, lView);\n // If `parentTNode` is an `ElementContainer` than it has `<!--ng-container--->`.\n // When we do inserts we have to make sure to insert in front of `<!--ng-container--->`.\n const insertInFrontOf = parentTNode && parentTNode.type & 8 /* TNodeType.ElementContainer */ ? lView[parentTNode.index] : null;\n prepareI18nBlockForHydration(lView, adjustedIndex, parentTNode, subTemplateIndex);\n applyCreateOpCodes(lView, tI18n.create, parentRNode, insertInFrontOf);\n setInI18nBlock(true);\n}\n/**\n * Translates a translation block marked by `i18nStart` and `i18nEnd`. It inserts the text/ICU nodes\n * into the render tree, moves the placeholder nodes and removes the deleted nodes.\n *\n * @codeGenApi\n */\nfunction ɵɵi18nEnd() {\n setInI18nBlock(false);\n}\n/**\n *\n * Use this instruction to create a translation block that doesn't contain any placeholder.\n * It calls both {@link i18nStart} and {@link i18nEnd} in one instruction.\n *\n * The translation `message` is the value which is locale specific. The translation string may\n * contain placeholders which associate inner elements and sub-templates within the translation.\n *\n * The translation `message` placeholders are:\n * - `<60>{index}(:{block})<29>`: *Binding Placeholder*: Marks a location where an expression will be\n * interpolated into. The placeholder `index` points to the expression binding index. An optional\n * `block` that matches the sub-template in which it was declared.\n * - `<60>#{index}(:{block})<29>`/`<60>/#{index}(:{block})<29>`: *Element Placeholder*: Marks the beginning\n * and end of DOM element that were embedded in the original translation block. The placeholder\n * `index` points to the element index in the template instructions set. An optional `block` that\n * matches the sub-template in which it was declared.\n * - `<60>*{index}:{block}<7D>`/`<60>/*{index}:{block}<7D>`: *Sub-template Placeholder*: Sub-templates must be\n * split up and translated separately in each angular template function. The `index` points to the\n * `template` instruction index. A `block` that matches the sub-template in which it was declared.\n *\n * @param index A unique index of the translation in the static block.\n * @param messageIndex An index of the translation message from the `def.consts` array.\n * @param subTemplateIndex Optional sub-template index in the `message`.\n *\n * @codeGenApi\n */\nfunction ɵɵi18n(index, messageIndex, subTemplateIndex) {\n ɵɵi18nStart(index, messageIndex, subTemplateIndex);\n ɵɵi18nEnd();\n}\n/**\n * Marks a list of attributes as translatable.\n *\n * @param index A unique index in the static block\n * @param values\n *\n * @codeGenApi\n */\nfunction ɵɵi18nAttributes(index, attrsIndex) {\n const tView = getTView();\n ngDevMode && assertDefined(tView, `tView should be defined`);\n const attrs = getConstant(tView.consts, attrsIndex);\n i18nAttributesFirstPass(tView, index + HEADER_OFFSET, attrs);\n}\n/**\n * Stores the values of the bindings during each update cycle in order to determine if we need to\n * update the translated nodes.\n *\n * @param value The binding's value\n * @returns This function returns itself so that it may be chained\n * (e.g. `i18nExp(ctx.name)(ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵi18nExp(value) {\n const lView = getLView();\n setMaskBit(bindingUpdated(lView, nextBindingIndex(), value));\n return ɵɵi18nExp;\n}\n/**\n * Updates a translation block or an i18n attribute when the bindings have changed.\n *\n * @param index Index of either {@link i18nStart} (translation block) or {@link i18nAttributes}\n * (i18n attribute) on which it should update the content.\n *\n * @codeGenApi\n */\nfunction ɵɵi18nApply(index) {\n applyI18n(getTView(), getLView(), index + HEADER_OFFSET);\n}\n/**\n * Handles message string post-processing for internationalization.\n *\n * Handles message string post-processing by transforming it from intermediate\n * format (that might contain some markers that we need to replace) to the final\n * form, consumable by i18nStart instruction. Post processing steps include:\n *\n * 1. Resolve all multi-value cases (like [<5B>*1:1<><31>#2:1<>|<7C>#4:1<>|<7C>5<EFBFBD>])\n * 2. Replace all ICU vars (like \"VAR_PLURAL\")\n * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n * 4. Replace all ICU references with corresponding values (like <20>ICU_EXP_ICU_1<5F>)\n * in case multiple ICUs have the same placeholder name\n *\n * @param message Raw translation string for post processing\n * @param replacements Set of replacements that should be applied\n *\n * @returns Transformed string that can be consumed by i18nStart instruction\n *\n * @codeGenApi\n */\nfunction ɵɵi18nPostprocess(message, replacements = {}) {\n return i18nPostprocess(message, replacements);\n}\n\n/**\n * Contains a reference to a function that disables event replay feature\n * for server-side rendered applications. This function is overridden with\n * an actual implementation when the event replay feature is enabled via\n * `withEventReplay()` call.\n */\nlet stashEventListener = (el, eventName, listenerFn) => {};\nfunction setStashFn(fn) {\n stashEventListener = fn;\n}\n/**\n * Adds an event listener to the current node.\n *\n * If an output exists on one of the node's directives, it also subscribes to the output\n * and saves the subscription for later cleanup.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param useCapture Whether or not to use capture in event listener - this argument is a reminder\n * from the Renderer3 infrastructure and should be removed from the instruction arguments\n * @param eventTargetResolver Function that returns global target information in case this listener\n * should be attached to a global object like window, document or body\n *\n * @codeGenApi\n */\nfunction ɵɵlistener(eventName, listenerFn, useCapture, eventTargetResolver) {\n const lView = getLView();\n const tView = getTView();\n const tNode = getCurrentTNode();\n listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn, eventTargetResolver);\n return ɵɵlistener;\n}\n/**\n * Registers a synthetic host listener (e.g. `(@foo.start)`) on a component or directive.\n *\n * This instruction is for compatibility purposes and is designed to ensure that a\n * synthetic host listener (e.g. `@HostListener('@foo.start')`) properly gets rendered\n * in the component's renderer. Normally all host listeners are evaluated with the\n * parent component's renderer, but, in the case of animation @triggers, they need\n * to be evaluated with the sub component's renderer (because that's where the\n * animation triggers are defined).\n *\n * Do not use this instruction as a replacement for `listener`. This instruction\n * only exists to ensure compatibility with the ViewEngine's host binding behavior.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param useCapture Whether or not to use capture in event listener\n * @param eventTargetResolver Function that returns global target information in case this listener\n * should be attached to a global object like window, document or body\n *\n * @codeGenApi\n */\nfunction ɵɵsyntheticHostListener(eventName, listenerFn) {\n const tNode = getCurrentTNode();\n const lView = getLView();\n const tView = getTView();\n const currentDef = getCurrentDirectiveDef(tView.data);\n const renderer = loadComponentRenderer(currentDef, tNode, lView);\n listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn);\n return ɵɵsyntheticHostListener;\n}\n/**\n * A utility function that checks if a given element has already an event handler registered for an\n * event with a specified name. The TView.cleanup data structure is used to find out which events\n * are registered for a given element.\n */\nfunction findExistingListener(tView, lView, eventName, tNodeIdx) {\n const tCleanup = tView.cleanup;\n if (tCleanup != null) {\n for (let i = 0; i < tCleanup.length - 1; i += 2) {\n const cleanupEventName = tCleanup[i];\n if (cleanupEventName === eventName && tCleanup[i + 1] === tNodeIdx) {\n // We have found a matching event name on the same node but it might not have been\n // registered yet, so we must explicitly verify entries in the LView cleanup data\n // structures.\n const lCleanup = lView[CLEANUP];\n const listenerIdxInLCleanup = tCleanup[i + 2];\n return lCleanup.length > listenerIdxInLCleanup ? lCleanup[listenerIdxInLCleanup] : null;\n }\n // TView.cleanup can have a mix of 4-elements entries (for event handler cleanups) or\n // 2-element entries (for directive and queries destroy hooks). As such we can encounter\n // blocks of 4 or 2 items in the tView.cleanup and this is why we iterate over 2 elements\n // first and jump another 2 elements if we detect listeners cleanup (4 elements). Also check\n // documentation of TView.cleanup for more details of this data structure layout.\n if (typeof cleanupEventName === 'string') {\n i += 2;\n }\n }\n }\n return null;\n}\nfunction listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, eventTargetResolver) {\n const isTNodeDirectiveHost = isDirectiveHost(tNode);\n const firstCreatePass = tView.firstCreatePass;\n const tCleanup = firstCreatePass && getOrCreateTViewCleanup(tView);\n const context = lView[CONTEXT];\n // When the ɵɵlistener instruction was generated and is executed we know that there is either a\n // native listener or a directive output on this element. As such we we know that we will have to\n // register a listener and store its cleanup function on LView.\n const lCleanup = getOrCreateLViewCleanup(lView);\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);\n let processOutputs = true;\n // Adding a native event listener is applicable when:\n // - The corresponding TNode represents a DOM element.\n // - The event target has a resolver (usually resulting in a global object,\n // such as `window` or `document`).\n if (tNode.type & 3 /* TNodeType.AnyRNode */ || eventTargetResolver) {\n const native = getNativeByTNode(tNode, lView);\n const target = eventTargetResolver ? eventTargetResolver(native) : native;\n const lCleanupIndex = lCleanup.length;\n const idxOrTargetGetter = eventTargetResolver ? _lView => eventTargetResolver(unwrapRNode(_lView[tNode.index])) : tNode.index;\n // In order to match current behavior, native DOM event listeners must be added for all\n // events (including outputs).\n // There might be cases where multiple directives on the same element try to register an event\n // handler function for the same event. In this situation we want to avoid registration of\n // several native listeners as each registration would be intercepted by NgZone and\n // trigger change detection. This would mean that a single user action would result in several\n // change detections being invoked. To avoid this situation we want to have only one call to\n // native handler registration (for the same element and same type of event).\n //\n // In order to have just one native event handler in presence of multiple handler functions,\n // we just register a first handler function as a native event listener and then chain\n // (coalesce) other handler functions on top of the first native handler function.\n let existingListener = null;\n // Please note that the coalescing described here doesn't happen for events specifying an\n // alternative target (ex. (document:click)) - this is to keep backward compatibility with the\n // view engine.\n // Also, we don't have to search for existing listeners is there are no directives\n // matching on a given node as we can't register multiple event handlers for the same event in\n // a template (this would mean having duplicate attributes).\n if (!eventTargetResolver && isTNodeDirectiveHost) {\n existingListener = findExistingListener(tView, lView, eventName, tNode.index);\n }\n if (existingListener !== null) {\n // Attach a new listener to coalesced listeners list, maintaining the order in which\n // listeners are registered. For performance reasons, we keep a reference to the last\n // listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through\n // the entire set each time we need to add a new listener.\n const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;\n lastListenerFn.__ngNextListenerFn__ = listenerFn;\n existingListener.__ngLastListenerFn__ = listenerFn;\n processOutputs = false;\n } else {\n listenerFn = wrapListener(tNode, lView, context, listenerFn);\n stashEventListener(native, eventName, listenerFn);\n const cleanupFn = renderer.listen(target, eventName, listenerFn);\n ngDevMode && ngDevMode.rendererAddEventListener++;\n lCleanup.push(listenerFn, cleanupFn);\n tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);\n }\n } else {\n // Even if there is no native listener to add, we still need to wrap the listener so that OnPush\n // ancestors are marked dirty when an event occurs.\n listenerFn = wrapListener(tNode, lView, context, listenerFn);\n }\n // subscribe to directive outputs\n const outputs = tNode.outputs;\n let props;\n if (processOutputs && outputs !== null && (props = outputs[eventName])) {\n const propsLength = props.length;\n if (propsLength) {\n for (let i = 0; i < propsLength; i += 2) {\n const index = props[i];\n ngDevMode && assertIndexInRange(lView, index);\n const minifiedName = props[i + 1];\n const directiveInstance = lView[index];\n const output = directiveInstance[minifiedName];\n if (ngDevMode && !isOutputSubscribable(output)) {\n throw new Error(`@Output ${minifiedName} not initialized in '${directiveInstance.constructor.name}'.`);\n }\n const subscription = output.subscribe(listenerFn);\n const idx = lCleanup.length;\n lCleanup.push(listenerFn, subscription);\n tCleanup && tCleanup.push(eventName, tNode.index, idx, -(idx + 1));\n }\n }\n }\n}\nfunction executeListenerWithErrorHandling(lView, context, listenerFn, e) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n profiler(6 /* ProfilerEvent.OutputStart */, context, listenerFn);\n // Only explicitly returning false from a listener should preventDefault\n return listenerFn(e) !== false;\n } catch (error) {\n handleError(lView, error);\n return false;\n } finally {\n profiler(7 /* ProfilerEvent.OutputEnd */, context, listenerFn);\n setActiveConsumer$1(prevConsumer);\n }\n}\n/**\n * Wraps an event listener with a function that marks ancestors dirty and prevents default behavior,\n * if applicable.\n *\n * @param tNode The TNode associated with this listener\n * @param lView The LView that contains this listener\n * @param listenerFn The listener function to call\n * @param wrapWithPreventDefault Whether or not to prevent default behavior\n * (the procedural renderer does this already, so in those cases, we should skip)\n */\nfunction wrapListener(tNode, lView, context, listenerFn) {\n // Note: we are performing most of the work in the listener function itself\n // to optimize listener registration.\n return function wrapListenerIn_markDirtyAndPreventDefault(e) {\n // Ivy uses `Function` as a special token that allows us to unwrap the function\n // so that it can be invoked programmatically by `DebugNode.triggerEventHandler`.\n if (e === Function) {\n return listenerFn;\n }\n // In order to be backwards compatible with View Engine, events on component host nodes\n // must also mark the component view itself dirty (i.e. the view that it owns).\n const startView = tNode.componentOffset > -1 ? getComponentLViewByIndex(tNode.index, lView) : lView;\n markViewDirty(startView, 5 /* NotificationSource.Listener */);\n let result = executeListenerWithErrorHandling(lView, context, listenerFn, e);\n // A just-invoked listener function might have coalesced listeners so we need to check for\n // their presence and invoke as needed.\n let nextListenerFn = wrapListenerIn_markDirtyAndPreventDefault.__ngNextListenerFn__;\n while (nextListenerFn) {\n // We should prevent default if any of the listeners explicitly return false\n result = executeListenerWithErrorHandling(lView, context, nextListenerFn, e) && result;\n nextListenerFn = nextListenerFn.__ngNextListenerFn__;\n }\n return result;\n };\n}\n/**\n * Whether the given value represents a subscribable output.\n *\n * For example, an `EventEmitter, a `Subject`, an `Observable` or an\n * `OutputEmitter`.\n */\nfunction isOutputSubscribable(value) {\n return value != null && typeof value.subscribe === 'function';\n}\n\n/**\n * Retrieves a context at the level specified and saves it as the global, contextViewData.\n * Will get the next level up if level is not specified.\n *\n * This is used to save contexts of parent views so they can be bound in embedded views, or\n * in conjunction with reference() to bind a ref from a parent view.\n *\n * @param level The relative level of the view from which to grab context compared to contextVewData\n * @returns context\n *\n * @codeGenApi\n */\nfunction ɵɵnextContext(level = 1) {\n return nextContextImpl(level);\n}\n\n/**\n * Checks a given node against matching projection slots and returns the\n * determined slot index. Returns \"null\" if no slot matched the given node.\n *\n * This function takes into account the parsed ngProjectAs selector from the\n * node's attributes. If present, it will check whether the ngProjectAs selector\n * matches any of the projection slot selectors.\n */\nfunction matchingProjectionSlotIndex(tNode, projectionSlots) {\n let wildcardNgContentIndex = null;\n const ngProjectAsAttrVal = getProjectAsAttrValue(tNode);\n for (let i = 0; i < projectionSlots.length; i++) {\n const slotValue = projectionSlots[i];\n // The last wildcard projection slot should match all nodes which aren't matching\n // any selector. This is necessary to be backwards compatible with view engine.\n if (slotValue === '*') {\n wildcardNgContentIndex = i;\n continue;\n }\n // If we ran into an `ngProjectAs` attribute, we should match its parsed selector\n // to the list of selectors, otherwise we fall back to matching against the node.\n if (ngProjectAsAttrVal === null ? isNodeMatchingSelectorList(tNode, slotValue, /* isProjectionMode */true) : isSelectorInSelectorList(ngProjectAsAttrVal, slotValue)) {\n return i; // first matching selector \"captures\" a given node\n }\n }\n return wildcardNgContentIndex;\n}\n/**\n * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.\n * It takes all the selectors from the entire component's template and decides where\n * each projected node belongs (it re-distributes nodes among \"buckets\" where each \"bucket\" is\n * backed by a selector).\n *\n * This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text,\n * un-parsed form.\n *\n * The parsed form is needed for efficient matching of a node against a given CSS selector.\n * The un-parsed, textual form is needed for support of the ngProjectAs attribute.\n *\n * Having a CSS selector in 2 different formats is not ideal, but alternatives have even more\n * drawbacks:\n * - having only a textual form would require runtime parsing of CSS selectors;\n * - we can't have only a parsed as we can't re-construct textual form from it (as entered by a\n * template author).\n *\n * @param projectionSlots? A collection of projection slots. A projection slot can be based\n * on a parsed CSS selectors or set to the wildcard selector (\"*\") in order to match\n * all nodes which do not match any selector. If not specified, a single wildcard\n * selector projection slot will be defined.\n *\n * @codeGenApi\n */\nfunction ɵɵprojectionDef(projectionSlots) {\n const componentNode = getLView()[DECLARATION_COMPONENT_VIEW][T_HOST];\n if (!componentNode.projection) {\n // If no explicit projection slots are defined, fall back to a single\n // projection slot with the wildcard selector.\n const numProjectionSlots = projectionSlots ? projectionSlots.length : 1;\n const projectionHeads = componentNode.projection = newArray(numProjectionSlots, null);\n const tails = projectionHeads.slice();\n let componentChild = componentNode.child;\n while (componentChild !== null) {\n // Do not project let declarations so they don't occupy a slot.\n if (componentChild.type !== 128 /* TNodeType.LetDeclaration */) {\n const slotIndex = projectionSlots ? matchingProjectionSlotIndex(componentChild, projectionSlots) : 0;\n if (slotIndex !== null) {\n if (tails[slotIndex]) {\n tails[slotIndex].projectionNext = componentChild;\n } else {\n projectionHeads[slotIndex] = componentChild;\n }\n tails[slotIndex] = componentChild;\n }\n }\n componentChild = componentChild.next;\n }\n }\n}\n/**\n * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call\n * to the projectionDef instruction.\n *\n * @param nodeIndex Index of the projection node.\n * @param selectorIndex Index of the slot selector.\n * - 0 when the selector is `*` (or unspecified as this is the default value),\n * - 1 based index of the selector from the {@link projectionDef}\n * @param attrs Static attributes set on the `ng-content` node.\n * @param fallbackTemplateFn Template function with fallback content.\n * Will be rendered if the slot is empty at runtime.\n * @param fallbackDecls Number of declarations in the fallback template.\n * @param fallbackVars Number of variables in the fallback template.\n *\n * @codeGenApi\n */\nfunction ɵɵprojection(nodeIndex, selectorIndex = 0, attrs, fallbackTemplateFn, fallbackDecls, fallbackVars) {\n const lView = getLView();\n const tView = getTView();\n const fallbackIndex = fallbackTemplateFn ? nodeIndex + 1 : null;\n // Fallback content needs to be declared no matter whether the slot is empty since different\n // instances of the component may or may not insert it. Also it needs to be declare *before*\n // the projection node in order to work correctly with hydration.\n if (fallbackIndex !== null) {\n declareTemplate(lView, tView, fallbackIndex, fallbackTemplateFn, fallbackDecls, fallbackVars, null, attrs);\n }\n const tProjectionNode = getOrCreateTNode(tView, HEADER_OFFSET + nodeIndex, 16 /* TNodeType.Projection */, null, attrs || null);\n // We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views.\n if (tProjectionNode.projection === null) {\n tProjectionNode.projection = selectorIndex;\n }\n // `<ng-content>` has no content. Even if there's fallback\n // content, the fallback is shown next to it.\n setCurrentTNodeAsNotParent();\n const hydrationInfo = lView[HYDRATION];\n const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1();\n const componentHostNode = lView[DECLARATION_COMPONENT_VIEW][T_HOST];\n const isEmpty = componentHostNode.projection[tProjectionNode.projection] === null;\n if (isEmpty && fallbackIndex !== null) {\n insertFallbackContent(lView, tView, fallbackIndex);\n } else if (isNodeCreationMode && (tProjectionNode.flags & 32 /* TNodeFlags.isDetached */) !== 32 /* TNodeFlags.isDetached */) {\n // re-distribution of projectable nodes is stored on a component's view level\n applyProjection(tView, lView, tProjectionNode);\n }\n}\n/** Inserts the fallback content of a projection slot. Assumes there's no projected content. */\nfunction insertFallbackContent(lView, tView, fallbackIndex) {\n const adjustedIndex = HEADER_OFFSET + fallbackIndex;\n const fallbackTNode = tView.data[adjustedIndex];\n const fallbackLContainer = lView[adjustedIndex];\n ngDevMode && assertTNode(fallbackTNode);\n ngDevMode && assertLContainer(fallbackLContainer);\n const dehydratedView = findMatchingDehydratedView(fallbackLContainer, fallbackTNode.tView.ssrId);\n const fallbackLView = createAndRenderEmbeddedLView(lView, fallbackTNode, undefined, {\n dehydratedView\n });\n addLViewToLContainer(fallbackLContainer, fallbackLView, 0, shouldAddViewToDom(fallbackTNode, dehydratedView));\n}\n\n/**\n *\n * Update an interpolated property on an element with a lone bound value\n *\n * Used when the value passed to a property has 1 interpolated value in it, an no additional text\n * surrounds that interpolated value:\n *\n * ```html\n * <div title=\"{{v0}}\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate('title', v0);\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate(propName, v0, sanitizer) {\n ɵɵpropertyInterpolate1(propName, '', v0, '', sanitizer);\n return ɵɵpropertyInterpolate;\n}\n/**\n *\n * Update an interpolated property on an element with single bound value surrounded by text.\n *\n * Used when the value passed to a property has 1 interpolated value in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate1('title', 'prefix', v0, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate1(propName, prefix, v0, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 1, prefix, suffix);\n }\n return ɵɵpropertyInterpolate1;\n}\n/**\n *\n * Update an interpolated property on an element with 2 bound values surrounded by text.\n *\n * Used when the value passed to a property has 2 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate2(propName, prefix, v0, i0, v1, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 2, prefix, i0, suffix);\n }\n return ɵɵpropertyInterpolate2;\n}\n/**\n *\n * Update an interpolated property on an element with 3 bound values surrounded by text.\n *\n * Used when the value passed to a property has 3 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate3(\n * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate3(propName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 3, prefix, i0, i1, suffix);\n }\n return ɵɵpropertyInterpolate3;\n}\n/**\n *\n * Update an interpolated property on an element with 4 bound values surrounded by text.\n *\n * Used when the value passed to a property has 4 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate4(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate4(propName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);\n }\n return ɵɵpropertyInterpolate4;\n}\n/**\n *\n * Update an interpolated property on an element with 5 bound values surrounded by text.\n *\n * Used when the value passed to a property has 5 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate5(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate5(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);\n }\n return ɵɵpropertyInterpolate5;\n}\n/**\n *\n * Update an interpolated property on an element with 6 bound values surrounded by text.\n *\n * Used when the value passed to a property has 6 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate6(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate6(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);\n }\n return ɵɵpropertyInterpolate6;\n}\n/**\n *\n * Update an interpolated property on an element with 7 bound values surrounded by text.\n *\n * Used when the value passed to a property has 7 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate7(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate7(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);\n }\n return ɵɵpropertyInterpolate7;\n}\n/**\n *\n * Update an interpolated property on an element with 8 bound values surrounded by text.\n *\n * Used when the value passed to a property has 8 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate8(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param i6 Static value used for concatenation only.\n * @param v7 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate8(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);\n }\n return ɵɵpropertyInterpolate8;\n}\n/**\n * Update an interpolated property on an element with 9 or more bound values surrounded by text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div\n * title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolateV(\n * 'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n * 'suffix']);\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update.\n * @param values The collection of values and the strings in between those values, beginning with a\n * string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolateV(propName, values, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolationV(lView, values);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n if (ngDevMode) {\n const interpolationInBetween = [values[0]]; // prefix\n for (let i = 2; i < values.length; i += 2) {\n interpolationInBetween.push(values[i]);\n }\n storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - interpolationInBetween.length + 1, ...interpolationInBetween);\n }\n }\n return ɵɵpropertyInterpolateV;\n}\n\n/**\n * Registers a QueryList, associated with a content query, for later refresh (part of a view\n * refresh).\n *\n * @param directiveIndex Current directive index\n * @param predicate The type for which the query will search\n * @param flags Flags associated with the query\n * @param read What to save in the query\n * @returns QueryList<T>\n *\n * @codeGenApi\n */\nfunction ɵɵcontentQuery(directiveIndex, predicate, flags, read) {\n createContentQuery(directiveIndex, predicate, flags, read);\n}\n/**\n * Creates a new view query by initializing internal data structures.\n *\n * @param predicate The type for which the query will search\n * @param flags Flags associated with the query\n * @param read What to save in the query\n *\n * @codeGenApi\n */\nfunction ɵɵviewQuery(predicate, flags, read) {\n createViewQuery(predicate, flags, read);\n}\n/**\n * Refreshes a query by combining matches from all active views and removing matches from deleted\n * views.\n *\n * @returns `true` if a query got dirty during change detection or if this is a static query\n * resolving in creation mode, `false` otherwise.\n *\n * @codeGenApi\n */\nfunction ɵɵqueryRefresh(queryList) {\n const lView = getLView();\n const tView = getTView();\n const queryIndex = getCurrentQueryIndex();\n setCurrentQueryIndex(queryIndex + 1);\n const tQuery = getTQuery(tView, queryIndex);\n if (queryList.dirty && isCreationMode(lView) === ((tQuery.metadata.flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */)) {\n if (tQuery.matches === null) {\n queryList.reset([]);\n } else {\n const result = getQueryResults(lView, queryIndex);\n queryList.reset(result, unwrapElementRef);\n queryList.notifyOnChanges();\n }\n return true;\n }\n return false;\n}\n/**\n * Loads a QueryList corresponding to the current view or content query.\n *\n * @codeGenApi\n */\nfunction ɵɵloadQuery() {\n return loadQueryInternal(getLView(), getCurrentQueryIndex());\n}\n\n/**\n * Creates a new content query and binds it to a signal created by an authoring function.\n *\n * @param directiveIndex Current directive index\n * @param target The target signal to which the query should be bound\n * @param predicate The type for which the query will search\n * @param flags Flags associated with the query\n * @param read What to save in the query\n *\n * @codeGenApi\n */\nfunction ɵɵcontentQuerySignal(directiveIndex, target, predicate, flags, read) {\n bindQueryToSignal(target, createContentQuery(directiveIndex, predicate, flags, read));\n}\n/**\n * Creates a new view query by initializing internal data structures and binding a new query to the\n * target signal.\n *\n * @param target The target signal to assign the query results to.\n * @param predicate The type or label that should match a given query\n * @param flags Flags associated with the query\n * @param read What to save in the query\n *\n * @codeGenApi\n */\nfunction ɵɵviewQuerySignal(target, predicate, flags, read) {\n bindQueryToSignal(target, createViewQuery(predicate, flags, read));\n}\n/**\n * Advances the current query index by a specified offset.\n *\n * Adjusting the current query index is necessary in cases where a given directive has a mix of\n * zone-based and signal-based queries. The signal-based queries don't require tracking of the\n * current index (those are refreshed on demand and not during change detection) so this instruction\n * is only necessary for backward-compatibility.\n *\n * @param index offset to apply to the current query index (defaults to 1)\n *\n * @codeGenApi\n */\nfunction ɵɵqueryAdvance(indexOffset = 1) {\n setCurrentQueryIndex(getCurrentQueryIndex() + indexOffset);\n}\n\n/** Store a value in the `data` at a given `index`. */\nfunction store(tView, lView, index, value) {\n // We don't store any static data for local variables, so the first time\n // we see the template, we should store as null to avoid a sparse array\n if (index >= tView.data.length) {\n tView.data[index] = null;\n tView.blueprint[index] = null;\n }\n lView[index] = value;\n}\n/**\n * Retrieves a local reference from the current contextViewData.\n *\n * If the reference to retrieve is in a parent view, this instruction is used in conjunction\n * with a nextContext() call, which walks up the tree and updates the contextViewData instance.\n *\n * @param index The index of the local ref in contextViewData.\n *\n * @codeGenApi\n */\nfunction ɵɵreference(index) {\n const contextLView = getContextLView();\n return load(contextLView, HEADER_OFFSET + index);\n}\n\n/**\n *\n * Update an interpolated style on an element with single bound value surrounded by text.\n *\n * Used when the value passed to a property has 1 interpolated value in it:\n *\n * ```html\n * <div style=\"key: {{v0}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate1('key: ', v0, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate1(prefix, v0, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n *\n * Update an interpolated style on an element with 2 bound values surrounded by text.\n *\n * Used when the value passed to a property has 2 interpolated values in it:\n *\n * ```html\n * <div style=\"key: {{v0}}; key1: {{v1}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate2('key: ', v0, '; key1: ', v1, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate2(prefix, v0, i0, v1, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n *\n * Update an interpolated style on an element with 3 bound values surrounded by text.\n *\n * Used when the value passed to a property has 3 interpolated values in it:\n *\n * ```html\n * <div style=\"key: {{v0}}; key2: {{v1}}; key2: {{v2}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate3(\n * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n *\n * Update an interpolated style on an element with 4 bound values surrounded by text.\n *\n * Used when the value passed to a property has 4 interpolated values in it:\n *\n * ```html\n * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate4(\n * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n *\n * Update an interpolated style on an element with 5 bound values surrounded by text.\n *\n * Used when the value passed to a property has 5 interpolated values in it:\n *\n * ```html\n * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate5(\n * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n *\n * Update an interpolated style on an element with 6 bound values surrounded by text.\n *\n * Used when the value passed to a property has 6 interpolated values in it:\n *\n * ```html\n * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}};\n * key5: {{v5}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate6(\n * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,\n * 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n *\n * Update an interpolated style on an element with 7 bound values surrounded by text.\n *\n * Used when the value passed to a property has 7 interpolated values in it:\n *\n * ```html\n * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};\n * key6: {{v6}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate7(\n * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,\n * '; key6: ', v6, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n *\n * Update an interpolated style on an element with 8 bound values surrounded by text.\n *\n * Used when the value passed to a property has 8 interpolated values in it:\n *\n * ```html\n * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};\n * key6: {{v6}}; key7: {{v7}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate8(\n * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,\n * '; key6: ', v6, '; key7: ', v7, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param i6 Static value used for concatenation only.\n * @param v7 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n * Update an interpolated style on an element with 9 or more bound values surrounded by text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div\n * class=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};\n * key6: {{v6}}; key7: {{v7}}; key8: {{v8}}; key9: {{v9}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolateV(\n * ['key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,\n * '; key6: ', v6, '; key7: ', v7, '; key8: ', v8, '; key9: ', v9, 'suffix']);\n * ```\n *.\n * @param values The collection of values and the strings in-between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '; key2: ', value1, '; key2: ', value2, ..., value99, 'suffix']`)\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolateV(values) {\n const lView = getLView();\n const interpolatedValue = interpolationV(lView, values);\n ɵɵstyleMap(interpolatedValue);\n}\n\n/**\n *\n * Update an interpolated style property on an element with single bound value surrounded by text.\n *\n * Used when the value passed to a property has 1 interpolated value in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate1(0, 'prefix', v0, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate1(prop, prefix, v0, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate1;\n}\n/**\n *\n * Update an interpolated style property on an element with 2 bound values surrounded by text.\n *\n * Used when the value passed to a property has 2 interpolated values in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}-{{v1}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate2(0, 'prefix', v0, '-', v1, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate2(prop, prefix, v0, i0, v1, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate2;\n}\n/**\n *\n * Update an interpolated style property on an element with 3 bound values surrounded by text.\n *\n * Used when the value passed to a property has 3 interpolated values in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate3(0, 'prefix', v0, '-', v1, '-', v2, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate3(prop, prefix, v0, i0, v1, i1, v2, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate3;\n}\n/**\n *\n * Update an interpolated style property on an element with 4 bound values surrounded by text.\n *\n * Used when the value passed to a property has 4 interpolated values in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate4(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate4(prop, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate4;\n}\n/**\n *\n * Update an interpolated style property on an element with 5 bound values surrounded by text.\n *\n * Used when the value passed to a property has 5 interpolated values in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate5(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate5(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate5;\n}\n/**\n *\n * Update an interpolated style property on an element with 6 bound values surrounded by text.\n *\n * Used when the value passed to a property has 6 interpolated values in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate6(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate6(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate6;\n}\n/**\n *\n * Update an interpolated style property on an element with 7 bound values surrounded by text.\n *\n * Used when the value passed to a property has 7 interpolated values in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate7(\n * 0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate7(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate7;\n}\n/**\n *\n * Update an interpolated style property on an element with 8 bound values surrounded by text.\n *\n * Used when the value passed to a property has 8 interpolated values in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate8(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6,\n * '-', v7, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param i6 Static value used for concatenation only.\n * @param v7 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate8(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate8;\n}\n/**\n * Update an interpolated style property on an element with 9 or more bound values surrounded by\n * text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div\n * style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix\">\n * </div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolateV(\n * 0, ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n * 'suffix']);\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`..\n * @param values The collection of values and the strings in-between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolateV(prop, values, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolationV(lView, values);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolateV;\n}\n\n/**\n * Create static text node\n *\n * @param index Index of the node in the data array\n * @param value Static string value to write.\n *\n * @codeGenApi\n */\nfunction ɵɵtext(index, value = '') {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n ngDevMode && assertEqual(getBindingIndex(), tView.bindingStartIndex, 'text nodes should be created before any bindings');\n ngDevMode && assertIndexInRange(lView, adjustedIndex);\n const tNode = tView.firstCreatePass ? getOrCreateTNode(tView, adjustedIndex, 1 /* TNodeType.Text */, value, null) : tView.data[adjustedIndex];\n const textNative = _locateOrCreateTextNode(tView, lView, tNode, value, index);\n lView[adjustedIndex] = textNative;\n if (wasLastNodeCreated()) {\n appendChild(tView, lView, textNative, tNode);\n }\n // Text nodes are self closing.\n setCurrentTNode(tNode, false);\n}\nlet _locateOrCreateTextNode = (tView, lView, tNode, value, index) => {\n lastNodeWasCreated(true);\n return createTextNode(lView[RENDERER], value);\n};\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode of text nodes.\n */\nfunction locateOrCreateTextNodeImpl(tView, lView, tNode, value, index) {\n const hydrationInfo = lView[HYDRATION];\n const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1() || isDetachedByI18n(tNode) || isDisconnectedNode$1(hydrationInfo, index);\n lastNodeWasCreated(isNodeCreationMode);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createTextNode(lView[RENDERER], value);\n }\n // Hydration mode, looking up an existing element in DOM.\n const textNative = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateMatchingNode(textNative, Node.TEXT_NODE, null, lView, tNode);\n ngDevMode && markRNodeAsClaimedByHydration(textNative);\n return textNative;\n}\nfunction enableLocateOrCreateTextNodeImpl() {\n _locateOrCreateTextNode = locateOrCreateTextNodeImpl;\n}\n\n/**\n *\n * Update text content with a lone bound value\n *\n * Used when a text node has 1 interpolated value in it, an no additional text\n * surrounds that interpolated value:\n *\n * ```html\n * <div>{{v0}}</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate(v0);\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate(v0) {\n ɵɵtextInterpolate1('', v0, '');\n return ɵɵtextInterpolate;\n}\n/**\n *\n * Update text content with single bound value surrounded by other text.\n *\n * Used when a text node has 1 interpolated value in it:\n *\n * ```html\n * <div>prefix{{v0}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate1('prefix', v0, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate1(prefix, v0, suffix) {\n const lView = getLView();\n const interpolated = interpolation1(lView, prefix, v0, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate1;\n}\n/**\n *\n * Update text content with 2 bound values surrounded by other text.\n *\n * Used when a text node has 2 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate2('prefix', v0, '-', v1, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate2(prefix, v0, i0, v1, suffix) {\n const lView = getLView();\n const interpolated = interpolation2(lView, prefix, v0, i0, v1, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate2;\n}\n/**\n *\n * Update text content with 3 bound values surrounded by other text.\n *\n * Used when a text node has 3 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate3(\n * 'prefix', v0, '-', v1, '-', v2, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) {\n const lView = getLView();\n const interpolated = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate3;\n}\n/**\n *\n * Update text content with 4 bound values surrounded by other text.\n *\n * Used when a text node has 4 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate4(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see ɵɵtextInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n const lView = getLView();\n const interpolated = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate4;\n}\n/**\n *\n * Update text content with 5 bound values surrounded by other text.\n *\n * Used when a text node has 5 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate5(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n const lView = getLView();\n const interpolated = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate5;\n}\n/**\n *\n * Update text content with 6 bound values surrounded by other text.\n *\n * Used when a text node has 6 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate6(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n * ```\n *\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change. @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n const lView = getLView();\n const interpolated = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate6;\n}\n/**\n *\n * Update text content with 7 bound values surrounded by other text.\n *\n * Used when a text node has 7 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate7(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n const lView = getLView();\n const interpolated = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate7;\n}\n/**\n *\n * Update text content with 8 bound values surrounded by other text.\n *\n * Used when a text node has 8 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate8(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n const lView = getLView();\n const interpolated = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate8;\n}\n/**\n * Update text content with 9 or more bound values other surrounded by text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolateV(\n * ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n * 'suffix']);\n * ```\n *.\n * @param values The collection of values and the strings in between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n *\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵtextInterpolateV(values) {\n const lView = getLView();\n const interpolated = interpolationV(lView, values);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolateV;\n}\n\n/*!\n * @license\n * Copyright Google LLC 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.dev/license\n */\n/**\n * Update a two-way bound property on a selected element.\n *\n * Operates on the element selected by index via the {@link select} instruction.\n *\n * @param propName Name of property.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @returns This function returns itself so that it may be chained\n * (e.g. `twoWayProperty('name', ctx.name)('title', ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵtwoWayProperty(propName, value, sanitizer) {\n // TODO(crisbeto): perf impact of re-evaluating this on each change detection?\n if (isWritableSignal(value)) {\n value = value();\n }\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, false);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵtwoWayProperty;\n}\n/**\n * Function used inside two-way listeners to conditionally set the value of the bound expression.\n *\n * @param target Field on which to set the value.\n * @param value Value to be set to the field.\n *\n * @codeGenApi\n */\nfunction ɵɵtwoWayBindingSet(target, value) {\n const canWrite = isWritableSignal(target);\n canWrite && target.set(value);\n return canWrite;\n}\n/**\n * Adds an event listener that updates a two-way binding to the current node.\n *\n * @param eventName Name of the event.\n * @param listenerFn The function to be called when event emits.\n *\n * @codeGenApi\n */\nfunction ɵɵtwoWayListener(eventName, listenerFn) {\n const lView = getLView();\n const tView = getTView();\n const tNode = getCurrentTNode();\n listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn);\n return ɵɵtwoWayListener;\n}\n\n/*!\n * @license\n * Copyright Google LLC 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.dev/license\n */\n/** Object that indicates the value of a `@let` declaration that hasn't been initialized yet. */\nconst UNINITIALIZED_LET = {};\n/**\n * Declares an `@let` at a specific data slot. Returns itself to allow chaining.\n *\n * @param index Index at which to declare the `@let`.\n *\n * @codeGenApi\n */\nfunction ɵɵdeclareLet(index) {\n const tView = getTView();\n const lView = getLView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = getOrCreateTNode(tView, adjustedIndex, 128 /* TNodeType.LetDeclaration */, null, null);\n setCurrentTNode(tNode, false);\n store(tView, lView, adjustedIndex, UNINITIALIZED_LET);\n return ɵɵdeclareLet;\n}\n/**\n * Instruction that stores the value of a `@let` declaration on the current view.\n * Returns the value to allow usage inside variable initializers.\n *\n * @codeGenApi\n */\nfunction ɵɵstoreLet(value) {\n performanceMarkFeature('NgLet');\n const tView = getTView();\n const lView = getLView();\n const index = getSelectedIndex();\n store(tView, lView, index, value);\n return value;\n}\n/**\n * Retrieves the value of a `@let` declaration defined in a parent view.\n *\n * @param index Index of the declaration within the view.\n *\n * @codeGenApi\n */\nfunction ɵɵreadContextLet(index) {\n const contextLView = getContextLView();\n const value = load(contextLView, HEADER_OFFSET + index);\n if (value === UNINITIALIZED_LET) {\n throw new RuntimeError(314 /* RuntimeErrorCode.UNINITIALIZED_LET_ACCESS */, ngDevMode && 'Attempting to access a @let declaration whose value is not available yet');\n }\n return value;\n}\n\n/*\n * This file re-exports all symbols contained in this directory.\n *\n * Why is this file not `index.ts`?\n *\n * There seems to be an inconsistent path resolution of an `index.ts` file\n * when only the parent directory is referenced. This could be due to the\n * node module resolution configuration differing from rollup and/or typescript.\n *\n * With commit\n * https://github.com/angular/angular/commit/d5e3f2c64bd13ce83e7c70788b7fc514ca4a9918\n * the `instructions.ts` file was moved to `instructions/instructions.ts` and an\n * `index.ts` file was used to re-export everything. Having had file names that were\n * importing from `instructions' directly (not the from the sub file or the `index.ts`\n * file) caused strange CI issues. `index.ts` had to be renamed to `all.ts` for this\n * to work.\n *\n * Jira Issue = FW-1184\n */\n\n/**\n * Resolves the providers which are defined in the DirectiveDef.\n *\n * When inserting the tokens and the factories in their respective arrays, we can assume that\n * this method is called first for the component (if any), and then for other directives on the same\n * node.\n * As a consequence,the providers are always processed in that order:\n * 1) The view providers of the component\n * 2) The providers of the component\n * 3) The providers of the other directives\n * This matches the structure of the injectables arrays of a view (for each node).\n * So the tokens and the factories can be pushed at the end of the arrays, except\n * in one case for multi providers.\n *\n * @param def the directive definition\n * @param providers: Array of `providers`.\n * @param viewProviders: Array of `viewProviders`.\n */\nfunction providersResolver(def, providers, viewProviders) {\n const tView = getTView();\n if (tView.firstCreatePass) {\n const isComponent = isComponentDef(def);\n // The list of view providers is processed first, and the flags are updated\n resolveProvider(viewProviders, tView.data, tView.blueprint, isComponent, true);\n // Then, the list of providers is processed, and the flags are updated\n resolveProvider(providers, tView.data, tView.blueprint, isComponent, false);\n }\n}\n/**\n * Resolves a provider and publishes it to the DI system.\n */\nfunction resolveProvider(provider, tInjectables, lInjectablesBlueprint, isComponent, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (let i = 0; i < provider.length; i++) {\n resolveProvider(provider[i], tInjectables, lInjectablesBlueprint, isComponent, isViewProvider);\n }\n } else {\n const tView = getTView();\n const lView = getLView();\n const tNode = getCurrentTNode();\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n const providerFactory = providerToFactory(provider);\n if (ngDevMode) {\n const injector = new NodeInjector(tNode, lView);\n runInInjectorProfilerContext(injector, token, () => {\n emitProviderConfiguredEvent(provider, isViewProvider);\n });\n }\n const beginIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;\n const endIndex = tNode.directiveStart;\n const cptViewProvidersCount = tNode.providerIndexes >> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */;\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n const factory = new NodeInjectorFactory(providerFactory, isViewProvider, ɵɵdirectiveInject);\n const existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex === -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 1048576 /* TNodeProviderIndexes.CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n } else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n } else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n const existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n const existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n const doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 && lInjectablesBlueprint[existingProvidersFactoryIndex];\n const doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 && lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if (isViewProvider && !doesViewProvidersFactoryExist || !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n const factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length, 0);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 1048576 /* TNodeProviderIndexes.CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n } else {\n // Cases 1.b and 2.b\n const indexInFactory = multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent);\n registerDestroyHooksIfSupported(tView, provider, existingProvidersFactoryIndex > -1 ? existingProvidersFactoryIndex : existingViewProvidersFactoryIndex, indexInFactory);\n }\n if (!isViewProvider && isComponent && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}\n/**\n * Registers the `ngOnDestroy` hook of a provider, if the provider supports destroy hooks.\n * @param tView `TView` in which to register the hook.\n * @param provider Provider whose hook should be registered.\n * @param contextIndex Index under which to find the context for the hook when it's being invoked.\n * @param indexInFactory Only required for `multi` providers. Index of the provider in the multi\n * provider factory.\n */\nfunction registerDestroyHooksIfSupported(tView, provider, contextIndex, indexInFactory) {\n const providerIsTypeProvider = isTypeProvider(provider);\n const providerIsClassProvider = isClassProvider(provider);\n if (providerIsTypeProvider || providerIsClassProvider) {\n // Resolve forward references as `useClass` can hold a forward reference.\n const classToken = providerIsClassProvider ? resolveForwardRef(provider.useClass) : provider;\n const prototype = classToken.prototype;\n const ngOnDestroy = prototype.ngOnDestroy;\n if (ngOnDestroy) {\n const hooks = tView.destroyHooks || (tView.destroyHooks = []);\n if (!providerIsTypeProvider && provider.multi) {\n ngDevMode && assertDefined(indexInFactory, 'indexInFactory when registering multi factory destroy hook');\n const existingCallbacksIndex = hooks.indexOf(contextIndex);\n if (existingCallbacksIndex === -1) {\n hooks.push(contextIndex, [indexInFactory, ngOnDestroy]);\n } else {\n hooks[existingCallbacksIndex + 1].push(indexInFactory, ngOnDestroy);\n }\n } else {\n hooks.push(contextIndex, ngOnDestroy);\n }\n }\n }\n}\n/**\n * Add a factory in a multi factory.\n * @returns Index at which the factory was inserted.\n */\nfunction multiFactoryAdd(multiFactory, factory, isComponentProvider) {\n if (isComponentProvider) {\n multiFactory.componentProviders++;\n }\n return multiFactory.multi.push(factory) - 1;\n}\n/**\n * Returns the index of item in the array, but only in the begin to end range.\n */\nfunction indexOf(item, arr, begin, end) {\n for (let i = begin; i < end; i++) {\n if (arr[i] === item) return i;\n }\n return -1;\n}\n/**\n * Use this with `multi` `providers`.\n */\nfunction multiProvidersFactoryResolver(_, tData, lData, tNode) {\n return multiResolve(this.multi, []);\n}\n/**\n * Use this with `multi` `viewProviders`.\n *\n * This factory knows how to concatenate itself with the existing `multi` `providers`.\n */\nfunction multiViewProvidersFactoryResolver(_, tData, lView, tNode) {\n const factories = this.multi;\n let result;\n if (this.providerFactory) {\n const componentCount = this.providerFactory.componentProviders;\n const multiProviders = getNodeInjectable(lView, lView[TVIEW], this.providerFactory.index, tNode);\n // Copy the section of the array which contains `multi` `providers` from the component\n result = multiProviders.slice(0, componentCount);\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n // Copy the section of the array which contains `multi` `providers` from other directives\n for (let i = componentCount; i < multiProviders.length; i++) {\n result.push(multiProviders[i]);\n }\n } else {\n result = [];\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n }\n return result;\n}\n/**\n * Maps an array of factories into an array of values.\n */\nfunction multiResolve(factories, result) {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i];\n result.push(factory());\n }\n return result;\n}\n/**\n * Creates a multi factory.\n */\nfunction multiFactory(factoryFn, index, isViewProvider, isComponent, f) {\n const factory = new NodeInjectorFactory(factoryFn, isViewProvider, ɵɵdirectiveInject);\n factory.multi = [];\n factory.index = index;\n factory.componentProviders = 0;\n multiFactoryAdd(factory, f, isComponent && !isViewProvider);\n return factory;\n}\n\n/**\n * This feature resolves the providers of a directive (or component),\n * and publish them into the DI system, making it visible to others for injection.\n *\n * For example:\n * ```ts\n * class ComponentWithProviders {\n * constructor(private greeter: GreeterDE) {}\n *\n * static ɵcmp = defineComponent({\n * type: ComponentWithProviders,\n * selectors: [['component-with-providers']],\n * factory: () => new ComponentWithProviders(directiveInject(GreeterDE as any)),\n * decls: 1,\n * vars: 1,\n * template: function(fs: RenderFlags, ctx: ComponentWithProviders) {\n * if (fs & RenderFlags.Create) {\n * ɵɵtext(0);\n * }\n * if (fs & RenderFlags.Update) {\n * ɵɵtextInterpolate(ctx.greeter.greet());\n * }\n * },\n * features: [ɵɵProvidersFeature([GreeterDE])]\n * });\n * }\n * ```\n *\n * @param definition\n *\n * @codeGenApi\n */\nfunction ɵɵProvidersFeature(providers, viewProviders = []) {\n return definition => {\n definition.providersResolver = (def, processProvidersFn) => {\n return providersResolver(def,\n //\n processProvidersFn ? processProvidersFn(providers) : providers,\n //\n viewProviders);\n };\n };\n}\n\n/**\n * A service used by the framework to create instances of standalone injectors. Those injectors are\n * created on demand in case of dynamic component instantiation and contain ambient providers\n * collected from the imports graph rooted at a given standalone component.\n */\nclass StandaloneService {\n constructor(_injector) {\n this._injector = _injector;\n this.cachedInjectors = new Map();\n }\n getOrCreateStandaloneInjector(componentDef) {\n if (!componentDef.standalone) {\n return null;\n }\n if (!this.cachedInjectors.has(componentDef)) {\n const providers = internalImportProvidersFrom(false, componentDef.type);\n const standaloneInjector = providers.length > 0 ? createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) : null;\n this.cachedInjectors.set(componentDef, standaloneInjector);\n }\n return this.cachedInjectors.get(componentDef);\n }\n ngOnDestroy() {\n try {\n for (const injector of this.cachedInjectors.values()) {\n if (injector !== null) {\n injector.destroy();\n }\n }\n } finally {\n this.cachedInjectors.clear();\n }\n }\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: StandaloneService,\n providedIn: 'environment',\n factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector))\n });\n }\n}\n/**\n * A feature that acts as a setup code for the {@link StandaloneService}.\n *\n * The most important responsibility of this feature is to expose the \"getStandaloneInjector\"\n * function (an entry points to a standalone injector creation) on a component definition object. We\n * go through the features infrastructure to make sure that the standalone injector creation logic\n * is tree-shakable and not included in applications that don't use standalone components.\n *\n * @codeGenApi\n */\nfunction ɵɵStandaloneFeature(definition) {\n performanceMarkFeature('NgStandalone');\n definition.getStandaloneInjector = parentInjector => {\n return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);\n };\n}\n\n/**\n * Generated next to NgModules to monkey-patch directive and pipe references onto a component's\n * definition, when generating a direct reference in the component file would otherwise create an\n * import cycle.\n *\n * See [this explanation](https://hackmd.io/Odw80D0pR6yfsOjg_7XCJg?view) for more details.\n *\n * @codeGenApi\n */\nfunction ɵɵsetComponentScope(type, directives, pipes) {\n const def = type.ɵcmp;\n def.directiveDefs = extractDefListOrFactory(directives, /* pipeDef */false);\n def.pipeDefs = extractDefListOrFactory(pipes, /* pipeDef */true);\n}\n/**\n * Adds the module metadata that is necessary to compute the module's transitive scope to an\n * existing module definition.\n *\n * Scope metadata of modules is not used in production builds, so calls to this function can be\n * marked pure to tree-shake it from the bundle, allowing for all referenced declarations\n * to become eligible for tree-shaking as well.\n *\n * @codeGenApi\n */\nfunction ɵɵsetNgModuleScope(type, scope) {\n return noSideEffects(() => {\n const ngModuleDef = getNgModuleDef(type, true);\n ngModuleDef.declarations = convertToTypeArray(scope.declarations || EMPTY_ARRAY);\n ngModuleDef.imports = convertToTypeArray(scope.imports || EMPTY_ARRAY);\n ngModuleDef.exports = convertToTypeArray(scope.exports || EMPTY_ARRAY);\n if (scope.bootstrap) {\n // This only happens in local compilation mode.\n ngModuleDef.bootstrap = convertToTypeArray(scope.bootstrap);\n }\n depsTracker.registerNgModule(type, scope);\n });\n}\nfunction convertToTypeArray(values) {\n if (typeof values === 'function') {\n return values;\n }\n const flattenValues = flatten(values);\n if (flattenValues.some(isForwardRef)) {\n return () => flattenValues.map(resolveForwardRef).map(maybeUnwrapModuleWithProviders);\n } else {\n return flattenValues.map(maybeUnwrapModuleWithProviders);\n }\n}\nfunction maybeUnwrapModuleWithProviders(value) {\n return isModuleWithProviders(value) ? value.ngModule : value;\n}\n\n/**\n * The name of a field that Angular monkey-patches onto a component\n * class to store a function that loads defer-loadable dependencies\n * and applies metadata to a class.\n */\nconst ASYNC_COMPONENT_METADATA_FN = '__ngAsyncComponentMetadataFn__';\n/**\n * If a given component has unresolved async metadata - returns a reference\n * to a function that applies component metadata after resolving defer-loadable\n * dependencies. Otherwise - this function returns `null`.\n */\nfunction getAsyncClassMetadataFn(type) {\n const componentClass = type; // cast to `any`, so that we can read a monkey-patched field\n return componentClass[ASYNC_COMPONENT_METADATA_FN] ?? null;\n}\n/**\n * Handles the process of applying metadata info to a component class in case\n * component template has defer blocks (thus some dependencies became deferrable).\n *\n * @param type Component class where metadata should be added\n * @param dependencyLoaderFn Function that loads dependencies\n * @param metadataSetterFn Function that forms a scope in which the `setClassMetadata` is invoked\n */\nfunction setClassMetadataAsync(type, dependencyLoaderFn, metadataSetterFn) {\n const componentClass = type; // cast to `any`, so that we can monkey-patch it\n componentClass[ASYNC_COMPONENT_METADATA_FN] = () => Promise.all(dependencyLoaderFn()).then(dependencies => {\n metadataSetterFn(...dependencies);\n // Metadata is now set, reset field value to indicate that this component\n // can by used/compiled synchronously.\n componentClass[ASYNC_COMPONENT_METADATA_FN] = null;\n return dependencies;\n });\n return componentClass[ASYNC_COMPONENT_METADATA_FN];\n}\n/**\n * Adds decorator, constructor, and property metadata to a given type via static metadata fields\n * on the type.\n *\n * These metadata fields can later be read with Angular's `ReflectionCapabilities` API.\n *\n * Calls to `setClassMetadata` can be guarded by ngDevMode, resulting in the metadata assignments\n * being tree-shaken away during production builds.\n */\nfunction setClassMetadata(type, decorators, ctorParameters, propDecorators) {\n return noSideEffects(() => {\n const clazz = type;\n if (decorators !== null) {\n if (clazz.hasOwnProperty('decorators') && clazz.decorators !== undefined) {\n clazz.decorators.push(...decorators);\n } else {\n clazz.decorators = decorators;\n }\n }\n if (ctorParameters !== null) {\n // Rather than merging, clobber the existing parameters. If other projects exist which\n // use tsickle-style annotations and reflect over them in the same way, this could\n // cause issues, but that is vanishingly unlikely.\n clazz.ctorParameters = ctorParameters;\n }\n if (propDecorators !== null) {\n // The property decorator objects are merged as it is possible different fields have\n // different decorator types. Decorators on individual fields are not merged, as it's\n // also incredibly unlikely that a field will be decorated both with an Angular\n // decorator and a non-Angular decorator that's also been downleveled.\n if (clazz.hasOwnProperty('propDecorators') && clazz.propDecorators !== undefined) {\n clazz.propDecorators = {\n ...clazz.propDecorators,\n ...propDecorators\n };\n } else {\n clazz.propDecorators = propDecorators;\n }\n }\n });\n}\n\n/**\n * Bindings for pure functions are stored after regular bindings.\n *\n * |-------decls------|---------vars---------| |----- hostVars (dir1) ------|\n * ------------------------------------------------------------------------------------------\n * | nodes/refs/pipes | bindings | fn slots | injector | dir1 | host bindings | host slots |\n * ------------------------------------------------------------------------------------------\n * ^ ^\n * TView.bindingStartIndex TView.expandoStartIndex\n *\n * Pure function instructions are given an offset from the binding root. Adding the offset to the\n * binding root gives the first index where the bindings are stored. In component views, the binding\n * root is the bindingStartIndex. In host bindings, the binding root is the expandoStartIndex +\n * any directive instances + any hostVars in directives evaluated before it.\n *\n * See VIEW_DATA.md for more information about host binding resolution.\n */\n/**\n * If the value hasn't been saved, calls the pure function to store and return the\n * value. If it has been saved, returns the saved value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns a value\n * @param thisArg Optional calling context of pureFn\n * @returns value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction0(slotOffset, pureFn, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n return lView[bindingIndex] === NO_CHANGE ? updateBinding(lView, bindingIndex, thisArg ? pureFn.call(thisArg) : pureFn()) : getBinding(lView, bindingIndex);\n}\n/**\n * If the value of the provided exp has changed, calls the pure function to return\n * an updated value. Or if the value has not changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns an updated value\n * @param exp Updated expression value\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction1(slotOffset, pureFn, exp, thisArg) {\n return pureFunction1Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction2(slotOffset, pureFn, exp1, exp2, thisArg) {\n return pureFunction2Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction3(slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n return pureFunction3Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction4(slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {\n return pureFunction4Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction5(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated(lView, bindingIndex + 4, exp5) || different ? updateBinding(lView, bindingIndex + 5, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5) : pureFn(exp1, exp2, exp3, exp4, exp5)) : getBinding(lView, bindingIndex + 5);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction6(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ? updateBinding(lView, bindingIndex + 6, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) : pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) : getBinding(lView, bindingIndex + 6);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction7(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n let different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated3(lView, bindingIndex + 4, exp5, exp6, exp7) || different ? updateBinding(lView, bindingIndex + 7, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7) : pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7)) : getBinding(lView, bindingIndex + 7);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param exp8\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction8(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated4(lView, bindingIndex + 4, exp5, exp6, exp7, exp8) || different ? updateBinding(lView, bindingIndex + 8, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8) : pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8)) : getBinding(lView, bindingIndex + 8);\n}\n/**\n * pureFunction instruction that can support any number of bindings.\n *\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn A pure function that takes binding values and builds an object or array\n * containing those values.\n * @param exps An array of binding values\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunctionV(slotOffset, pureFn, exps, thisArg) {\n return pureFunctionVInternal(getLView(), getBindingRoot(), slotOffset, pureFn, exps, thisArg);\n}\n/**\n * Results of a pure function invocation are stored in LView in a dedicated slot that is initialized\n * to NO_CHANGE. In rare situations a pure pipe might throw an exception on the very first\n * invocation and not produce any valid results. In this case LView would keep holding the NO_CHANGE\n * value. The NO_CHANGE is not something that we can use in expressions / bindings thus we convert\n * it to `undefined`.\n */\nfunction getPureFunctionReturnValue(lView, returnValueIndex) {\n ngDevMode && assertIndexInRange(lView, returnValueIndex);\n const lastReturnValue = lView[returnValueIndex];\n return lastReturnValue === NO_CHANGE ? undefined : lastReturnValue;\n}\n/**\n * If the value of the provided exp has changed, calls the pure function to return\n * an updated value. Or if the value has not changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns an updated value\n * @param exp Updated expression value\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunction1Internal(lView, bindingRoot, slotOffset, pureFn, exp, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated(lView, bindingIndex, exp) ? updateBinding(lView, bindingIndex + 1, thisArg ? pureFn.call(thisArg, exp) : pureFn(exp)) : getPureFunctionReturnValue(lView, bindingIndex + 1);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunction2Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated2(lView, bindingIndex, exp1, exp2) ? updateBinding(lView, bindingIndex + 2, thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2)) : getPureFunctionReturnValue(lView, bindingIndex + 2);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ? updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) : getPureFunctionReturnValue(lView, bindingIndex + 3);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n */\nfunction pureFunction4Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) ? updateBinding(lView, bindingIndex + 4, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4)) : getPureFunctionReturnValue(lView, bindingIndex + 4);\n}\n/**\n * pureFunction instruction that can support any number of bindings.\n *\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn A pure function that takes binding values and builds an object or array\n * containing those values.\n * @param exps An array of binding values\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunctionVInternal(lView, bindingRoot, slotOffset, pureFn, exps, thisArg) {\n let bindingIndex = bindingRoot + slotOffset;\n let different = false;\n for (let i = 0; i < exps.length; i++) {\n bindingUpdated(lView, bindingIndex++, exps[i]) && (different = true);\n }\n return different ? updateBinding(lView, bindingIndex, pureFn.apply(thisArg, exps)) : getPureFunctionReturnValue(lView, bindingIndex);\n}\n\n/**\n * Create a pipe.\n *\n * @param index Pipe index where the pipe will be stored.\n * @param pipeName The name of the pipe\n * @returns T the instance of the pipe.\n *\n * @codeGenApi\n */\nfunction ɵɵpipe(index, pipeName) {\n const tView = getTView();\n let pipeDef;\n const adjustedIndex = index + HEADER_OFFSET;\n if (tView.firstCreatePass) {\n // The `getPipeDef` throws if a pipe with a given name is not found\n // (so we use non-null assertion below).\n pipeDef = getPipeDef(pipeName, tView.pipeRegistry);\n tView.data[adjustedIndex] = pipeDef;\n if (pipeDef.onDestroy) {\n (tView.destroyHooks ??= []).push(adjustedIndex, pipeDef.onDestroy);\n }\n } else {\n pipeDef = tView.data[adjustedIndex];\n }\n const pipeFactory = pipeDef.factory || (pipeDef.factory = getFactoryDef(pipeDef.type, true));\n let previousInjectorProfilerContext;\n if (ngDevMode) {\n previousInjectorProfilerContext = setInjectorProfilerContext({\n injector: new NodeInjector(getCurrentTNode(), getLView()),\n token: pipeDef.type\n });\n }\n const previousInjectImplementation = setInjectImplementation(ɵɵdirectiveInject);\n try {\n // DI for pipes is supposed to behave like directives when placed on a component\n // host node, which means that we have to disable access to `viewProviders`.\n const previousIncludeViewProviders = setIncludeViewProviders(false);\n const pipeInstance = pipeFactory();\n setIncludeViewProviders(previousIncludeViewProviders);\n store(tView, getLView(), adjustedIndex, pipeInstance);\n return pipeInstance;\n } finally {\n // we have to restore the injector implementation in finally, just in case the creation of the\n // pipe throws an error.\n setInjectImplementation(previousInjectImplementation);\n ngDevMode && setInjectorProfilerContext(previousInjectorProfilerContext);\n }\n}\n/**\n * Searches the pipe registry for a pipe with the given name. If one is found,\n * returns the pipe. Otherwise, an error is thrown because the pipe cannot be resolved.\n *\n * @param name Name of pipe to resolve\n * @param registry Full list of available pipes\n * @returns Matching PipeDef\n */\nfunction getPipeDef(name, registry) {\n if (registry) {\n if (ngDevMode) {\n const pipes = registry.filter(pipe => pipe.name === name);\n // TODO: Throw an error in the next major\n if (pipes.length > 1) {\n console.warn(formatRuntimeError(313 /* RuntimeErrorCode.MULTIPLE_MATCHING_PIPES */, getMultipleMatchingPipesMessage(name)));\n }\n }\n for (let i = registry.length - 1; i >= 0; i--) {\n const pipeDef = registry[i];\n if (name === pipeDef.name) {\n return pipeDef;\n }\n }\n }\n if (ngDevMode) {\n throw new RuntimeError(-302 /* RuntimeErrorCode.PIPE_NOT_FOUND */, getPipeNotFoundErrorMessage(name));\n }\n return;\n}\n/**\n * Generates a helpful error message for the user when multiple pipes match the name.\n *\n * @param name Name of the pipe\n * @returns The error message\n */\nfunction getMultipleMatchingPipesMessage(name) {\n const lView = getLView();\n const declarationLView = lView[DECLARATION_COMPONENT_VIEW];\n const context = declarationLView[CONTEXT];\n const hostIsStandalone = isHostComponentStandalone(lView);\n const componentInfoMessage = context ? ` in the '${context.constructor.name}' component` : '';\n const verifyMessage = `check ${hostIsStandalone ? \"'@Component.imports' of this component\" : 'the imports of this module'}`;\n const errorMessage = `Multiple pipes match the name \\`${name}\\`${componentInfoMessage}. ${verifyMessage}`;\n return errorMessage;\n}\n/**\n * Generates a helpful error message for the user when a pipe is not found.\n *\n * @param name Name of the missing pipe\n * @returns The error message\n */\nfunction getPipeNotFoundErrorMessage(name) {\n const lView = getLView();\n const declarationLView = lView[DECLARATION_COMPONENT_VIEW];\n const context = declarationLView[CONTEXT];\n const hostIsStandalone = isHostComponentStandalone(lView);\n const componentInfoMessage = context ? ` in the '${context.constructor.name}' component` : '';\n const verifyMessage = `Verify that it is ${hostIsStandalone ? \"included in the '@Component.imports' of this component\" : 'declared or imported in this module'}`;\n const errorMessage = `The pipe '${name}' could not be found${componentInfoMessage}. ${verifyMessage}`;\n return errorMessage;\n}\n/**\n * Invokes a pipe with 1 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param offset the binding offset\n * @param v1 1st argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind1(index, offset, v1) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ? pureFunction1Internal(lView, getBindingRoot(), offset, pipeInstance.transform, v1, pipeInstance) : pipeInstance.transform(v1);\n}\n/**\n * Invokes a pipe with 2 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind2(index, slotOffset, v1, v2) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ? pureFunction2Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, pipeInstance) : pipeInstance.transform(v1, v2);\n}\n/**\n * Invokes a pipe with 3 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 4rd argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind3(index, slotOffset, v1, v2, v3) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ? pureFunction3Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, pipeInstance) : pipeInstance.transform(v1, v2, v3);\n}\n/**\n * Invokes a pipe with 4 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 3rd argument to {@link PipeTransform#transform}.\n * @param v4 4th argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind4(index, slotOffset, v1, v2, v3, v4) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ? pureFunction4Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, v4, pipeInstance) : pipeInstance.transform(v1, v2, v3, v4);\n}\n/**\n * Invokes a pipe with variable number of arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param values Array of arguments to pass to {@link PipeTransform#transform} method.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBindV(index, slotOffset, values) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ? pureFunctionVInternal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, values, pipeInstance) : pipeInstance.transform.apply(pipeInstance, values);\n}\nfunction isPure(lView, index) {\n return lView[TVIEW].data[index].pure;\n}\n\n/**\n * Retrieves `TemplateRef` instance from `Injector` when a local reference is placed on the\n * `<ng-template>` element.\n *\n * @codeGenApi\n */\nfunction ɵɵtemplateRefExtractor(tNode, lView) {\n return createTemplateRef(tNode, lView);\n}\nfunction ɵɵgetComponentDepsFactory(type, rawImports) {\n return () => {\n try {\n return depsTracker.getComponentDependencies(type, rawImports).dependencies;\n } catch (e) {\n console.error(`Computing dependencies in local compilation mode for the component \"${type.name}\" failed with the exception:`, e);\n throw e;\n }\n };\n}\n\n/**\n * Sets the debug info for an Angular class.\n *\n * This runtime is guarded by ngDevMode flag.\n */\nfunction ɵsetClassDebugInfo(type, debugInfo) {\n const def = getComponentDef(type);\n if (def !== null) {\n def.debugInfo = debugInfo;\n }\n}\n\n/**\n * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.\n *\n * This should be kept up to date with the public exports of @angular/core.\n */\nconst angularCoreEnv = (() => ({\n 'ɵɵattribute': ɵɵattribute,\n 'ɵɵattributeInterpolate1': ɵɵattributeInterpolate1,\n 'ɵɵattributeInterpolate2': ɵɵattributeInterpolate2,\n 'ɵɵattributeInterpolate3': ɵɵattributeInterpolate3,\n 'ɵɵattributeInterpolate4': ɵɵattributeInterpolate4,\n 'ɵɵattributeInterpolate5': ɵɵattributeInterpolate5,\n 'ɵɵattributeInterpolate6': ɵɵattributeInterpolate6,\n 'ɵɵattributeInterpolate7': ɵɵattributeInterpolate7,\n 'ɵɵattributeInterpolate8': ɵɵattributeInterpolate8,\n 'ɵɵattributeInterpolateV': ɵɵattributeInterpolateV,\n 'ɵɵdefineComponent': ɵɵdefineComponent,\n 'ɵɵdefineDirective': ɵɵdefineDirective,\n 'ɵɵdefineInjectable': ɵɵdefineInjectable,\n 'ɵɵdefineInjector': ɵɵdefineInjector,\n 'ɵɵdefineNgModule': ɵɵdefineNgModule,\n 'ɵɵdefinePipe': ɵɵdefinePipe,\n 'ɵɵdirectiveInject': ɵɵdirectiveInject,\n 'ɵɵgetInheritedFactory': ɵɵgetInheritedFactory,\n 'ɵɵinject': ɵɵinject,\n 'ɵɵinjectAttribute': ɵɵinjectAttribute,\n 'ɵɵinvalidFactory': ɵɵinvalidFactory,\n 'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,\n 'ɵɵtemplateRefExtractor': ɵɵtemplateRefExtractor,\n 'ɵɵresetView': ɵɵresetView,\n 'ɵɵHostDirectivesFeature': ɵɵHostDirectivesFeature,\n 'ɵɵNgOnChangesFeature': ɵɵNgOnChangesFeature,\n 'ɵɵProvidersFeature': ɵɵProvidersFeature,\n 'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature,\n 'ɵɵInheritDefinitionFeature': ɵɵInheritDefinitionFeature,\n 'ɵɵInputTransformsFeature': ɵɵInputTransformsFeature,\n 'ɵɵStandaloneFeature': ɵɵStandaloneFeature,\n 'ɵɵnextContext': ɵɵnextContext,\n 'ɵɵnamespaceHTML': ɵɵnamespaceHTML,\n 'ɵɵnamespaceMathML': ɵɵnamespaceMathML,\n 'ɵɵnamespaceSVG': ɵɵnamespaceSVG,\n 'ɵɵenableBindings': ɵɵenableBindings,\n 'ɵɵdisableBindings': ɵɵdisableBindings,\n 'ɵɵelementStart': ɵɵelementStart,\n 'ɵɵelementEnd': ɵɵelementEnd,\n 'ɵɵelement': ɵɵelement,\n 'ɵɵelementContainerStart': ɵɵelementContainerStart,\n 'ɵɵelementContainerEnd': ɵɵelementContainerEnd,\n 'ɵɵelementContainer': ɵɵelementContainer,\n 'ɵɵpureFunction0': ɵɵpureFunction0,\n 'ɵɵpureFunction1': ɵɵpureFunction1,\n 'ɵɵpureFunction2': ɵɵpureFunction2,\n 'ɵɵpureFunction3': ɵɵpureFunction3,\n 'ɵɵpureFunction4': ɵɵpureFunction4,\n 'ɵɵpureFunction5': ɵɵpureFunction5,\n 'ɵɵpureFunction6': ɵɵpureFunction6,\n 'ɵɵpureFunction7': ɵɵpureFunction7,\n 'ɵɵpureFunction8': ɵɵpureFunction8,\n 'ɵɵpureFunctionV': ɵɵpureFunctionV,\n 'ɵɵgetCurrentView': ɵɵgetCurrentView,\n 'ɵɵrestoreView': ɵɵrestoreView,\n 'ɵɵlistener': ɵɵlistener,\n 'ɵɵprojection': ɵɵprojection,\n 'ɵɵsyntheticHostProperty': ɵɵsyntheticHostProperty,\n 'ɵɵsyntheticHostListener': ɵɵsyntheticHostListener,\n 'ɵɵpipeBind1': ɵɵpipeBind1,\n 'ɵɵpipeBind2': ɵɵpipeBind2,\n 'ɵɵpipeBind3': ɵɵpipeBind3,\n 'ɵɵpipeBind4': ɵɵpipeBind4,\n 'ɵɵpipeBindV': ɵɵpipeBindV,\n 'ɵɵprojectionDef': ɵɵprojectionDef,\n 'ɵɵhostProperty': ɵɵhostProperty,\n 'ɵɵproperty': ɵɵproperty,\n 'ɵɵpropertyInterpolate': ɵɵpropertyInterpolate,\n 'ɵɵpropertyInterpolate1': ɵɵpropertyInterpolate1,\n 'ɵɵpropertyInterpolate2': ɵɵpropertyInterpolate2,\n 'ɵɵpropertyInterpolate3': ɵɵpropertyInterpolate3,\n 'ɵɵpropertyInterpolate4': ɵɵpropertyInterpolate4,\n 'ɵɵpropertyInterpolate5': ɵɵpropertyInterpolate5,\n 'ɵɵpropertyInterpolate6': ɵɵpropertyInterpolate6,\n 'ɵɵpropertyInterpolate7': ɵɵpropertyInterpolate7,\n 'ɵɵpropertyInterpolate8': ɵɵpropertyInterpolate8,\n 'ɵɵpropertyInterpolateV': ɵɵpropertyInterpolateV,\n 'ɵɵpipe': ɵɵpipe,\n 'ɵɵqueryRefresh': ɵɵqueryRefresh,\n 'ɵɵqueryAdvance': ɵɵqueryAdvance,\n 'ɵɵviewQuery': ɵɵviewQuery,\n 'ɵɵviewQuerySignal': ɵɵviewQuerySignal,\n 'ɵɵloadQuery': ɵɵloadQuery,\n 'ɵɵcontentQuery': ɵɵcontentQuery,\n 'ɵɵcontentQuerySignal': ɵɵcontentQuerySignal,\n 'ɵɵreference': ɵɵreference,\n 'ɵɵclassMap': ɵɵclassMap,\n 'ɵɵclassMapInterpolate1': ɵɵclassMapInterpolate1,\n 'ɵɵclassMapInterpolate2': ɵɵclassMapInterpolate2,\n 'ɵɵclassMapInterpolate3': ɵɵclassMapInterpolate3,\n 'ɵɵclassMapInterpolate4': ɵɵclassMapInterpolate4,\n 'ɵɵclassMapInterpolate5': ɵɵclassMapInterpolate5,\n 'ɵɵclassMapInterpolate6': ɵɵclassMapInterpolate6,\n 'ɵɵclassMapInterpolate7': ɵɵclassMapInterpolate7,\n 'ɵɵclassMapInterpolate8': ɵɵclassMapInterpolate8,\n 'ɵɵclassMapInterpolateV': ɵɵclassMapInterpolateV,\n 'ɵɵstyleMap': ɵɵstyleMap,\n 'ɵɵstyleMapInterpolate1': ɵɵstyleMapInterpolate1,\n 'ɵɵstyleMapInterpolate2': ɵɵstyleMapInterpolate2,\n 'ɵɵstyleMapInterpolate3': ɵɵstyleMapInterpolate3,\n 'ɵɵstyleMapInterpolate4': ɵɵstyleMapInterpolate4,\n 'ɵɵstyleMapInterpolate5': ɵɵstyleMapInterpolate5,\n 'ɵɵstyleMapInterpolate6': ɵɵstyleMapInterpolate6,\n 'ɵɵstyleMapInterpolate7': ɵɵstyleMapInterpolate7,\n 'ɵɵstyleMapInterpolate8': ɵɵstyleMapInterpolate8,\n 'ɵɵstyleMapInterpolateV': ɵɵstyleMapInterpolateV,\n 'ɵɵstyleProp': ɵɵstyleProp,\n 'ɵɵstylePropInterpolate1': ɵɵstylePropInterpolate1,\n 'ɵɵstylePropInterpolate2': ɵɵstylePropInterpolate2,\n 'ɵɵstylePropInterpolate3': ɵɵstylePropInterpolate3,\n 'ɵɵstylePropInterpolate4': ɵɵstylePropInterpolate4,\n 'ɵɵstylePropInterpolate5': ɵɵstylePropInterpolate5,\n 'ɵɵstylePropInterpolate6': ɵɵstylePropInterpolate6,\n 'ɵɵstylePropInterpolate7': ɵɵstylePropInterpolate7,\n 'ɵɵstylePropInterpolate8': ɵɵstylePropInterpolate8,\n 'ɵɵstylePropInterpolateV': ɵɵstylePropInterpolateV,\n 'ɵɵclassProp': ɵɵclassProp,\n 'ɵɵadvance': ɵɵadvance,\n 'ɵɵtemplate': ɵɵtemplate,\n 'ɵɵconditional': ɵɵconditional,\n 'ɵɵdefer': ɵɵdefer,\n 'ɵɵdeferWhen': ɵɵdeferWhen,\n 'ɵɵdeferOnIdle': ɵɵdeferOnIdle,\n 'ɵɵdeferOnImmediate': ɵɵdeferOnImmediate,\n 'ɵɵdeferOnTimer': ɵɵdeferOnTimer,\n 'ɵɵdeferOnHover': ɵɵdeferOnHover,\n 'ɵɵdeferOnInteraction': ɵɵdeferOnInteraction,\n 'ɵɵdeferOnViewport': ɵɵdeferOnViewport,\n 'ɵɵdeferPrefetchWhen': ɵɵdeferPrefetchWhen,\n 'ɵɵdeferPrefetchOnIdle': ɵɵdeferPrefetchOnIdle,\n 'ɵɵdeferPrefetchOnImmediate': ɵɵdeferPrefetchOnImmediate,\n 'ɵɵdeferPrefetchOnTimer': ɵɵdeferPrefetchOnTimer,\n 'ɵɵdeferPrefetchOnHover': ɵɵdeferPrefetchOnHover,\n 'ɵɵdeferPrefetchOnInteraction': ɵɵdeferPrefetchOnInteraction,\n 'ɵɵdeferPrefetchOnViewport': ɵɵdeferPrefetchOnViewport,\n 'ɵɵdeferEnableTimerScheduling': ɵɵdeferEnableTimerScheduling,\n 'ɵɵrepeater': ɵɵrepeater,\n 'ɵɵrepeaterCreate': ɵɵrepeaterCreate,\n 'ɵɵrepeaterTrackByIndex': ɵɵrepeaterTrackByIndex,\n 'ɵɵrepeaterTrackByIdentity': ɵɵrepeaterTrackByIdentity,\n 'ɵɵcomponentInstance': ɵɵcomponentInstance,\n 'ɵɵtext': ɵɵtext,\n 'ɵɵtextInterpolate': ɵɵtextInterpolate,\n 'ɵɵtextInterpolate1': ɵɵtextInterpolate1,\n 'ɵɵtextInterpolate2': ɵɵtextInterpolate2,\n 'ɵɵtextInterpolate3': ɵɵtextInterpolate3,\n 'ɵɵtextInterpolate4': ɵɵtextInterpolate4,\n 'ɵɵtextInterpolate5': ɵɵtextInterpolate5,\n 'ɵɵtextInterpolate6': ɵɵtextInterpolate6,\n 'ɵɵtextInterpolate7': ɵɵtextInterpolate7,\n 'ɵɵtextInterpolate8': ɵɵtextInterpolate8,\n 'ɵɵtextInterpolateV': ɵɵtextInterpolateV,\n 'ɵɵi18n': ɵɵi18n,\n 'ɵɵi18nAttributes': ɵɵi18nAttributes,\n 'ɵɵi18nExp': ɵɵi18nExp,\n 'ɵɵi18nStart': ɵɵi18nStart,\n 'ɵɵi18nEnd': ɵɵi18nEnd,\n 'ɵɵi18nApply': ɵɵi18nApply,\n 'ɵɵi18nPostprocess': ɵɵi18nPostprocess,\n 'ɵɵresolveWindow': ɵɵresolveWindow,\n 'ɵɵresolveDocument': ɵɵresolveDocument,\n 'ɵɵresolveBody': ɵɵresolveBody,\n 'ɵɵsetComponentScope': ɵɵsetComponentScope,\n 'ɵɵsetNgModuleScope': ɵɵsetNgModuleScope,\n 'ɵɵregisterNgModuleType': registerNgModuleType,\n 'ɵɵgetComponentDepsFactory': ɵɵgetComponentDepsFactory,\n 'ɵsetClassDebugInfo': ɵsetClassDebugInfo,\n 'ɵɵdeclareLet': ɵɵdeclareLet,\n 'ɵɵstoreLet': ɵɵstoreLet,\n 'ɵɵreadContextLet': ɵɵreadContextLet,\n 'ɵɵsanitizeHtml': ɵɵsanitizeHtml,\n 'ɵɵsanitizeStyle': ɵɵsanitizeStyle,\n 'ɵɵsanitizeResourceUrl': ɵɵsanitizeResourceUrl,\n 'ɵɵsanitizeScript': ɵɵsanitizeScript,\n 'ɵɵsanitizeUrl': ɵɵsanitizeUrl,\n 'ɵɵsanitizeUrlOrResourceUrl': ɵɵsanitizeUrlOrResourceUrl,\n 'ɵɵtrustConstantHtml': ɵɵtrustConstantHtml,\n 'ɵɵtrustConstantResourceUrl': ɵɵtrustConstantResourceUrl,\n 'ɵɵvalidateIframeAttribute': ɵɵvalidateIframeAttribute,\n 'forwardRef': forwardRef,\n 'resolveForwardRef': resolveForwardRef,\n 'ɵɵtwoWayProperty': ɵɵtwoWayProperty,\n 'ɵɵtwoWayBindingSet': ɵɵtwoWayBindingSet,\n 'ɵɵtwoWayListener': ɵɵtwoWayListener\n}))();\nlet jitOptions = null;\nfunction setJitOptions(options) {\n if (jitOptions !== null) {\n if (options.defaultEncapsulation !== jitOptions.defaultEncapsulation) {\n ngDevMode && console.error('Provided value for `defaultEncapsulation` can not be changed once it has been set.');\n return;\n }\n if (options.preserveWhitespaces !== jitOptions.preserveWhitespaces) {\n ngDevMode && console.error('Provided value for `preserveWhitespaces` can not be changed once it has been set.');\n return;\n }\n }\n jitOptions = options;\n}\nfunction getJitOptions() {\n return jitOptions;\n}\nfunction resetJitOptions() {\n jitOptions = null;\n}\nfunction patchModuleCompilation() {\n // Does nothing, but exists as a target for patching.\n}\nconst moduleQueue = [];\n/**\n * Enqueues moduleDef to be checked later to see if scope can be set on its\n * component declarations.\n */\nfunction enqueueModuleForDelayedScoping(moduleType, ngModule) {\n moduleQueue.push({\n moduleType,\n ngModule\n });\n}\nlet flushingModuleQueue = false;\n/**\n * Loops over queued module definitions, if a given module definition has all of its\n * declarations resolved, it dequeues that module definition and sets the scope on\n * its declarations.\n */\nfunction flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (let i = moduleQueue.length - 1; i >= 0; i--) {\n const {\n moduleType,\n ngModule\n } = moduleQueue[i];\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n } finally {\n flushingModuleQueue = false;\n }\n }\n}\n/**\n * Returns truthy if a declaration has resolved. If the declaration happens to be\n * an array of declarations, it will recurse to check each declaration in that array\n * (which may also be arrays).\n */\nfunction isResolvedDeclaration(declaration) {\n if (Array.isArray(declaration)) {\n return declaration.every(isResolvedDeclaration);\n }\n return !!resolveForwardRef(declaration);\n}\n/**\n * Compiles a module in JIT mode.\n *\n * This function automatically gets called when a class has a `@NgModule` decorator.\n */\nfunction compileNgModule(moduleType, ngModule = {}) {\n patchModuleCompilation();\n compileNgModuleDefs(moduleType, ngModule);\n if (ngModule.id !== undefined) {\n registerNgModuleType(moduleType, ngModule.id);\n }\n // Because we don't know if all declarations have resolved yet at the moment the\n // NgModule decorator is executing, we're enqueueing the setting of module scope\n // on its declarations to be run at a later time when all declarations for the module,\n // including forward refs, have resolved.\n enqueueModuleForDelayedScoping(moduleType, ngModule);\n}\n/**\n * Compiles and adds the `ɵmod`, `ɵfac` and `ɵinj` properties to the module class.\n *\n * It's possible to compile a module via this API which will allow duplicate declarations in its\n * root.\n */\nfunction compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInRoot = false) {\n ngDevMode && assertDefined(moduleType, 'Required value moduleType');\n ngDevMode && assertDefined(ngModule, 'Required value ngModule');\n const declarations = flatten(ngModule.declarations || EMPTY_ARRAY);\n let ngModuleDef = null;\n Object.defineProperty(moduleType, NG_MOD_DEF, {\n configurable: true,\n get: () => {\n if (ngModuleDef === null) {\n if (ngDevMode && ngModule.imports && ngModule.imports.indexOf(moduleType) > -1) {\n // We need to assert this immediately, because allowing it to continue will cause it to\n // go into an infinite loop before we've reached the point where we throw all the errors.\n throw new Error(`'${stringifyForError(moduleType)}' module can't import itself`);\n }\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'NgModule',\n type: moduleType\n });\n ngModuleDef = compiler.compileNgModule(angularCoreEnv, `ng:///${moduleType.name}/ɵmod.js`, {\n type: moduleType,\n bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY).map(resolveForwardRef),\n declarations: declarations.map(resolveForwardRef),\n imports: flatten(ngModule.imports || EMPTY_ARRAY).map(resolveForwardRef).map(expandModuleWithProviders),\n exports: flatten(ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef).map(expandModuleWithProviders),\n schemas: ngModule.schemas ? flatten(ngModule.schemas) : null,\n id: ngModule.id || null\n });\n // Set `schemas` on ngModuleDef to an empty array in JIT mode to indicate that runtime\n // should verify that there are no unknown elements in a template. In AOT mode, that check\n // happens at compile time and `schemas` information is not present on Component and Module\n // defs after compilation (so the check doesn't happen the second time at runtime).\n if (!ngModuleDef.schemas) {\n ngModuleDef.schemas = [];\n }\n }\n return ngModuleDef;\n }\n });\n let ngFactoryDef = null;\n Object.defineProperty(moduleType, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'NgModule',\n type: moduleType\n });\n ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${moduleType.name}/ɵfac.js`, {\n name: moduleType.name,\n type: moduleType,\n deps: reflectDependencies(moduleType),\n target: compiler.FactoryTarget.NgModule,\n typeArgumentCount: 0\n });\n }\n return ngFactoryDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n let ngInjectorDef = null;\n Object.defineProperty(moduleType, NG_INJ_DEF, {\n get: () => {\n if (ngInjectorDef === null) {\n ngDevMode && verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot);\n const meta = {\n name: moduleType.name,\n type: moduleType,\n providers: ngModule.providers || EMPTY_ARRAY,\n imports: [(ngModule.imports || EMPTY_ARRAY).map(resolveForwardRef), (ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef)]\n };\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'NgModule',\n type: moduleType\n });\n ngInjectorDef = compiler.compileInjector(angularCoreEnv, `ng:///${moduleType.name}/ɵinj.js`, meta);\n }\n return ngInjectorDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n}\nfunction generateStandaloneInDeclarationsError(type, location) {\n const prefix = `Unexpected \"${stringifyForError(type)}\" found in the \"declarations\" array of the`;\n const suffix = `\"${stringifyForError(type)}\" is marked as standalone and can't be declared ` + 'in any NgModule - did you intend to import it instead (by adding it to the \"imports\" array)?';\n return `${prefix} ${location}, ${suffix}`;\n}\nfunction verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot, importingModule) {\n if (verifiedNgModule.get(moduleType)) return;\n // skip verifications of standalone components, directives, and pipes\n if (isStandalone(moduleType)) return;\n verifiedNgModule.set(moduleType, true);\n moduleType = resolveForwardRef(moduleType);\n let ngModuleDef;\n if (importingModule) {\n ngModuleDef = getNgModuleDef(moduleType);\n if (!ngModuleDef) {\n throw new Error(`Unexpected value '${moduleType.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);\n }\n } else {\n ngModuleDef = getNgModuleDef(moduleType, true);\n }\n const errors = [];\n const declarations = maybeUnwrapFn(ngModuleDef.declarations);\n const imports = maybeUnwrapFn(ngModuleDef.imports);\n flatten(imports).map(unwrapModuleWithProvidersImports).forEach(modOrStandaloneCmpt => {\n verifySemanticsOfNgModuleImport(modOrStandaloneCmpt, moduleType);\n verifySemanticsOfNgModuleDef(modOrStandaloneCmpt, false, moduleType);\n });\n const exports = maybeUnwrapFn(ngModuleDef.exports);\n declarations.forEach(verifyDeclarationsHaveDefinitions);\n declarations.forEach(verifyDirectivesHaveSelector);\n declarations.forEach(declarationType => verifyNotStandalone(declarationType, moduleType));\n const combinedDeclarations = [...declarations.map(resolveForwardRef), ...flatten(imports.map(computeCombinedExports)).map(resolveForwardRef)];\n exports.forEach(verifyExportsAreDeclaredOrReExported);\n declarations.forEach(decl => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot));\n const ngModule = getAnnotation(moduleType, 'NgModule');\n if (ngModule) {\n ngModule.imports && flatten(ngModule.imports).map(unwrapModuleWithProvidersImports).forEach(mod => {\n verifySemanticsOfNgModuleImport(mod, moduleType);\n verifySemanticsOfNgModuleDef(mod, false, moduleType);\n });\n ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyCorrectBootstrapType);\n ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyComponentIsPartOfNgModule);\n }\n // Throw Error if any errors were detected.\n if (errors.length) {\n throw new Error(errors.join('\\n'));\n }\n ////////////////////////////////////////////////////////////////////////////////////////////////\n function verifyDeclarationsHaveDefinitions(type) {\n type = resolveForwardRef(type);\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);\n if (!def) {\n errors.push(`Unexpected value '${stringifyForError(type)}' declared by the module '${stringifyForError(moduleType)}'. Please add a @Pipe/@Directive/@Component annotation.`);\n }\n }\n function verifyDirectivesHaveSelector(type) {\n type = resolveForwardRef(type);\n const def = getDirectiveDef(type);\n if (!getComponentDef(type) && def && def.selectors.length == 0) {\n errors.push(`Directive ${stringifyForError(type)} has no selector, please add it!`);\n }\n }\n function verifyNotStandalone(type, moduleType) {\n type = resolveForwardRef(type);\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);\n if (def?.standalone) {\n const location = `\"${stringifyForError(moduleType)}\" NgModule`;\n errors.push(generateStandaloneInDeclarationsError(type, location));\n }\n }\n function verifyExportsAreDeclaredOrReExported(type) {\n type = resolveForwardRef(type);\n const kind = getComponentDef(type) && 'component' || getDirectiveDef(type) && 'directive' || getPipeDef$1(type) && 'pipe';\n if (kind) {\n // only checked if we are declared as Component, Directive, or Pipe\n // Modules don't need to be declared or imported.\n if (combinedDeclarations.lastIndexOf(type) === -1) {\n // We are exporting something which we don't explicitly declare or import.\n errors.push(`Can't export ${kind} ${stringifyForError(type)} from ${stringifyForError(moduleType)} as it was neither declared nor imported!`);\n }\n }\n }\n function verifyDeclarationIsUnique(type, suppressErrors) {\n type = resolveForwardRef(type);\n const existingModule = ownerNgModule.get(type);\n if (existingModule && existingModule !== moduleType) {\n if (!suppressErrors) {\n const modules = [existingModule, moduleType].map(stringifyForError).sort();\n errors.push(`Type ${stringifyForError(type)} is part of the declarations of 2 modules: ${modules[0]} and ${modules[1]}! ` + `Please consider moving ${stringifyForError(type)} to a higher module that imports ${modules[0]} and ${modules[1]}. ` + `You can also create a new NgModule that exports and includes ${stringifyForError(type)} then import that NgModule in ${modules[0]} and ${modules[1]}.`);\n }\n } else {\n // Mark type as having owner.\n ownerNgModule.set(type, moduleType);\n }\n }\n function verifyComponentIsPartOfNgModule(type) {\n type = resolveForwardRef(type);\n const existingModule = ownerNgModule.get(type);\n if (!existingModule && !isStandalone(type)) {\n errors.push(`Component ${stringifyForError(type)} is not part of any NgModule or the module has not been imported into your module.`);\n }\n }\n function verifyCorrectBootstrapType(type) {\n type = resolveForwardRef(type);\n if (!getComponentDef(type)) {\n errors.push(`${stringifyForError(type)} cannot be used as an entry component.`);\n }\n if (isStandalone(type)) {\n // Note: this error should be the same as the\n // `NGMODULE_BOOTSTRAP_IS_STANDALONE` one in AOT compiler.\n errors.push(`The \\`${stringifyForError(type)}\\` class is a standalone component, which can ` + `not be used in the \\`@NgModule.bootstrap\\` array. Use the \\`bootstrapApplication\\` ` + `function for bootstrap instead.`);\n }\n }\n function verifySemanticsOfNgModuleImport(type, importingModule) {\n type = resolveForwardRef(type);\n const directiveDef = getComponentDef(type) || getDirectiveDef(type);\n if (directiveDef !== null && !directiveDef.standalone) {\n throw new Error(`Unexpected directive '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);\n }\n const pipeDef = getPipeDef$1(type);\n if (pipeDef !== null && !pipeDef.standalone) {\n throw new Error(`Unexpected pipe '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);\n }\n }\n}\nfunction unwrapModuleWithProvidersImports(typeOrWithProviders) {\n typeOrWithProviders = resolveForwardRef(typeOrWithProviders);\n return typeOrWithProviders.ngModule || typeOrWithProviders;\n}\nfunction getAnnotation(type, name) {\n let annotation = null;\n collect(type.__annotations__);\n collect(type.decorators);\n return annotation;\n function collect(annotations) {\n if (annotations) {\n annotations.forEach(readAnnotation);\n }\n }\n function readAnnotation(decorator) {\n if (!annotation) {\n const proto = Object.getPrototypeOf(decorator);\n if (proto.ngMetadataName == name) {\n annotation = decorator;\n } else if (decorator.type) {\n const proto = Object.getPrototypeOf(decorator.type);\n if (proto.ngMetadataName == name) {\n annotation = decorator.args[0];\n }\n }\n }\n }\n}\n/**\n * Keep track of compiled components. This is needed because in tests we often want to compile the\n * same component with more than one NgModule. This would cause an error unless we reset which\n * NgModule the component belongs to. We keep the list of compiled components here so that the\n * TestBed can reset it later.\n */\nlet ownerNgModule = new WeakMap();\nlet verifiedNgModule = new WeakMap();\nfunction resetCompiledComponents() {\n ownerNgModule = new WeakMap();\n verifiedNgModule = new WeakMap();\n moduleQueue.length = 0;\n GENERATED_COMP_IDS.clear();\n}\n/**\n * Computes the combined declarations of explicit declarations, as well as declarations inherited by\n * traversing the exports of imported modules.\n * @param type\n */\nfunction computeCombinedExports(type) {\n type = resolveForwardRef(type);\n const ngModuleDef = getNgModuleDef(type);\n // a standalone component, directive or pipe\n if (ngModuleDef === null) {\n return [type];\n }\n return flatten(maybeUnwrapFn(ngModuleDef.exports).map(type => {\n const ngModuleDef = getNgModuleDef(type);\n if (ngModuleDef) {\n verifySemanticsOfNgModuleDef(type, false);\n return computeCombinedExports(type);\n } else {\n return type;\n }\n }));\n}\n/**\n * Some declared components may be compiled asynchronously, and thus may not have their\n * ɵcmp set yet. If this is the case, then a reference to the module is written into\n * the `ngSelectorScope` property of the declared type.\n */\nfunction setScopeOnDeclaredComponents(moduleType, ngModule) {\n const declarations = flatten(ngModule.declarations || EMPTY_ARRAY);\n const transitiveScopes = transitiveScopesFor(moduleType);\n declarations.forEach(declaration => {\n declaration = resolveForwardRef(declaration);\n if (declaration.hasOwnProperty(NG_COMP_DEF)) {\n // A `ɵcmp` field exists - go ahead and patch the component directly.\n const component = declaration;\n const componentDef = getComponentDef(component);\n patchComponentDefWithScope(componentDef, transitiveScopes);\n } else if (!declaration.hasOwnProperty(NG_DIR_DEF) && !declaration.hasOwnProperty(NG_PIPE_DEF)) {\n // Set `ngSelectorScope` for future reference when the component compilation finishes.\n declaration.ngSelectorScope = moduleType;\n }\n });\n}\n/**\n * Patch the definition of a component with directives and pipes from the compilation scope of\n * a given module.\n */\nfunction patchComponentDefWithScope(componentDef, transitiveScopes) {\n componentDef.directiveDefs = () => Array.from(transitiveScopes.compilation.directives).map(dir => dir.hasOwnProperty(NG_COMP_DEF) ? getComponentDef(dir) : getDirectiveDef(dir)).filter(def => !!def);\n componentDef.pipeDefs = () => Array.from(transitiveScopes.compilation.pipes).map(pipe => getPipeDef$1(pipe));\n componentDef.schemas = transitiveScopes.schemas;\n // Since we avoid Components/Directives/Pipes recompiling in case there are no overrides, we\n // may face a problem where previously compiled defs available to a given Component/Directive\n // are cached in TView and may become stale (in case any of these defs gets recompiled). In\n // order to avoid this problem, we force fresh TView to be created.\n componentDef.tView = null;\n}\n/**\n * Compute the pair of transitive scopes (compilation scope and exported scope) for a given type\n * (either a NgModule or a standalone component / directive / pipe).\n */\nfunction transitiveScopesFor(type) {\n if (isNgModule(type)) {\n if (USE_RUNTIME_DEPS_TRACKER_FOR_JIT) {\n const scope = depsTracker.getNgModuleScope(type);\n const def = getNgModuleDef(type, true);\n return {\n schemas: def.schemas || null,\n ...scope\n };\n } else {\n return transitiveScopesForNgModule(type);\n }\n } else if (isStandalone(type)) {\n const directiveDef = getComponentDef(type) || getDirectiveDef(type);\n if (directiveDef !== null) {\n return {\n schemas: null,\n compilation: {\n directives: new Set(),\n pipes: new Set()\n },\n exported: {\n directives: new Set([type]),\n pipes: new Set()\n }\n };\n }\n const pipeDef = getPipeDef$1(type);\n if (pipeDef !== null) {\n return {\n schemas: null,\n compilation: {\n directives: new Set(),\n pipes: new Set()\n },\n exported: {\n directives: new Set(),\n pipes: new Set([type])\n }\n };\n }\n }\n // TODO: change the error message to be more user-facing and take standalone into account\n throw new Error(`${type.name} does not have a module def (ɵmod property)`);\n}\n/**\n * Compute the pair of transitive scopes (compilation scope and exported scope) for a given module.\n *\n * This operation is memoized and the result is cached on the module's definition. This function can\n * be called on modules with components that have not fully compiled yet, but the result should not\n * be used until they have.\n *\n * @param moduleType module that transitive scope should be calculated for.\n */\nfunction transitiveScopesForNgModule(moduleType) {\n const def = getNgModuleDef(moduleType, true);\n if (def.transitiveCompileScopes !== null) {\n return def.transitiveCompileScopes;\n }\n const scopes = {\n schemas: def.schemas || null,\n compilation: {\n directives: new Set(),\n pipes: new Set()\n },\n exported: {\n directives: new Set(),\n pipes: new Set()\n }\n };\n maybeUnwrapFn(def.imports).forEach(imported => {\n // When this module imports another, the imported module's exported directives and pipes are\n // added to the compilation scope of this module.\n const importedScope = transitiveScopesFor(imported);\n importedScope.exported.directives.forEach(entry => scopes.compilation.directives.add(entry));\n importedScope.exported.pipes.forEach(entry => scopes.compilation.pipes.add(entry));\n });\n maybeUnwrapFn(def.declarations).forEach(declared => {\n const declaredWithDefs = declared;\n if (getPipeDef$1(declaredWithDefs)) {\n scopes.compilation.pipes.add(declared);\n } else {\n // Either declared has a ɵcmp or ɵdir, or it's a component which hasn't\n // had its template compiled yet. In either case, it gets added to the compilation's\n // directives.\n scopes.compilation.directives.add(declared);\n }\n });\n maybeUnwrapFn(def.exports).forEach(exported => {\n const exportedType = exported;\n // Either the type is a module, a pipe, or a component/directive (which may not have a\n // ɵcmp as it might be compiled asynchronously).\n if (isNgModule(exportedType)) {\n // When this module exports another, the exported module's exported directives and pipes are\n // added to both the compilation and exported scopes of this module.\n const exportedScope = transitiveScopesFor(exportedType);\n exportedScope.exported.directives.forEach(entry => {\n scopes.compilation.directives.add(entry);\n scopes.exported.directives.add(entry);\n });\n exportedScope.exported.pipes.forEach(entry => {\n scopes.compilation.pipes.add(entry);\n scopes.exported.pipes.add(entry);\n });\n } else if (getPipeDef$1(exportedType)) {\n scopes.exported.pipes.add(exportedType);\n } else {\n scopes.exported.directives.add(exportedType);\n }\n });\n def.transitiveCompileScopes = scopes;\n return scopes;\n}\nfunction expandModuleWithProviders(value) {\n if (isModuleWithProviders(value)) {\n return value.ngModule;\n }\n return value;\n}\n\n/**\n * Keep track of the compilation depth to avoid reentrancy issues during JIT compilation. This\n * matters in the following scenario:\n *\n * Consider a component 'A' that extends component 'B', both declared in module 'M'. During\n * the compilation of 'A' the definition of 'B' is requested to capture the inheritance chain,\n * potentially triggering compilation of 'B'. If this nested compilation were to trigger\n * `flushModuleScopingQueueAsMuchAsPossible` it may happen that module 'M' is still pending in the\n * queue, resulting in 'A' and 'B' to be patched with the NgModule scope. As the compilation of\n * 'A' is still in progress, this would introduce a circular dependency on its compilation. To avoid\n * this issue, the module scope queue is only flushed for compilations at the depth 0, to ensure\n * all compilations have finished.\n */\nlet compilationDepth = 0;\n/**\n * Compile an Angular component according to its decorator metadata, and patch the resulting\n * component def (ɵcmp) onto the component type.\n *\n * Compilation may be asynchronous (due to the need to resolve URLs for the component template or\n * other resources, for example). In the event that compilation is not immediate, `compileComponent`\n * will enqueue resource resolution into a global queue and will fail to return the `ɵcmp`\n * until the global queue has been resolved with a call to `resolveComponentResources`.\n */\nfunction compileComponent(type, metadata) {\n // Initialize ngDevMode. This must be the first statement in compileComponent.\n // See the `initNgDevMode` docstring for more information.\n (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();\n let ngComponentDef = null;\n // Metadata may have resources which need to be resolved.\n maybeQueueResolutionOfComponentResources(type, metadata);\n // Note that we're using the same function as `Directive`, because that's only subset of metadata\n // that we need to create the ngFactoryDef. We're avoiding using the component metadata\n // because we'd have to resolve the asynchronous templates.\n addDirectiveFactoryDef(type, metadata);\n Object.defineProperty(type, NG_COMP_DEF, {\n get: () => {\n if (ngComponentDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'component',\n type: type\n });\n if (componentNeedsResolution(metadata)) {\n const error = [`Component '${type.name}' is not resolved:`];\n if (metadata.templateUrl) {\n error.push(` - templateUrl: ${metadata.templateUrl}`);\n }\n if (metadata.styleUrls && metadata.styleUrls.length) {\n error.push(` - styleUrls: ${JSON.stringify(metadata.styleUrls)}`);\n }\n if (metadata.styleUrl) {\n error.push(` - styleUrl: ${metadata.styleUrl}`);\n }\n error.push(`Did you run and wait for 'resolveComponentResources()'?`);\n throw new Error(error.join('\\n'));\n }\n // This const was called `jitOptions` previously but had to be renamed to `options` because\n // of a bug with Terser that caused optimized JIT builds to throw a `ReferenceError`.\n // This bug was investigated in https://github.com/angular/angular-cli/issues/17264.\n // We should not rename it back until https://github.com/terser/terser/issues/615 is fixed.\n const options = getJitOptions();\n let preserveWhitespaces = metadata.preserveWhitespaces;\n if (preserveWhitespaces === undefined) {\n if (options !== null && options.preserveWhitespaces !== undefined) {\n preserveWhitespaces = options.preserveWhitespaces;\n } else {\n preserveWhitespaces = false;\n }\n }\n let encapsulation = metadata.encapsulation;\n if (encapsulation === undefined) {\n if (options !== null && options.defaultEncapsulation !== undefined) {\n encapsulation = options.defaultEncapsulation;\n } else {\n encapsulation = ViewEncapsulation$1.Emulated;\n }\n }\n const templateUrl = metadata.templateUrl || `ng:///${type.name}/template.html`;\n const meta = {\n ...directiveMetadata(type, metadata),\n typeSourceSpan: compiler.createParseSourceSpan('Component', type.name, templateUrl),\n template: metadata.template || '',\n preserveWhitespaces,\n styles: typeof metadata.styles === 'string' ? [metadata.styles] : metadata.styles || EMPTY_ARRAY,\n animations: metadata.animations,\n // JIT components are always compiled against an empty set of `declarations`. Instead, the\n // `directiveDefs` and `pipeDefs` are updated at a later point:\n // * for NgModule-based components, they're set when the NgModule which declares the\n // component resolves in the module scoping queue\n // * for standalone components, they're set just below, after `compileComponent`.\n declarations: [],\n changeDetection: metadata.changeDetection,\n encapsulation,\n interpolation: metadata.interpolation,\n viewProviders: metadata.viewProviders || null\n };\n compilationDepth++;\n try {\n if (meta.usesInheritance) {\n addDirectiveDefToUndecoratedParents(type);\n }\n ngComponentDef = compiler.compileComponent(angularCoreEnv, templateUrl, meta);\n if (metadata.standalone) {\n // Patch the component definition for standalone components with `directiveDefs` and\n // `pipeDefs` functions which lazily compute the directives/pipes available in the\n // standalone component. Also set `dependencies` to the lazily resolved list of imports.\n const imports = flatten(metadata.imports || EMPTY_ARRAY);\n const {\n directiveDefs,\n pipeDefs\n } = getStandaloneDefFunctions(type, imports);\n ngComponentDef.directiveDefs = directiveDefs;\n ngComponentDef.pipeDefs = pipeDefs;\n ngComponentDef.dependencies = () => imports.map(resolveForwardRef);\n }\n } finally {\n // Ensure that the compilation depth is decremented even when the compilation failed.\n compilationDepth--;\n }\n if (compilationDepth === 0) {\n // When NgModule decorator executed, we enqueued the module definition such that\n // it would only dequeue and add itself as module scope to all of its declarations,\n // but only if if all of its declarations had resolved. This call runs the check\n // to see if any modules that are in the queue can be dequeued and add scope to\n // their declarations.\n flushModuleScopingQueueAsMuchAsPossible();\n }\n // If component compilation is async, then the @NgModule annotation which declares the\n // component may execute and set an ngSelectorScope property on the component type. This\n // allows the component to patch itself with directiveDefs from the module after it\n // finishes compiling.\n if (hasSelectorScope(type)) {\n const scopes = transitiveScopesFor(type.ngSelectorScope);\n patchComponentDefWithScope(ngComponentDef, scopes);\n }\n if (metadata.schemas) {\n if (metadata.standalone) {\n ngComponentDef.schemas = metadata.schemas;\n } else {\n throw new Error(`The 'schemas' was specified for the ${stringifyForError(type)} but is only valid on a component that is standalone.`);\n }\n } else if (metadata.standalone) {\n ngComponentDef.schemas = [];\n }\n }\n return ngComponentDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n}\n/**\n * Build memoized `directiveDefs` and `pipeDefs` functions for the component definition of a\n * standalone component, which process `imports` and filter out directives and pipes. The use of\n * memoized functions here allows for the delayed resolution of any `forwardRef`s present in the\n * component's `imports`.\n */\nfunction getStandaloneDefFunctions(type, imports) {\n let cachedDirectiveDefs = null;\n let cachedPipeDefs = null;\n const directiveDefs = () => {\n if (!USE_RUNTIME_DEPS_TRACKER_FOR_JIT) {\n if (cachedDirectiveDefs === null) {\n // Standalone components are always able to self-reference, so include the component's own\n // definition in its `directiveDefs`.\n cachedDirectiveDefs = [getComponentDef(type)];\n const seen = new Set([type]);\n for (const rawDep of imports) {\n ngDevMode && verifyStandaloneImport(rawDep, type);\n const dep = resolveForwardRef(rawDep);\n if (seen.has(dep)) {\n continue;\n }\n seen.add(dep);\n if (!!getNgModuleDef(dep)) {\n const scope = transitiveScopesFor(dep);\n for (const dir of scope.exported.directives) {\n const def = getComponentDef(dir) || getDirectiveDef(dir);\n if (def && !seen.has(dir)) {\n seen.add(dir);\n cachedDirectiveDefs.push(def);\n }\n }\n } else {\n const def = getComponentDef(dep) || getDirectiveDef(dep);\n if (def) {\n cachedDirectiveDefs.push(def);\n }\n }\n }\n }\n return cachedDirectiveDefs;\n } else {\n if (ngDevMode) {\n for (const rawDep of imports) {\n verifyStandaloneImport(rawDep, type);\n }\n }\n if (!isComponent(type)) {\n return [];\n }\n const scope = depsTracker.getStandaloneComponentScope(type, imports);\n return [...scope.compilation.directives].map(p => getComponentDef(p) || getDirectiveDef(p)).filter(d => d !== null);\n }\n };\n const pipeDefs = () => {\n if (!USE_RUNTIME_DEPS_TRACKER_FOR_JIT) {\n if (cachedPipeDefs === null) {\n cachedPipeDefs = [];\n const seen = new Set();\n for (const rawDep of imports) {\n const dep = resolveForwardRef(rawDep);\n if (seen.has(dep)) {\n continue;\n }\n seen.add(dep);\n if (!!getNgModuleDef(dep)) {\n const scope = transitiveScopesFor(dep);\n for (const pipe of scope.exported.pipes) {\n const def = getPipeDef$1(pipe);\n if (def && !seen.has(pipe)) {\n seen.add(pipe);\n cachedPipeDefs.push(def);\n }\n }\n } else {\n const def = getPipeDef$1(dep);\n if (def) {\n cachedPipeDefs.push(def);\n }\n }\n }\n }\n return cachedPipeDefs;\n } else {\n if (ngDevMode) {\n for (const rawDep of imports) {\n verifyStandaloneImport(rawDep, type);\n }\n }\n if (!isComponent(type)) {\n return [];\n }\n const scope = depsTracker.getStandaloneComponentScope(type, imports);\n return [...scope.compilation.pipes].map(p => getPipeDef$1(p)).filter(d => d !== null);\n }\n };\n return {\n directiveDefs,\n pipeDefs\n };\n}\nfunction hasSelectorScope(component) {\n return component.ngSelectorScope !== undefined;\n}\n/**\n * Compile an Angular directive according to its decorator metadata, and patch the resulting\n * directive def onto the component type.\n *\n * In the event that compilation is not immediate, `compileDirective` will return a `Promise` which\n * will resolve when compilation completes and the directive becomes usable.\n */\nfunction compileDirective(type, directive) {\n let ngDirectiveDef = null;\n addDirectiveFactoryDef(type, directive || {});\n Object.defineProperty(type, NG_DIR_DEF, {\n get: () => {\n if (ngDirectiveDef === null) {\n // `directive` can be null in the case of abstract directives as a base class\n // that use `@Directive()` with no selector. In that case, pass empty object to the\n // `directiveMetadata` function instead of null.\n const meta = getDirectiveMetadata(type, directive || {});\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'directive',\n type\n });\n ngDirectiveDef = compiler.compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata);\n }\n return ngDirectiveDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n}\nfunction getDirectiveMetadata(type, metadata) {\n const name = type && type.name;\n const sourceMapUrl = `ng:///${name}/ɵdir.js`;\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'directive',\n type\n });\n const facade = directiveMetadata(type, metadata);\n facade.typeSourceSpan = compiler.createParseSourceSpan('Directive', name, sourceMapUrl);\n if (facade.usesInheritance) {\n addDirectiveDefToUndecoratedParents(type);\n }\n return {\n metadata: facade,\n sourceMapUrl\n };\n}\nfunction addDirectiveFactoryDef(type, metadata) {\n let ngFactoryDef = null;\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const meta = getDirectiveMetadata(type, metadata);\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'directive',\n type\n });\n ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${type.name}/ɵfac.js`, {\n name: meta.metadata.name,\n type: meta.metadata.type,\n typeArgumentCount: 0,\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Directive\n });\n }\n return ngFactoryDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n}\nfunction extendsDirectlyFromObject(type) {\n return Object.getPrototypeOf(type.prototype) === Object.prototype;\n}\n/**\n * Extract the `R3DirectiveMetadata` for a particular directive (either a `Directive` or a\n * `Component`).\n */\nfunction directiveMetadata(type, metadata) {\n // Reflect inputs and outputs.\n const reflect = getReflect();\n const propMetadata = reflect.ownPropMetadata(type);\n return {\n name: type.name,\n type: type,\n selector: metadata.selector !== undefined ? metadata.selector : null,\n host: metadata.host || EMPTY_OBJ,\n propMetadata: propMetadata,\n inputs: metadata.inputs || EMPTY_ARRAY,\n outputs: metadata.outputs || EMPTY_ARRAY,\n queries: extractQueriesMetadata(type, propMetadata, isContentQuery),\n lifecycle: {\n usesOnChanges: reflect.hasLifecycleHook(type, 'ngOnChanges')\n },\n typeSourceSpan: null,\n usesInheritance: !extendsDirectlyFromObject(type),\n exportAs: extractExportAs(metadata.exportAs),\n providers: metadata.providers || null,\n viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery),\n isStandalone: !!metadata.standalone,\n isSignal: !!metadata.signals,\n hostDirectives: metadata.hostDirectives?.map(directive => typeof directive === 'function' ? {\n directive\n } : directive) || null\n };\n}\n/**\n * Adds a directive definition to all parent classes of a type that don't have an Angular decorator.\n */\nfunction addDirectiveDefToUndecoratedParents(type) {\n const objPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objPrototype) {\n // Since inheritance works if the class was annotated already, we only need to add\n // the def if there are no annotations and the def hasn't been created already.\n if (!getDirectiveDef(parent) && !getComponentDef(parent) && shouldAddAbstractDirective(parent)) {\n compileDirective(parent, null);\n }\n parent = Object.getPrototypeOf(parent);\n }\n}\nfunction convertToR3QueryPredicate(selector) {\n return typeof selector === 'string' ? splitByComma(selector) : resolveForwardRef(selector);\n}\nfunction convertToR3QueryMetadata(propertyName, ann) {\n return {\n propertyName: propertyName,\n predicate: convertToR3QueryPredicate(ann.selector),\n descendants: ann.descendants,\n first: ann.first,\n read: ann.read ? ann.read : null,\n static: !!ann.static,\n emitDistinctChangesOnly: !!ann.emitDistinctChangesOnly,\n isSignal: !!ann.isSignal\n };\n}\nfunction extractQueriesMetadata(type, propMetadata, isQueryAnn) {\n const queriesMeta = [];\n for (const field in propMetadata) {\n if (propMetadata.hasOwnProperty(field)) {\n const annotations = propMetadata[field];\n annotations.forEach(ann => {\n if (isQueryAnn(ann)) {\n if (!ann.selector) {\n throw new Error(`Can't construct a query for the property \"${field}\" of ` + `\"${stringifyForError(type)}\" since the query selector wasn't defined.`);\n }\n if (annotations.some(isInputAnnotation)) {\n throw new Error(`Cannot combine @Input decorators with query decorators`);\n }\n queriesMeta.push(convertToR3QueryMetadata(field, ann));\n }\n });\n }\n }\n return queriesMeta;\n}\nfunction extractExportAs(exportAs) {\n return exportAs === undefined ? null : splitByComma(exportAs);\n}\nfunction isContentQuery(value) {\n const name = value.ngMetadataName;\n return name === 'ContentChild' || name === 'ContentChildren';\n}\nfunction isViewQuery(value) {\n const name = value.ngMetadataName;\n return name === 'ViewChild' || name === 'ViewChildren';\n}\nfunction isInputAnnotation(value) {\n return value.ngMetadataName === 'Input';\n}\nfunction splitByComma(value) {\n return value.split(',').map(piece => piece.trim());\n}\nconst LIFECYCLE_HOOKS = ['ngOnChanges', 'ngOnInit', 'ngOnDestroy', 'ngDoCheck', 'ngAfterViewInit', 'ngAfterViewChecked', 'ngAfterContentInit', 'ngAfterContentChecked'];\nfunction shouldAddAbstractDirective(type) {\n const reflect = getReflect();\n if (LIFECYCLE_HOOKS.some(hookName => reflect.hasLifecycleHook(type, hookName))) {\n return true;\n }\n const propMetadata = reflect.propMetadata(type);\n for (const field in propMetadata) {\n const annotations = propMetadata[field];\n for (let i = 0; i < annotations.length; i++) {\n const current = annotations[i];\n const metadataName = current.ngMetadataName;\n if (isInputAnnotation(current) || isContentQuery(current) || isViewQuery(current) || metadataName === 'Output' || metadataName === 'HostBinding' || metadataName === 'HostListener') {\n return true;\n }\n }\n }\n return false;\n}\nfunction compilePipe(type, meta) {\n let ngPipeDef = null;\n let ngFactoryDef = null;\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const metadata = getPipeMetadata(type, meta);\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'pipe',\n type: metadata.type\n });\n ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${metadata.name}/ɵfac.js`, {\n name: metadata.name,\n type: metadata.type,\n typeArgumentCount: 0,\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Pipe\n });\n }\n return ngFactoryDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n Object.defineProperty(type, NG_PIPE_DEF, {\n get: () => {\n if (ngPipeDef === null) {\n const metadata = getPipeMetadata(type, meta);\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'pipe',\n type: metadata.type\n });\n ngPipeDef = compiler.compilePipe(angularCoreEnv, `ng:///${metadata.name}/ɵpipe.js`, metadata);\n }\n return ngPipeDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n}\nfunction getPipeMetadata(type, meta) {\n return {\n type: type,\n name: type.name,\n pipeName: meta.name,\n pure: meta.pure !== undefined ? meta.pure : true,\n isStandalone: !!meta.standalone\n };\n}\n\n/**\n * Type of the Directive metadata.\n *\n * @publicApi\n */\nconst Directive = makeDecorator('Directive', (dir = {}) => dir, undefined, undefined, (type, meta) => compileDirective(type, meta));\n/**\n * Component decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Component = makeDecorator('Component', (c = {}) => ({\n changeDetection: ChangeDetectionStrategy.Default,\n ...c\n}), Directive, undefined, (type, meta) => compileComponent(type, meta));\n/**\n * @Annotation\n * @publicApi\n */\nconst Pipe = makeDecorator('Pipe', p => ({\n pure: true,\n ...p\n}), undefined, undefined, (type, meta) => compilePipe(type, meta));\n/**\n * @Annotation\n * @publicApi\n */\nconst Input = makePropDecorator('Input', arg => {\n if (!arg) {\n return {};\n }\n return typeof arg === 'string' ? {\n alias: arg\n } : arg;\n});\n/**\n * @Annotation\n * @publicApi\n */\nconst Output = makePropDecorator('Output', alias => ({\n alias\n}));\n/**\n * @Annotation\n * @publicApi\n */\nconst HostBinding = makePropDecorator('HostBinding', hostPropertyName => ({\n hostPropertyName\n}));\n/**\n * @Annotation\n * @publicApi\n */\nconst HostListener = makePropDecorator('HostListener', (eventName, args) => ({\n eventName,\n args\n}));\n\n/**\n * @Annotation\n */\nconst NgModule = makeDecorator('NgModule', ngModule => ngModule, undefined, undefined,\n/**\n * Decorator that marks the following class as an NgModule, and supplies\n * configuration metadata for it.\n *\n * * The `declarations` option configures the compiler\n * with information about what belongs to the NgModule.\n * * The `providers` options configures the NgModule's injector to provide\n * dependencies the NgModule members.\n * * The `imports` and `exports` options bring in members from other modules, and make\n * this module's members available to others.\n */\n(type, meta) => compileNgModule(type, meta));\n\n/**\n * This indirection is needed to free up Component, etc symbols in the public API\n * to be used by the decorator versions of these annotations.\n */\n\n/**\n * @description Represents the version of Angular\n *\n * @publicApi\n */\nclass Version {\n constructor(full) {\n this.full = full;\n const parts = full.split('.');\n this.major = parts[0];\n this.minor = parts[1];\n this.patch = parts.slice(2).join('.');\n }\n}\n/**\n * @publicApi\n */\nconst VERSION = new Version('18.2.10');\n\n/*\n * This file exists to support compilation of @angular/core in Ivy mode.\n *\n * When the Angular compiler processes a compilation unit, it normally writes imports to\n * @angular/core. When compiling the core package itself this strategy isn't usable. Instead, the\n * compiler writes imports to this file.\n *\n * Only a subset of such imports are supported - core is not allowed to declare components or pipes.\n * A check in ngtsc's `R3SymbolsImportRewriter` validates this condition. The rewriter is only used\n * when compiling @angular/core and is responsible for translating an external name (prefixed with\n * ɵ) to the internal symbol name as exported below.\n *\n * The below symbols are used for @Injectable and @NgModule compilation.\n */\n/**\n * The existence of this constant (in this particular file) informs the Angular compiler that the\n * current program is actually @angular/core, which needs to be compiled specially.\n */\nconst ITS_JUST_ANGULAR = true;\nclass Console {\n log(message) {\n // tslint:disable-next-line:no-console\n console.log(message);\n }\n // Note: for reporting errors use `DOM.logError()` as it is platform specific\n warn(message) {\n // tslint:disable-next-line:no-console\n console.warn(message);\n }\n static {\n this.ɵfac = function Console_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || Console)();\n };\n }\n static {\n this.ɵprov = /*@__PURE__*/ɵɵdefineInjectable({\n token: Console,\n factory: Console.ɵfac,\n providedIn: 'platform'\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(Console, [{\n type: Injectable,\n args: [{\n providedIn: 'platform'\n }]\n }], null, null);\n})();\n\n/**\n * These are the data structures that our framework injector profiler will fill with data in order\n * to support DI debugging APIs.\n *\n * resolverToTokenToDependencies: Maps an injector to a Map of tokens to an Array of\n * dependencies. Injector -> Token -> Dependencies This is used to support the\n * getDependenciesFromInjectable API, which takes in an injector and a token and returns it's\n * dependencies.\n *\n * resolverToProviders: Maps a DI resolver (an Injector or a TNode) to the providers configured\n * within it This is used to support the getInjectorProviders API, which takes in an injector and\n * returns the providers that it was configured with. Note that for the element injector case we\n * use the TNode instead of the LView as the DI resolver. This is because the registration of\n * providers happens only once per type of TNode. If an injector is created with an identical TNode,\n * the providers for that injector will not be reconfigured.\n *\n * standaloneInjectorToComponent: Maps the injector of a standalone component to the standalone\n * component that it is associated with. Used in the getInjectorProviders API, specificially in the\n * discovery of import paths for each provider. This is necessary because the imports array of a\n * standalone component is processed and configured in its standalone injector, but exists within\n * the component's definition. Because getInjectorProviders takes in an injector, if that injector\n * is the injector of a standalone component, we need to be able to discover the place where the\n * imports array is located (the component) in order to flatten the imports array within it to\n * discover all of it's providers.\n *\n *\n * All of these data structures are instantiated with WeakMaps. This will ensure that the presence\n * of any object in the keys of these maps does not prevent the garbage collector from collecting\n * those objects. Because of this property of WeakMaps, these data structures will never be the\n * source of a memory leak.\n *\n * An example of this advantage: When components are destroyed, we don't need to do\n * any additional work to remove that component from our mappings.\n *\n */\nclass DIDebugData {\n constructor() {\n this.resolverToTokenToDependencies = new WeakMap();\n this.resolverToProviders = new WeakMap();\n this.standaloneInjectorToComponent = new WeakMap();\n }\n reset() {\n this.resolverToTokenToDependencies = new WeakMap();\n this.resolverToProviders = new WeakMap();\n this.standaloneInjectorToComponent = new WeakMap();\n }\n}\nlet frameworkDIDebugData = new DIDebugData();\nfunction getFrameworkDIDebugData() {\n return frameworkDIDebugData;\n}\n/**\n * Initalize default handling of injector events. This handling parses events\n * as they are emitted and constructs the data structures necessary to support\n * some of debug APIs.\n *\n * See handleInjectEvent, handleCreateEvent and handleProviderConfiguredEvent\n * for descriptions of each handler\n *\n * Supported APIs:\n * - getDependenciesFromInjectable\n * - getInjectorProviders\n */\nfunction setupFrameworkInjectorProfiler() {\n frameworkDIDebugData.reset();\n setInjectorProfiler(injectorProfilerEvent => handleInjectorProfilerEvent(injectorProfilerEvent));\n}\nfunction handleInjectorProfilerEvent(injectorProfilerEvent) {\n const {\n context,\n type\n } = injectorProfilerEvent;\n if (type === 0 /* InjectorProfilerEventType.Inject */) {\n handleInjectEvent(context, injectorProfilerEvent.service);\n } else if (type === 1 /* InjectorProfilerEventType.InstanceCreatedByInjector */) {\n handleInstanceCreatedByInjectorEvent(context, injectorProfilerEvent.instance);\n } else if (type === 2 /* InjectorProfilerEventType.ProviderConfigured */) {\n handleProviderConfiguredEvent(context, injectorProfilerEvent.providerRecord);\n }\n}\n/**\n *\n * Stores the injected service in frameworkDIDebugData.resolverToTokenToDependencies\n * based on it's injector and token.\n *\n * @param context InjectorProfilerContext the injection context that this event occurred in.\n * @param data InjectedService the service associated with this inject event.\n *\n */\nfunction handleInjectEvent(context, data) {\n const diResolver = getDIResolver(context.injector);\n if (diResolver === null) {\n throwError('An Inject event must be run within an injection context.');\n }\n const diResolverToInstantiatedToken = frameworkDIDebugData.resolverToTokenToDependencies;\n if (!diResolverToInstantiatedToken.has(diResolver)) {\n diResolverToInstantiatedToken.set(diResolver, new WeakMap());\n }\n // if token is a primitive type, ignore this event. We do this because we cannot keep track of\n // non-primitive tokens in WeakMaps since they are not garbage collectable.\n if (!canBeHeldWeakly(context.token)) {\n return;\n }\n const instantiatedTokenToDependencies = diResolverToInstantiatedToken.get(diResolver);\n if (!instantiatedTokenToDependencies.has(context.token)) {\n instantiatedTokenToDependencies.set(context.token, []);\n }\n const {\n token,\n value,\n flags\n } = data;\n assertDefined(context.token, 'Injector profiler context token is undefined.');\n const dependencies = instantiatedTokenToDependencies.get(context.token);\n assertDefined(dependencies, 'Could not resolve dependencies for token.');\n if (context.injector instanceof NodeInjector) {\n dependencies.push({\n token,\n value,\n flags,\n injectedIn: getNodeInjectorContext(context.injector)\n });\n } else {\n dependencies.push({\n token,\n value,\n flags\n });\n }\n}\n/**\n *\n * Returns the LView and TNode associated with a NodeInjector. Returns undefined if the injector\n * is not a NodeInjector.\n *\n * @param injector\n * @returns {lView: LView, tNode: TNode}|undefined\n */\nfunction getNodeInjectorContext(injector) {\n if (!(injector instanceof NodeInjector)) {\n throwError('getNodeInjectorContext must be called with a NodeInjector');\n }\n const lView = getNodeInjectorLView(injector);\n const tNode = getNodeInjectorTNode(injector);\n if (tNode === null) {\n return;\n }\n assertTNodeForLView(tNode, lView);\n return {\n lView,\n tNode\n };\n}\n/**\n *\n * If the created instance is an instance of a standalone component, maps the injector to that\n * standalone component in frameworkDIDebugData.standaloneInjectorToComponent\n *\n * @param context InjectorProfilerContext the injection context that this event occurred in.\n * @param data InjectorCreatedInstance an object containing the instance that was just created\n *\n */\nfunction handleInstanceCreatedByInjectorEvent(context, data) {\n const {\n value\n } = data;\n if (getDIResolver(context.injector) === null) {\n throwError('An InjectorCreatedInstance event must be run within an injection context.');\n }\n // if our value is an instance of a standalone component, map the injector of that standalone\n // component to the component class. Otherwise, this event is a noop.\n let standaloneComponent = undefined;\n if (typeof value === 'object') {\n standaloneComponent = value?.constructor;\n }\n // We want to also cover if `standaloneComponent === null` in addition to `undefined`\n if (standaloneComponent == undefined || !isStandaloneComponent(standaloneComponent)) {\n return;\n }\n const environmentInjector = context.injector.get(EnvironmentInjector, null, {\n optional: true\n });\n // Standalone components should have an environment injector. If one cannot be\n // found we may be in a test case for low level functionality that did not explicitly\n // setup this injector. In those cases, we simply ignore this event.\n if (environmentInjector === null) {\n return;\n }\n const {\n standaloneInjectorToComponent\n } = frameworkDIDebugData;\n // If our injector has already been mapped, as is the case\n // when a standalone component imports another standalone component,\n // we consider the original component (the component doing the importing)\n // as the component connected to our injector.\n if (standaloneInjectorToComponent.has(environmentInjector)) {\n return;\n }\n // If our injector hasn't been mapped, then we map it to the standalone component\n standaloneInjectorToComponent.set(environmentInjector, standaloneComponent);\n}\nfunction isStandaloneComponent(value) {\n const def = getComponentDef(value);\n return !!def?.standalone;\n}\n/**\n *\n * Stores the emitted ProviderRecords from the InjectorProfilerEventType.ProviderConfigured\n * event in frameworkDIDebugData.resolverToProviders\n *\n * @param context InjectorProfilerContext the injection context that this event occurred in.\n * @param data ProviderRecord an object containing the instance that was just created\n *\n */\nfunction handleProviderConfiguredEvent(context, data) {\n const {\n resolverToProviders\n } = frameworkDIDebugData;\n let diResolver;\n if (context?.injector instanceof NodeInjector) {\n diResolver = getNodeInjectorTNode(context.injector);\n } else {\n diResolver = context.injector;\n }\n if (diResolver === null) {\n throwError('A ProviderConfigured event must be run within an injection context.');\n }\n if (!resolverToProviders.has(diResolver)) {\n resolverToProviders.set(diResolver, []);\n }\n resolverToProviders.get(diResolver).push(data);\n}\nfunction getDIResolver(injector) {\n let diResolver = null;\n if (injector === undefined) {\n return diResolver;\n }\n // We use the LView as the diResolver for NodeInjectors because they\n // do not persist anywhere in the framework. They are simply wrappers around an LView and a TNode\n // that do persist. Because of this, we rely on the LView of the NodeInjector in order to use\n // as a concrete key to represent this injector. If we get the same LView back later, we know\n // we're looking at the same injector.\n if (injector instanceof NodeInjector) {\n diResolver = getNodeInjectorLView(injector);\n }\n // Other injectors can be used a keys for a map because their instances\n // persist\n else {\n diResolver = injector;\n }\n return diResolver;\n}\n// inspired by\n// https://tc39.es/ecma262/multipage/executable-code-and-execution-contexts.html#sec-canbeheldweakly\nfunction canBeHeldWeakly(value) {\n // we check for value !== null here because typeof null === 'object\n return value !== null && (typeof value === 'object' || typeof value === 'function' || typeof value === 'symbol');\n}\n\n/**\n * Marks a component for check (in case of OnPush components) and synchronously\n * performs change detection on the application this component belongs to.\n *\n * @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}.\n *\n * @publicApi\n */\nfunction applyChanges(component) {\n ngDevMode && assertDefined(component, 'component');\n markViewDirty(getComponentViewByInstance(component), 3 /* NotificationSource.DebugApplyChanges */);\n getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent));\n}\n/**\n * Synchronously perform change detection on a component (and possibly its sub-components).\n *\n * This function triggers change detection in a synchronous way on a component.\n *\n * @param component The component which the change detection should be performed on.\n */\nfunction detectChanges(component) {\n const view = getComponentViewByInstance(component);\n view[FLAGS] |= 1024 /* LViewFlags.RefreshView */;\n detectChangesInternal(view);\n}\n\n/**\n * Discovers the dependencies of an injectable instance. Provides DI information about each\n * dependency that the injectable was instantiated with, including where they were provided from.\n *\n * @param injector An injector instance\n * @param token a DI token that was constructed by the given injector instance\n * @returns an object that contains the created instance of token as well as all of the dependencies\n * that it was instantiated with OR undefined if the token was not created within the given\n * injector.\n */\nfunction getDependenciesFromInjectable(injector, token) {\n // First we check to see if the token given maps to an actual instance in the injector given.\n // We use `self: true` because we only want to look at the injector we were given.\n // We use `optional: true` because it's possible that the token we were given was never\n // constructed by the injector we were given.\n const instance = injector.get(token, null, {\n self: true,\n optional: true\n });\n if (instance === null) {\n throw new Error(`Unable to determine instance of ${token} in given injector`);\n }\n const unformattedDependencies = getDependenciesForTokenInInjector(token, injector);\n const resolutionPath = getInjectorResolutionPath(injector);\n const dependencies = unformattedDependencies.map(dep => {\n // injectedIn contains private fields, so we omit it from the response\n const formattedDependency = {\n value: dep.value\n };\n // convert injection flags to booleans\n const flags = dep.flags;\n formattedDependency.flags = {\n optional: (8 /* InternalInjectFlags.Optional */ & flags) === 8 /* InternalInjectFlags.Optional */,\n host: (1 /* InternalInjectFlags.Host */ & flags) === 1 /* InternalInjectFlags.Host */,\n self: (2 /* InternalInjectFlags.Self */ & flags) === 2 /* InternalInjectFlags.Self */,\n skipSelf: (4 /* InternalInjectFlags.SkipSelf */ & flags) === 4 /* InternalInjectFlags.SkipSelf */\n };\n // find the injector that provided the dependency\n for (let i = 0; i < resolutionPath.length; i++) {\n const injectorToCheck = resolutionPath[i];\n // if skipSelf is true we skip the first injector\n if (i === 0 && formattedDependency.flags.skipSelf) {\n continue;\n }\n // host only applies to NodeInjectors\n if (formattedDependency.flags.host && injectorToCheck instanceof EnvironmentInjector) {\n break;\n }\n const instance = injectorToCheck.get(dep.token, null, {\n self: true,\n optional: true\n });\n if (instance !== null) {\n // if host flag is true we double check that we can get the service from the first element\n // in the resolution path by using the host flag. This is done to make sure that we've found\n // the correct providing injector, and not a node injector that is connected to our path via\n // a router outlet.\n if (formattedDependency.flags.host) {\n const firstInjector = resolutionPath[0];\n const lookupFromFirstInjector = firstInjector.get(dep.token, null, {\n ...formattedDependency.flags,\n optional: true\n });\n if (lookupFromFirstInjector !== null) {\n formattedDependency.providedIn = injectorToCheck;\n }\n break;\n }\n formattedDependency.providedIn = injectorToCheck;\n break;\n }\n // if self is true we stop after the first injector\n if (i === 0 && formattedDependency.flags.self) {\n break;\n }\n }\n if (dep.token) formattedDependency.token = dep.token;\n return formattedDependency;\n });\n return {\n instance,\n dependencies\n };\n}\nfunction getDependenciesForTokenInInjector(token, injector) {\n const {\n resolverToTokenToDependencies\n } = getFrameworkDIDebugData();\n if (!(injector instanceof NodeInjector)) {\n return resolverToTokenToDependencies.get(injector)?.get?.(token) ?? [];\n }\n const lView = getNodeInjectorLView(injector);\n const tokenDependencyMap = resolverToTokenToDependencies.get(lView);\n const dependencies = tokenDependencyMap?.get(token) ?? [];\n // In the NodeInjector case, all injections for every node are stored in the same lView.\n // We use the injectedIn field of the dependency to filter out the dependencies that\n // do not come from the same node as the instance we're looking at.\n return dependencies.filter(dependency => {\n const dependencyNode = dependency.injectedIn?.tNode;\n if (dependencyNode === undefined) {\n return false;\n }\n const instanceNode = getNodeInjectorTNode(injector);\n assertTNode(dependencyNode);\n assertTNode(instanceNode);\n return dependencyNode === instanceNode;\n });\n}\n/**\n * Gets the class associated with an injector that contains a provider `imports` array in it's\n * definition\n *\n * For Module Injectors this returns the NgModule constructor.\n *\n * For Standalone injectors this returns the standalone component constructor.\n *\n * @param injector Injector an injector instance\n * @returns the constructor where the `imports` array that configures this injector is located\n */\nfunction getProviderImportsContainer(injector) {\n const {\n standaloneInjectorToComponent\n } = getFrameworkDIDebugData();\n // standalone components configure providers through a component def, so we have to\n // use the standalone component associated with this injector if Injector represents\n // a standalone components EnvironmentInjector\n if (standaloneInjectorToComponent.has(injector)) {\n return standaloneInjectorToComponent.get(injector);\n }\n // Module injectors configure providers through their NgModule def, so we use the\n // injector to lookup its NgModuleRef and through that grab its instance\n const defTypeRef = injector.get(NgModuleRef$1, null, {\n self: true,\n optional: true\n });\n // If we can't find an associated imports container, return null.\n // This could be the case if this function is called with an R3Injector that does not represent\n // a standalone component or NgModule.\n if (defTypeRef === null) {\n return null;\n }\n // In standalone applications, the root environment injector created by bootstrapApplication\n // may have no associated \"instance\".\n if (defTypeRef.instance === null) {\n return null;\n }\n return defTypeRef.instance.constructor;\n}\n/**\n * Gets the providers configured on a NodeInjector\n *\n * @param injector A NodeInjector instance\n * @returns ProviderRecord[] an array of objects representing the providers configured on this\n * injector\n */\nfunction getNodeInjectorProviders(injector) {\n const diResolver = getNodeInjectorTNode(injector);\n const {\n resolverToProviders\n } = getFrameworkDIDebugData();\n return resolverToProviders.get(diResolver) ?? [];\n}\n/**\n * Gets a mapping of providers configured on an injector to their import paths\n *\n * ModuleA -> imports ModuleB\n * ModuleB -> imports ModuleC\n * ModuleB -> provides MyServiceA\n * ModuleC -> provides MyServiceB\n *\n * getProviderImportPaths(ModuleA)\n * > Map(2) {\n * MyServiceA => [ModuleA, ModuleB]\n * MyServiceB => [ModuleA, ModuleB, ModuleC]\n * }\n *\n * @param providerImportsContainer constructor of class that contains an `imports` array in it's\n * definition\n * @returns A Map object that maps providers to an array of constructors representing it's import\n * path\n *\n */\nfunction getProviderImportPaths(providerImportsContainer) {\n const providerToPath = new Map();\n const visitedContainers = new Set();\n const visitor = walkProviderTreeToDiscoverImportPaths(providerToPath, visitedContainers);\n walkProviderTree(providerImportsContainer, visitor, [], new Set());\n return providerToPath;\n}\n/**\n *\n * Higher order function that returns a visitor for WalkProviderTree\n *\n * Takes in a Map and Set to keep track of the providers and containers\n * visited, so that we can discover the import paths of these providers\n * during the traversal.\n *\n * This visitor takes advantage of the fact that walkProviderTree performs a\n * postorder traversal of the provider tree for the passed in container. Because postorder\n * traversal recursively processes subtrees from leaf nodes until the traversal reaches the root,\n * we write a visitor that constructs provider import paths in reverse.\n *\n *\n * We use the visitedContainers set defined outside this visitor\n * because we want to run some logic only once for\n * each container in the tree. That logic can be described as:\n *\n *\n * 1. for each discovered_provider and discovered_path in the incomplete provider paths we've\n * already discovered\n * 2. get the first container in discovered_path\n * 3. if that first container is in the imports array of the container we're visiting\n * Then the container we're visiting is also in the import path of discovered_provider, so we\n * unshift discovered_path with the container we're currently visiting\n *\n *\n * Example Run:\n * ```\n * ┌──────────┐\n * │containerA│\n * ┌─imports-─┤ ├──imports─┐\n * │ │ provA │ │\n * │ │ provB │ │\n * │ └──────────┘ │\n * │ │\n * ┌▼─────────┐ ┌────────▼─┐\n * │containerB│ │containerC│\n * │ │ │ │\n * │ provD │ │ provF │\n * │ provE │ │ provG │\n * └──────────┘ └──────────┘\n * ```\n *\n * Each step of the traversal,\n *\n * ```\n * visitor(provD, containerB)\n * providerToPath === Map { provD => [containerB] }\n * visitedContainers === Set { containerB }\n *\n * visitor(provE, containerB)\n * providerToPath === Map { provD => [containerB], provE => [containerB] }\n * visitedContainers === Set { containerB }\n *\n * visitor(provF, containerC)\n * providerToPath === Map { provD => [containerB], provE => [containerB], provF => [containerC] }\n * visitedContainers === Set { containerB, containerC }\n *\n * visitor(provG, containerC)\n * providerToPath === Map {\n * provD => [containerB], provE => [containerB], provF => [containerC], provG => [containerC]\n * }\n * visitedContainers === Set { containerB, containerC }\n *\n * visitor(provA, containerA)\n * providerToPath === Map {\n * provD => [containerA, containerB],\n * provE => [containerA, containerB],\n * provF => [containerA, containerC],\n * provG => [containerA, containerC],\n * provA => [containerA]\n * }\n * visitedContainers === Set { containerB, containerC, containerA }\n *\n * visitor(provB, containerA)\n * providerToPath === Map {\n * provD => [containerA, containerB],\n * provE => [containerA, containerB],\n * provF => [containerA, containerC],\n * provG => [containerA, containerC],\n * provA => [containerA]\n * provB => [containerA]\n * }\n * visitedContainers === Set { containerB, containerC, containerA }\n * ```\n *\n * @param providerToPath Map map of providers to paths that this function fills\n * @param visitedContainers Set a set to keep track of the containers we've already visited\n * @return function(provider SingleProvider, container: Type<unknown> | InjectorType<unknown>) =>\n * void\n */\nfunction walkProviderTreeToDiscoverImportPaths(providerToPath, visitedContainers) {\n return (provider, container) => {\n // If the provider is not already in the providerToPath map,\n // add an entry with the provider as the key and an array containing the current container as\n // the value\n if (!providerToPath.has(provider)) {\n providerToPath.set(provider, [container]);\n }\n // This block will run exactly once for each container in the import tree.\n // This is where we run the logic to check the imports array of the current\n // container to see if it's the next container in the path for our currently\n // discovered providers.\n if (!visitedContainers.has(container)) {\n // Iterate through the providers we've already seen\n for (const prov of providerToPath.keys()) {\n const existingImportPath = providerToPath.get(prov);\n let containerDef = getInjectorDef(container);\n if (!containerDef) {\n const ngModule = container.ngModule;\n containerDef = getInjectorDef(ngModule);\n }\n if (!containerDef) {\n return;\n }\n const lastContainerAddedToPath = existingImportPath[0];\n let isNextStepInPath = false;\n deepForEach(containerDef.imports, moduleImport => {\n if (isNextStepInPath) {\n return;\n }\n isNextStepInPath = moduleImport.ngModule === lastContainerAddedToPath || moduleImport === lastContainerAddedToPath;\n if (isNextStepInPath) {\n providerToPath.get(prov)?.unshift(container);\n }\n });\n }\n }\n visitedContainers.add(container);\n };\n}\n/**\n * Gets the providers configured on an EnvironmentInjector\n *\n * @param injector EnvironmentInjector\n * @returns an array of objects representing the providers of the given injector\n */\nfunction getEnvironmentInjectorProviders(injector) {\n const providerRecordsWithoutImportPaths = getFrameworkDIDebugData().resolverToProviders.get(injector) ?? [];\n // platform injector has no provider imports container so can we skip trying to\n // find import paths\n if (isPlatformInjector(injector)) {\n return providerRecordsWithoutImportPaths;\n }\n const providerImportsContainer = getProviderImportsContainer(injector);\n if (providerImportsContainer === null) {\n // We assume that if an environment injector exists without an associated provider imports\n // container, it was created without such a container. Some examples cases where this could\n // happen:\n // - The root injector of a standalone application\n // - A router injector created by using the providers array in a lazy loaded route\n // - A manually created injector that is attached to the injector tree\n // Since each of these cases has no provider container, there is no concept of import paths,\n // so we can simply return the provider records.\n return providerRecordsWithoutImportPaths;\n }\n const providerToPath = getProviderImportPaths(providerImportsContainer);\n const providerRecords = [];\n for (const providerRecord of providerRecordsWithoutImportPaths) {\n const provider = providerRecord.provider;\n // Ignore these special providers for now until we have a cleaner way of\n // determing when they are provided by the framework vs provided by the user.\n const token = provider.provide;\n if (token === ENVIRONMENT_INITIALIZER || token === INJECTOR_DEF_TYPES) {\n continue;\n }\n let importPath = providerToPath.get(provider) ?? [];\n const def = getComponentDef(providerImportsContainer);\n const isStandaloneComponent = !!def?.standalone;\n // We prepend the component constructor in the standalone case\n // because walkProviderTree does not visit this constructor during it's traversal\n if (isStandaloneComponent) {\n importPath = [providerImportsContainer, ...importPath];\n }\n providerRecords.push({\n ...providerRecord,\n importPath\n });\n }\n return providerRecords;\n}\nfunction isPlatformInjector(injector) {\n return injector instanceof R3Injector && injector.scopes.has('platform');\n}\n/**\n * Gets the providers configured on an injector.\n *\n * @param injector the injector to lookup the providers of\n * @returns ProviderRecord[] an array of objects representing the providers of the given injector\n */\nfunction getInjectorProviders(injector) {\n if (injector instanceof NodeInjector) {\n return getNodeInjectorProviders(injector);\n } else if (injector instanceof EnvironmentInjector) {\n return getEnvironmentInjectorProviders(injector);\n }\n throwError('getInjectorProviders only supports NodeInjector and EnvironmentInjector');\n}\n/**\n *\n * Given an injector, this function will return\n * an object containing the type and source of the injector.\n *\n * | | type | source |\n * |--------------|-------------|-------------------------------------------------------------|\n * | NodeInjector | element | DOM element that created this injector |\n * | R3Injector | environment | `injector.source` |\n * | NullInjector | null | null |\n *\n * @param injector the Injector to get metadata for\n * @returns an object containing the type and source of the given injector. If the injector metadata\n * cannot be determined, returns null.\n */\nfunction getInjectorMetadata(injector) {\n if (injector instanceof NodeInjector) {\n const lView = getNodeInjectorLView(injector);\n const tNode = getNodeInjectorTNode(injector);\n assertTNodeForLView(tNode, lView);\n return {\n type: 'element',\n source: getNativeByTNode(tNode, lView)\n };\n }\n if (injector instanceof R3Injector) {\n return {\n type: 'environment',\n source: injector.source ?? null\n };\n }\n if (injector instanceof NullInjector) {\n return {\n type: 'null',\n source: null\n };\n }\n return null;\n}\nfunction getInjectorResolutionPath(injector) {\n const resolutionPath = [injector];\n getInjectorResolutionPathHelper(injector, resolutionPath);\n return resolutionPath;\n}\nfunction getInjectorResolutionPathHelper(injector, resolutionPath) {\n const parent = getInjectorParent(injector);\n // if getInjectorParent can't find a parent, then we've either reached the end\n // of the path, or we need to move from the Element Injector tree to the\n // module injector tree using the first injector in our path as the connection point.\n if (parent === null) {\n if (injector instanceof NodeInjector) {\n const firstInjector = resolutionPath[0];\n if (firstInjector instanceof NodeInjector) {\n const moduleInjector = getModuleInjectorOfNodeInjector(firstInjector);\n if (moduleInjector === null) {\n throwError('NodeInjector must have some connection to the module injector tree');\n }\n resolutionPath.push(moduleInjector);\n getInjectorResolutionPathHelper(moduleInjector, resolutionPath);\n }\n return resolutionPath;\n }\n } else {\n resolutionPath.push(parent);\n getInjectorResolutionPathHelper(parent, resolutionPath);\n }\n return resolutionPath;\n}\n/**\n * Gets the parent of an injector.\n *\n * This function is not able to make the jump from the Element Injector Tree to the Module\n * injector tree. This is because the \"parent\" (the next step in the reoslution path)\n * of a root NodeInjector is dependent on which NodeInjector ancestor initiated\n * the DI lookup. See getInjectorResolutionPath for a function that can make this jump.\n *\n * In the below diagram:\n * ```ts\n * getInjectorParent(NodeInjectorB)\n * > NodeInjectorA\n * getInjectorParent(NodeInjectorA) // or getInjectorParent(getInjectorParent(NodeInjectorB))\n * > null // cannot jump to ModuleInjector tree\n * ```\n *\n * ```\n * ┌───────┐ ┌───────────────────┐\n * ┌───────────┤ModuleA├───Injector────►│EnvironmentInjector│\n * │ └───┬───┘ └───────────────────┘\n * │ │\n * │ bootstraps\n * │ │\n * │ │\n * │ ┌────▼─────┐ ┌─────────────┐\n * declares │ComponentA├────Injector────►│NodeInjectorA│\n * │ └────┬─────┘ └─────▲───────┘\n * │ │ │\n * │ renders parent\n * │ │ │\n * │ ┌────▼─────┐ ┌─────┴───────┐\n * └─────────►│ComponentB├────Injector────►│NodeInjectorB│\n * └──────────┘ └─────────────┘\n *```\n *\n * @param injector an Injector to get the parent of\n * @returns Injector the parent of the given injector\n */\nfunction getInjectorParent(injector) {\n if (injector instanceof R3Injector) {\n const parent = injector.parent;\n if (isRouterOutletInjector(parent)) {\n // This is a special case for a `ChainedInjector` instance, which represents\n // a combination of a Router's `OutletInjector` and an EnvironmentInjector,\n // which represents a `@defer` block. Since the `OutletInjector` doesn't store\n // any tokens itself, we point to the parent injector instead. See the\n // `OutletInjector.__ngOutletInjector` field for additional information.\n return parent.parentInjector;\n }\n return parent;\n }\n let tNode;\n let lView;\n if (injector instanceof NodeInjector) {\n tNode = getNodeInjectorTNode(injector);\n lView = getNodeInjectorLView(injector);\n } else if (injector instanceof NullInjector) {\n return null;\n } else if (injector instanceof ChainedInjector) {\n return injector.parentInjector;\n } else {\n throwError('getInjectorParent only support injectors of type R3Injector, NodeInjector, NullInjector');\n }\n const parentLocation = getParentInjectorLocation(tNode, lView);\n if (hasParentInjector(parentLocation)) {\n const parentInjectorIndex = getParentInjectorIndex(parentLocation);\n const parentLView = getParentInjectorView(parentLocation, lView);\n const parentTView = parentLView[TVIEW];\n const parentTNode = parentTView.data[parentInjectorIndex + 8 /* NodeInjectorOffset.TNODE */];\n return new NodeInjector(parentTNode, parentLView);\n } else {\n const chainedInjector = lView[INJECTOR];\n // Case where chainedInjector.injector is an OutletInjector and chainedInjector.injector.parent\n // is a NodeInjector.\n // todo(aleksanderbodurri): ideally nothing in packages/core should deal\n // directly with router concerns. Refactor this so that we can make the jump from\n // NodeInjector -> OutletInjector -> NodeInjector\n // without explicitly relying on types contracts from packages/router\n const injectorParent = chainedInjector.injector?.parent;\n if (injectorParent instanceof NodeInjector) {\n return injectorParent;\n }\n }\n return null;\n}\n/**\n * Gets the module injector of a NodeInjector.\n *\n * @param injector NodeInjector to get module injector of\n * @returns Injector representing module injector of the given NodeInjector\n */\nfunction getModuleInjectorOfNodeInjector(injector) {\n let lView;\n if (injector instanceof NodeInjector) {\n lView = getNodeInjectorLView(injector);\n } else {\n throwError('getModuleInjectorOfNodeInjector must be called with a NodeInjector');\n }\n const inj = lView[INJECTOR];\n const moduleInjector = inj instanceof ChainedInjector ? inj.parentInjector : inj.parent;\n if (!moduleInjector) {\n throwError('NodeInjector must have some connection to the module injector tree');\n }\n return moduleInjector;\n}\n\n/**\n * This file introduces series of globally accessible debug tools\n * to allow for the Angular debugging story to function.\n *\n * To see this in action run the following command:\n *\n * bazel run //packages/core/test/bundling/todo:devserver\n *\n * Then load `localhost:5432` and start using the console tools.\n */\n/**\n * This value reflects the property on the window where the dev\n * tools are patched (window.ng).\n * */\nconst GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';\nconst globalUtilsFunctions = {\n /**\n * Warning: functions that start with `ɵ` are considered *INTERNAL* and should not be relied upon\n * in application's code. The contract of those functions might be changed in any release and/or a\n * function can be removed completely.\n */\n 'ɵgetDependenciesFromInjectable': getDependenciesFromInjectable,\n 'ɵgetInjectorProviders': getInjectorProviders,\n 'ɵgetInjectorResolutionPath': getInjectorResolutionPath,\n 'ɵgetInjectorMetadata': getInjectorMetadata,\n 'ɵsetProfiler': setProfiler,\n 'getDirectiveMetadata': getDirectiveMetadata$1,\n 'getComponent': getComponent$1,\n 'getContext': getContext,\n 'getListeners': getListeners,\n 'getOwningComponent': getOwningComponent,\n 'getHostElement': getHostElement,\n 'getInjector': getInjector,\n 'getRootComponents': getRootComponents,\n 'getDirectives': getDirectives,\n 'applyChanges': applyChanges,\n 'isSignal': isSignal\n};\nlet _published = false;\n/**\n * Publishes a collection of default debug tools onto`window.ng`.\n *\n * These functions are available globally when Angular is in development\n * mode and are automatically stripped away from prod mode is on.\n */\nfunction publishDefaultGlobalUtils$1() {\n if (!_published) {\n _published = true;\n if (typeof window !== 'undefined') {\n // Only configure the injector profiler when running in the browser.\n setupFrameworkInjectorProfiler();\n }\n for (const [methodName, method] of Object.entries(globalUtilsFunctions)) {\n publishGlobalUtil(methodName, method);\n }\n }\n}\n/**\n * Publishes the given function to `window.ng` so that it can be\n * used from the browser console when an application is not in production.\n */\nfunction publishGlobalUtil(name, fn) {\n if (typeof COMPILED === 'undefined' || !COMPILED) {\n // Note: we can't export `ng` when using closure enhanced optimization as:\n // - closure declares globals itself for minified names, which sometimes clobber our `ng` global\n // - we can't declare a closure extern as the namespace `ng` is already used within Google\n // for typings for AngularJS (via `goog.provide('ng....')`).\n const w = _global;\n ngDevMode && assertDefined(fn, 'function not defined');\n w[GLOBAL_PUBLISH_EXPANDO_KEY] ??= {};\n w[GLOBAL_PUBLISH_EXPANDO_KEY][name] = fn;\n }\n}\n\n/**\n * Internal injection token that can used to access an instance of a Testability class.\n *\n * This token acts as a bridge between the core bootstrap code and the `Testability` class. This is\n * needed to ensure that there are no direct references to the `Testability` class, so it can be\n * tree-shaken away (if not referenced). For the environments/setups when the `Testability` class\n * should be available, this token is used to add a provider that references the `Testability`\n * class. Otherwise, only this token is retained in a bundle, but the `Testability` class is not.\n */\nconst TESTABILITY = new InjectionToken('');\n/**\n * Internal injection token to retrieve Testability getter class instance.\n */\nconst TESTABILITY_GETTER = new InjectionToken('');\n/**\n * The Testability service provides testing hooks that can be accessed from\n * the browser.\n *\n * Angular applications bootstrapped using an NgModule (via `@NgModule.bootstrap` field) will also\n * instantiate Testability by default (in both development and production modes).\n *\n * For applications bootstrapped using the `bootstrapApplication` function, Testability is not\n * included by default. You can include it into your applications by getting the list of necessary\n * providers using the `provideProtractorTestingSupport()` function and adding them into the\n * `options.providers` array. Example:\n *\n * ```typescript\n * import {provideProtractorTestingSupport} from '@angular/platform-browser';\n *\n * await bootstrapApplication(RootComponent, providers: [provideProtractorTestingSupport()]);\n * ```\n *\n * @publicApi\n */\nclass Testability {\n constructor(_ngZone, registry, testabilityGetter) {\n this._ngZone = _ngZone;\n this.registry = registry;\n this._isZoneStable = true;\n this._callbacks = [];\n this.taskTrackingZone = null;\n // If there was no Testability logic registered in the global scope\n // before, register the current testability getter as a global one.\n if (!_testabilityGetter) {\n setTestabilityGetter(testabilityGetter);\n testabilityGetter.addToWindow(registry);\n }\n this._watchAngularEvents();\n _ngZone.run(() => {\n this.taskTrackingZone = typeof Zone == 'undefined' ? null : Zone.current.get('TaskTrackingZone');\n });\n }\n _watchAngularEvents() {\n this._ngZone.onUnstable.subscribe({\n next: () => {\n this._isZoneStable = false;\n }\n });\n this._ngZone.runOutsideAngular(() => {\n this._ngZone.onStable.subscribe({\n next: () => {\n NgZone.assertNotInAngularZone();\n queueMicrotask(() => {\n this._isZoneStable = true;\n this._runCallbacksIfReady();\n });\n }\n });\n });\n }\n /**\n * Whether an associated application is stable\n */\n isStable() {\n return this._isZoneStable && !this._ngZone.hasPendingMacrotasks;\n }\n _runCallbacksIfReady() {\n if (this.isStable()) {\n // Schedules the call backs in a new frame so that it is always async.\n queueMicrotask(() => {\n while (this._callbacks.length !== 0) {\n let cb = this._callbacks.pop();\n clearTimeout(cb.timeoutId);\n cb.doneCb();\n }\n });\n } else {\n // Still not stable, send updates.\n let pending = this.getPendingTasks();\n this._callbacks = this._callbacks.filter(cb => {\n if (cb.updateCb && cb.updateCb(pending)) {\n clearTimeout(cb.timeoutId);\n return false;\n }\n return true;\n });\n }\n }\n getPendingTasks() {\n if (!this.taskTrackingZone) {\n return [];\n }\n // Copy the tasks data so that we don't leak tasks.\n return this.taskTrackingZone.macroTasks.map(t => {\n return {\n source: t.source,\n // From TaskTrackingZone:\n // https://github.com/angular/zone.js/blob/master/lib/zone-spec/task-tracking.ts#L40\n creationLocation: t.creationLocation,\n data: t.data\n };\n });\n }\n addCallback(cb, timeout, updateCb) {\n let timeoutId = -1;\n if (timeout && timeout > 0) {\n timeoutId = setTimeout(() => {\n this._callbacks = this._callbacks.filter(cb => cb.timeoutId !== timeoutId);\n cb();\n }, timeout);\n }\n this._callbacks.push({\n doneCb: cb,\n timeoutId: timeoutId,\n updateCb: updateCb\n });\n }\n /**\n * Wait for the application to be stable with a timeout. If the timeout is reached before that\n * happens, the callback receives a list of the macro tasks that were pending, otherwise null.\n *\n * @param doneCb The callback to invoke when Angular is stable or the timeout expires\n * whichever comes first.\n * @param timeout Optional. The maximum time to wait for Angular to become stable. If not\n * specified, whenStable() will wait forever.\n * @param updateCb Optional. If specified, this callback will be invoked whenever the set of\n * pending macrotasks changes. If this callback returns true doneCb will not be invoked\n * and no further updates will be issued.\n */\n whenStable(doneCb, timeout, updateCb) {\n if (updateCb && !this.taskTrackingZone) {\n throw new Error('Task tracking zone is required when passing an update callback to ' + 'whenStable(). Is \"zone.js/plugins/task-tracking\" loaded?');\n }\n this.addCallback(doneCb, timeout, updateCb);\n this._runCallbacksIfReady();\n }\n /**\n * Registers an application with a testability hook so that it can be tracked.\n * @param token token of application, root element\n *\n * @internal\n */\n registerApplication(token) {\n this.registry.registerApplication(token, this);\n }\n /**\n * Unregisters an application.\n * @param token token of application, root element\n *\n * @internal\n */\n unregisterApplication(token) {\n this.registry.unregisterApplication(token);\n }\n /**\n * Find providers by name\n * @param using The root element to search from\n * @param provider The name of binding variable\n * @param exactMatch Whether using exactMatch\n */\n findProviders(using, provider, exactMatch) {\n // TODO(juliemr): implement.\n return [];\n }\n static {\n this.ɵfac = function Testability_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || Testability)(ɵɵinject(NgZone), ɵɵinject(TestabilityRegistry), ɵɵinject(TESTABILITY_GETTER));\n };\n }\n static {\n this.ɵprov = /*@__PURE__*/ɵɵdefineInjectable({\n token: Testability,\n factory: Testability.ɵfac\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(Testability, [{\n type: Injectable\n }], () => [{\n type: NgZone\n }, {\n type: TestabilityRegistry\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [TESTABILITY_GETTER]\n }]\n }], null);\n})();\n/**\n * A global registry of {@link Testability} instances for specific elements.\n * @publicApi\n */\nclass TestabilityRegistry {\n constructor() {\n /** @internal */\n this._applications = new Map();\n }\n /**\n * Registers an application with a testability hook so that it can be tracked\n * @param token token of application, root element\n * @param testability Testability hook\n */\n registerApplication(token, testability) {\n this._applications.set(token, testability);\n }\n /**\n * Unregisters an application.\n * @param token token of application, root element\n */\n unregisterApplication(token) {\n this._applications.delete(token);\n }\n /**\n * Unregisters all applications\n */\n unregisterAllApplications() {\n this._applications.clear();\n }\n /**\n * Get a testability hook associated with the application\n * @param elem root element\n */\n getTestability(elem) {\n return this._applications.get(elem) || null;\n }\n /**\n * Get all registered testabilities\n */\n getAllTestabilities() {\n return Array.from(this._applications.values());\n }\n /**\n * Get all registered applications(root elements)\n */\n getAllRootElements() {\n return Array.from(this._applications.keys());\n }\n /**\n * Find testability of a node in the Tree\n * @param elem node\n * @param findInAncestors whether finding testability in ancestors if testability was not found in\n * current node\n */\n findTestabilityInTree(elem, findInAncestors = true) {\n return _testabilityGetter?.findTestabilityInTree(this, elem, findInAncestors) ?? null;\n }\n static {\n this.ɵfac = function TestabilityRegistry_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || TestabilityRegistry)();\n };\n }\n static {\n this.ɵprov = /*@__PURE__*/ɵɵdefineInjectable({\n token: TestabilityRegistry,\n factory: TestabilityRegistry.ɵfac,\n providedIn: 'platform'\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(TestabilityRegistry, [{\n type: Injectable,\n args: [{\n providedIn: 'platform'\n }]\n }], null, null);\n})();\n/**\n * Set the {@link GetTestability} implementation used by the Angular testing framework.\n * @publicApi\n */\nfunction setTestabilityGetter(getter) {\n _testabilityGetter = getter;\n}\nlet _testabilityGetter;\n\n/**\n * Determine if the argument is shaped like a Promise\n */\nfunction isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}\n/**\n * Determine if the argument is a Subscribable\n */\nfunction isSubscribable(obj) {\n return !!obj && typeof obj.subscribe === 'function';\n}\n\n/**\n * A DI token that you can use to provide\n * one or more initialization functions.\n *\n * The provided functions are injected at application startup and executed during\n * app initialization. If any of these functions returns a Promise or an Observable, initialization\n * does not complete until the Promise is resolved or the Observable is completed.\n *\n * You can, for example, create a factory function that loads language data\n * or an external configuration, and provide that function to the `APP_INITIALIZER` token.\n * The function is executed during the application bootstrap process,\n * and the needed data is available on startup.\n *\n * @see {@link ApplicationInitStatus}\n *\n * @usageNotes\n *\n * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token\n * and a function returning a promise.\n * ### Example with NgModule-based application\n * ```\n * function initializeApp(): Promise<any> {\n * return new Promise((resolve, reject) => {\n * // Do some asynchronous stuff\n * resolve();\n * });\n * }\n *\n * @NgModule({\n * imports: [BrowserModule],\n * declarations: [AppComponent],\n * bootstrap: [AppComponent],\n * providers: [{\n * provide: APP_INITIALIZER,\n * useFactory: () => initializeApp,\n * multi: true\n * }]\n * })\n * export class AppModule {}\n * ```\n *\n * ### Example with standalone application\n * ```\n * export function initializeApp(http: HttpClient) {\n * return (): Promise<any> =>\n * firstValueFrom(\n * http\n * .get(\"https://someUrl.com/api/user\")\n * .pipe(tap(user => { ... }))\n * );\n * }\n *\n * bootstrapApplication(App, {\n * providers: [\n * provideHttpClient(),\n * {\n * provide: APP_INITIALIZER,\n * useFactory: initializeApp,\n * multi: true,\n * deps: [HttpClient],\n * },\n * ],\n * });\n\n * ```\n *\n *\n * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function\n * returning an observable, see an example below. Note: the `HttpClient` in this example is used for\n * demo purposes to illustrate how the factory function can work with other providers available\n * through DI.\n *\n * ### Example with NgModule-based application\n * ```\n * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {\n * return () => httpClient.get(\"https://someUrl.com/api/user\")\n * .pipe(\n * tap(user => { ... })\n * );\n * }\n *\n * @NgModule({\n * imports: [BrowserModule, HttpClientModule],\n * declarations: [AppComponent],\n * bootstrap: [AppComponent],\n * providers: [{\n * provide: APP_INITIALIZER,\n * useFactory: initializeAppFactory,\n * deps: [HttpClient],\n * multi: true\n * }]\n * })\n * export class AppModule {}\n * ```\n *\n * ### Example with standalone application\n * ```\n * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {\n * return () => httpClient.get(\"https://someUrl.com/api/user\")\n * .pipe(\n * tap(user => { ... })\n * );\n * }\n *\n * bootstrapApplication(App, {\n * providers: [\n * provideHttpClient(),\n * {\n * provide: APP_INITIALIZER,\n * useFactory: initializeAppFactory,\n * multi: true,\n * deps: [HttpClient],\n * },\n * ],\n * });\n * ```\n *\n * @publicApi\n */\nconst APP_INITIALIZER = new InjectionToken(ngDevMode ? 'Application Initializer' : '');\n/**\n * A class that reflects the state of running {@link APP_INITIALIZER} functions.\n *\n * @publicApi\n */\nclass ApplicationInitStatus {\n constructor() {\n this.initialized = false;\n this.done = false;\n this.donePromise = new Promise((res, rej) => {\n this.resolve = res;\n this.reject = rej;\n });\n this.appInits = inject(APP_INITIALIZER, {\n optional: true\n }) ?? [];\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !Array.isArray(this.appInits)) {\n throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_INITIALIZER` token value ' + `(expected an array, but got ${typeof this.appInits}). ` + 'Please check that the `APP_INITIALIZER` token is configured as a ' + '`multi: true` provider.');\n }\n }\n /** @internal */\n runInitializers() {\n if (this.initialized) {\n return;\n }\n const asyncInitPromises = [];\n for (const appInits of this.appInits) {\n const initResult = appInits();\n if (isPromise(initResult)) {\n asyncInitPromises.push(initResult);\n } else if (isSubscribable(initResult)) {\n const observableAsPromise = new Promise((resolve, reject) => {\n initResult.subscribe({\n complete: resolve,\n error: reject\n });\n });\n asyncInitPromises.push(observableAsPromise);\n }\n }\n const complete = () => {\n // @ts-expect-error overwriting a readonly\n this.done = true;\n this.resolve();\n };\n Promise.all(asyncInitPromises).then(() => {\n complete();\n }).catch(e => {\n this.reject(e);\n });\n if (asyncInitPromises.length === 0) {\n complete();\n }\n this.initialized = true;\n }\n static {\n this.ɵfac = function ApplicationInitStatus_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || ApplicationInitStatus)();\n };\n }\n static {\n this.ɵprov = /*@__PURE__*/ɵɵdefineInjectable({\n token: ApplicationInitStatus,\n factory: ApplicationInitStatus.ɵfac,\n providedIn: 'root'\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], () => [], null);\n})();\n\n/**\n * A DI token that provides a set of callbacks to\n * be called for every component that is bootstrapped.\n *\n * Each callback must take a `ComponentRef` instance and return nothing.\n *\n * `(componentRef: ComponentRef) => void`\n *\n * @publicApi\n */\nconst APP_BOOTSTRAP_LISTENER = new InjectionToken(ngDevMode ? 'appBootstrapListener' : '');\nfunction publishDefaultGlobalUtils() {\n ngDevMode && publishDefaultGlobalUtils$1();\n}\n/**\n * Sets the error for an invalid write to a signal to be an Angular `RuntimeError`.\n */\nfunction publishSignalConfiguration() {\n setThrowInvalidWriteToSignalError$1(() => {\n throw new RuntimeError(600 /* RuntimeErrorCode.SIGNAL_WRITE_FROM_ILLEGAL_CONTEXT */, ngDevMode && 'Writing to signals is not allowed in a `computed` or an `effect` by default. ' + 'Use `allowSignalWrites` in the `CreateEffectOptions` to enable this inside effects.');\n });\n}\nfunction isBoundToModule(cf) {\n return cf.isBoundToModule;\n}\n/**\n * A token for third-party components that can register themselves with NgProbe.\n *\n * @deprecated\n * @publicApi\n */\nclass NgProbeToken {\n constructor(name, token) {\n this.name = name;\n this.token = token;\n }\n}\n/** Maximum number of times ApplicationRef will refresh all attached views in a single tick. */\nconst MAXIMUM_REFRESH_RERUNS = 10;\nfunction _callAndReportToErrorHandler(errorHandler, ngZone, callback) {\n try {\n const result = callback();\n if (isPromise(result)) {\n return result.catch(e => {\n ngZone.runOutsideAngular(() => errorHandler.handleError(e));\n // rethrow as the exception handler might not do it\n throw e;\n });\n }\n return result;\n } catch (e) {\n ngZone.runOutsideAngular(() => errorHandler.handleError(e));\n // rethrow as the exception handler might not do it\n throw e;\n }\n}\nfunction optionsReducer(dst, objs) {\n if (Array.isArray(objs)) {\n return objs.reduce(optionsReducer, dst);\n }\n return {\n ...dst,\n ...objs\n };\n}\n/**\n * A reference to an Angular application running on a page.\n *\n * @usageNotes\n * {@a is-stable-examples}\n * ### isStable examples and caveats\n *\n * Note two important points about `isStable`, demonstrated in the examples below:\n * - the application will never be stable if you start any kind\n * of recurrent asynchronous task when the application starts\n * (for example for a polling process, started with a `setInterval`, a `setTimeout`\n * or using RxJS operators like `interval`);\n * - the `isStable` Observable runs outside of the Angular zone.\n *\n * Let's imagine that you start a recurrent task\n * (here incrementing a counter, using RxJS `interval`),\n * and at the same time subscribe to `isStable`.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * filter(stable => stable)\n * ).subscribe(() => console.log('App is stable now');\n * interval(1000).subscribe(counter => console.log(counter));\n * }\n * ```\n * In this example, `isStable` will never emit `true`,\n * and the trace \"App is stable now\" will never get logged.\n *\n * If you want to execute something when the app is stable,\n * you have to wait for the application to be stable\n * before starting your polling process.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * tap(stable => console.log('App is stable now')),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => console.log(counter));\n * }\n * ```\n * In this example, the trace \"App is stable now\" will be logged\n * and then the counter starts incrementing every second.\n *\n * Note also that this Observable runs outside of the Angular zone,\n * which means that the code in the subscription\n * to this Observable will not trigger the change detection.\n *\n * Let's imagine that instead of logging the counter value,\n * you update a field of your component\n * and display it in its template.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => this.value = counter);\n * }\n * ```\n * As the `isStable` Observable runs outside the zone,\n * the `value` field will be updated properly,\n * but the template will not be refreshed!\n *\n * You'll have to manually trigger the change detection to update the template.\n *\n * ```\n * constructor(appRef: ApplicationRef, cd: ChangeDetectorRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => {\n * this.value = counter;\n * cd.detectChanges();\n * });\n * }\n * ```\n *\n * Or make the subscription callback run inside the zone.\n *\n * ```\n * constructor(appRef: ApplicationRef, zone: NgZone) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => zone.run(() => this.value = counter));\n * }\n * ```\n *\n * @publicApi\n */\nclass ApplicationRef {\n constructor() {\n /** @internal */\n this._bootstrapListeners = [];\n /** @internal */\n this._runningTick = false;\n this._destroyed = false;\n this._destroyListeners = [];\n /** @internal */\n this._views = [];\n this.internalErrorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);\n this.afterRenderManager = inject(AfterRenderManager);\n this.zonelessEnabled = inject(ZONELESS_ENABLED);\n /**\n * Current dirty state of the application across a number of dimensions (views, afterRender hooks,\n * etc).\n *\n * A flag set here means that `tick()` will attempt to resolve the dirtiness when executed.\n *\n * @internal\n */\n this.dirtyFlags = 0 /* ApplicationRefDirtyFlags.None */;\n /**\n * Like `dirtyFlags` but don't cause `tick()` to loop.\n *\n * @internal\n */\n this.deferredDirtyFlags = 0 /* ApplicationRefDirtyFlags.None */;\n // Needed for ComponentFixture temporarily during migration of autoDetect behavior\n // Eventually the hostView of the fixture should just attach to ApplicationRef.\n this.externalTestViews = new Set();\n this.beforeRender = new Subject();\n /** @internal */\n this.afterTick = new Subject();\n /**\n * Get a list of component types registered to this application.\n * This list is populated even before the component is created.\n */\n this.componentTypes = [];\n /**\n * Get a list of components registered to this application.\n */\n this.components = [];\n /**\n * Returns an Observable that indicates when the application is stable or unstable.\n */\n this.isStable = inject(PendingTasks).hasPendingTasks.pipe(map(pending => !pending));\n this._injector = inject(EnvironmentInjector);\n }\n /** @internal */\n get allViews() {\n return [...this.externalTestViews.keys(), ...this._views];\n }\n /**\n * Indicates whether this instance was destroyed.\n */\n get destroyed() {\n return this._destroyed;\n }\n /**\n * @returns A promise that resolves when the application becomes stable\n */\n whenStable() {\n let subscription;\n return new Promise(resolve => {\n subscription = this.isStable.subscribe({\n next: stable => {\n if (stable) {\n resolve();\n }\n }\n });\n }).finally(() => {\n subscription.unsubscribe();\n });\n }\n /**\n * The `EnvironmentInjector` used to create this application.\n */\n get injector() {\n return this._injector;\n }\n /**\n * Bootstrap a component onto the element identified by its selector or, optionally, to a\n * specified element.\n *\n * @usageNotes\n * ### Bootstrap process\n *\n * When bootstrapping a component, Angular mounts it onto a target DOM element\n * and kicks off automatic change detection. The target DOM element can be\n * provided using the `rootSelectorOrNode` argument.\n *\n * If the target DOM element is not provided, Angular tries to find one on a page\n * using the `selector` of the component that is being bootstrapped\n * (first matched element is used).\n *\n * ### Example\n *\n * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,\n * but it requires us to know the component while writing the application code.\n *\n * Imagine a situation where we have to wait for an API call to decide about the component to\n * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to\n * dynamically bootstrap a component.\n *\n * {@example core/ts/platform/platform.ts region='componentSelector'}\n *\n * Optionally, a component can be mounted onto a DOM element that does not match the\n * selector of the bootstrapped component.\n *\n * In the following example, we are providing a CSS selector to match the target element.\n *\n * {@example core/ts/platform/platform.ts region='cssSelector'}\n *\n * While in this example, we are providing reference to a DOM node.\n *\n * {@example core/ts/platform/platform.ts region='domNode'}\n */\n bootstrap(componentOrFactory, rootSelectorOrNode) {\n (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();\n const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;\n const initStatus = this._injector.get(ApplicationInitStatus);\n if (!initStatus.done) {\n const standalone = !isComponentFactory && isStandalone(componentOrFactory);\n const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) && 'Cannot bootstrap as there are still asynchronous initializers running.' + (standalone ? '' : ' Bootstrap components in the `ngDoBootstrap` method of the root module.');\n throw new RuntimeError(405 /* RuntimeErrorCode.ASYNC_INITIALIZERS_STILL_RUNNING */, errorMessage);\n }\n let componentFactory;\n if (isComponentFactory) {\n componentFactory = componentOrFactory;\n } else {\n const resolver = this._injector.get(ComponentFactoryResolver$1);\n componentFactory = resolver.resolveComponentFactory(componentOrFactory);\n }\n this.componentTypes.push(componentFactory.componentType);\n // Create a factory associated with the current module if it's not bound to some other\n const ngModule = isBoundToModule(componentFactory) ? undefined : this._injector.get(NgModuleRef$1);\n const selectorOrNode = rootSelectorOrNode || componentFactory.selector;\n const compRef = componentFactory.create(Injector.NULL, [], selectorOrNode, ngModule);\n const nativeElement = compRef.location.nativeElement;\n const testability = compRef.injector.get(TESTABILITY, null);\n testability?.registerApplication(nativeElement);\n compRef.onDestroy(() => {\n this.detachView(compRef.hostView);\n remove(this.components, compRef);\n testability?.unregisterApplication(nativeElement);\n });\n this._loadComponent(compRef);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const _console = this._injector.get(Console);\n _console.log(`Angular is running in development mode.`);\n }\n return compRef;\n }\n /**\n * Invoke this method to explicitly process change detection and its side-effects.\n *\n * In development mode, `tick()` also performs a second change detection cycle to ensure that no\n * further changes are detected. If additional changes are picked up during this second cycle,\n * bindings in the app have side-effects that cannot be resolved in a single change detection\n * pass.\n * In this case, Angular throws an error, since an Angular application can only have one change\n * detection pass during which all change detection must complete.\n */\n tick() {\n if (!this.zonelessEnabled) {\n this.dirtyFlags |= 1 /* ApplicationRefDirtyFlags.ViewTreeGlobal */;\n }\n this._tick();\n }\n /** @internal */\n _tick() {\n (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();\n if (this._runningTick) {\n throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, ngDevMode && 'ApplicationRef.tick is called recursively');\n }\n const prevConsumer = setActiveConsumer$1(null);\n try {\n this._runningTick = true;\n this.synchronize();\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n for (let view of this._views) {\n view.checkNoChanges();\n }\n }\n } catch (e) {\n // Attention: Don't rethrow as it could cancel subscriptions to Observables!\n this.internalErrorHandler(e);\n } finally {\n this._runningTick = false;\n setActiveConsumer$1(prevConsumer);\n this.afterTick.next();\n }\n }\n /**\n * Performs the core work of synchronizing the application state with the UI, resolving any\n * pending dirtiness (potentially in a loop).\n */\n synchronize() {\n let rendererFactory = null;\n if (!this._injector.destroyed) {\n rendererFactory = this._injector.get(RendererFactory2, null, {\n optional: true\n });\n }\n // When beginning synchronization, all deferred dirtiness becomes active dirtiness.\n this.dirtyFlags |= this.deferredDirtyFlags;\n this.deferredDirtyFlags = 0 /* ApplicationRefDirtyFlags.None */;\n let runs = 0;\n while (this.dirtyFlags !== 0 /* ApplicationRefDirtyFlags.None */ && runs++ < MAXIMUM_REFRESH_RERUNS) {\n this.synchronizeOnce(rendererFactory);\n }\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && runs >= MAXIMUM_REFRESH_RERUNS) {\n throw new RuntimeError(103 /* RuntimeErrorCode.INFINITE_CHANGE_DETECTION */, ngDevMode && 'Infinite change detection while refreshing application views. ' + 'Ensure views are not calling `markForCheck` on every template execution or ' + 'that afterRender hooks always mark views for check.');\n }\n }\n /**\n * Perform a single synchronization pass.\n */\n synchronizeOnce(rendererFactory) {\n // If we happened to loop, deferred dirtiness can be processed as active dirtiness again.\n this.dirtyFlags |= this.deferredDirtyFlags;\n this.deferredDirtyFlags = 0 /* ApplicationRefDirtyFlags.None */;\n // First check dirty views, if there are any.\n if (this.dirtyFlags & 7 /* ApplicationRefDirtyFlags.ViewTreeAny */) {\n // Change detection on views starts in targeted mode (only check components if they're\n // marked as dirty) unless global checking is specifically requested via APIs like\n // `ApplicationRef.tick()` and the `NgZone` integration.\n const useGlobalCheck = Boolean(this.dirtyFlags & 1 /* ApplicationRefDirtyFlags.ViewTreeGlobal */);\n // Clear the view-related dirty flags.\n this.dirtyFlags &= ~7 /* ApplicationRefDirtyFlags.ViewTreeAny */;\n // Set the AfterRender bit, as we're checking views and will need to run afterRender hooks.\n this.dirtyFlags |= 8 /* ApplicationRefDirtyFlags.AfterRender */;\n // Check all potentially dirty views.\n this.beforeRender.next(useGlobalCheck);\n for (let {\n _lView,\n notifyErrorHandler\n } of this._views) {\n detectChangesInViewIfRequired(_lView, notifyErrorHandler, useGlobalCheck, this.zonelessEnabled);\n }\n // If `markForCheck()` was called during view checking, it will have set the `ViewTreeCheck`\n // flag. We clear the flag here because, for backwards compatibility, `markForCheck()`\n // during view checking doesn't cause the view to be re-checked.\n this.dirtyFlags &= ~4 /* ApplicationRefDirtyFlags.ViewTreeCheck */;\n // Check if any views are still dirty after checking and we need to loop back.\n this.syncDirtyFlagsWithViews();\n if (this.dirtyFlags & 7 /* ApplicationRefDirtyFlags.ViewTreeAny */) {\n // If any views are still dirty after checking, loop back before running render hooks.\n return;\n }\n } else {\n // If we skipped refreshing views above, there might still be unflushed animations\n // because we never called `detectChangesInternal` on the views.\n rendererFactory?.begin?.();\n rendererFactory?.end?.();\n }\n // Even if there were no dirty views, afterRender hooks might still be dirty.\n if (this.dirtyFlags & 8 /* ApplicationRefDirtyFlags.AfterRender */) {\n this.dirtyFlags &= ~8 /* ApplicationRefDirtyFlags.AfterRender */;\n this.afterRenderManager.execute();\n // afterRender hooks might influence dirty flags.\n }\n this.syncDirtyFlagsWithViews();\n }\n /**\n * Checks `allViews` for views which require refresh/traversal, and updates `dirtyFlags`\n * accordingly, with two potential behaviors:\n *\n * 1. If any of our views require updating, then this adds the `ViewTreeTraversal` dirty flag.\n * This _should_ be a no-op, since the scheduler should've added the flag at the same time the\n * view was marked as needing updating.\n *\n * TODO(alxhub): figure out if this behavior is still needed for edge cases.\n *\n * 2. If none of our views require updating, then clear the view-related `dirtyFlag`s. This\n * happens when the scheduler is notified of a view becoming dirty, but the view itself isn't\n * reachable through traversal from our roots (e.g. it's detached from the CD tree).\n */\n syncDirtyFlagsWithViews() {\n if (this.allViews.some(({\n _lView\n }) => requiresRefreshOrTraversal(_lView))) {\n // If after running all afterRender callbacks new views are dirty, ensure we loop back.\n this.dirtyFlags |= 2 /* ApplicationRefDirtyFlags.ViewTreeTraversal */;\n return;\n } else {\n // Even though this flag may be set, none of _our_ views require traversal, and so the\n // `ApplicationRef` doesn't require any repeated checking.\n this.dirtyFlags &= ~7 /* ApplicationRefDirtyFlags.ViewTreeAny */;\n }\n }\n /**\n * Attaches a view so that it will be dirty checked.\n * The view will be automatically detached when it is destroyed.\n * This will throw if the view is already attached to a ViewContainer.\n */\n attachView(viewRef) {\n (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();\n const view = viewRef;\n this._views.push(view);\n view.attachToAppRef(this);\n }\n /**\n * Detaches a view from dirty checking again.\n */\n detachView(viewRef) {\n (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();\n const view = viewRef;\n remove(this._views, view);\n view.detachFromAppRef();\n }\n _loadComponent(componentRef) {\n this.attachView(componentRef.hostView);\n this.tick();\n this.components.push(componentRef);\n // Get the listeners lazily to prevent DI cycles.\n const listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, []);\n if (ngDevMode && !Array.isArray(listeners)) {\n throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_BOOTSTRAP_LISTENER` token value ' + `(expected an array, but got ${typeof listeners}). ` + 'Please check that the `APP_BOOTSTRAP_LISTENER` token is configured as a ' + '`multi: true` provider.');\n }\n [...this._bootstrapListeners, ...listeners].forEach(listener => listener(componentRef));\n }\n /** @internal */\n ngOnDestroy() {\n if (this._destroyed) return;\n try {\n // Call all the lifecycle hooks.\n this._destroyListeners.forEach(listener => listener());\n // Destroy all registered views.\n this._views.slice().forEach(view => view.destroy());\n } finally {\n // Indicate that this instance is destroyed.\n this._destroyed = true;\n // Release all references.\n this._views = [];\n this._bootstrapListeners = [];\n this._destroyListeners = [];\n }\n }\n /**\n * Registers a listener to be called when an instance is destroyed.\n *\n * @param callback A callback function to add as a listener.\n * @returns A function which unregisters a listener.\n */\n onDestroy(callback) {\n (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();\n this._destroyListeners.push(callback);\n return () => remove(this._destroyListeners, callback);\n }\n /**\n * Destroys an Angular application represented by this `ApplicationRef`. Calling this function\n * will destroy the associated environment injectors as well as all the bootstrapped components\n * with their views.\n */\n destroy() {\n if (this._destroyed) {\n throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');\n }\n const injector = this._injector;\n // Check that this injector instance supports destroy operation.\n if (injector.destroy && !injector.destroyed) {\n // Destroying an underlying injector will trigger the `ngOnDestroy` lifecycle\n // hook, which invokes the remaining cleanup actions.\n injector.destroy();\n }\n }\n /**\n * Returns the number of attached views.\n */\n get viewCount() {\n return this._views.length;\n }\n warnIfDestroyed() {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && this._destroyed) {\n console.warn(formatRuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));\n }\n }\n static {\n this.ɵfac = function ApplicationRef_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || ApplicationRef)();\n };\n }\n static {\n this.ɵprov = /*@__PURE__*/ɵɵdefineInjectable({\n token: ApplicationRef,\n factory: ApplicationRef.ɵfac,\n providedIn: 'root'\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ApplicationRef, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], null, null);\n})();\nfunction remove(list, el) {\n const index = list.indexOf(el);\n if (index > -1) {\n list.splice(index, 1);\n }\n}\nlet whenStableStore;\n/**\n * Returns a Promise that resolves when the application becomes stable after this method is called\n * the first time.\n */\nfunction whenStable(applicationRef) {\n whenStableStore ??= new WeakMap();\n const cachedWhenStable = whenStableStore.get(applicationRef);\n if (cachedWhenStable) {\n return cachedWhenStable;\n }\n const whenStablePromise = applicationRef.isStable.pipe(first(isStable => isStable)).toPromise().then(() => void 0);\n whenStableStore.set(applicationRef, whenStablePromise);\n // Be a good citizen and clean the store `onDestroy` even though we are using `WeakMap`.\n applicationRef.onDestroy(() => whenStableStore?.delete(applicationRef));\n return whenStablePromise;\n}\nfunction detectChangesInViewIfRequired(lView, notifyErrorHandler, isFirstPass, zonelessEnabled) {\n // When re-checking, only check views which actually need it.\n if (!isFirstPass && !requiresRefreshOrTraversal(lView)) {\n return;\n }\n const mode = isFirstPass && !zonelessEnabled ?\n // The first pass is always in Global mode, which includes `CheckAlways` views.\n 0 /* ChangeDetectionMode.Global */ :\n // Only refresh views with the `RefreshView` flag or views is a changed signal\n 1 /* ChangeDetectionMode.Targeted */;\n detectChangesInternal(lView, notifyErrorHandler, mode);\n}\n\n/**\n * Combination of NgModuleFactory and ComponentFactories.\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n */\nclass ModuleWithComponentFactories {\n constructor(ngModuleFactory, componentFactories) {\n this.ngModuleFactory = ngModuleFactory;\n this.componentFactories = componentFactories;\n }\n}\n/**\n * Low-level service for running the angular compiler during runtime\n * to create {@link ComponentFactory}s, which\n * can later be used to create and render a Component instance.\n *\n * Each `@NgModule` provides an own `Compiler` to its injector,\n * that will use the directives/pipes of the ng module for compilation\n * of components.\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n */\nclass Compiler {\n /**\n * Compiles the given NgModule and all of its components. All templates of the components\n * have to be inlined.\n */\n compileModuleSync(moduleType) {\n return new NgModuleFactory(moduleType);\n }\n /**\n * Compiles the given NgModule and all of its components\n */\n compileModuleAsync(moduleType) {\n return Promise.resolve(this.compileModuleSync(moduleType));\n }\n /**\n * Same as {@link Compiler#compileModuleSync compileModuleSync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsSync(moduleType) {\n const ngModuleFactory = this.compileModuleSync(moduleType);\n const moduleDef = getNgModuleDef(moduleType);\n const componentFactories = maybeUnwrapFn(moduleDef.declarations).reduce((factories, declaration) => {\n const componentDef = getComponentDef(declaration);\n componentDef && factories.push(new ComponentFactory(componentDef));\n return factories;\n }, []);\n return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);\n }\n /**\n * Same as {@link Compiler#compileModuleAsync compileModuleAsync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsAsync(moduleType) {\n return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));\n }\n /**\n * Clears all caches.\n */\n clearCache() {}\n /**\n * Clears the cache for the given component/ngModule.\n */\n clearCacheFor(type) {}\n /**\n * Returns the id for a given NgModule, if one is defined and known to the compiler.\n */\n getModuleId(moduleType) {\n return undefined;\n }\n static {\n this.ɵfac = function Compiler_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || Compiler)();\n };\n }\n static {\n this.ɵprov = /*@__PURE__*/ɵɵdefineInjectable({\n token: Compiler,\n factory: Compiler.ɵfac,\n providedIn: 'root'\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(Compiler, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], null, null);\n})();\n/**\n * Token to provide CompilerOptions in the platform injector.\n *\n * @publicApi\n */\nconst COMPILER_OPTIONS = new InjectionToken(ngDevMode ? 'compilerOptions' : '');\n/**\n * A factory for creating a Compiler\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n */\nclass CompilerFactory {}\nfunction compileNgModuleFactory(injector, options, moduleType) {\n ngDevMode && assertNgModuleType(moduleType);\n const moduleFactory = new NgModuleFactory(moduleType);\n // All of the logic below is irrelevant for AOT-compiled code.\n if (typeof ngJitMode !== 'undefined' && !ngJitMode) {\n return Promise.resolve(moduleFactory);\n }\n const compilerOptions = injector.get(COMPILER_OPTIONS, []).concat(options);\n // Configure the compiler to use the provided options. This call may fail when multiple modules\n // are bootstrapped with incompatible options, as a component can only be compiled according to\n // a single set of options.\n setJitOptions({\n defaultEncapsulation: _lastDefined(compilerOptions.map(opts => opts.defaultEncapsulation)),\n preserveWhitespaces: _lastDefined(compilerOptions.map(opts => opts.preserveWhitespaces))\n });\n if (isComponentResourceResolutionQueueEmpty()) {\n return Promise.resolve(moduleFactory);\n }\n const compilerProviders = compilerOptions.flatMap(option => option.providers ?? []);\n // In case there are no compiler providers, we just return the module factory as\n // there won't be any resource loader. This can happen with Ivy, because AOT compiled\n // modules can be still passed through \"bootstrapModule\". In that case we shouldn't\n // unnecessarily require the JIT compiler.\n if (compilerProviders.length === 0) {\n return Promise.resolve(moduleFactory);\n }\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'NgModule',\n type: moduleType\n });\n const compilerInjector = Injector.create({\n providers: compilerProviders\n });\n const resourceLoader = compilerInjector.get(compiler.ResourceLoader);\n // The resource loader can also return a string while the \"resolveComponentResources\"\n // always expects a promise. Therefore we need to wrap the returned value in a promise.\n return resolveComponentResources(url => Promise.resolve(resourceLoader.get(url))).then(() => moduleFactory);\n}\nfunction _lastDefined(args) {\n for (let i = args.length - 1; i >= 0; i--) {\n if (args[i] !== undefined) {\n return args[i];\n }\n }\n return undefined;\n}\nclass NgZoneChangeDetectionScheduler {\n constructor() {\n this.zone = inject(NgZone);\n this.changeDetectionScheduler = inject(ChangeDetectionScheduler);\n this.applicationRef = inject(ApplicationRef);\n }\n initialize() {\n if (this._onMicrotaskEmptySubscription) {\n return;\n }\n this._onMicrotaskEmptySubscription = this.zone.onMicrotaskEmpty.subscribe({\n next: () => {\n // `onMicroTaskEmpty` can happen _during_ the zoneless scheduler change detection because\n // zone.run(() => {}) will result in `checkStable` at the end of the `zone.run` closure\n // and emit `onMicrotaskEmpty` synchronously if run coalsecing is false.\n if (this.changeDetectionScheduler.runningTick) {\n return;\n }\n this.zone.run(() => {\n this.applicationRef.tick();\n });\n }\n });\n }\n ngOnDestroy() {\n this._onMicrotaskEmptySubscription?.unsubscribe();\n }\n static {\n this.ɵfac = function NgZoneChangeDetectionScheduler_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgZoneChangeDetectionScheduler)();\n };\n }\n static {\n this.ɵprov = /*@__PURE__*/ɵɵdefineInjectable({\n token: NgZoneChangeDetectionScheduler,\n factory: NgZoneChangeDetectionScheduler.ɵfac,\n providedIn: 'root'\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(NgZoneChangeDetectionScheduler, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], null, null);\n})();\n/**\n * Internal token used to verify that `provideZoneChangeDetection` is not used\n * with the bootstrapModule API.\n */\nconst PROVIDED_NG_ZONE = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'provideZoneChangeDetection token' : '', {\n factory: () => false\n});\nfunction internalProvideZoneChangeDetection({\n ngZoneFactory,\n ignoreChangesOutsideZone,\n scheduleInRootZone\n}) {\n ngZoneFactory ??= () => new NgZone({\n ...getNgZoneOptions(),\n scheduleInRootZone\n });\n return [{\n provide: NgZone,\n useFactory: ngZoneFactory\n }, {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory: () => {\n const ngZoneChangeDetectionScheduler = inject(NgZoneChangeDetectionScheduler, {\n optional: true\n });\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && ngZoneChangeDetectionScheduler === null) {\n throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, `A required Injectable was not found in the dependency injection tree. ` + 'If you are bootstrapping an NgModule, make sure that the `BrowserModule` is imported.');\n }\n return () => ngZoneChangeDetectionScheduler.initialize();\n }\n }, {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory: () => {\n const service = inject(ZoneStablePendingTask);\n return () => {\n service.initialize();\n };\n }\n },\n // Always disable scheduler whenever explicitly disabled, even if another place called\n // `provideZoneChangeDetection` without the 'ignore' option.\n ignoreChangesOutsideZone === true ? {\n provide: ZONELESS_SCHEDULER_DISABLED,\n useValue: true\n } : [], {\n provide: SCHEDULE_IN_ROOT_ZONE,\n useValue: scheduleInRootZone ?? SCHEDULE_IN_ROOT_ZONE_DEFAULT\n }];\n}\n/**\n * Provides `NgZone`-based change detection for the application bootstrapped using\n * `bootstrapApplication`.\n *\n * `NgZone` is already provided in applications by default. This provider allows you to configure\n * options like `eventCoalescing` in the `NgZone`.\n * This provider is not available for `platformBrowser().bootstrapModule`, which uses\n * `BootstrapOptions` instead.\n *\n * @usageNotes\n * ```typescript\n * bootstrapApplication(MyApp, {providers: [\n * provideZoneChangeDetection({eventCoalescing: true}),\n * ]});\n * ```\n *\n * @publicApi\n * @see {@link bootstrapApplication}\n * @see {@link NgZoneOptions}\n */\nfunction provideZoneChangeDetection(options) {\n const ignoreChangesOutsideZone = options?.ignoreChangesOutsideZone;\n const scheduleInRootZone = options?.scheduleInRootZone;\n const zoneProviders = internalProvideZoneChangeDetection({\n ngZoneFactory: () => {\n const ngZoneOptions = getNgZoneOptions(options);\n ngZoneOptions.scheduleInRootZone = scheduleInRootZone;\n if (ngZoneOptions.shouldCoalesceEventChangeDetection) {\n performanceMarkFeature('NgZone_CoalesceEvent');\n }\n return new NgZone(ngZoneOptions);\n },\n ignoreChangesOutsideZone,\n scheduleInRootZone\n });\n return makeEnvironmentProviders([{\n provide: PROVIDED_NG_ZONE,\n useValue: true\n }, {\n provide: ZONELESS_ENABLED,\n useValue: false\n }, zoneProviders]);\n}\n// Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->\n// `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in\n// a set of default options returned.\nfunction getNgZoneOptions(options) {\n return {\n enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,\n shouldCoalesceEventChangeDetection: options?.eventCoalescing ?? false,\n shouldCoalesceRunChangeDetection: options?.runCoalescing ?? false\n };\n}\nclass ZoneStablePendingTask {\n constructor() {\n this.subscription = new Subscription();\n this.initialized = false;\n this.zone = inject(NgZone);\n this.pendingTasks = inject(PendingTasks);\n }\n initialize() {\n if (this.initialized) {\n return;\n }\n this.initialized = true;\n let task = null;\n if (!this.zone.isStable && !this.zone.hasPendingMacrotasks && !this.zone.hasPendingMicrotasks) {\n task = this.pendingTasks.add();\n }\n this.zone.runOutsideAngular(() => {\n this.subscription.add(this.zone.onStable.subscribe(() => {\n NgZone.assertNotInAngularZone();\n // Check whether there are no pending macro/micro tasks in the next tick\n // to allow for NgZone to update the state.\n queueMicrotask(() => {\n if (task !== null && !this.zone.hasPendingMacrotasks && !this.zone.hasPendingMicrotasks) {\n this.pendingTasks.remove(task);\n task = null;\n }\n });\n }));\n });\n this.subscription.add(this.zone.onUnstable.subscribe(() => {\n NgZone.assertInAngularZone();\n task ??= this.pendingTasks.add();\n }));\n }\n ngOnDestroy() {\n this.subscription.unsubscribe();\n }\n static {\n this.ɵfac = function ZoneStablePendingTask_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || ZoneStablePendingTask)();\n };\n }\n static {\n this.ɵprov = /*@__PURE__*/ɵɵdefineInjectable({\n token: ZoneStablePendingTask,\n factory: ZoneStablePendingTask.ɵfac,\n providedIn: 'root'\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ZoneStablePendingTask, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], null, null);\n})();\nconst CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT = 100;\nlet consecutiveMicrotaskNotifications = 0;\nlet stackFromLastFewNotifications = [];\nfunction trackMicrotaskNotificationForDebugging() {\n consecutiveMicrotaskNotifications++;\n if (CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT - consecutiveMicrotaskNotifications < 5) {\n const stack = new Error().stack;\n if (stack) {\n stackFromLastFewNotifications.push(stack);\n }\n }\n if (consecutiveMicrotaskNotifications === CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT) {\n throw new RuntimeError(103 /* RuntimeErrorCode.INFINITE_CHANGE_DETECTION */, 'Angular could not stabilize because there were endless change notifications within the browser event loop. ' + 'The stack from the last several notifications: \\n' + stackFromLastFewNotifications.join('\\n'));\n }\n}\nclass ChangeDetectionSchedulerImpl {\n constructor() {\n this.appRef = inject(ApplicationRef);\n this.taskService = inject(PendingTasks);\n this.ngZone = inject(NgZone);\n this.zonelessEnabled = inject(ZONELESS_ENABLED);\n this.disableScheduling = inject(ZONELESS_SCHEDULER_DISABLED, {\n optional: true\n }) ?? false;\n this.zoneIsDefined = typeof Zone !== 'undefined' && !!Zone.root.run;\n this.schedulerTickApplyArgs = [{\n data: {\n '__scheduler_tick__': true\n }\n }];\n this.subscriptions = new Subscription();\n this.angularZoneId = this.zoneIsDefined ? this.ngZone._inner?.get(angularZoneInstanceIdProperty) : null;\n this.scheduleInRootZone = !this.zonelessEnabled && this.zoneIsDefined && (inject(SCHEDULE_IN_ROOT_ZONE, {\n optional: true\n }) ?? false);\n this.cancelScheduledCallback = null;\n this.useMicrotaskScheduler = false;\n this.runningTick = false;\n this.pendingRenderTaskId = null;\n this.subscriptions.add(this.appRef.afterTick.subscribe(() => {\n // If the scheduler isn't running a tick but the application ticked, that means\n // someone called ApplicationRef.tick manually. In this case, we should cancel\n // any change detections that had been scheduled so we don't run an extra one.\n if (!this.runningTick) {\n this.cleanup();\n }\n }));\n this.subscriptions.add(this.ngZone.onUnstable.subscribe(() => {\n // If the zone becomes unstable when we're not running tick (this happens from the zone.run),\n // we should cancel any scheduled change detection here because at this point we\n // know that the zone will stabilize at some point and run change detection itself.\n if (!this.runningTick) {\n this.cleanup();\n }\n }));\n // TODO(atscott): These conditions will need to change when zoneless is the default\n // Instead, they should flip to checking if ZoneJS scheduling is provided\n this.disableScheduling ||= !this.zonelessEnabled && (\n // NoopNgZone without enabling zoneless means no scheduling whatsoever\n this.ngZone instanceof NoopNgZone ||\n // The same goes for the lack of Zone without enabling zoneless scheduling\n !this.zoneIsDefined);\n }\n notify(source) {\n if (!this.zonelessEnabled && source === 5 /* NotificationSource.Listener */) {\n // When the notification comes from a listener, we skip the notification unless the\n // application has enabled zoneless. Ideally, listeners wouldn't notify the scheduler at all\n // automatically. We do not know that a developer made a change in the listener callback that\n // requires an `ApplicationRef.tick` (synchronize templates / run render hooks). We do this\n // only for an easier migration from OnPush components to zoneless. Because listeners are\n // usually executed inside the Angular zone and listeners automatically call `markViewDirty`,\n // developers never needed to manually use `ChangeDetectorRef.markForCheck` or some other API\n // to make listener callbacks work correctly with `OnPush` components.\n return;\n }\n switch (source) {\n case 0 /* NotificationSource.MarkAncestorsForTraversal */:\n {\n this.appRef.dirtyFlags |= 2 /* ApplicationRefDirtyFlags.ViewTreeTraversal */;\n break;\n }\n case 3 /* NotificationSource.DebugApplyChanges */:\n case 2 /* NotificationSource.DeferBlockStateUpdate */:\n case 4 /* NotificationSource.MarkForCheck */:\n case 5 /* NotificationSource.Listener */:\n case 1 /* NotificationSource.SetInput */:\n {\n this.appRef.dirtyFlags |= 4 /* ApplicationRefDirtyFlags.ViewTreeCheck */;\n break;\n }\n case 7 /* NotificationSource.DeferredRenderHook */:\n {\n // Render hooks are \"deferred\" when they're triggered from other render hooks. Using the\n // deferred dirty flags ensures that adding new hooks doesn't automatically trigger a loop\n // inside tick().\n this.appRef.deferredDirtyFlags |= 8 /* ApplicationRefDirtyFlags.AfterRender */;\n break;\n }\n case 9 /* NotificationSource.ViewDetachedFromDOM */:\n case 8 /* NotificationSource.ViewAttached */:\n case 6 /* NotificationSource.RenderHook */:\n case 10 /* NotificationSource.AsyncAnimationsLoaded */:\n default:\n {\n // These notifications only schedule a tick but do not change whether we should refresh\n // views. Instead, we only need to run render hooks unless another notification from the\n // other set is also received before `tick` happens.\n this.appRef.dirtyFlags |= 8 /* ApplicationRefDirtyFlags.AfterRender */;\n }\n }\n if (!this.shouldScheduleTick()) {\n return;\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (this.useMicrotaskScheduler) {\n trackMicrotaskNotificationForDebugging();\n } else {\n consecutiveMicrotaskNotifications = 0;\n stackFromLastFewNotifications.length = 0;\n }\n }\n const scheduleCallback = this.useMicrotaskScheduler ? scheduleCallbackWithMicrotask : scheduleCallbackWithRafRace;\n this.pendingRenderTaskId = this.taskService.add();\n if (this.scheduleInRootZone) {\n this.cancelScheduledCallback = Zone.root.run(() => scheduleCallback(() => this.tick()));\n } else {\n this.cancelScheduledCallback = this.ngZone.runOutsideAngular(() => scheduleCallback(() => this.tick()));\n }\n }\n shouldScheduleTick() {\n if (this.disableScheduling) {\n return false;\n }\n // already scheduled or running\n if (this.pendingRenderTaskId !== null || this.runningTick || this.appRef._runningTick) {\n return false;\n }\n // If we're inside the zone don't bother with scheduler. Zone will stabilize\n // eventually and run change detection.\n if (!this.zonelessEnabled && this.zoneIsDefined && Zone.current.get(angularZoneInstanceIdProperty + this.angularZoneId)) {\n return false;\n }\n return true;\n }\n /**\n * Calls ApplicationRef._tick inside the `NgZone`.\n *\n * Calling `tick` directly runs change detection and cancels any change detection that had been\n * scheduled previously.\n *\n * @param shouldRefreshViews Passed directly to `ApplicationRef._tick` and skips straight to\n * render hooks when `false`.\n */\n tick() {\n // When ngZone.run below exits, onMicrotaskEmpty may emit if the zone is\n // stable. We want to prevent double ticking so we track whether the tick is\n // already running and skip it if so.\n if (this.runningTick || this.appRef.destroyed) {\n return;\n }\n // The scheduler used to pass \"whether to check views\" as a boolean flag instead of setting\n // fine-grained dirtiness flags, and global checking was always used on the first pass. This\n // created an interesting edge case: if a notification made a view dirty and then ticked via the\n // scheduler (and not the zone) a global check was still performed.\n //\n // Ideally, this would not be the case, and only zone-based ticks would do global passes.\n // However this is a breaking change and requires fixes in g3. Until this cleanup can be done,\n // we add the `ViewTreeGlobal` flag to request a global check if any views are dirty in a\n // scheduled tick (unless zoneless is enabled, in which case global checks aren't really a\n // thing).\n //\n // TODO(alxhub): clean up and remove this workaround as a breaking change.\n if (!this.zonelessEnabled && this.appRef.dirtyFlags & 7 /* ApplicationRefDirtyFlags.ViewTreeAny */) {\n this.appRef.dirtyFlags |= 1 /* ApplicationRefDirtyFlags.ViewTreeGlobal */;\n }\n const task = this.taskService.add();\n try {\n this.ngZone.run(() => {\n this.runningTick = true;\n this.appRef._tick();\n }, undefined, this.schedulerTickApplyArgs);\n } catch (e) {\n this.taskService.remove(task);\n throw e;\n } finally {\n this.cleanup();\n }\n // If we're notified of a change within 1 microtask of running change\n // detection, run another round in the same event loop. This allows code\n // which uses Promise.resolve (see NgModel) to avoid\n // ExpressionChanged...Error to still be reflected in a single browser\n // paint, even if that spans multiple rounds of change detection.\n this.useMicrotaskScheduler = true;\n scheduleCallbackWithMicrotask(() => {\n this.useMicrotaskScheduler = false;\n this.taskService.remove(task);\n });\n }\n ngOnDestroy() {\n this.subscriptions.unsubscribe();\n this.cleanup();\n }\n cleanup() {\n this.runningTick = false;\n this.cancelScheduledCallback?.();\n this.cancelScheduledCallback = null;\n // If this is the last task, the service will synchronously emit a stable\n // notification. If there is a subscriber that then acts in a way that\n // tries to notify the scheduler again, we need to be able to respond to\n // schedule a new change detection. Therefore, we should clear the task ID\n // before removing it from the pending tasks (or the tasks service should\n // not synchronously emit stable, similar to how Zone stableness only\n // happens if it's still stable after a microtask).\n if (this.pendingRenderTaskId !== null) {\n const taskId = this.pendingRenderTaskId;\n this.pendingRenderTaskId = null;\n this.taskService.remove(taskId);\n }\n }\n static {\n this.ɵfac = function ChangeDetectionSchedulerImpl_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || ChangeDetectionSchedulerImpl)();\n };\n }\n static {\n this.ɵprov = /*@__PURE__*/ɵɵdefineInjectable({\n token: ChangeDetectionSchedulerImpl,\n factory: ChangeDetectionSchedulerImpl.ɵfac,\n providedIn: 'root'\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ChangeDetectionSchedulerImpl, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], () => [], null);\n})();\n/**\n * Provides change detection without ZoneJS for the application bootstrapped using\n * `bootstrapApplication`.\n *\n * This function allows you to configure the application to not use the state/state changes of\n * ZoneJS to schedule change detection in the application. This will work when ZoneJS is not present\n * on the page at all or if it exists because something else is using it (either another Angular\n * application which uses ZoneJS for scheduling or some other library that relies on ZoneJS).\n *\n * This can also be added to the `TestBed` providers to configure the test environment to more\n * closely match production behavior. This will help give higher confidence that components are\n * compatible with zoneless change detection.\n *\n * ZoneJS uses browser events to trigger change detection. When using this provider, Angular will\n * instead use Angular APIs to schedule change detection. These APIs include:\n *\n * - `ChangeDetectorRef.markForCheck`\n * - `ComponentRef.setInput`\n * - updating a signal that is read in a template\n * - when bound host or template listeners are triggered\n * - attaching a view that was marked dirty by one of the above\n * - removing a view\n * - registering a render hook (templates are only refreshed if render hooks do one of the above)\n *\n * @usageNotes\n * ```typescript\n * bootstrapApplication(MyApp, {providers: [\n * provideExperimentalZonelessChangeDetection(),\n * ]});\n * ```\n *\n * This API is experimental. Neither the shape, nor the underlying behavior is stable and can change\n * in patch versions. There are known feature gaps and API ergonomic considerations. We will iterate\n * on the exact API based on the feedback and our understanding of the problem and solution space.\n *\n * @publicApi\n * @experimental\n * @see [bootstrapApplication](/api/platform-browser/bootstrapApplication)\n */\nfunction provideExperimentalZonelessChangeDetection() {\n performanceMarkFeature('NgZoneless');\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && typeof Zone !== 'undefined' && Zone) {\n const message = formatRuntimeError(914 /* RuntimeErrorCode.UNEXPECTED_ZONEJS_PRESENT_IN_ZONELESS_MODE */, `The application is using zoneless change detection, but is still loading Zone.js. ` + `Consider removing Zone.js to get the full benefits of zoneless. ` + `In applications using the Angular CLI, Zone.js is typically included in the \"polyfills\" section of the angular.json file.`);\n console.warn(message);\n }\n return makeEnvironmentProviders([{\n provide: ChangeDetectionScheduler,\n useExisting: ChangeDetectionSchedulerImpl\n }, {\n provide: NgZone,\n useClass: NoopNgZone\n }, {\n provide: ZONELESS_ENABLED,\n useValue: true\n }, {\n provide: SCHEDULE_IN_ROOT_ZONE,\n useValue: false\n }, typeof ngDevMode === 'undefined' || ngDevMode ? [{\n provide: PROVIDED_ZONELESS,\n useValue: true\n }] : []]);\n}\n\n/**\n * Work out the locale from the potential global properties.\n *\n * * Closure Compiler: use `goog.LOCALE`.\n * * Ivy enabled: use `$localize.locale`\n */\nfunction getGlobalLocale() {\n if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode && typeof goog !== 'undefined' && goog.LOCALE !== 'en') {\n // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.\n // * In order to preserve backwards compatibility, we use Angular default value over\n // Closure Compiler's one.\n return goog.LOCALE;\n } else {\n // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE\n // COMPILE-TIME INLINER.\n //\n // * During compile time inlining of translations the expression will be replaced\n // with a string literal that is the current locale. Other forms of this expression are not\n // guaranteed to be replaced.\n //\n // * During runtime translation evaluation, the developer is required to set `$localize.locale`\n // if required, or just to provide their own `LOCALE_ID` provider.\n return typeof $localize !== 'undefined' && $localize.locale || DEFAULT_LOCALE_ID;\n }\n}\n/**\n * Provide this token to set the locale of your application.\n * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,\n * DecimalPipe and PercentPipe) and by ICU expressions.\n *\n * See the [i18n guide](guide/i18n/locale-id) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { LOCALE_ID } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]\n * });\n * ```\n *\n * @publicApi\n */\nconst LOCALE_ID = new InjectionToken(ngDevMode ? 'LocaleId' : '', {\n providedIn: 'root',\n factory: () => inject(LOCALE_ID, InjectFlags.Optional | InjectFlags.SkipSelf) || getGlobalLocale()\n});\n/**\n * Provide this token to set the default currency code your application uses for\n * CurrencyPipe when there is no currency code passed into it. This is only used by\n * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.\n *\n * See the [i18n guide](guide/i18n/locale-id) for more information.\n *\n * <div class=\"alert is-helpful\">\n *\n * **Deprecation notice:**\n *\n * The default currency code is currently always `USD` but this is deprecated from v9.\n *\n * **In v10 the default currency code will be taken from the current locale.**\n *\n * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in\n * your application `NgModule`:\n *\n * ```ts\n * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}\n * ```\n *\n * </div>\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]\n * });\n * ```\n *\n * @publicApi\n */\nconst DEFAULT_CURRENCY_CODE = new InjectionToken(ngDevMode ? 'DefaultCurrencyCode' : '', {\n providedIn: 'root',\n factory: () => USD_CURRENCY_CODE\n});\n/**\n * Use this token at bootstrap to provide the content of your translation file (`xtb`,\n * `xlf` or `xlf2`) when you want to translate your application in another language.\n *\n * See the [i18n guide](guide/i18n/merge) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { TRANSLATIONS } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * // content of your translation file\n * const translations = '....';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS, useValue: translations }]\n * });\n * ```\n *\n * @publicApi\n */\nconst TRANSLATIONS = new InjectionToken(ngDevMode ? 'Translations' : '');\n/**\n * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,\n * `xlf` or `xlf2`.\n *\n * See the [i18n guide](guide/i18n/merge) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { TRANSLATIONS_FORMAT } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]\n * });\n * ```\n *\n * @publicApi\n */\nconst TRANSLATIONS_FORMAT = new InjectionToken(ngDevMode ? 'TranslationsFormat' : '');\n/**\n * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy\n * that the compiler should use in case of missing translations:\n * - Error: throw if you have missing translations.\n * - Warning (default): show a warning in the console and/or shell.\n * - Ignore: do nothing.\n *\n * See the [i18n guide](guide/i18n/merge#report-missing-translations) for more information.\n *\n * @usageNotes\n * ### Example\n * ```typescript\n * import { MissingTranslationStrategy } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * missingTranslation: MissingTranslationStrategy.Error\n * });\n * ```\n *\n * @publicApi\n */\nvar MissingTranslationStrategy;\n(function (MissingTranslationStrategy) {\n MissingTranslationStrategy[MissingTranslationStrategy[\"Error\"] = 0] = \"Error\";\n MissingTranslationStrategy[MissingTranslationStrategy[\"Warning\"] = 1] = \"Warning\";\n MissingTranslationStrategy[MissingTranslationStrategy[\"Ignore\"] = 2] = \"Ignore\";\n})(MissingTranslationStrategy || (MissingTranslationStrategy = {}));\n\n// A delay in milliseconds before the scan is run after onLoad, to avoid any\n// potential race conditions with other LCP-related functions. This delay\n// happens outside of the main JavaScript execution and will only effect the timing\n// on when the warning becomes visible in the console.\nconst SCAN_DELAY = 200;\nconst OVERSIZED_IMAGE_TOLERANCE = 1200;\nclass ImagePerformanceWarning {\n constructor() {\n // Map of full image URLs -> original `ngSrc` values.\n this.window = null;\n this.observer = null;\n this.options = inject(IMAGE_CONFIG);\n this.isBrowser = inject(PLATFORM_ID) === 'browser';\n }\n start() {\n if (!this.isBrowser || typeof PerformanceObserver === 'undefined' || this.options?.disableImageSizeWarning && this.options?.disableImageLazyLoadWarning) {\n return;\n }\n this.observer = this.initPerformanceObserver();\n const doc = getDocument();\n const win = doc.defaultView;\n if (typeof win !== 'undefined') {\n this.window = win;\n // Wait to avoid race conditions where LCP image triggers\n // load event before it's recorded by the performance observer\n const waitToScan = () => {\n setTimeout(this.scanImages.bind(this), SCAN_DELAY);\n };\n const setup = () => {\n // Consider the case when the application is created and destroyed multiple times.\n // Typically, applications are created instantly once the page is loaded, and the\n // `window.load` listener is always triggered. However, the `window.load` event will never\n // be fired if the page is loaded, and the application is created later. Checking for\n // `readyState` is the easiest way to determine whether the page has been loaded or not.\n if (doc.readyState === 'complete') {\n waitToScan();\n } else {\n this.window?.addEventListener('load', waitToScan, {\n once: true\n });\n }\n };\n // Angular doesn't have to run change detection whenever any asynchronous tasks are invoked in\n // the scope of this functionality.\n if (typeof Zone !== 'undefined') {\n Zone.root.run(() => setup());\n } else {\n setup();\n }\n }\n }\n ngOnDestroy() {\n this.observer?.disconnect();\n }\n initPerformanceObserver() {\n if (typeof PerformanceObserver === 'undefined') {\n return null;\n }\n const observer = new PerformanceObserver(entryList => {\n const entries = entryList.getEntries();\n if (entries.length === 0) return;\n // We use the latest entry produced by the `PerformanceObserver` as the best\n // signal on which element is actually an LCP one. As an example, the first image to load on\n // a page, by virtue of being the only thing on the page so far, is often a LCP candidate\n // and gets reported by PerformanceObserver, but isn't necessarily the LCP element.\n const lcpElement = entries[entries.length - 1];\n // Cast to `any` due to missing `element` on the `LargestContentfulPaint` type of entry.\n // See https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint\n const imgSrc = lcpElement.element?.src ?? '';\n // Exclude `data:` and `blob:` URLs, since they are fetched resources.\n if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:')) return;\n this.lcpImageUrl = imgSrc;\n });\n observer.observe({\n type: 'largest-contentful-paint',\n buffered: true\n });\n return observer;\n }\n scanImages() {\n const images = getDocument().querySelectorAll('img');\n let lcpElementFound,\n lcpElementLoadedCorrectly = false;\n images.forEach(image => {\n if (!this.options?.disableImageSizeWarning) {\n // Image elements using the NgOptimizedImage directive are excluded,\n // as that directive has its own version of this check.\n if (!image.getAttribute('ng-img') && this.isOversized(image)) {\n logOversizedImageWarning(image.src);\n }\n }\n if (!this.options?.disableImageLazyLoadWarning && this.lcpImageUrl) {\n if (image.src === this.lcpImageUrl) {\n lcpElementFound = true;\n if (image.loading !== 'lazy' || image.getAttribute('ng-img')) {\n // This variable is set to true and never goes back to false to account\n // for the case where multiple images have the same src url, and some\n // have lazy loading while others don't.\n // Also ignore NgOptimizedImage because there's a different warning for that.\n lcpElementLoadedCorrectly = true;\n }\n }\n }\n });\n if (lcpElementFound && !lcpElementLoadedCorrectly && this.lcpImageUrl && !this.options?.disableImageLazyLoadWarning) {\n logLazyLCPWarning(this.lcpImageUrl);\n }\n }\n isOversized(image) {\n if (!this.window) {\n return false;\n }\n // The `isOversized` check may not be applicable or may require adjustments\n // for several types of image formats or scenarios. Currently, we specify only\n // `svg`, but this may also include `gif` since their quality isnt tied to\n // dimensions in the same way as raster images.\n const nonOversizedImageExtentions = [\n // SVG images are vector-based, which means they can scale\n // to any size without losing quality.\n '.svg'];\n // Convert it to lowercase because this may have uppercase\n // extensions, such as `IMAGE.SVG`.\n // We fallback to an empty string because `src` may be `undefined`\n // if it is explicitly set to `null` by some third-party code\n // (e.g., `image.src = null`).\n const imageSource = (image.src || '').toLowerCase();\n if (nonOversizedImageExtentions.some(extension => imageSource.endsWith(extension))) {\n return false;\n }\n const computedStyle = this.window.getComputedStyle(image);\n let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));\n let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));\n const boxSizing = computedStyle.getPropertyValue('box-sizing');\n const objectFit = computedStyle.getPropertyValue('object-fit');\n if (objectFit === `cover`) {\n // Object fit cover may indicate a use case such as a sprite sheet where\n // this warning does not apply.\n return false;\n }\n if (boxSizing === 'border-box') {\n // If the image `box-sizing` is set to `border-box`, we adjust the rendered\n // dimensions by subtracting padding values.\n const paddingTop = computedStyle.getPropertyValue('padding-top');\n const paddingRight = computedStyle.getPropertyValue('padding-right');\n const paddingBottom = computedStyle.getPropertyValue('padding-bottom');\n const paddingLeft = computedStyle.getPropertyValue('padding-left');\n renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);\n renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);\n }\n const intrinsicWidth = image.naturalWidth;\n const intrinsicHeight = image.naturalHeight;\n const recommendedWidth = this.window.devicePixelRatio * renderedWidth;\n const recommendedHeight = this.window.devicePixelRatio * renderedHeight;\n const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE;\n const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE;\n return oversizedWidth || oversizedHeight;\n }\n static {\n this.ɵfac = function ImagePerformanceWarning_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || ImagePerformanceWarning)();\n };\n }\n static {\n this.ɵprov = /*@__PURE__*/ɵɵdefineInjectable({\n token: ImagePerformanceWarning,\n factory: ImagePerformanceWarning.ɵfac,\n providedIn: 'root'\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ImagePerformanceWarning, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], null, null);\n})();\nfunction logLazyLCPWarning(src) {\n console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} is the Largest Contentful Paint (LCP) element ` + `but was given a \"loading\" value of \"lazy\", which can negatively impact ` + `application loading performance. This warning can be addressed by ` + `changing the loading value of the LCP image to \"eager\", or by using the ` + `NgOptimizedImage directive's prioritization utilities. For more ` + `information about addressing or disabling this warning, see ` + `https://angular.dev/errors/NG0913`));\n}\nfunction logOversizedImageWarning(src) {\n console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} has intrinsic file dimensions much larger than its ` + `rendered size. This can negatively impact application loading performance. ` + `For more information about addressing or disabling this warning, see ` + `https://angular.dev/errors/NG0913`));\n}\n\n/**\n * Internal token that allows to register extra callbacks that should be invoked during the\n * `PlatformRef.destroy` operation. This token is needed to avoid a direct reference to the\n * `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the\n * entire class tree-shakeable.\n */\nconst PLATFORM_DESTROY_LISTENERS = new InjectionToken(ngDevMode ? 'PlatformDestroyListeners' : '');\nfunction isApplicationBootstrapConfig(config) {\n return !config.moduleRef;\n}\nfunction bootstrap(config) {\n const envInjector = isApplicationBootstrapConfig(config) ? config.r3Injector : config.moduleRef.injector;\n const ngZone = envInjector.get(NgZone);\n return ngZone.run(() => {\n if (isApplicationBootstrapConfig(config)) {\n config.r3Injector.resolveInjectorInitializers();\n } else {\n config.moduleRef.resolveInjectorInitializers();\n }\n const exceptionHandler = envInjector.get(ErrorHandler, null);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (exceptionHandler === null) {\n const errorMessage = isApplicationBootstrapConfig(config) ? 'No `ErrorHandler` found in the Dependency Injection tree.' : 'No ErrorHandler. Is platform module (BrowserModule) included';\n throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, errorMessage);\n }\n if (envInjector.get(PROVIDED_ZONELESS) && envInjector.get(PROVIDED_NG_ZONE)) {\n throw new RuntimeError(408 /* RuntimeErrorCode.PROVIDED_BOTH_ZONE_AND_ZONELESS */, 'Invalid change detection configuration: ' + 'provideZoneChangeDetection and provideExperimentalZonelessChangeDetection cannot be used together.');\n }\n }\n let onErrorSubscription;\n ngZone.runOutsideAngular(() => {\n onErrorSubscription = ngZone.onError.subscribe({\n next: error => {\n exceptionHandler.handleError(error);\n }\n });\n });\n // If the whole platform is destroyed, invoke the `destroy` method\n // for all bootstrapped applications as well.\n if (isApplicationBootstrapConfig(config)) {\n const destroyListener = () => envInjector.destroy();\n const onPlatformDestroyListeners = config.platformInjector.get(PLATFORM_DESTROY_LISTENERS);\n onPlatformDestroyListeners.add(destroyListener);\n envInjector.onDestroy(() => {\n onErrorSubscription.unsubscribe();\n onPlatformDestroyListeners.delete(destroyListener);\n });\n } else {\n const destroyListener = () => config.moduleRef.destroy();\n const onPlatformDestroyListeners = config.platformInjector.get(PLATFORM_DESTROY_LISTENERS);\n onPlatformDestroyListeners.add(destroyListener);\n config.moduleRef.onDestroy(() => {\n remove(config.allPlatformModules, config.moduleRef);\n onErrorSubscription.unsubscribe();\n onPlatformDestroyListeners.delete(destroyListener);\n });\n }\n return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {\n const initStatus = envInjector.get(ApplicationInitStatus);\n initStatus.runInitializers();\n return initStatus.donePromise.then(() => {\n // If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy\n const localeId = envInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);\n setLocaleId(localeId || DEFAULT_LOCALE_ID);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const imagePerformanceService = envInjector.get(ImagePerformanceWarning);\n imagePerformanceService.start();\n }\n if (isApplicationBootstrapConfig(config)) {\n const appRef = envInjector.get(ApplicationRef);\n if (config.rootComponent !== undefined) {\n appRef.bootstrap(config.rootComponent);\n }\n return appRef;\n } else {\n moduleDoBootstrap(config.moduleRef, config.allPlatformModules);\n return config.moduleRef;\n }\n });\n });\n });\n}\nfunction moduleDoBootstrap(moduleRef, allPlatformModules) {\n const appRef = moduleRef.injector.get(ApplicationRef);\n if (moduleRef._bootstrapComponents.length > 0) {\n moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f));\n } else if (moduleRef.instance.ngDoBootstrap) {\n moduleRef.instance.ngDoBootstrap(appRef);\n } else {\n throw new RuntimeError(-403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode && `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` + `but it does not declare \"@NgModule.bootstrap\" components nor a \"ngDoBootstrap\" method. ` + `Please define one of these.`);\n }\n allPlatformModules.push(moduleRef);\n}\n\n/**\n * The Angular platform is the entry point for Angular on a web page.\n * Each page has exactly one platform. Services (such as reflection) which are common\n * to every Angular application running on the page are bound in its scope.\n * A page's platform is initialized implicitly when a platform is created using a platform\n * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.\n *\n * @publicApi\n */\nclass PlatformRef {\n /** @internal */\n constructor(_injector) {\n this._injector = _injector;\n this._modules = [];\n this._destroyListeners = [];\n this._destroyed = false;\n }\n /**\n * Creates an instance of an `@NgModule` for the given platform.\n *\n * @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function\n * argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.\n */\n bootstrapModuleFactory(moduleFactory, options) {\n const scheduleInRootZone = options?.scheduleInRootZone;\n const ngZoneFactory = () => getNgZone(options?.ngZone, {\n ...getNgZoneOptions({\n eventCoalescing: options?.ngZoneEventCoalescing,\n runCoalescing: options?.ngZoneRunCoalescing\n }),\n scheduleInRootZone\n });\n const ignoreChangesOutsideZone = options?.ignoreChangesOutsideZone;\n const allAppProviders = [internalProvideZoneChangeDetection({\n ngZoneFactory,\n ignoreChangesOutsideZone\n }), {\n provide: ChangeDetectionScheduler,\n useExisting: ChangeDetectionSchedulerImpl\n }];\n const moduleRef = createNgModuleRefWithProviders(moduleFactory.moduleType, this.injector, allAppProviders);\n return bootstrap({\n moduleRef,\n allPlatformModules: this._modules,\n platformInjector: this.injector\n });\n }\n /**\n * Creates an instance of an `@NgModule` for a given platform.\n *\n * @usageNotes\n * ### Simple Example\n *\n * ```typescript\n * @NgModule({\n * imports: [BrowserModule]\n * })\n * class MyModule {}\n *\n * let moduleRef = platformBrowser().bootstrapModule(MyModule);\n * ```\n *\n */\n bootstrapModule(moduleType, compilerOptions = []) {\n const options = optionsReducer({}, compilerOptions);\n return compileNgModuleFactory(this.injector, options, moduleType).then(moduleFactory => this.bootstrapModuleFactory(moduleFactory, options));\n }\n /**\n * Registers a listener to be called when the platform is destroyed.\n */\n onDestroy(callback) {\n this._destroyListeners.push(callback);\n }\n /**\n * Retrieves the platform {@link Injector}, which is the parent injector for\n * every Angular application on the page and provides singleton providers.\n */\n get injector() {\n return this._injector;\n }\n /**\n * Destroys the current Angular platform and all Angular applications on the page.\n * Destroys all modules and listeners registered with the platform.\n */\n destroy() {\n if (this._destroyed) {\n throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);\n if (destroyListeners) {\n destroyListeners.forEach(listener => listener());\n destroyListeners.clear();\n }\n this._destroyed = true;\n }\n /**\n * Indicates whether this instance was destroyed.\n */\n get destroyed() {\n return this._destroyed;\n }\n static {\n this.ɵfac = function PlatformRef_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || PlatformRef)(ɵɵinject(Injector));\n };\n }\n static {\n this.ɵprov = /*@__PURE__*/ɵɵdefineInjectable({\n token: PlatformRef,\n factory: PlatformRef.ɵfac,\n providedIn: 'platform'\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(PlatformRef, [{\n type: Injectable,\n args: [{\n providedIn: 'platform'\n }]\n }], () => [{\n type: Injector\n }], null);\n})();\nlet _platformInjector = null;\n/**\n * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only\n * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.\n */\nconst ALLOW_MULTIPLE_PLATFORMS = new InjectionToken(ngDevMode ? 'AllowMultipleToken' : '');\n/**\n * Creates a platform.\n * Platforms must be created on launch using this function.\n *\n * @publicApi\n */\nfunction createPlatform(injector) {\n if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode && 'There can be only one platform. Destroy the previous one to create a new one.');\n }\n publishDefaultGlobalUtils();\n publishSignalConfiguration();\n _platformInjector = injector;\n const platform = injector.get(PlatformRef);\n runPlatformInitializers(injector);\n return platform;\n}\n/**\n * Creates a factory for a platform. Can be used to provide or override `Providers` specific to\n * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.\n * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories\n * to build up configurations that might be required by different libraries or parts of the\n * application.\n * @param name Identifies the new platform factory.\n * @param providers A set of dependency providers for platforms created with the new factory.\n *\n * @publicApi\n */\nfunction createPlatformFactory(parentPlatformFactory, name, providers = []) {\n const desc = `Platform: ${name}`;\n const marker = new InjectionToken(desc);\n return (extraProviders = []) => {\n let platform = getPlatform();\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n const platformProviders = [...providers, ...extraProviders, {\n provide: marker,\n useValue: true\n }];\n if (parentPlatformFactory) {\n parentPlatformFactory(platformProviders);\n } else {\n createPlatform(createPlatformInjector(platformProviders, desc));\n }\n }\n return assertPlatform(marker);\n };\n}\n/**\n * Helper function to create an instance of a platform injector (that maintains the 'platform'\n * scope).\n */\nfunction createPlatformInjector(providers = [], name) {\n return Injector.create({\n name,\n providers: [{\n provide: INJECTOR_SCOPE,\n useValue: 'platform'\n }, {\n provide: PLATFORM_DESTROY_LISTENERS,\n useValue: new Set([() => _platformInjector = null])\n }, ...providers]\n });\n}\n/**\n * Checks that there is currently a platform that contains the given token as a provider.\n *\n * @publicApi\n */\nfunction assertPlatform(requiredToken) {\n const platform = getPlatform();\n if (!platform) {\n throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');\n }\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !platform.injector.get(requiredToken, null)) {\n throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');\n }\n return platform;\n}\n/**\n * Returns the current platform.\n *\n * @publicApi\n */\nfunction getPlatform() {\n return _platformInjector?.get(PlatformRef) ?? null;\n}\n/**\n * Destroys the current Angular platform and all Angular applications on the page.\n * Destroys all modules and listeners registered with the platform.\n *\n * @publicApi\n */\nfunction destroyPlatform() {\n getPlatform()?.destroy();\n}\n/**\n * The goal of this function is to bootstrap a platform injector,\n * but avoid referencing `PlatformRef` class.\n * This function is needed for bootstrapping a Standalone Component.\n */\nfunction createOrReusePlatformInjector(providers = []) {\n // If a platform injector already exists, it means that the platform\n // is already bootstrapped and no additional actions are required.\n if (_platformInjector) return _platformInjector;\n publishDefaultGlobalUtils();\n // Otherwise, setup a new platform injector and run platform initializers.\n const injector = createPlatformInjector(providers);\n _platformInjector = injector;\n publishSignalConfiguration();\n runPlatformInitializers(injector);\n return injector;\n}\nfunction runPlatformInitializers(injector) {\n const inits = injector.get(PLATFORM_INITIALIZER, null);\n inits?.forEach(init => init());\n}\n\n/**\n * Used to periodically verify no expressions have changed after they were checked.\n *\n * @param options Used to configure when the check will execute.\n * - `interval` will periodically run exhaustive `checkNoChanges` on application views\n * - `useNgZoneOnStable` will use ZoneJS to determine when change detection might have run\n * in an application using ZoneJS to drive change detection. When the `NgZone.onStable` would\n * have emitted, all views attached to the `ApplicationRef` are checked for changes.\n * - 'exhaustive' means that all views attached to `ApplicationRef` and all the descendants of those views will be\n * checked for changes (excluding those subtrees which are detached via `ChangeDetectorRef.detach()`).\n * This is useful because the check that runs after regular change detection does not work for components using `ChangeDetectionStrategy.OnPush`.\n * This check is will surface any existing errors hidden by `OnPush` components. By default, this check is exhaustive\n * and will always check all views, regardless of their \"dirty\" state and `ChangeDetectionStrategy`.\n *\n * When the `useNgZoneOnStable` option is `true`, this function will provide its own `NgZone` implementation and needs\n * to come after any other `NgZone` provider, including `provideZoneChangeDetection()` and `provideExperimentalZonelessChangeDetection()`.\n *\n * @experimental\n * @publicApi\n */\nfunction provideExperimentalCheckNoChangesForDebug(options) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (options.interval === undefined && !options.useNgZoneOnStable) {\n throw new Error('Must provide one of `useNgZoneOnStable` or `interval`');\n }\n const checkNoChangesMode = options?.exhaustive === false ? CheckNoChangesMode.OnlyDirtyViews : CheckNoChangesMode.Exhaustive;\n return makeEnvironmentProviders([options?.useNgZoneOnStable ? {\n provide: NgZone,\n useFactory: () => new DebugNgZoneForCheckNoChanges(checkNoChangesMode)\n } : [], options?.interval !== undefined ? exhaustiveCheckNoChangesInterval(options.interval, checkNoChangesMode) : [], {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useValue: () => {\n if (options?.useNgZoneOnStable && !(inject(NgZone) instanceof DebugNgZoneForCheckNoChanges)) {\n throw new Error('`provideExperimentalCheckNoChangesForDebug` with `useNgZoneOnStable` must be after any other provider for `NgZone`.');\n }\n }\n }]);\n } else {\n return makeEnvironmentProviders([]);\n }\n}\nclass DebugNgZoneForCheckNoChanges extends NgZone {\n constructor(checkNoChangesMode) {\n const zonelessEnabled = inject(ZONELESS_ENABLED);\n // Use coalescing to ensure we aren't ever running this check synchronously\n super({\n shouldCoalesceEventChangeDetection: true,\n shouldCoalesceRunChangeDetection: zonelessEnabled\n });\n this.checkNoChangesMode = checkNoChangesMode;\n this.injector = inject(EnvironmentInjector);\n if (zonelessEnabled) {\n // prevent emits to ensure code doesn't rely on these\n this.onMicrotaskEmpty.emit = () => {};\n this.onStable.emit = () => {\n this.scheduler ||= this.injector.get(ChangeDetectionSchedulerImpl);\n if (this.scheduler.pendingRenderTaskId || this.scheduler.runningTick) {\n return;\n }\n this.checkApplicationViews();\n };\n this.onUnstable.emit = () => {};\n } else {\n this.runOutsideAngular(() => {\n this.onStable.subscribe(() => {\n this.checkApplicationViews();\n });\n });\n }\n }\n checkApplicationViews() {\n this.applicationRef ||= this.injector.get(ApplicationRef);\n for (const view of this.applicationRef.allViews) {\n try {\n checkNoChangesInternal(view._lView, this.checkNoChangesMode, view.notifyErrorHandler);\n } catch (e) {\n this.errorHandler ||= this.injector.get(ErrorHandler);\n this.errorHandler.handleError(e);\n }\n }\n }\n}\nfunction exhaustiveCheckNoChangesInterval(interval, checkNoChangesMode) {\n return {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory: () => {\n const applicationRef = inject(ApplicationRef);\n const errorHandler = inject(ErrorHandler);\n const scheduler = inject(ChangeDetectionSchedulerImpl);\n const ngZone = inject(NgZone);\n return () => {\n function scheduleCheckNoChanges() {\n ngZone.runOutsideAngular(() => {\n setTimeout(() => {\n if (applicationRef.destroyed) {\n return;\n }\n if (scheduler.pendingRenderTaskId || scheduler.runningTick) {\n scheduleCheckNoChanges();\n return;\n }\n for (const view of applicationRef.allViews) {\n try {\n checkNoChangesInternal(view._lView, checkNoChangesMode, view.notifyErrorHandler);\n } catch (e) {\n errorHandler.handleError(e);\n }\n }\n scheduleCheckNoChanges();\n }, interval);\n });\n }\n scheduleCheckNoChanges();\n };\n }\n };\n}\n\n/**\n * Returns whether Angular is in development mode.\n *\n * By default, this is true, unless `enableProdMode` is invoked prior to calling this method or the\n * application is built using the Angular CLI with the `optimization` option.\n * @see {@link cli/build ng build}\n *\n * @publicApi\n */\nfunction isDevMode() {\n return typeof ngDevMode === 'undefined' || !!ngDevMode;\n}\n/**\n * Disable Angular's development mode, which turns off assertions and other\n * checks within the framework.\n *\n * One important assertion this disables verifies that a change detection pass\n * does not result in additional changes to any bindings (also known as\n * unidirectional data flow).\n *\n * Using this method is discouraged as the Angular CLI will set production mode when using the\n * `optimization` option.\n * @see {@link cli/build ng build}\n *\n * @publicApi\n */\nfunction enableProdMode() {\n // The below check is there so when ngDevMode is set via terser\n // `global['ngDevMode'] = false;` is also dropped.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _global['ngDevMode'] = false;\n }\n}\n\n// Public API for render\n\n/**\n * Returns the NgModuleFactory with the given id (specified using [@NgModule.id\n * field](api/core/NgModule#id)), if it exists and has been loaded. Factories for NgModules that do\n * not specify an `id` cannot be retrieved. Throws if an NgModule cannot be found.\n * @publicApi\n * @deprecated Use `getNgModuleById` instead.\n */\nfunction getModuleFactory(id) {\n const type = getRegisteredNgModuleType(id);\n if (!type) throw noModuleError(id);\n return new NgModuleFactory(type);\n}\n/**\n * Returns the NgModule class with the given id (specified using [@NgModule.id\n * field](api/core/NgModule#id)), if it exists and has been loaded. Classes for NgModules that do\n * not specify an `id` cannot be retrieved. Throws if an NgModule cannot be found.\n * @publicApi\n */\nfunction getNgModuleById(id) {\n const type = getRegisteredNgModuleType(id);\n if (!type) throw noModuleError(id);\n return type;\n}\nfunction noModuleError(id) {\n return new Error(`No module with ID ${id} loaded`);\n}\n\n/**\n * Base class that provides change detection functionality.\n * A change-detection tree collects all views that are to be checked for changes.\n * Use the methods to add and remove views from the tree, initiate change-detection,\n * and explicitly mark views as _dirty_, meaning that they have changed and need to be re-rendered.\n *\n * @see [Using change detection hooks](guide/components/lifecycle#using-change-detection-hooks)\n * @see [Defining custom change detection](guide/components/lifecycle#defining-custom-change-detection)\n *\n * @usageNotes\n *\n * The following examples demonstrate how to modify default change-detection behavior\n * to perform explicit detection when needed.\n *\n * ### Use `markForCheck()` with `CheckOnce` strategy\n *\n * The following example sets the `OnPush` change-detection strategy for a component\n * (`CheckOnce`, rather than the default `CheckAlways`), then forces a second check\n * after an interval.\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\"\n * region=\"mark-for-check\"></code-example>\n *\n * ### Detach change detector to limit how often check occurs\n *\n * The following example defines a component with a large list of read-only data\n * that is expected to change constantly, many times per second.\n * To improve performance, we want to check and update the list\n * less often than the changes actually occur. To do that, we detach\n * the component's change detector and perform an explicit local check every five seconds.\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\" region=\"detach\"></code-example>\n *\n *\n * ### Reattaching a detached component\n *\n * The following example creates a component displaying live data.\n * The component detaches its change detector from the main change detector tree\n * when the `live` property is set to false, and reattaches it when the property\n * becomes true.\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\" region=\"reattach\"></code-example>\n *\n * @publicApi\n */\nclass ChangeDetectorRef {\n /**\n * @internal\n * @nocollapse\n */\n static {\n this.__NG_ELEMENT_ID__ = injectChangeDetectorRef;\n }\n}\n/** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */\nfunction injectChangeDetectorRef(flags) {\n return createViewRef(getCurrentTNode(), getLView(), (flags & 16 /* InternalInjectFlags.ForPipe */) === 16 /* InternalInjectFlags.ForPipe */);\n}\n/**\n * Creates a ViewRef and stores it on the injector as ChangeDetectorRef (public alias).\n *\n * @param tNode The node that is requesting a ChangeDetectorRef\n * @param lView The view to which the node belongs\n * @param isPipe Whether the view is being injected into a pipe.\n * @returns The ChangeDetectorRef to use\n */\nfunction createViewRef(tNode, lView, isPipe) {\n if (isComponentHost(tNode) && !isPipe) {\n // The LView represents the location where the component is declared.\n // Instead we want the LView for the component View and so we need to look it up.\n const componentView = getComponentLViewByIndex(tNode.index, lView); // look down\n return new ViewRef$1(componentView, componentView);\n } else if (tNode.type & (3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 32 /* TNodeType.Icu */ | 128 /* TNodeType.LetDeclaration */)) {\n // The LView represents the location where the injection is requested from.\n // We need to locate the containing LView (in case where the `lView` is an embedded view)\n const hostComponentView = lView[DECLARATION_COMPONENT_VIEW]; // look up\n return new ViewRef$1(hostComponentView, lView);\n }\n return null;\n}\n\n/**\n * Represents an Angular view.\n *\n * @see [Change detection usage](/api/core/ChangeDetectorRef?tab=usage-notes)\n *\n * @publicApi\n */\nclass ViewRef extends ChangeDetectorRef {}\n/**\n * Represents an Angular view in a view container.\n * An embedded view can be referenced from a component\n * other than the hosting component whose template defines it, or it can be defined\n * independently by a `TemplateRef`.\n *\n * Properties of elements in a view can change, but the structure (number and order) of elements in\n * a view cannot. Change the structure of elements by inserting, moving, or\n * removing nested views in a view container.\n *\n * @see {@link ViewContainerRef}\n *\n * @usageNotes\n *\n * The following template breaks down into two separate `TemplateRef` instances,\n * an outer one and an inner one.\n *\n * ```\n * Count: {{items.length}}\n * <ul>\n * <li *ngFor=\"let item of items\">{{item}}</li>\n * </ul>\n * ```\n *\n * This is the outer `TemplateRef`:\n *\n * ```\n * Count: {{items.length}}\n * <ul>\n * <ng-template ngFor let-item [ngForOf]=\"items\"></ng-template>\n * </ul>\n * ```\n *\n * This is the inner `TemplateRef`:\n *\n * ```\n * <li>{{item}}</li>\n * ```\n *\n * The outer and inner `TemplateRef` instances are assembled into views as follows:\n *\n * ```\n * <!-- ViewRef: outer-0 -->\n * Count: 2\n * <ul>\n * <ng-template view-container-ref></ng-template>\n * <!-- ViewRef: inner-1 --><li>first</li><!-- /ViewRef: inner-1 -->\n * <!-- ViewRef: inner-2 --><li>second</li><!-- /ViewRef: inner-2 -->\n * </ul>\n * <!-- /ViewRef: outer-0 -->\n * ```\n * @publicApi\n */\nclass EmbeddedViewRef extends ViewRef {}\n\n// Public API for compiler\n\n// This file exists for easily patching NgModuleFactoryLoader in g3\nvar ng_module_factory_loader_impl = {};\n\n/**\n * @publicApi\n */\nclass DebugEventListener {\n constructor(name, callback) {\n this.name = name;\n this.callback = callback;\n }\n}\n/**\n * @publicApi\n */\nfunction asNativeElements(debugEls) {\n return debugEls.map(el => el.nativeElement);\n}\n/**\n * @publicApi\n */\nclass DebugNode {\n constructor(nativeNode) {\n this.nativeNode = nativeNode;\n }\n /**\n * The `DebugElement` parent. Will be `null` if this is the root element.\n */\n get parent() {\n const parent = this.nativeNode.parentNode;\n return parent ? new DebugElement(parent) : null;\n }\n /**\n * The host dependency injector. For example, the root element's component instance injector.\n */\n get injector() {\n return getInjector(this.nativeNode);\n }\n /**\n * The element's own component instance, if it has one.\n */\n get componentInstance() {\n const nativeElement = this.nativeNode;\n return nativeElement && (getComponent$1(nativeElement) || getOwningComponent(nativeElement));\n }\n /**\n * An object that provides parent context for this element. Often an ancestor component instance\n * that governs this element.\n *\n * When an element is repeated within *ngFor, the context is an `NgForOf` whose `$implicit`\n * property is the value of the row instance value. For example, the `hero` in `*ngFor=\"let hero\n * of heroes\"`.\n */\n get context() {\n return getComponent$1(this.nativeNode) || getContext(this.nativeNode);\n }\n /**\n * The callbacks attached to the component's @Output properties and/or the element's event\n * properties.\n */\n get listeners() {\n return getListeners(this.nativeNode).filter(listener => listener.type === 'dom');\n }\n /**\n * Dictionary of objects associated with template local variables (e.g. #foo), keyed by the local\n * variable name.\n */\n get references() {\n return getLocalRefs(this.nativeNode);\n }\n /**\n * This component's injector lookup tokens. Includes the component itself plus the tokens that the\n * component lists in its providers metadata.\n */\n get providerTokens() {\n return getInjectionTokens(this.nativeNode);\n }\n}\n/**\n * @publicApi\n *\n * @see [Component testing scenarios](guide/testing/components-scenarios)\n * @see [Basics of testing components](guide/testing/components-basics)\n * @see [Testing utility APIs](guide/testing/utility-apis)\n */\nclass DebugElement extends DebugNode {\n constructor(nativeNode) {\n ngDevMode && assertDomNode(nativeNode);\n super(nativeNode);\n }\n /**\n * The underlying DOM element at the root of the component.\n */\n get nativeElement() {\n return this.nativeNode.nodeType == Node.ELEMENT_NODE ? this.nativeNode : null;\n }\n /**\n * The element tag name, if it is an element.\n */\n get name() {\n const context = getLContext(this.nativeNode);\n const lView = context ? context.lView : null;\n if (lView !== null) {\n const tData = lView[TVIEW].data;\n const tNode = tData[context.nodeIndex];\n return tNode.value;\n } else {\n return this.nativeNode.nodeName;\n }\n }\n /**\n * Gets a map of property names to property values for an element.\n *\n * This map includes:\n * - Regular property bindings (e.g. `[id]=\"id\"`)\n * - Host property bindings (e.g. `host: { '[id]': \"id\" }`)\n * - Interpolated property bindings (e.g. `id=\"{{ value }}\")\n *\n * It does not include:\n * - input property bindings (e.g. `[myCustomInput]=\"value\"`)\n * - attribute bindings (e.g. `[attr.role]=\"menu\"`)\n */\n get properties() {\n const context = getLContext(this.nativeNode);\n const lView = context ? context.lView : null;\n if (lView === null) {\n return {};\n }\n const tData = lView[TVIEW].data;\n const tNode = tData[context.nodeIndex];\n const properties = {};\n // Collect properties from the DOM.\n copyDomProperties(this.nativeElement, properties);\n // Collect properties from the bindings. This is needed for animation renderer which has\n // synthetic properties which don't get reflected into the DOM.\n collectPropertyBindings(properties, tNode, lView, tData);\n return properties;\n }\n /**\n * A map of attribute names to attribute values for an element.\n */\n // TODO: replace null by undefined in the return type\n get attributes() {\n const attributes = {};\n const element = this.nativeElement;\n if (!element) {\n return attributes;\n }\n const context = getLContext(element);\n const lView = context ? context.lView : null;\n if (lView === null) {\n return {};\n }\n const tNodeAttrs = lView[TVIEW].data[context.nodeIndex].attrs;\n const lowercaseTNodeAttrs = [];\n // For debug nodes we take the element's attribute directly from the DOM since it allows us\n // to account for ones that weren't set via bindings (e.g. ViewEngine keeps track of the ones\n // that are set through `Renderer2`). The problem is that the browser will lowercase all names,\n // however since we have the attributes already on the TNode, we can preserve the case by going\n // through them once, adding them to the `attributes` map and putting their lower-cased name\n // into an array. Afterwards when we're going through the native DOM attributes, we can check\n // whether we haven't run into an attribute already through the TNode.\n if (tNodeAttrs) {\n let i = 0;\n while (i < tNodeAttrs.length) {\n const attrName = tNodeAttrs[i];\n // Stop as soon as we hit a marker. We only care about the regular attributes. Everything\n // else will be handled below when we read the final attributes off the DOM.\n if (typeof attrName !== 'string') break;\n const attrValue = tNodeAttrs[i + 1];\n attributes[attrName] = attrValue;\n lowercaseTNodeAttrs.push(attrName.toLowerCase());\n i += 2;\n }\n }\n for (const attr of element.attributes) {\n // Make sure that we don't assign the same attribute both in its\n // case-sensitive form and the lower-cased one from the browser.\n if (!lowercaseTNodeAttrs.includes(attr.name)) {\n attributes[attr.name] = attr.value;\n }\n }\n return attributes;\n }\n /**\n * The inline styles of the DOM element.\n */\n // TODO: replace null by undefined in the return type\n get styles() {\n const element = this.nativeElement;\n return element?.style ?? {};\n }\n /**\n * A map containing the class names on the element as keys.\n *\n * This map is derived from the `className` property of the DOM element.\n *\n * Note: The values of this object will always be `true`. The class key will not appear in the KV\n * object if it does not exist on the element.\n *\n * @see [Element.className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className)\n */\n get classes() {\n const result = {};\n const element = this.nativeElement;\n // SVG elements return an `SVGAnimatedString` instead of a plain string for the `className`.\n const className = element.className;\n const classes = typeof className !== 'string' ? className.baseVal.split(' ') : className.split(' ');\n classes.forEach(value => result[value] = true);\n return result;\n }\n /**\n * The `childNodes` of the DOM element as a `DebugNode` array.\n *\n * @see [Node.childNodes](https://developer.mozilla.org/en-US/docs/Web/API/Node/childNodes)\n */\n get childNodes() {\n const childNodes = this.nativeNode.childNodes;\n const children = [];\n for (let i = 0; i < childNodes.length; i++) {\n const element = childNodes[i];\n children.push(getDebugNode(element));\n }\n return children;\n }\n /**\n * The immediate `DebugElement` children. Walk the tree by descending through `children`.\n */\n get children() {\n const nativeElement = this.nativeElement;\n if (!nativeElement) return [];\n const childNodes = nativeElement.children;\n const children = [];\n for (let i = 0; i < childNodes.length; i++) {\n const element = childNodes[i];\n children.push(getDebugNode(element));\n }\n return children;\n }\n /**\n * @returns the first `DebugElement` that matches the predicate at any depth in the subtree.\n */\n query(predicate) {\n const results = this.queryAll(predicate);\n return results[0] || null;\n }\n /**\n * @returns All `DebugElement` matches for the predicate at any depth in the subtree.\n */\n queryAll(predicate) {\n const matches = [];\n _queryAll(this, predicate, matches, true);\n return matches;\n }\n /**\n * @returns All `DebugNode` matches for the predicate at any depth in the subtree.\n */\n queryAllNodes(predicate) {\n const matches = [];\n _queryAll(this, predicate, matches, false);\n return matches;\n }\n /**\n * Triggers the event by its name if there is a corresponding listener in the element's\n * `listeners` collection.\n *\n * If the event lacks a listener or there's some other problem, consider\n * calling `nativeElement.dispatchEvent(eventObject)`.\n *\n * @param eventName The name of the event to trigger\n * @param eventObj The _event object_ expected by the handler\n *\n * @see [Testing components scenarios](guide/testing/components-scenarios#trigger-event-handler)\n */\n triggerEventHandler(eventName, eventObj) {\n const node = this.nativeNode;\n const invokedListeners = [];\n this.listeners.forEach(listener => {\n if (listener.name === eventName) {\n const callback = listener.callback;\n callback.call(node, eventObj);\n invokedListeners.push(callback);\n }\n });\n // We need to check whether `eventListeners` exists, because it's something\n // that Zone.js only adds to `EventTarget` in browser environments.\n if (typeof node.eventListeners === 'function') {\n // Note that in Ivy we wrap event listeners with a call to `event.preventDefault` in some\n // cases. We use '__ngUnwrap__' as a special token that gives us access to the actual event\n // listener.\n node.eventListeners(eventName).forEach(listener => {\n // In order to ensure that we can detect the special __ngUnwrap__ token described above, we\n // use `toString` on the listener and see if it contains the token. We use this approach to\n // ensure that it still worked with compiled code since it cannot remove or rename string\n // literals. We also considered using a special function name (i.e. if(listener.name ===\n // special)) but that was more cumbersome and we were also concerned the compiled code could\n // strip the name, turning the condition in to (\"\" === \"\") and always returning true.\n if (listener.toString().indexOf('__ngUnwrap__') !== -1) {\n const unwrappedListener = listener('__ngUnwrap__');\n return invokedListeners.indexOf(unwrappedListener) === -1 && unwrappedListener.call(node, eventObj);\n }\n });\n }\n }\n}\nfunction copyDomProperties(element, properties) {\n if (element) {\n // Skip own properties (as those are patched)\n let obj = Object.getPrototypeOf(element);\n const NodePrototype = Node.prototype;\n while (obj !== null && obj !== NodePrototype) {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n for (let key in descriptors) {\n if (!key.startsWith('__') && !key.startsWith('on')) {\n // don't include properties starting with `__` and `on`.\n // `__` are patched values which should not be included.\n // `on` are listeners which also should not be included.\n const value = element[key];\n if (isPrimitiveValue(value)) {\n properties[key] = value;\n }\n }\n }\n obj = Object.getPrototypeOf(obj);\n }\n }\n}\nfunction isPrimitiveValue(value) {\n return typeof value === 'string' || typeof value === 'boolean' || typeof value === 'number' || value === null;\n}\nfunction _queryAll(parentElement, predicate, matches, elementsOnly) {\n const context = getLContext(parentElement.nativeNode);\n const lView = context ? context.lView : null;\n if (lView !== null) {\n const parentTNode = lView[TVIEW].data[context.nodeIndex];\n _queryNodeChildren(parentTNode, lView, predicate, matches, elementsOnly, parentElement.nativeNode);\n } else {\n // If the context is null, then `parentElement` was either created with Renderer2 or native DOM\n // APIs.\n _queryNativeNodeDescendants(parentElement.nativeNode, predicate, matches, elementsOnly);\n }\n}\n/**\n * Recursively match the current TNode against the predicate, and goes on with the next ones.\n *\n * @param tNode the current TNode\n * @param lView the LView of this TNode\n * @param predicate the predicate to match\n * @param matches the list of positive matches\n * @param elementsOnly whether only elements should be searched\n * @param rootNativeNode the root native node on which predicate should not be matched\n */\nfunction _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, rootNativeNode) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n const nativeNode = getNativeByTNodeOrNull(tNode, lView);\n // For each type of TNode, specific logic is executed.\n if (tNode.type & (3 /* TNodeType.AnyRNode */ | 8 /* TNodeType.ElementContainer */)) {\n // Case 1: the TNode is an element\n // The native node has to be checked.\n _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);\n if (isComponentHost(tNode)) {\n // If the element is the host of a component, then all nodes in its view have to be processed.\n // Note: the component's content (tNode.child) will be processed from the insertion points.\n const componentView = getComponentLViewByIndex(tNode.index, lView);\n if (componentView && componentView[TVIEW].firstChild) {\n _queryNodeChildren(componentView[TVIEW].firstChild, componentView, predicate, matches, elementsOnly, rootNativeNode);\n }\n } else {\n if (tNode.child) {\n // Otherwise, its children have to be processed.\n _queryNodeChildren(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n // We also have to query the DOM directly in order to catch elements inserted through\n // Renderer2. Note that this is __not__ optimal, because we're walking similar trees multiple\n // times. ViewEngine could do it more efficiently, because all the insertions go through\n // Renderer2, however that's not the case in Ivy. This approach is being used because:\n // 1. Matching the ViewEngine behavior would mean potentially introducing a dependency\n // from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.\n // 2. It allows us to capture nodes that were inserted directly via the DOM.\n nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);\n }\n // In all cases, if a dynamic container exists for this node, each view inside it has to be\n // processed.\n const nodeOrContainer = lView[tNode.index];\n if (isLContainer(nodeOrContainer)) {\n _queryNodeChildrenInContainer(nodeOrContainer, predicate, matches, elementsOnly, rootNativeNode);\n }\n } else if (tNode.type & 4 /* TNodeType.Container */) {\n // Case 2: the TNode is a container\n // The native node has to be checked.\n const lContainer = lView[tNode.index];\n _addQueryMatch(lContainer[NATIVE], predicate, matches, elementsOnly, rootNativeNode);\n // Each view inside the container has to be processed.\n _queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode);\n } else if (tNode.type & 16 /* TNodeType.Projection */) {\n // Case 3: the TNode is a projection insertion point (i.e. a <ng-content>).\n // The nodes projected at this location all need to be processed.\n const componentView = lView[DECLARATION_COMPONENT_VIEW];\n const componentHost = componentView[T_HOST];\n const head = componentHost.projection[tNode.projection];\n if (Array.isArray(head)) {\n for (let nativeNode of head) {\n _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);\n }\n } else if (head) {\n const nextLView = componentView[PARENT];\n const nextTNode = nextLView[TVIEW].data[head.index];\n _queryNodeChildren(nextTNode, nextLView, predicate, matches, elementsOnly, rootNativeNode);\n }\n } else if (tNode.child) {\n // Case 4: the TNode is a view.\n _queryNodeChildren(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n // We don't want to go to the next sibling of the root node.\n if (rootNativeNode !== nativeNode) {\n // To determine the next node to be processed, we need to use the next or the projectionNext\n // link, depending on whether the current node has been projected.\n const nextTNode = tNode.flags & 2 /* TNodeFlags.isProjected */ ? tNode.projectionNext : tNode.next;\n if (nextTNode) {\n _queryNodeChildren(nextTNode, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}\n/**\n * Process all TNodes in a given container.\n *\n * @param lContainer the container to be processed\n * @param predicate the predicate to match\n * @param matches the list of positive matches\n * @param elementsOnly whether only elements should be searched\n * @param rootNativeNode the root native node on which predicate should not be matched\n */\nfunction _queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildren(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}\n/**\n * Match the current native node against the predicate.\n *\n * @param nativeNode the current native node\n * @param predicate the predicate to match\n * @param matches the list of positive matches\n * @param elementsOnly whether only elements should be searched\n * @param rootNativeNode the root native node on which predicate should not be matched\n */\nfunction _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode) {\n if (rootNativeNode !== nativeNode) {\n const debugNode = getDebugNode(nativeNode);\n if (!debugNode) {\n return;\n }\n // Type of the \"predicate and \"matches\" array are set based on the value of\n // the \"elementsOnly\" parameter. TypeScript is not able to properly infer these\n // types with generics, so we manually cast the parameters accordingly.\n if (elementsOnly && debugNode instanceof DebugElement && predicate(debugNode) && matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n } else if (!elementsOnly && predicate(debugNode) && matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n }\n}\n/**\n * Match all the descendants of a DOM node against a predicate.\n *\n * @param nativeNode the current native node\n * @param predicate the predicate to match\n * @param matches the list where matches are stored\n * @param elementsOnly whether only elements should be searched\n */\nfunction _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement && predicate(debugNode) && matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n } else if (!elementsOnly && predicate(debugNode) && matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}\n/**\n * Iterates through the property bindings for a given node and generates\n * a map of property names to values. This map only contains property bindings\n * defined in templates, not in host bindings.\n */\nfunction collectPropertyBindings(properties, tNode, lView, tData) {\n let bindingIndexes = tNode.propertyBindings;\n if (bindingIndexes !== null) {\n for (let i = 0; i < bindingIndexes.length; i++) {\n const bindingIndex = bindingIndexes[i];\n const propMetadata = tData[bindingIndex];\n const metadataParts = propMetadata.split(INTERPOLATION_DELIMITER);\n const propertyName = metadataParts[0];\n if (metadataParts.length > 1) {\n let value = metadataParts[1];\n for (let j = 1; j < metadataParts.length - 1; j++) {\n value += renderStringify(lView[bindingIndex + j - 1]) + metadataParts[j + 1];\n }\n properties[propertyName] = value;\n } else {\n properties[propertyName] = lView[bindingIndex];\n }\n }\n }\n}\n// Need to keep the nodes in a global Map so that multiple angular apps are supported.\nconst _nativeNodeToDebugNode = new Map();\nconst NG_DEBUG_PROPERTY = '__ng_debug__';\n/**\n * @publicApi\n */\nfunction getDebugNode(nativeNode) {\n if (nativeNode instanceof Node) {\n if (!nativeNode.hasOwnProperty(NG_DEBUG_PROPERTY)) {\n nativeNode[NG_DEBUG_PROPERTY] = nativeNode.nodeType == Node.ELEMENT_NODE ? new DebugElement(nativeNode) : new DebugNode(nativeNode);\n }\n return nativeNode[NG_DEBUG_PROPERTY];\n }\n return null;\n}\nfunction getAllDebugNodes() {\n return Array.from(_nativeNodeToDebugNode.values());\n}\nfunction indexDebugNode(node) {\n _nativeNodeToDebugNode.set(node.nativeNode, node);\n}\nfunction removeDebugNodeFromIndex(node) {\n _nativeNodeToDebugNode.delete(node.nativeNode);\n}\nclass DefaultIterableDifferFactory {\n constructor() {}\n supports(obj) {\n return isListLikeIterable(obj);\n }\n create(trackByFn) {\n return new DefaultIterableDiffer(trackByFn);\n }\n}\nconst trackByIdentity = (index, item) => item;\n/**\n * @deprecated v4.0.0 - Should not be part of public API.\n * @publicApi\n */\nclass DefaultIterableDiffer {\n constructor(trackByFn) {\n this.length = 0;\n // Keeps track of the used records at any point in time (during & across `_check()` calls)\n this._linkedRecords = null;\n // Keeps track of the removed records at any point in time during `_check()` calls.\n this._unlinkedRecords = null;\n this._previousItHead = null;\n this._itHead = null;\n this._itTail = null;\n this._additionsHead = null;\n this._additionsTail = null;\n this._movesHead = null;\n this._movesTail = null;\n this._removalsHead = null;\n this._removalsTail = null;\n // Keeps track of records where custom track by is the same, but item identity has changed\n this._identityChangesHead = null;\n this._identityChangesTail = null;\n this._trackByFn = trackByFn || trackByIdentity;\n }\n forEachItem(fn) {\n let record;\n for (record = this._itHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n forEachOperation(fn) {\n let nextIt = this._itHead;\n let nextRemove = this._removalsHead;\n let addRemoveOffset = 0;\n let moveOffsets = null;\n while (nextIt || nextRemove) {\n // Figure out which is the next record to process\n // Order: remove, add, move\n const record = !nextRemove || nextIt && nextIt.currentIndex < getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ? nextIt : nextRemove;\n const adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);\n const currentIndex = record.currentIndex;\n // consume the item, and adjust the addRemoveOffset and update moveDistance if necessary\n if (record === nextRemove) {\n addRemoveOffset--;\n nextRemove = nextRemove._nextRemoved;\n } else {\n nextIt = nextIt._next;\n if (record.previousIndex == null) {\n addRemoveOffset++;\n } else {\n // INVARIANT: currentIndex < previousIndex\n if (!moveOffsets) moveOffsets = [];\n const localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;\n const localCurrentIndex = currentIndex - addRemoveOffset;\n if (localMovePreviousIndex != localCurrentIndex) {\n for (let i = 0; i < localMovePreviousIndex; i++) {\n const offset = i < moveOffsets.length ? moveOffsets[i] : moveOffsets[i] = 0;\n const index = offset + i;\n if (localCurrentIndex <= index && index < localMovePreviousIndex) {\n moveOffsets[i] = offset + 1;\n }\n }\n const previousIndex = record.previousIndex;\n moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex;\n }\n }\n }\n if (adjPreviousIndex !== currentIndex) {\n fn(record, adjPreviousIndex, currentIndex);\n }\n }\n }\n forEachPreviousItem(fn) {\n let record;\n for (record = this._previousItHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n forEachAddedItem(fn) {\n let record;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n forEachMovedItem(fn) {\n let record;\n for (record = this._movesHead; record !== null; record = record._nextMoved) {\n fn(record);\n }\n }\n forEachRemovedItem(fn) {\n let record;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n forEachIdentityChange(fn) {\n let record;\n for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {\n fn(record);\n }\n }\n diff(collection) {\n if (collection == null) collection = [];\n if (!isListLikeIterable(collection)) {\n throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode && `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);\n }\n if (this.check(collection)) {\n return this;\n } else {\n return null;\n }\n }\n onDestroy() {}\n check(collection) {\n this._reset();\n let record = this._itHead;\n let mayBeDirty = false;\n let index;\n let item;\n let itemTrackBy;\n if (Array.isArray(collection)) {\n this.length = collection.length;\n for (let index = 0; index < this.length; index++) {\n item = collection[index];\n itemTrackBy = this._trackByFn(index, item);\n if (record === null || !Object.is(record.trackById, itemTrackBy)) {\n record = this._mismatch(record, item, itemTrackBy, index);\n mayBeDirty = true;\n } else {\n if (mayBeDirty) {\n // TODO(misko): can we limit this to duplicates only?\n record = this._verifyReinsertion(record, item, itemTrackBy, index);\n }\n if (!Object.is(record.item, item)) this._addIdentityChange(record, item);\n }\n record = record._next;\n }\n } else {\n index = 0;\n iterateListLike(collection, item => {\n itemTrackBy = this._trackByFn(index, item);\n if (record === null || !Object.is(record.trackById, itemTrackBy)) {\n record = this._mismatch(record, item, itemTrackBy, index);\n mayBeDirty = true;\n } else {\n if (mayBeDirty) {\n // TODO(misko): can we limit this to duplicates only?\n record = this._verifyReinsertion(record, item, itemTrackBy, index);\n }\n if (!Object.is(record.item, item)) this._addIdentityChange(record, item);\n }\n record = record._next;\n index++;\n });\n this.length = index;\n }\n this._truncate(record);\n this.collection = collection;\n return this.isDirty;\n }\n /* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity\n * changes.\n */\n get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null || this._removalsHead !== null || this._identityChangesHead !== null;\n }\n /**\n * Reset the state of the change objects to show no changes. This means set previousKey to\n * currentKey, and clear all of the queues (additions, moves, removals).\n * Set the previousIndexes of moved and added items to their currentIndexes\n * Reset the list of additions, moves and removals\n *\n * @internal\n */\n _reset() {\n if (this.isDirty) {\n let record;\n for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n record.previousIndex = record.currentIndex;\n }\n this._additionsHead = this._additionsTail = null;\n for (record = this._movesHead; record !== null; record = record._nextMoved) {\n record.previousIndex = record.currentIndex;\n }\n this._movesHead = this._movesTail = null;\n this._removalsHead = this._removalsTail = null;\n this._identityChangesHead = this._identityChangesTail = null;\n // TODO(vicb): when assert gets supported\n // assert(!this.isDirty);\n }\n }\n /**\n * This is the core function which handles differences between collections.\n *\n * - `record` is the record which we saw at this position last time. If null then it is a new\n * item.\n * - `item` is the current item in the collection\n * - `index` is the position of the item in the collection\n *\n * @internal\n */\n _mismatch(record, item, itemTrackBy, index) {\n // The previous record after which we will append the current one.\n let previousRecord;\n if (record === null) {\n previousRecord = this._itTail;\n } else {\n previousRecord = record._prev;\n // Remove the record from the collection since we know it does not match the item.\n this._remove(record);\n }\n // See if we have evicted the item, which used to be at some anterior position of _itHead list.\n record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (record !== null) {\n // It is an item which we have evicted earlier: reinsert it back into the list.\n // But first we need to check if identity changed, so we can update in view if necessary.\n if (!Object.is(record.item, item)) this._addIdentityChange(record, item);\n this._reinsertAfter(record, previousRecord, index);\n } else {\n // Attempt to see if the item is at some posterior position of _itHead list.\n record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);\n if (record !== null) {\n // We have the item in _itHead at/after `index` position. We need to move it forward in the\n // collection.\n // But first we need to check if identity changed, so we can update in view if necessary.\n if (!Object.is(record.item, item)) this._addIdentityChange(record, item);\n this._moveAfter(record, previousRecord, index);\n } else {\n // It is a new item: add it.\n record = this._addAfter(new IterableChangeRecord_(item, itemTrackBy), previousRecord, index);\n }\n }\n return record;\n }\n /**\n * This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)\n *\n * Use case: `[a, a]` => `[b, a, a]`\n *\n * If we did not have this check then the insertion of `b` would:\n * 1) evict first `a`\n * 2) insert `b` at `0` index.\n * 3) leave `a` at index `1` as is. <-- this is wrong!\n * 3) reinsert `a` at index 2. <-- this is wrong!\n *\n * The correct behavior is:\n * 1) evict first `a`\n * 2) insert `b` at `0` index.\n * 3) reinsert `a` at index 1.\n * 3) move `a` at from `1` to `2`.\n *\n *\n * Double check that we have not evicted a duplicate item. We need to check if the item type may\n * have already been removed:\n * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted\n * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a\n * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'\n * at the end.\n *\n * @internal\n */\n _verifyReinsertion(record, item, itemTrackBy, index) {\n let reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (reinsertRecord !== null) {\n record = this._reinsertAfter(reinsertRecord, record._prev, index);\n } else if (record.currentIndex != index) {\n record.currentIndex = index;\n this._addToMoves(record, index);\n }\n return record;\n }\n /**\n * Get rid of any excess {@link IterableChangeRecord_}s from the previous collection\n *\n * - `record` The first excess {@link IterableChangeRecord_}.\n *\n * @internal\n */\n _truncate(record) {\n // Anything after that needs to be removed;\n while (record !== null) {\n const nextRecord = record._next;\n this._addToRemovals(this._unlink(record));\n record = nextRecord;\n }\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.clear();\n }\n if (this._additionsTail !== null) {\n this._additionsTail._nextAdded = null;\n }\n if (this._movesTail !== null) {\n this._movesTail._nextMoved = null;\n }\n if (this._itTail !== null) {\n this._itTail._next = null;\n }\n if (this._removalsTail !== null) {\n this._removalsTail._nextRemoved = null;\n }\n if (this._identityChangesTail !== null) {\n this._identityChangesTail._nextIdentityChange = null;\n }\n }\n /** @internal */\n _reinsertAfter(record, prevRecord, index) {\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.remove(record);\n }\n const prev = record._prevRemoved;\n const next = record._nextRemoved;\n if (prev === null) {\n this._removalsHead = next;\n } else {\n prev._nextRemoved = next;\n }\n if (next === null) {\n this._removalsTail = prev;\n } else {\n next._prevRemoved = prev;\n }\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n /** @internal */\n _moveAfter(record, prevRecord, index) {\n this._unlink(record);\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n /** @internal */\n _addAfter(record, prevRecord, index) {\n this._insertAfter(record, prevRecord, index);\n if (this._additionsTail === null) {\n // TODO(vicb):\n // assert(this._additionsHead === null);\n this._additionsTail = this._additionsHead = record;\n } else {\n // TODO(vicb):\n // assert(_additionsTail._nextAdded === null);\n // assert(record._nextAdded === null);\n this._additionsTail = this._additionsTail._nextAdded = record;\n }\n return record;\n }\n /** @internal */\n _insertAfter(record, prevRecord, index) {\n // TODO(vicb):\n // assert(record != prevRecord);\n // assert(record._next === null);\n // assert(record._prev === null);\n const next = prevRecord === null ? this._itHead : prevRecord._next;\n // TODO(vicb):\n // assert(next != record);\n // assert(prevRecord != record);\n record._next = next;\n record._prev = prevRecord;\n if (next === null) {\n this._itTail = record;\n } else {\n next._prev = record;\n }\n if (prevRecord === null) {\n this._itHead = record;\n } else {\n prevRecord._next = record;\n }\n if (this._linkedRecords === null) {\n this._linkedRecords = new _DuplicateMap();\n }\n this._linkedRecords.put(record);\n record.currentIndex = index;\n return record;\n }\n /** @internal */\n _remove(record) {\n return this._addToRemovals(this._unlink(record));\n }\n /** @internal */\n _unlink(record) {\n if (this._linkedRecords !== null) {\n this._linkedRecords.remove(record);\n }\n const prev = record._prev;\n const next = record._next;\n // TODO(vicb):\n // assert((record._prev = null) === null);\n // assert((record._next = null) === null);\n if (prev === null) {\n this._itHead = next;\n } else {\n prev._next = next;\n }\n if (next === null) {\n this._itTail = prev;\n } else {\n next._prev = prev;\n }\n return record;\n }\n /** @internal */\n _addToMoves(record, toIndex) {\n // TODO(vicb):\n // assert(record._nextMoved === null);\n if (record.previousIndex === toIndex) {\n return record;\n }\n if (this._movesTail === null) {\n // TODO(vicb):\n // assert(_movesHead === null);\n this._movesTail = this._movesHead = record;\n } else {\n // TODO(vicb):\n // assert(_movesTail._nextMoved === null);\n this._movesTail = this._movesTail._nextMoved = record;\n }\n return record;\n }\n _addToRemovals(record) {\n if (this._unlinkedRecords === null) {\n this._unlinkedRecords = new _DuplicateMap();\n }\n this._unlinkedRecords.put(record);\n record.currentIndex = null;\n record._nextRemoved = null;\n if (this._removalsTail === null) {\n // TODO(vicb):\n // assert(_removalsHead === null);\n this._removalsTail = this._removalsHead = record;\n record._prevRemoved = null;\n } else {\n // TODO(vicb):\n // assert(_removalsTail._nextRemoved === null);\n // assert(record._nextRemoved === null);\n record._prevRemoved = this._removalsTail;\n this._removalsTail = this._removalsTail._nextRemoved = record;\n }\n return record;\n }\n /** @internal */\n _addIdentityChange(record, item) {\n record.item = item;\n if (this._identityChangesTail === null) {\n this._identityChangesTail = this._identityChangesHead = record;\n } else {\n this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record;\n }\n return record;\n }\n}\nclass IterableChangeRecord_ {\n constructor(item, trackById) {\n this.item = item;\n this.trackById = trackById;\n this.currentIndex = null;\n this.previousIndex = null;\n /** @internal */\n this._nextPrevious = null;\n /** @internal */\n this._prev = null;\n /** @internal */\n this._next = null;\n /** @internal */\n this._prevDup = null;\n /** @internal */\n this._nextDup = null;\n /** @internal */\n this._prevRemoved = null;\n /** @internal */\n this._nextRemoved = null;\n /** @internal */\n this._nextAdded = null;\n /** @internal */\n this._nextMoved = null;\n /** @internal */\n this._nextIdentityChange = null;\n }\n}\n// A linked list of IterableChangeRecords with the same IterableChangeRecord_.item\nclass _DuplicateItemRecordList {\n constructor() {\n /** @internal */\n this._head = null;\n /** @internal */\n this._tail = null;\n }\n /**\n * Append the record to the list of duplicates.\n *\n * Note: by design all records in the list of duplicates hold the same value in record.item.\n */\n add(record) {\n if (this._head === null) {\n this._head = this._tail = record;\n record._nextDup = null;\n record._prevDup = null;\n } else {\n // TODO(vicb):\n // assert(record.item == _head.item ||\n // record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN);\n this._tail._nextDup = record;\n record._prevDup = this._tail;\n record._nextDup = null;\n this._tail = record;\n }\n }\n // Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and\n // IterableChangeRecord_.currentIndex >= atOrAfterIndex\n get(trackById, atOrAfterIndex) {\n let record;\n for (record = this._head; record !== null; record = record._nextDup) {\n if ((atOrAfterIndex === null || atOrAfterIndex <= record.currentIndex) && Object.is(record.trackById, trackById)) {\n return record;\n }\n }\n return null;\n }\n /**\n * Remove one {@link IterableChangeRecord_} from the list of duplicates.\n *\n * Returns whether the list of duplicates is empty.\n */\n remove(record) {\n // TODO(vicb):\n // assert(() {\n // // verify that the record being removed is in the list.\n // for (IterableChangeRecord_ cursor = _head; cursor != null; cursor = cursor._nextDup) {\n // if (identical(cursor, record)) return true;\n // }\n // return false;\n //});\n const prev = record._prevDup;\n const next = record._nextDup;\n if (prev === null) {\n this._head = next;\n } else {\n prev._nextDup = next;\n }\n if (next === null) {\n this._tail = prev;\n } else {\n next._prevDup = prev;\n }\n return this._head === null;\n }\n}\nclass _DuplicateMap {\n constructor() {\n this.map = new Map();\n }\n put(record) {\n const key = record.trackById;\n let duplicates = this.map.get(key);\n if (!duplicates) {\n duplicates = new _DuplicateItemRecordList();\n this.map.set(key, duplicates);\n }\n duplicates.add(record);\n }\n /**\n * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we\n * have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.\n *\n * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we\n * have any more `a`s needs to return the second `a`.\n */\n get(trackById, atOrAfterIndex) {\n const key = trackById;\n const recordList = this.map.get(key);\n return recordList ? recordList.get(trackById, atOrAfterIndex) : null;\n }\n /**\n * Removes a {@link IterableChangeRecord_} from the list of duplicates.\n *\n * The list of duplicates also is removed from the map if it gets empty.\n */\n remove(record) {\n const key = record.trackById;\n const recordList = this.map.get(key);\n // Remove the list of duplicates when it gets empty\n if (recordList.remove(record)) {\n this.map.delete(key);\n }\n return record;\n }\n get isEmpty() {\n return this.map.size === 0;\n }\n clear() {\n this.map.clear();\n }\n}\nfunction getPreviousIndex(item, addRemoveOffset, moveOffsets) {\n const previousIndex = item.previousIndex;\n if (previousIndex === null) return previousIndex;\n let moveOffset = 0;\n if (moveOffsets && previousIndex < moveOffsets.length) {\n moveOffset = moveOffsets[previousIndex];\n }\n return previousIndex + addRemoveOffset + moveOffset;\n}\nclass DefaultKeyValueDifferFactory {\n constructor() {}\n supports(obj) {\n return obj instanceof Map || isJsObject(obj);\n }\n create() {\n return new DefaultKeyValueDiffer();\n }\n}\nclass DefaultKeyValueDiffer {\n constructor() {\n this._records = new Map();\n this._mapHead = null;\n // _appendAfter is used in the check loop\n this._appendAfter = null;\n this._previousMapHead = null;\n this._changesHead = null;\n this._changesTail = null;\n this._additionsHead = null;\n this._additionsTail = null;\n this._removalsHead = null;\n this._removalsTail = null;\n }\n get isDirty() {\n return this._additionsHead !== null || this._changesHead !== null || this._removalsHead !== null;\n }\n forEachItem(fn) {\n let record;\n for (record = this._mapHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n forEachPreviousItem(fn) {\n let record;\n for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n forEachChangedItem(fn) {\n let record;\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n fn(record);\n }\n }\n forEachAddedItem(fn) {\n let record;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n forEachRemovedItem(fn) {\n let record;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n diff(map) {\n if (!map) {\n map = new Map();\n } else if (!(map instanceof Map || isJsObject(map))) {\n throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode && `Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);\n }\n return this.check(map) ? this : null;\n }\n onDestroy() {}\n /**\n * Check the current state of the map vs the previous.\n * The algorithm is optimised for when the keys do no change.\n */\n check(map) {\n this._reset();\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n this._forEach(map, (value, key) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n } else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n this._removalsHead = insertBefore;\n for (let record = insertBefore; record !== null; record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n // Make sure tails have no next records from previous runs\n if (this._changesTail) this._changesTail._nextChanged = null;\n if (this._additionsTail) this._additionsTail._nextAdded = null;\n return this.isDirty;\n }\n /**\n * Inserts a record before `before` or append at the end of the list when `before` is null.\n *\n * Notes:\n * - This method appends at `this._appendAfter`,\n * - This method updates `this._appendAfter`,\n * - The return value is the new value for the insertion pointer.\n */\n _insertBeforeOrAppend(before, record) {\n if (before) {\n const prev = before._prev;\n record._next = before;\n record._prev = prev;\n before._prev = record;\n if (prev) {\n prev._next = record;\n }\n if (before === this._mapHead) {\n this._mapHead = record;\n }\n this._appendAfter = before;\n return before;\n }\n if (this._appendAfter) {\n this._appendAfter._next = record;\n record._prev = this._appendAfter;\n } else {\n this._mapHead = record;\n }\n this._appendAfter = record;\n return null;\n }\n _getOrCreateRecordForKey(key, value) {\n if (this._records.has(key)) {\n const record = this._records.get(key);\n this._maybeAddToChanges(record, value);\n const prev = record._prev;\n const next = record._next;\n if (prev) {\n prev._next = next;\n }\n if (next) {\n next._prev = prev;\n }\n record._next = null;\n record._prev = null;\n return record;\n }\n const record = new KeyValueChangeRecord_(key);\n this._records.set(key, record);\n record.currentValue = value;\n this._addToAdditions(record);\n return record;\n }\n /** @internal */\n _reset() {\n if (this.isDirty) {\n let record;\n // let `_previousMapHead` contain the state of the map before the changes\n this._previousMapHead = this._mapHead;\n for (record = this._previousMapHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n // Update `record.previousValue` with the value of the item before the changes\n // We need to update all changed items (that's those which have been added and changed)\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n record.previousValue = record.currentValue;\n }\n for (record = this._additionsHead; record != null; record = record._nextAdded) {\n record.previousValue = record.currentValue;\n }\n this._changesHead = this._changesTail = null;\n this._additionsHead = this._additionsTail = null;\n this._removalsHead = null;\n }\n }\n // Add the record or a given key to the list of changes only when the value has actually changed\n _maybeAddToChanges(record, newValue) {\n if (!Object.is(newValue, record.currentValue)) {\n record.previousValue = record.currentValue;\n record.currentValue = newValue;\n this._addToChanges(record);\n }\n }\n _addToAdditions(record) {\n if (this._additionsHead === null) {\n this._additionsHead = this._additionsTail = record;\n } else {\n this._additionsTail._nextAdded = record;\n this._additionsTail = record;\n }\n }\n _addToChanges(record) {\n if (this._changesHead === null) {\n this._changesHead = this._changesTail = record;\n } else {\n this._changesTail._nextChanged = record;\n this._changesTail = record;\n }\n }\n /** @internal */\n _forEach(obj, fn) {\n if (obj instanceof Map) {\n obj.forEach(fn);\n } else {\n Object.keys(obj).forEach(k => fn(obj[k], k));\n }\n }\n}\nclass KeyValueChangeRecord_ {\n constructor(key) {\n this.key = key;\n this.previousValue = null;\n this.currentValue = null;\n /** @internal */\n this._nextPrevious = null;\n /** @internal */\n this._next = null;\n /** @internal */\n this._prev = null;\n /** @internal */\n this._nextAdded = null;\n /** @internal */\n this._nextRemoved = null;\n /** @internal */\n this._nextChanged = null;\n }\n}\nfunction defaultIterableDiffersFactory() {\n return new IterableDiffers([new DefaultIterableDifferFactory()]);\n}\n/**\n * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.\n *\n * @publicApi\n */\nclass IterableDiffers {\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: IterableDiffers,\n providedIn: 'root',\n factory: defaultIterableDiffersFactory\n });\n }\n constructor(factories) {\n this.factories = factories;\n }\n static create(factories, parent) {\n if (parent != null) {\n const copied = parent.factories.slice();\n factories = factories.concat(copied);\n }\n return new IterableDiffers(factories);\n }\n /**\n * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the\n * inherited {@link IterableDiffers} instance with the provided factories and return a new\n * {@link IterableDiffers} instance.\n *\n * @usageNotes\n * ### Example\n *\n * The following example shows how to extend an existing list of factories,\n * which will only be applied to the injector for this component and its children.\n * This step is all that's required to make a new {@link IterableDiffer} available.\n *\n * ```\n * @Component({\n * viewProviders: [\n * IterableDiffers.extend([new ImmutableListDiffer()])\n * ]\n * })\n * ```\n */\n static extend(factories) {\n return {\n provide: IterableDiffers,\n useFactory: parent => {\n // if parent is null, it means that we are in the root injector and we have just overridden\n // the default injection mechanism for IterableDiffers, in such a case just assume\n // `defaultIterableDiffersFactory`.\n return IterableDiffers.create(factories, parent || defaultIterableDiffersFactory());\n },\n // Dependency technically isn't optional, but we can provide a better error message this way.\n deps: [[IterableDiffers, new SkipSelf(), new Optional()]]\n };\n }\n find(iterable) {\n const factory = this.factories.find(f => f.supports(iterable));\n if (factory != null) {\n return factory;\n } else {\n throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode && `Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);\n }\n }\n}\nfunction getTypeNameForDebugging(type) {\n return type['name'] || typeof type;\n}\nfunction defaultKeyValueDiffersFactory() {\n return new KeyValueDiffers([new DefaultKeyValueDifferFactory()]);\n}\n/**\n * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.\n *\n * @publicApi\n */\nclass KeyValueDiffers {\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: KeyValueDiffers,\n providedIn: 'root',\n factory: defaultKeyValueDiffersFactory\n });\n }\n constructor(factories) {\n this.factories = factories;\n }\n static create(factories, parent) {\n if (parent) {\n const copied = parent.factories.slice();\n factories = factories.concat(copied);\n }\n return new KeyValueDiffers(factories);\n }\n /**\n * Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the\n * inherited {@link KeyValueDiffers} instance with the provided factories and return a new\n * {@link KeyValueDiffers} instance.\n *\n * @usageNotes\n * ### Example\n *\n * The following example shows how to extend an existing list of factories,\n * which will only be applied to the injector for this component and its children.\n * This step is all that's required to make a new {@link KeyValueDiffer} available.\n *\n * ```\n * @Component({\n * viewProviders: [\n * KeyValueDiffers.extend([new ImmutableMapDiffer()])\n * ]\n * })\n * ```\n */\n static extend(factories) {\n return {\n provide: KeyValueDiffers,\n useFactory: parent => {\n // if parent is null, it means that we are in the root injector and we have just overridden\n // the default injection mechanism for KeyValueDiffers, in such a case just assume\n // `defaultKeyValueDiffersFactory`.\n return KeyValueDiffers.create(factories, parent || defaultKeyValueDiffersFactory());\n },\n // Dependency technically isn't optional, but we can provide a better error message this way.\n deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]]\n };\n }\n find(kv) {\n const factory = this.factories.find(f => f.supports(kv));\n if (factory) {\n return factory;\n }\n throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode && `Cannot find a differ supporting object '${kv}'`);\n }\n}\n\n/**\n * Structural diffing for `Object`s and `Map`s.\n */\nconst keyValDiff = [new DefaultKeyValueDifferFactory()];\n/**\n * Structural diffing for `Iterable` types such as `Array`s.\n */\nconst iterableDiff = [new DefaultIterableDifferFactory()];\nconst defaultIterableDiffers = new IterableDiffers(iterableDiff);\nconst defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);\n\n/**\n * @module\n * @description\n * Change detection enables data binding in Angular.\n */\n\n/**\n * This platform has to be included in any other platform\n *\n * @publicApi\n */\nconst platformCore = createPlatformFactory(null, 'core', []);\n\n/**\n * Re-exported by `BrowserModule`, which is included automatically in the root\n * `AppModule` when you create a new app with the CLI `new` command. Eagerly injects\n * `ApplicationRef` to instantiate it.\n *\n * @publicApi\n */\nclass ApplicationModule {\n // Inject ApplicationRef to make it eager...\n constructor(appRef) {}\n static {\n this.ɵfac = function ApplicationModule_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || ApplicationModule)(ɵɵinject(ApplicationRef));\n };\n }\n static {\n this.ɵmod = /*@__PURE__*/ɵɵdefineNgModule({\n type: ApplicationModule\n });\n }\n static {\n this.ɵinj = /*@__PURE__*/ɵɵdefineInjector({});\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ApplicationModule, [{\n type: NgModule\n }], () => [{\n type: ApplicationRef\n }], null);\n})();\n\n/**\n * The default equality function used for `signal` and `computed`, which uses referential equality.\n */\nfunction defaultEquals(a, b) {\n return Object.is(a, b);\n}\n\n/**\n * The currently active consumer `ReactiveNode`, if running code in a reactive context.\n *\n * Change this via `setActiveConsumer`.\n */\nlet activeConsumer = null;\nlet inNotificationPhase = false;\n/**\n * Global epoch counter. Incremented whenever a source signal is set.\n */\nlet epoch = 1;\n/**\n * Symbol used to tell `Signal`s apart from other functions.\n *\n * This can be used to auto-unwrap signals in various cases, or to auto-wrap non-signal values.\n */\nconst SIGNAL = /* @__PURE__ */Symbol('SIGNAL');\nfunction setActiveConsumer(consumer) {\n const prev = activeConsumer;\n activeConsumer = consumer;\n return prev;\n}\nfunction getActiveConsumer() {\n return activeConsumer;\n}\nfunction isInNotificationPhase() {\n return inNotificationPhase;\n}\nfunction isReactive(value) {\n return value[SIGNAL] !== undefined;\n}\nconst REACTIVE_NODE = {\n version: 0,\n lastCleanEpoch: 0,\n dirty: false,\n producerNode: undefined,\n producerLastReadVersion: undefined,\n producerIndexOfThis: undefined,\n nextProducerIndex: 0,\n liveConsumerNode: undefined,\n liveConsumerIndexOfThis: undefined,\n consumerAllowSignalWrites: false,\n consumerIsAlwaysLive: false,\n producerMustRecompute: () => false,\n producerRecomputeValue: () => {},\n consumerMarkedDirty: () => {},\n consumerOnSignalRead: () => {}\n};\n/**\n * Called by implementations when a producer's signal is read.\n */\nfunction producerAccessed(node) {\n if (inNotificationPhase) {\n throw new Error(typeof ngDevMode !== 'undefined' && ngDevMode ? `Assertion error: signal read during notification phase` : '');\n }\n if (activeConsumer === null) {\n // Accessed outside of a reactive context, so nothing to record.\n return;\n }\n activeConsumer.consumerOnSignalRead(node);\n // This producer is the `idx`th dependency of `activeConsumer`.\n const idx = activeConsumer.nextProducerIndex++;\n assertConsumerNode(activeConsumer);\n if (idx < activeConsumer.producerNode.length && activeConsumer.producerNode[idx] !== node) {\n // There's been a change in producers since the last execution of `activeConsumer`.\n // `activeConsumer.producerNode[idx]` holds a stale dependency which will be be removed and\n // replaced with `this`.\n //\n // If `activeConsumer` isn't live, then this is a no-op, since we can replace the producer in\n // `activeConsumer.producerNode` directly. However, if `activeConsumer` is live, then we need\n // to remove it from the stale producer's `liveConsumer`s.\n if (consumerIsLive(activeConsumer)) {\n const staleProducer = activeConsumer.producerNode[idx];\n producerRemoveLiveConsumerAtIndex(staleProducer, activeConsumer.producerIndexOfThis[idx]);\n // At this point, the only record of `staleProducer` is the reference at\n // `activeConsumer.producerNode[idx]` which will be overwritten below.\n }\n }\n if (activeConsumer.producerNode[idx] !== node) {\n // We're a new dependency of the consumer (at `idx`).\n activeConsumer.producerNode[idx] = node;\n // If the active consumer is live, then add it as a live consumer. If not, then use 0 as a\n // placeholder value.\n activeConsumer.producerIndexOfThis[idx] = consumerIsLive(activeConsumer) ? producerAddLiveConsumer(node, activeConsumer, idx) : 0;\n }\n activeConsumer.producerLastReadVersion[idx] = node.version;\n}\n/**\n * Increment the global epoch counter.\n *\n * Called by source producers (that is, not computeds) whenever their values change.\n */\nfunction producerIncrementEpoch() {\n epoch++;\n}\n/**\n * Ensure this producer's `version` is up-to-date.\n */\nfunction producerUpdateValueVersion(node) {\n if (consumerIsLive(node) && !node.dirty) {\n // A live consumer will be marked dirty by producers, so a clean state means that its version\n // is guaranteed to be up-to-date.\n return;\n }\n if (!node.dirty && node.lastCleanEpoch === epoch) {\n // Even non-live consumers can skip polling if they previously found themselves to be clean at\n // the current epoch, since their dependencies could not possibly have changed (such a change\n // would've increased the epoch).\n return;\n }\n if (!node.producerMustRecompute(node) && !consumerPollProducersForChange(node)) {\n // None of our producers report a change since the last time they were read, so no\n // recomputation of our value is necessary, and we can consider ourselves clean.\n node.dirty = false;\n node.lastCleanEpoch = epoch;\n return;\n }\n node.producerRecomputeValue(node);\n // After recomputing the value, we're no longer dirty.\n node.dirty = false;\n node.lastCleanEpoch = epoch;\n}\n/**\n * Propagate a dirty notification to live consumers of this producer.\n */\nfunction producerNotifyConsumers(node) {\n if (node.liveConsumerNode === undefined) {\n return;\n }\n // Prevent signal reads when we're updating the graph\n const prev = inNotificationPhase;\n inNotificationPhase = true;\n try {\n for (const consumer of node.liveConsumerNode) {\n if (!consumer.dirty) {\n consumerMarkDirty(consumer);\n }\n }\n } finally {\n inNotificationPhase = prev;\n }\n}\n/**\n * Whether this `ReactiveNode` in its producer capacity is currently allowed to initiate updates,\n * based on the current consumer context.\n */\nfunction producerUpdatesAllowed() {\n return activeConsumer?.consumerAllowSignalWrites !== false;\n}\nfunction consumerMarkDirty(node) {\n node.dirty = true;\n producerNotifyConsumers(node);\n node.consumerMarkedDirty?.(node);\n}\n/**\n * Prepare this consumer to run a computation in its reactive context.\n *\n * Must be called by subclasses which represent reactive computations, before those computations\n * begin.\n */\nfunction consumerBeforeComputation(node) {\n node && (node.nextProducerIndex = 0);\n return setActiveConsumer(node);\n}\n/**\n * Finalize this consumer's state after a reactive computation has run.\n *\n * Must be called by subclasses which represent reactive computations, after those computations\n * have finished.\n */\nfunction consumerAfterComputation(node, prevConsumer) {\n setActiveConsumer(prevConsumer);\n if (!node || node.producerNode === undefined || node.producerIndexOfThis === undefined || node.producerLastReadVersion === undefined) {\n return;\n }\n if (consumerIsLive(node)) {\n // For live consumers, we need to remove the producer -> consumer edge for any stale producers\n // which weren't dependencies after the recomputation.\n for (let i = node.nextProducerIndex; i < node.producerNode.length; i++) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n }\n }\n // Truncate the producer tracking arrays.\n // Perf note: this is essentially truncating the length to `node.nextProducerIndex`, but\n // benchmarking has shown that individual pop operations are faster.\n while (node.producerNode.length > node.nextProducerIndex) {\n node.producerNode.pop();\n node.producerLastReadVersion.pop();\n node.producerIndexOfThis.pop();\n }\n}\n/**\n * Determine whether this consumer has any dependencies which have changed since the last time\n * they were read.\n */\nfunction consumerPollProducersForChange(node) {\n assertConsumerNode(node);\n // Poll producers for change.\n for (let i = 0; i < node.producerNode.length; i++) {\n const producer = node.producerNode[i];\n const seenVersion = node.producerLastReadVersion[i];\n // First check the versions. A mismatch means that the producer's value is known to have\n // changed since the last time we read it.\n if (seenVersion !== producer.version) {\n return true;\n }\n // The producer's version is the same as the last time we read it, but it might itself be\n // stale. Force the producer to recompute its version (calculating a new value if necessary).\n producerUpdateValueVersion(producer);\n // Now when we do this check, `producer.version` is guaranteed to be up to date, so if the\n // versions still match then it has not changed since the last time we read it.\n if (seenVersion !== producer.version) {\n return true;\n }\n }\n return false;\n}\n/**\n * Disconnect this consumer from the graph.\n */\nfunction consumerDestroy(node) {\n assertConsumerNode(node);\n if (consumerIsLive(node)) {\n // Drop all connections from the graph to this node.\n for (let i = 0; i < node.producerNode.length; i++) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n }\n }\n // Truncate all the arrays to drop all connection from this node to the graph.\n node.producerNode.length = node.producerLastReadVersion.length = node.producerIndexOfThis.length = 0;\n if (node.liveConsumerNode) {\n node.liveConsumerNode.length = node.liveConsumerIndexOfThis.length = 0;\n }\n}\n/**\n * Add `consumer` as a live consumer of this node.\n *\n * Note that this operation is potentially transitive. If this node becomes live, then it becomes\n * a live consumer of all of its current producers.\n */\nfunction producerAddLiveConsumer(node, consumer, indexOfThis) {\n assertProducerNode(node);\n if (node.liveConsumerNode.length === 0 && isConsumerNode(node)) {\n // When going from 0 to 1 live consumers, we become a live consumer to our producers.\n for (let i = 0; i < node.producerNode.length; i++) {\n node.producerIndexOfThis[i] = producerAddLiveConsumer(node.producerNode[i], node, i);\n }\n }\n node.liveConsumerIndexOfThis.push(indexOfThis);\n return node.liveConsumerNode.push(consumer) - 1;\n}\n/**\n * Remove the live consumer at `idx`.\n */\nfunction producerRemoveLiveConsumerAtIndex(node, idx) {\n assertProducerNode(node);\n if (typeof ngDevMode !== 'undefined' && ngDevMode && idx >= node.liveConsumerNode.length) {\n throw new Error(`Assertion error: active consumer index ${idx} is out of bounds of ${node.liveConsumerNode.length} consumers)`);\n }\n if (node.liveConsumerNode.length === 1 && isConsumerNode(node)) {\n // When removing the last live consumer, we will no longer be live. We need to remove\n // ourselves from our producers' tracking (which may cause consumer-producers to lose\n // liveness as well).\n for (let i = 0; i < node.producerNode.length; i++) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n }\n }\n // Move the last value of `liveConsumers` into `idx`. Note that if there's only a single\n // live consumer, this is a no-op.\n const lastIdx = node.liveConsumerNode.length - 1;\n node.liveConsumerNode[idx] = node.liveConsumerNode[lastIdx];\n node.liveConsumerIndexOfThis[idx] = node.liveConsumerIndexOfThis[lastIdx];\n // Truncate the array.\n node.liveConsumerNode.length--;\n node.liveConsumerIndexOfThis.length--;\n // If the index is still valid, then we need to fix the index pointer from the producer to this\n // consumer, and update it from `lastIdx` to `idx` (accounting for the move above).\n if (idx < node.liveConsumerNode.length) {\n const idxProducer = node.liveConsumerIndexOfThis[idx];\n const consumer = node.liveConsumerNode[idx];\n assertConsumerNode(consumer);\n consumer.producerIndexOfThis[idxProducer] = idx;\n }\n}\nfunction consumerIsLive(node) {\n return node.consumerIsAlwaysLive || (node?.liveConsumerNode?.length ?? 0) > 0;\n}\nfunction assertConsumerNode(node) {\n node.producerNode ??= [];\n node.producerIndexOfThis ??= [];\n node.producerLastReadVersion ??= [];\n}\nfunction assertProducerNode(node) {\n node.liveConsumerNode ??= [];\n node.liveConsumerIndexOfThis ??= [];\n}\nfunction isConsumerNode(node) {\n return node.producerNode !== undefined;\n}\n\n/**\n * Create a computed signal which derives a reactive value from an expression.\n */\nfunction createComputed(computation) {\n const node = Object.create(COMPUTED_NODE);\n node.computation = computation;\n const computed = () => {\n // Check if the value needs updating before returning it.\n producerUpdateValueVersion(node);\n // Record that someone looked at this signal.\n producerAccessed(node);\n if (node.value === ERRORED) {\n throw node.error;\n }\n return node.value;\n };\n computed[SIGNAL] = node;\n return computed;\n}\n/**\n * A dedicated symbol used before a computed value has been calculated for the first time.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nconst UNSET = /* @__PURE__ */Symbol('UNSET');\n/**\n * A dedicated symbol used in place of a computed signal value to indicate that a given computation\n * is in progress. Used to detect cycles in computation chains.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nconst COMPUTING = /* @__PURE__ */Symbol('COMPUTING');\n/**\n * A dedicated symbol used in place of a computed signal value to indicate that a given computation\n * failed. The thrown error is cached until the computation gets dirty again.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nconst ERRORED = /* @__PURE__ */Symbol('ERRORED');\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst COMPUTED_NODE = /* @__PURE__ */(() => {\n return {\n ...REACTIVE_NODE,\n value: UNSET,\n dirty: true,\n error: null,\n equal: defaultEquals,\n producerMustRecompute(node) {\n // Force a recomputation if there's no current value, or if the current value is in the\n // process of being calculated (which should throw an error).\n return node.value === UNSET || node.value === COMPUTING;\n },\n producerRecomputeValue(node) {\n if (node.value === COMPUTING) {\n // Our computation somehow led to a cyclic read of itself.\n throw new Error('Detected cycle in computations.');\n }\n const oldValue = node.value;\n node.value = COMPUTING;\n const prevConsumer = consumerBeforeComputation(node);\n let newValue;\n try {\n newValue = node.computation();\n } catch (err) {\n newValue = ERRORED;\n node.error = err;\n } finally {\n consumerAfterComputation(node, prevConsumer);\n }\n if (oldValue !== UNSET && oldValue !== ERRORED && newValue !== ERRORED && node.equal(oldValue, newValue)) {\n // No change to `valueVersion` - old and new values are\n // semantically equivalent.\n node.value = oldValue;\n return;\n }\n node.value = newValue;\n node.version++;\n }\n };\n})();\nfunction defaultThrowError() {\n throw new Error();\n}\nlet throwInvalidWriteToSignalErrorFn = defaultThrowError;\nfunction throwInvalidWriteToSignalError() {\n throwInvalidWriteToSignalErrorFn();\n}\nfunction setThrowInvalidWriteToSignalError(fn) {\n throwInvalidWriteToSignalErrorFn = fn;\n}\n\n/**\n * If set, called after `WritableSignal`s are updated.\n *\n * This hook can be used to achieve various effects, such as running effects synchronously as part\n * of setting a signal.\n */\nlet postSignalSetFn = null;\n/**\n * Create a `Signal` that can be set or updated directly.\n */\nfunction createSignal(initialValue) {\n const node = Object.create(SIGNAL_NODE);\n node.value = initialValue;\n const getter = () => {\n producerAccessed(node);\n return node.value;\n };\n getter[SIGNAL] = node;\n return getter;\n}\nfunction setPostSignalSetFn(fn) {\n const prev = postSignalSetFn;\n postSignalSetFn = fn;\n return prev;\n}\nfunction signalGetFn() {\n producerAccessed(this);\n return this.value;\n}\nfunction signalSetFn(node, newValue) {\n if (!producerUpdatesAllowed()) {\n throwInvalidWriteToSignalError();\n }\n if (!node.equal(node.value, newValue)) {\n node.value = newValue;\n signalValueChanged(node);\n }\n}\nfunction signalUpdateFn(node, updater) {\n if (!producerUpdatesAllowed()) {\n throwInvalidWriteToSignalError();\n }\n signalSetFn(node, updater(node.value));\n}\nfunction runPostSignalSetFn() {\n postSignalSetFn?.();\n}\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst SIGNAL_NODE = /* @__PURE__ */(() => {\n return {\n ...REACTIVE_NODE,\n equal: defaultEquals,\n value: undefined\n };\n})();\nfunction signalValueChanged(node) {\n node.version++;\n producerIncrementEpoch();\n producerNotifyConsumers(node);\n postSignalSetFn?.();\n}\nfunction createWatch(fn, schedule, allowSignalWrites) {\n const node = Object.create(WATCH_NODE);\n if (allowSignalWrites) {\n node.consumerAllowSignalWrites = true;\n }\n node.fn = fn;\n node.schedule = schedule;\n const registerOnCleanup = cleanupFn => {\n node.cleanupFn = cleanupFn;\n };\n function isWatchNodeDestroyed(node) {\n return node.fn === null && node.schedule === null;\n }\n function destroyWatchNode(node) {\n if (!isWatchNodeDestroyed(node)) {\n consumerDestroy(node); // disconnect watcher from the reactive graph\n node.cleanupFn();\n // nullify references to the integration functions to mark node as destroyed\n node.fn = null;\n node.schedule = null;\n node.cleanupFn = NOOP_CLEANUP_FN;\n }\n }\n const run = () => {\n if (node.fn === null) {\n // trying to run a destroyed watch is noop\n return;\n }\n if (isInNotificationPhase()) {\n throw new Error(`Schedulers cannot synchronously execute watches while scheduling.`);\n }\n node.dirty = false;\n if (node.hasRun && !consumerPollProducersForChange(node)) {\n return;\n }\n node.hasRun = true;\n const prevConsumer = consumerBeforeComputation(node);\n try {\n node.cleanupFn();\n node.cleanupFn = NOOP_CLEANUP_FN;\n node.fn(registerOnCleanup);\n } finally {\n consumerAfterComputation(node, prevConsumer);\n }\n };\n node.ref = {\n notify: () => consumerMarkDirty(node),\n run,\n cleanup: () => node.cleanupFn(),\n destroy: () => destroyWatchNode(node),\n [SIGNAL]: node\n };\n return node.ref;\n}\nconst NOOP_CLEANUP_FN = () => {};\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst WATCH_NODE = /* @__PURE__ */(() => {\n return {\n ...REACTIVE_NODE,\n consumerIsAlwaysLive: true,\n consumerAllowSignalWrites: false,\n consumerMarkedDirty: node => {\n if (node.schedule !== null) {\n node.schedule(node.ref);\n }\n },\n hasRun: false,\n cleanupFn: NOOP_CLEANUP_FN\n };\n})();\nfunction setAlternateWeakRefImpl(impl) {\n // TODO: remove this function\n}\n\n/**\n * Internal create application API that implements the core application creation logic and optional\n * bootstrap logic.\n *\n * Platforms (such as `platform-browser`) may require different set of application and platform\n * providers for an application to function correctly. As a result, platforms may use this function\n * internally and supply the necessary providers during the bootstrap, while exposing\n * platform-specific APIs as a part of their public API.\n *\n * @returns A promise that returns an `ApplicationRef` instance once resolved.\n */\nfunction internalCreateApplication(config) {\n try {\n const {\n rootComponent,\n appProviders,\n platformProviders\n } = config;\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && rootComponent !== undefined) {\n assertStandaloneComponentType(rootComponent);\n }\n const platformInjector = createOrReusePlatformInjector(platformProviders);\n // Create root application injector based on a set of providers configured at the platform\n // bootstrap level as well as providers passed to the bootstrap call by a user.\n const allAppProviders = [internalProvideZoneChangeDetection({}), {\n provide: ChangeDetectionScheduler,\n useExisting: ChangeDetectionSchedulerImpl\n }, ...(appProviders || [])];\n const adapter = new EnvironmentNgModuleRefAdapter({\n providers: allAppProviders,\n parent: platformInjector,\n debugName: typeof ngDevMode === 'undefined' || ngDevMode ? 'Environment Injector' : '',\n // We skip environment initializers because we need to run them inside the NgZone, which\n // happens after we get the NgZone instance from the Injector.\n runEnvironmentInitializers: false\n });\n return bootstrap({\n r3Injector: adapter.injector,\n platformInjector,\n rootComponent\n });\n } catch (e) {\n return Promise.reject(e);\n }\n}\n\n/**\n * Retrieves all defer blocks in a given LView.\n *\n * @param lView lView with defer blocks\n * @param deferBlocks defer block aggregator array\n */\nfunction getDeferBlocks(lView, deferBlocks) {\n const tView = lView[TVIEW];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (isLContainer(lView[i])) {\n const lContainer = lView[i];\n // An LContainer may represent an instance of a defer block, in which case\n // we store it as a result. Otherwise, keep iterating over LContainer views and\n // look for defer blocks.\n const isLast = i === tView.bindingStartIndex - 1;\n if (!isLast) {\n const tNode = tView.data[i];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (isTDeferBlockDetails(tDetails)) {\n deferBlocks.push({\n lContainer,\n lView,\n tNode,\n tDetails\n });\n // This LContainer represents a defer block, so we exit\n // this iteration and don't inspect views in this LContainer.\n continue;\n }\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n getDeferBlocks(lContainer[i], deferBlocks);\n }\n } else if (isLView(lView[i])) {\n // This is a component, enter the `getDeferBlocks` recursively.\n getDeferBlocks(lView[i], deferBlocks);\n }\n }\n}\nfunction invokeRegisteredListeners(event) {\n const handlerFns = event.currentTarget?.__jsaction_fns?.get(event.type);\n if (!handlerFns) {\n return;\n }\n for (const handler of handlerFns) {\n handler(event);\n }\n}\nfunction setJSActionAttributes(nativeElement, eventTypes) {\n if (!eventTypes.length) {\n return;\n }\n const parts = eventTypes.reduce((prev, curr) => prev + curr + ':;', '');\n const existingAttr = nativeElement.getAttribute(Attribute$1.JSACTION);\n nativeElement.setAttribute(Attribute$1.JSACTION, `${existingAttr ?? ''}${parts}`);\n}\nconst sharedStashFunction = (rEl, eventType, listenerFn) => {\n const el = rEl;\n const eventListenerMap = el.__jsaction_fns ?? new Map();\n const eventListeners = eventListenerMap.get(eventType) ?? [];\n eventListeners.push(listenerFn);\n eventListenerMap.set(eventType, eventListeners);\n el.__jsaction_fns = eventListenerMap;\n};\nconst removeListeners = el => {\n el.removeAttribute(Attribute$1.JSACTION);\n el.__jsaction_fns = undefined;\n};\nconst JSACTION_EVENT_CONTRACT = new InjectionToken(ngDevMode ? 'EVENT_CONTRACT_DETAILS' : '', {\n providedIn: 'root',\n factory: () => ({})\n});\n\n/**\n * A set of DOM elements with `jsaction` attributes.\n */\nconst jsactionSet = new Set();\n/**\n * Determines whether Event Replay feature should be activated on the client.\n */\nfunction shouldEnableEventReplay(injector) {\n return injector.get(IS_EVENT_REPLAY_ENABLED, EVENT_REPLAY_ENABLED_DEFAULT);\n}\n/**\n * Returns a set of providers required to setup support for event replay.\n * Requires hydration to be enabled separately.\n */\nfunction withEventReplay() {\n return [{\n provide: IS_EVENT_REPLAY_ENABLED,\n useFactory: () => {\n let isEnabled = true;\n if (isPlatformBrowser()) {\n // Note: globalThis[CONTRACT_PROPERTY] may be undefined in case Event Replay feature\n // is enabled, but there are no events configured in this application, in which case\n // we don't activate this feature, since there are no events to replay.\n const appId = inject(APP_ID);\n isEnabled = !!window._ejsas?.[appId];\n }\n if (isEnabled) {\n performanceMarkFeature('NgEventReplay');\n }\n return isEnabled;\n }\n }, {\n provide: ENVIRONMENT_INITIALIZER,\n useValue: () => {\n const injector = inject(Injector);\n if (isPlatformBrowser(injector) && shouldEnableEventReplay(injector)) {\n setStashFn((rEl, eventName, listenerFn) => {\n sharedStashFunction(rEl, eventName, listenerFn);\n jsactionSet.add(rEl);\n });\n }\n },\n multi: true\n }, {\n provide: APP_BOOTSTRAP_LISTENER,\n useFactory: () => {\n if (isPlatformBrowser()) {\n const injector = inject(Injector);\n const appRef = inject(ApplicationRef);\n return () => {\n if (!shouldEnableEventReplay(injector)) {\n return;\n }\n // Kick off event replay logic once hydration for the initial part\n // of the application is completed. This timing is similar to the unclaimed\n // dehydrated views cleanup timing.\n whenStable(appRef).then(() => {\n const eventContractDetails = injector.get(JSACTION_EVENT_CONTRACT);\n initEventReplay(eventContractDetails, injector);\n jsactionSet.forEach(removeListeners);\n // After hydration, we shouldn't need to do anymore work related to\n // event replay anymore.\n setStashFn(() => {});\n });\n };\n }\n return () => {}; // noop for the server code\n },\n multi: true\n }];\n}\nconst initEventReplay = (eventDelegation, injector) => {\n const appId = injector.get(APP_ID);\n // This is set in packages/platform-server/src/utils.ts\n const earlyJsactionData = window._ejsas[appId];\n const eventContract = eventDelegation.instance = new EventContract(new EventContractContainer(earlyJsactionData.c));\n for (const et of earlyJsactionData.et) {\n eventContract.addEvent(et);\n }\n for (const et of earlyJsactionData.etc) {\n eventContract.addEvent(et);\n }\n const eventInfos = getAppScopedQueuedEventInfos(appId);\n eventContract.replayEarlyEventInfos(eventInfos);\n clearAppScopedEarlyEventContract(appId);\n const dispatcher = new EventDispatcher(invokeRegisteredListeners);\n registerDispatcher(eventContract, dispatcher);\n};\n/**\n * Extracts information about all DOM events (added in a template) registered on elements in a give\n * LView. Maps collected events to a corresponding DOM element (an element is used as a key).\n */\nfunction collectDomEventsInfo(tView, lView, eventTypesToReplay) {\n const domEventsInfo = new Map();\n const lCleanup = lView[CLEANUP];\n const tCleanup = tView.cleanup;\n if (!tCleanup || !lCleanup) {\n return domEventsInfo;\n }\n for (let i = 0; i < tCleanup.length;) {\n const firstParam = tCleanup[i++];\n const secondParam = tCleanup[i++];\n if (typeof firstParam !== 'string') {\n continue;\n }\n const eventType = firstParam;\n if (!isEarlyEventType(eventType)) {\n continue;\n }\n if (isCaptureEventType(eventType)) {\n eventTypesToReplay.capture.add(eventType);\n } else {\n eventTypesToReplay.regular.add(eventType);\n }\n const listenerElement = unwrapRNode(lView[secondParam]);\n i++; // move the cursor to the next position (location of the listener idx)\n const useCaptureOrIndx = tCleanup[i++];\n // if useCaptureOrIndx is boolean then report it as is.\n // if useCaptureOrIndx is positive number then it in unsubscribe method\n // if useCaptureOrIndx is negative number then it is a Subscription\n const isDomEvent = typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0;\n if (!isDomEvent) {\n continue;\n }\n if (!domEventsInfo.has(listenerElement)) {\n domEventsInfo.set(listenerElement, [eventType]);\n } else {\n domEventsInfo.get(listenerElement).push(eventType);\n }\n }\n return domEventsInfo;\n}\n\n/**\n * A collection that tracks all serialized views (`ngh` DOM annotations)\n * to avoid duplication. An attempt to add a duplicate view results in the\n * collection returning the index of the previously collected serialized view.\n * This reduces the number of annotations needed for a given page.\n */\nclass SerializedViewCollection {\n constructor() {\n this.views = [];\n this.indexByContent = new Map();\n }\n add(serializedView) {\n const viewAsString = JSON.stringify(serializedView);\n if (!this.indexByContent.has(viewAsString)) {\n const index = this.views.length;\n this.views.push(serializedView);\n this.indexByContent.set(viewAsString, index);\n return index;\n }\n return this.indexByContent.get(viewAsString);\n }\n getAll() {\n return this.views;\n }\n}\n/**\n * Global counter that is used to generate a unique id for TViews\n * during the serialization process.\n */\nlet tViewSsrId = 0;\n/**\n * Generates a unique id for a given TView and returns this id.\n * The id is also stored on this instance of a TView and reused in\n * subsequent calls.\n *\n * This id is needed to uniquely identify and pick up dehydrated views\n * at runtime.\n */\nfunction getSsrId(tView) {\n if (!tView.ssrId) {\n tView.ssrId = `t${tViewSsrId++}`;\n }\n return tView.ssrId;\n}\n/**\n * Computes the number of root nodes in a given view\n * (or child nodes in a given container if a tNode is provided).\n */\nfunction calcNumRootNodes(tView, lView, tNode) {\n const rootNodes = [];\n collectNativeNodes(tView, lView, tNode, rootNodes);\n return rootNodes.length;\n}\n/**\n * Computes the number of root nodes in all views in a given LContainer.\n */\nfunction calcNumRootNodesInLContainer(lContainer) {\n const rootNodes = [];\n collectNativeNodesInLContainer(lContainer, rootNodes);\n return rootNodes.length;\n}\n/**\n * Annotates root level component's LView for hydration,\n * see `annotateHostElementForHydration` for additional information.\n */\nfunction annotateComponentLViewForHydration(lView, context) {\n const hostElement = lView[HOST];\n // Root elements might also be annotated with the `ngSkipHydration` attribute,\n // check if it's present before starting the serialization process.\n if (hostElement && !hostElement.hasAttribute(SKIP_HYDRATION_ATTR_NAME)) {\n return annotateHostElementForHydration(hostElement, lView, context);\n }\n return null;\n}\n/**\n * Annotates root level LContainer for hydration. This happens when a root component\n * injects ViewContainerRef, thus making the component an anchor for a view container.\n * This function serializes the component itself as well as all views from the view\n * container.\n */\nfunction annotateLContainerForHydration(lContainer, context) {\n const componentLView = unwrapLView(lContainer[HOST]);\n // Serialize the root component itself.\n const componentLViewNghIndex = annotateComponentLViewForHydration(componentLView, context);\n if (componentLViewNghIndex === null) {\n // Component was not serialized (for example, if hydration was skipped by adding\n // the `ngSkipHydration` attribute or this component uses i18n blocks in the template,\n // but `withI18nSupport()` was not added), avoid annotating host element with the `ngh`\n // attribute.\n return;\n }\n const hostElement = unwrapRNode(componentLView[HOST]);\n // Serialize all views within this view container.\n const rootLView = lContainer[PARENT];\n const rootLViewNghIndex = annotateHostElementForHydration(hostElement, rootLView, context);\n const renderer = componentLView[RENDERER];\n // For cases when a root component also acts as an anchor node for a ViewContainerRef\n // (for example, when ViewContainerRef is injected in a root component), there is a need\n // to serialize information about the component itself, as well as an LContainer that\n // represents this ViewContainerRef. Effectively, we need to serialize 2 pieces of info:\n // (1) hydration info for the root component itself and (2) hydration info for the\n // ViewContainerRef instance (an LContainer). Each piece of information is included into\n // the hydration data (in the TransferState object) separately, thus we end up with 2 ids.\n // Since we only have 1 root element, we encode both bits of info into a single string:\n // ids are separated by the `|` char (e.g. `10|25`, where `10` is the ngh for a component view\n // and 25 is the `ngh` for a root view which holds LContainer).\n const finalIndex = `${componentLViewNghIndex}|${rootLViewNghIndex}`;\n renderer.setAttribute(hostElement, NGH_ATTR_NAME, finalIndex);\n}\n/**\n * Annotates all components bootstrapped in a given ApplicationRef\n * with info needed for hydration.\n *\n * @param appRef An instance of an ApplicationRef.\n * @param doc A reference to the current Document instance.\n * @return event types that need to be replayed\n */\nfunction annotateForHydration(appRef, doc) {\n const injector = appRef.injector;\n const isI18nHydrationEnabledVal = isI18nHydrationEnabled(injector);\n const serializedViewCollection = new SerializedViewCollection();\n const corruptedTextNodes = new Map();\n const viewRefs = appRef._views;\n const shouldReplayEvents = injector.get(IS_EVENT_REPLAY_ENABLED, EVENT_REPLAY_ENABLED_DEFAULT);\n const eventTypesToReplay = {\n regular: new Set(),\n capture: new Set()\n };\n for (const viewRef of viewRefs) {\n const lNode = getLNodeForHydration(viewRef);\n // An `lView` might be `null` if a `ViewRef` represents\n // an embedded view (not a component view).\n if (lNode !== null) {\n const context = {\n serializedViewCollection,\n corruptedTextNodes,\n isI18nHydrationEnabled: isI18nHydrationEnabledVal,\n i18nChildren: new Map(),\n eventTypesToReplay,\n shouldReplayEvents\n };\n if (isLContainer(lNode)) {\n annotateLContainerForHydration(lNode, context);\n } else {\n annotateComponentLViewForHydration(lNode, context);\n }\n insertCorruptedTextNodeMarkers(corruptedTextNodes, doc);\n }\n }\n // Note: we *always* include hydration info key and a corresponding value\n // into the TransferState, even if the list of serialized views is empty.\n // This is needed as a signal to the client that the server part of the\n // hydration logic was setup and enabled correctly. Otherwise, if a client\n // hydration doesn't find a key in the transfer state - an error is produced.\n const serializedViews = serializedViewCollection.getAll();\n const transferState = injector.get(TransferState);\n transferState.set(NGH_DATA_KEY, serializedViews);\n return eventTypesToReplay;\n}\n/**\n * Serializes the lContainer data into a list of SerializedView objects,\n * that represent views within this lContainer.\n *\n * @param lContainer the lContainer we are serializing\n * @param context the hydration context\n * @returns an array of the `SerializedView` objects\n */\nfunction serializeLContainer(lContainer, context) {\n const views = [];\n let lastViewAsString = '';\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n let childLView = lContainer[i];\n let template;\n let numRootNodes;\n let serializedView;\n if (isRootView(childLView)) {\n // If this is a root view, get an LView for the underlying component,\n // because it contains information about the view to serialize.\n childLView = childLView[HEADER_OFFSET];\n // If we have an LContainer at this position, this indicates that the\n // host element was used as a ViewContainerRef anchor (e.g. a `ViewContainerRef`\n // was injected within the component class). This case requires special handling.\n if (isLContainer(childLView)) {\n // Calculate the number of root nodes in all views in a given container\n // and increment by one to account for an anchor node itself, i.e. in this\n // scenario we'll have a layout that would look like this:\n // `<app-root /><#VIEW1><#VIEW2>...<!--container-->`\n // The `+1` is to capture the `<app-root />` element.\n numRootNodes = calcNumRootNodesInLContainer(childLView) + 1;\n annotateLContainerForHydration(childLView, context);\n const componentLView = unwrapLView(childLView[HOST]);\n serializedView = {\n [TEMPLATE_ID]: componentLView[TVIEW].ssrId,\n [NUM_ROOT_NODES]: numRootNodes\n };\n }\n }\n if (!serializedView) {\n const childTView = childLView[TVIEW];\n if (childTView.type === 1 /* TViewType.Component */) {\n template = childTView.ssrId;\n // This is a component view, thus it has only 1 root node: the component\n // host node itself (other nodes would be inside that host node).\n numRootNodes = 1;\n } else {\n template = getSsrId(childTView);\n numRootNodes = calcNumRootNodes(childTView, childLView, childTView.firstChild);\n }\n serializedView = {\n [TEMPLATE_ID]: template,\n [NUM_ROOT_NODES]: numRootNodes,\n ...serializeLView(lContainer[i], context)\n };\n }\n // Check if the previous view has the same shape (for example, it was\n // produced by the *ngFor), in which case bump the counter on the previous\n // view instead of including the same information again.\n const currentViewAsString = JSON.stringify(serializedView);\n if (views.length > 0 && currentViewAsString === lastViewAsString) {\n const previousView = views[views.length - 1];\n previousView[MULTIPLIER] ??= 1;\n previousView[MULTIPLIER]++;\n } else {\n // Record this view as most recently added.\n lastViewAsString = currentViewAsString;\n views.push(serializedView);\n }\n }\n return views;\n}\n/**\n * Helper function to produce a node path (which navigation steps runtime logic\n * needs to take to locate a node) and stores it in the `NODES` section of the\n * current serialized view.\n */\nfunction appendSerializedNodePath(ngh, tNode, lView, excludedParentNodes) {\n const noOffsetIndex = tNode.index - HEADER_OFFSET;\n ngh[NODES] ??= {};\n // Ensure we don't calculate the path multiple times.\n ngh[NODES][noOffsetIndex] ??= calcPathForNode(tNode, lView, excludedParentNodes);\n}\n/**\n * Helper function to append information about a disconnected node.\n * This info is needed at runtime to avoid DOM lookups for this element\n * and instead, the element would be created from scratch.\n */\nfunction appendDisconnectedNodeIndex(ngh, tNodeOrNoOffsetIndex) {\n const noOffsetIndex = typeof tNodeOrNoOffsetIndex === 'number' ? tNodeOrNoOffsetIndex : tNodeOrNoOffsetIndex.index - HEADER_OFFSET;\n ngh[DISCONNECTED_NODES] ??= [];\n if (!ngh[DISCONNECTED_NODES].includes(noOffsetIndex)) {\n ngh[DISCONNECTED_NODES].push(noOffsetIndex);\n }\n}\n/**\n * Serializes the lView data into a SerializedView object that will later be added\n * to the TransferState storage and referenced using the `ngh` attribute on a host\n * element.\n *\n * @param lView the lView we are serializing\n * @param context the hydration context\n * @returns the `SerializedView` object containing the data to be added to the host node\n */\nfunction serializeLView(lView, context) {\n const ngh = {};\n const tView = lView[TVIEW];\n const i18nChildren = getOrComputeI18nChildren(tView, context);\n const nativeElementsToEventTypes = context.shouldReplayEvents ? collectDomEventsInfo(tView, lView, context.eventTypesToReplay) : null;\n // Iterate over DOM element references in an LView.\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n const tNode = tView.data[i];\n const noOffsetIndex = i - HEADER_OFFSET;\n // Attempt to serialize any i18n data for the given slot. We do this first, as i18n\n // has its own process for serialization.\n const i18nData = trySerializeI18nBlock(lView, i, context);\n if (i18nData) {\n ngh[I18N_DATA] ??= {};\n ngh[I18N_DATA][noOffsetIndex] = i18nData.caseQueue;\n for (const nodeNoOffsetIndex of i18nData.disconnectedNodes) {\n appendDisconnectedNodeIndex(ngh, nodeNoOffsetIndex);\n }\n for (const nodeNoOffsetIndex of i18nData.disjointNodes) {\n const tNode = tView.data[nodeNoOffsetIndex + HEADER_OFFSET];\n ngDevMode && assertTNode(tNode);\n appendSerializedNodePath(ngh, tNode, lView, i18nChildren);\n }\n continue;\n }\n // Skip processing of a given slot in the following cases:\n // - Local refs (e.g. <div #localRef>) take up an extra slot in LViews\n // to store the same element. In this case, there is no information in\n // a corresponding slot in TNode data structure.\n // - When a slot contains something other than a TNode. For example, there\n // might be some metadata information about a defer block or a control flow block.\n if (!isTNodeShape(tNode)) {\n continue;\n }\n // Skip any nodes that are in an i18n block but are considered detached (i.e. not\n // present in the template). These nodes are disconnected from the DOM tree, and\n // so we don't want to serialize any information about them.\n if (isDetachedByI18n(tNode)) {\n continue;\n }\n // Check if a native node that represents a given TNode is disconnected from the DOM tree.\n // Such nodes must be excluded from the hydration (since the hydration won't be able to\n // find them), so the TNode ids are collected and used at runtime to skip the hydration.\n //\n // This situation may happen during the content projection, when some nodes don't make it\n // into one of the content projection slots (for example, when there is no default\n // <ng-content /> slot in projector component's template).\n if (isDisconnectedNode(tNode, lView) && isContentProjectedNode(tNode)) {\n appendDisconnectedNodeIndex(ngh, tNode);\n continue;\n }\n // Attach `jsaction` attribute to elements that have registered listeners,\n // thus potentially having a need to do an event replay.\n if (nativeElementsToEventTypes && tNode.type & 2 /* TNodeType.Element */) {\n const nativeElement = unwrapRNode(lView[i]);\n if (nativeElementsToEventTypes.has(nativeElement)) {\n setJSActionAttributes(nativeElement, nativeElementsToEventTypes.get(nativeElement));\n }\n }\n if (Array.isArray(tNode.projection)) {\n for (const projectionHeadTNode of tNode.projection) {\n // We may have `null`s in slots with no projected content.\n if (!projectionHeadTNode) continue;\n if (!Array.isArray(projectionHeadTNode)) {\n // If we process re-projected content (i.e. `<ng-content>`\n // appears at projection location), skip annotations for this content\n // since all DOM nodes in this projection were handled while processing\n // a parent lView, which contains those nodes.\n if (!isProjectionTNode(projectionHeadTNode) && !isInSkipHydrationBlock(projectionHeadTNode)) {\n if (isDisconnectedNode(projectionHeadTNode, lView)) {\n // Check whether this node is connected, since we may have a TNode\n // in the data structure as a projection segment head, but the\n // content projection slot might be disabled (e.g.\n // <ng-content *ngIf=\"false\" />).\n appendDisconnectedNodeIndex(ngh, projectionHeadTNode);\n } else {\n appendSerializedNodePath(ngh, projectionHeadTNode, lView, i18nChildren);\n }\n }\n } else {\n // If a value is an array, it means that we are processing a projection\n // where projectable nodes were passed in as DOM nodes (for example, when\n // calling `ViewContainerRef.createComponent(CmpA, {projectableNodes: [...]})`).\n //\n // In this scenario, nodes can come from anywhere (either created manually,\n // accessed via `document.querySelector`, etc) and may be in any state\n // (attached or detached from the DOM tree). As a result, we can not reliably\n // restore the state for such cases during hydration.\n throw unsupportedProjectionOfDomNodes(unwrapRNode(lView[i]));\n }\n }\n }\n conditionallyAnnotateNodePath(ngh, tNode, lView, i18nChildren);\n if (isLContainer(lView[i])) {\n // Serialize information about a template.\n const embeddedTView = tNode.tView;\n if (embeddedTView !== null) {\n ngh[TEMPLATES] ??= {};\n ngh[TEMPLATES][noOffsetIndex] = getSsrId(embeddedTView);\n }\n // Serialize views within this LContainer.\n const hostNode = lView[i][HOST]; // host node of this container\n // LView[i][HOST] can be of 2 different types:\n // - either a DOM node\n // - or an array that represents an LView of a component\n if (Array.isArray(hostNode)) {\n // This is a component, serialize info about it.\n const targetNode = unwrapRNode(hostNode);\n if (!targetNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME)) {\n annotateHostElementForHydration(targetNode, hostNode, context);\n }\n }\n ngh[CONTAINERS] ??= {};\n ngh[CONTAINERS][noOffsetIndex] = serializeLContainer(lView[i], context);\n } else if (Array.isArray(lView[i]) && !isLetDeclaration(tNode)) {\n // This is a component, annotate the host node with an `ngh` attribute.\n // Note: Let declarations that return an array are also storing an array in the LView,\n // we need to exclude them.\n const targetNode = unwrapRNode(lView[i][HOST]);\n if (!targetNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME)) {\n annotateHostElementForHydration(targetNode, lView[i], context);\n }\n } else {\n // <ng-container> case\n if (tNode.type & 8 /* TNodeType.ElementContainer */) {\n // An <ng-container> is represented by the number of\n // top-level nodes. This information is needed to skip over\n // those nodes to reach a corresponding anchor node (comment node).\n ngh[ELEMENT_CONTAINERS] ??= {};\n ngh[ELEMENT_CONTAINERS][noOffsetIndex] = calcNumRootNodes(tView, lView, tNode.child);\n } else if (tNode.type & (16 /* TNodeType.Projection */ | 128 /* TNodeType.LetDeclaration */)) {\n // Current TNode represents an `<ng-content>` slot or `@let` declaration,\n // thus it has no DOM elements associated with it, so the **next sibling**\n // node would not be able to find an anchor. In this case, use full path instead.\n let nextTNode = tNode.next;\n // Skip over all `<ng-content>` slots and `@let` declarations in a row.\n while (nextTNode !== null && nextTNode.type & (16 /* TNodeType.Projection */ | 128 /* TNodeType.LetDeclaration */)) {\n nextTNode = nextTNode.next;\n }\n if (nextTNode && !isInSkipHydrationBlock(nextTNode)) {\n // Handle a tNode after the `<ng-content>` slot.\n appendSerializedNodePath(ngh, nextTNode, lView, i18nChildren);\n }\n } else if (tNode.type & 1 /* TNodeType.Text */) {\n const rNode = unwrapRNode(lView[i]);\n processTextNodeBeforeSerialization(context, rNode);\n }\n }\n }\n return ngh;\n}\n/**\n * Serializes node location in cases when it's needed, specifically:\n *\n * 1. If `tNode.projectionNext` is different from `tNode.next` - it means that\n * the next `tNode` after projection is different from the one in the original\n * template. Since hydration relies on `tNode.next`, this serialized info\n * is required to help runtime code find the node at the correct location.\n * 2. In certain content projection-based use-cases, it's possible that only\n * a content of a projected element is rendered. In this case, content nodes\n * require an extra annotation, since runtime logic can't rely on parent-child\n * connection to identify the location of a node.\n */\nfunction conditionallyAnnotateNodePath(ngh, tNode, lView, excludedParentNodes) {\n if (isProjectionTNode(tNode)) {\n // Do not annotate projection nodes (<ng-content />), since\n // they don't have a corresponding DOM node representing them.\n return;\n }\n // Handle case #1 described above.\n if (tNode.projectionNext && tNode.projectionNext !== tNode.next && !isInSkipHydrationBlock(tNode.projectionNext)) {\n appendSerializedNodePath(ngh, tNode.projectionNext, lView, excludedParentNodes);\n }\n // Handle case #2 described above.\n // Note: we only do that for the first node (i.e. when `tNode.prev === null`),\n // the rest of the nodes would rely on the current node location, so no extra\n // annotation is needed.\n if (tNode.prev === null && tNode.parent !== null && isDisconnectedNode(tNode.parent, lView) && !isDisconnectedNode(tNode, lView)) {\n appendSerializedNodePath(ngh, tNode, lView, excludedParentNodes);\n }\n}\n/**\n * Determines whether a component instance that is represented\n * by a given LView uses `ViewEncapsulation.ShadowDom`.\n */\nfunction componentUsesShadowDomEncapsulation(lView) {\n const instance = lView[CONTEXT];\n return instance?.constructor ? getComponentDef(instance.constructor)?.encapsulation === ViewEncapsulation$1.ShadowDom : false;\n}\n/**\n * Annotates component host element for hydration:\n * - by either adding the `ngh` attribute and collecting hydration-related info\n * for the serialization and transferring to the client\n * - or by adding the `ngSkipHydration` attribute in case Angular detects that\n * component contents is not compatible with hydration.\n *\n * @param element The Host element to be annotated\n * @param lView The associated LView\n * @param context The hydration context\n * @returns An index of serialized view from the transfer state object\n * or `null` when a given component can not be serialized.\n */\nfunction annotateHostElementForHydration(element, lView, context) {\n const renderer = lView[RENDERER];\n if (hasI18n(lView) && !isI18nHydrationSupportEnabled() || componentUsesShadowDomEncapsulation(lView)) {\n // Attach the skip hydration attribute if this component:\n // - either has i18n blocks, since hydrating such blocks is not yet supported\n // - or uses ShadowDom view encapsulation, since Domino doesn't support\n // shadow DOM, so we can not guarantee that client and server representations\n // would exactly match\n renderer.setAttribute(element, SKIP_HYDRATION_ATTR_NAME, '');\n return null;\n } else {\n const ngh = serializeLView(lView, context);\n const index = context.serializedViewCollection.add(ngh);\n renderer.setAttribute(element, NGH_ATTR_NAME, index.toString());\n return index;\n }\n}\n/**\n * Physically inserts the comment nodes to ensure empty text nodes and adjacent\n * text node separators are preserved after server serialization of the DOM.\n * These get swapped back for empty text nodes or separators once hydration happens\n * on the client.\n *\n * @param corruptedTextNodes The Map of text nodes to be replaced with comments\n * @param doc The document\n */\nfunction insertCorruptedTextNodeMarkers(corruptedTextNodes, doc) {\n for (const [textNode, marker] of corruptedTextNodes) {\n textNode.after(doc.createComment(marker));\n }\n}\n/**\n * Detects whether a given TNode represents a node that\n * is being content projected.\n */\nfunction isContentProjectedNode(tNode) {\n let currentTNode = tNode;\n while (currentTNode != null) {\n // If we come across a component host node in parent nodes -\n // this TNode is in the content projection section.\n if (isComponentHost(currentTNode)) {\n return true;\n }\n currentTNode = currentTNode.parent;\n }\n return false;\n}\n\n/**\n * Indicates whether the hydration-related code was added,\n * prevents adding it multiple times.\n */\nlet isHydrationSupportEnabled = false;\n/**\n * Indicates whether the i18n-related code was added,\n * prevents adding it multiple times.\n *\n * Note: This merely controls whether the code is loaded,\n * while `setIsI18nHydrationSupportEnabled` determines\n * whether i18n blocks are serialized or hydrated.\n */\nlet isI18nHydrationRuntimeSupportEnabled = false;\n/**\n * Defines a period of time that Angular waits for the `ApplicationRef.isStable` to emit `true`.\n * If there was no event with the `true` value during this time, Angular reports a warning.\n */\nconst APPLICATION_IS_STABLE_TIMEOUT = 10_000;\n/**\n * Brings the necessary hydration code in tree-shakable manner.\n * The code is only present when the `provideClientHydration` is\n * invoked. Otherwise, this code is tree-shaken away during the\n * build optimization step.\n *\n * This technique allows us to swap implementations of methods so\n * tree shaking works appropriately when hydration is disabled or\n * enabled. It brings in the appropriate version of the method that\n * supports hydration only when enabled.\n */\nfunction enableHydrationRuntimeSupport() {\n if (!isHydrationSupportEnabled) {\n isHydrationSupportEnabled = true;\n enableRetrieveHydrationInfoImpl();\n enableLocateOrCreateElementNodeImpl();\n enableLocateOrCreateTextNodeImpl();\n enableLocateOrCreateElementContainerNodeImpl();\n enableLocateOrCreateContainerAnchorImpl();\n enableLocateOrCreateContainerRefImpl();\n enableFindMatchingDehydratedViewImpl();\n enableApplyRootElementTransformImpl();\n }\n}\n/**\n * Brings the necessary i18n hydration code in tree-shakable manner.\n * Similar to `enableHydrationRuntimeSupport`, the code is only\n * present when `withI18nSupport` is invoked.\n */\nfunction enableI18nHydrationRuntimeSupport() {\n if (!isI18nHydrationRuntimeSupportEnabled) {\n isI18nHydrationRuntimeSupportEnabled = true;\n enableLocateOrCreateI18nNodeImpl();\n enablePrepareI18nBlockForHydrationImpl();\n enableClaimDehydratedIcuCaseImpl();\n }\n}\n/**\n * Outputs a message with hydration stats into a console.\n */\nfunction printHydrationStats(injector) {\n const console = injector.get(Console);\n const message = `Angular hydrated ${ngDevMode.hydratedComponents} component(s) ` + `and ${ngDevMode.hydratedNodes} node(s), ` + `${ngDevMode.componentsSkippedHydration} component(s) were skipped. ` + `Learn more at https://angular.dev/guide/hydration.`;\n // tslint:disable-next-line:no-console\n console.log(message);\n}\n/**\n * Returns a Promise that is resolved when an application becomes stable.\n */\nfunction whenStableWithTimeout(appRef, injector) {\n const whenStablePromise = whenStable(appRef);\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n const timeoutTime = APPLICATION_IS_STABLE_TIMEOUT;\n const console = injector.get(Console);\n const ngZone = injector.get(NgZone);\n // The following call should not and does not prevent the app to become stable\n // We cannot use RxJS timer here because the app would remain unstable.\n // This also avoids an extra change detection cycle.\n const timeoutId = ngZone.runOutsideAngular(() => {\n return setTimeout(() => logWarningOnStableTimedout(timeoutTime, console), timeoutTime);\n });\n whenStablePromise.finally(() => clearTimeout(timeoutId));\n }\n return whenStablePromise;\n}\n/**\n * Returns a set of providers required to setup hydration support\n * for an application that is server side rendered. This function is\n * included into the `provideClientHydration` public API function from\n * the `platform-browser` package.\n *\n * The function sets up an internal flag that would be recognized during\n * the server side rendering time as well, so there is no need to\n * configure or change anything in NgUniversal to enable the feature.\n */\nfunction withDomHydration() {\n return makeEnvironmentProviders([{\n provide: IS_HYDRATION_DOM_REUSE_ENABLED,\n useFactory: () => {\n let isEnabled = true;\n if (isPlatformBrowser()) {\n // On the client, verify that the server response contains\n // hydration annotations. Otherwise, keep hydration disabled.\n const transferState = inject(TransferState, {\n optional: true\n });\n isEnabled = !!transferState?.get(NGH_DATA_KEY, null);\n if (!isEnabled && typeof ngDevMode !== 'undefined' && ngDevMode) {\n const console = inject(Console);\n const message = formatRuntimeError(-505 /* RuntimeErrorCode.MISSING_HYDRATION_ANNOTATIONS */, 'Angular hydration was requested on the client, but there was no ' + 'serialized information present in the server response, ' + 'thus hydration was not enabled. ' + 'Make sure the `provideClientHydration()` is included into the list ' + 'of providers in the server part of the application configuration.');\n // tslint:disable-next-line:no-console\n console.warn(message);\n }\n }\n if (isEnabled) {\n performanceMarkFeature('NgHydration');\n }\n return isEnabled;\n }\n }, {\n provide: ENVIRONMENT_INITIALIZER,\n useValue: () => {\n // i18n support is enabled by calling withI18nSupport(), but there's\n // no way to turn it off (e.g. for tests), so we turn it off by default.\n setIsI18nHydrationSupportEnabled(false);\n // Since this function is used across both server and client,\n // make sure that the runtime code is only added when invoked\n // on the client. Moving forward, the `isPlatformBrowser` check should\n // be replaced with a tree-shakable alternative (e.g. `isServer`\n // flag).\n if (isPlatformBrowser() && inject(IS_HYDRATION_DOM_REUSE_ENABLED)) {\n verifySsrContentsIntegrity();\n enableHydrationRuntimeSupport();\n }\n },\n multi: true\n }, {\n provide: PRESERVE_HOST_CONTENT,\n useFactory: () => {\n // Preserve host element content only in a browser\n // environment and when hydration is configured properly.\n // On a server, an application is rendered from scratch,\n // so the host content needs to be empty.\n return isPlatformBrowser() && inject(IS_HYDRATION_DOM_REUSE_ENABLED);\n }\n }, {\n provide: APP_BOOTSTRAP_LISTENER,\n useFactory: () => {\n if (isPlatformBrowser() && inject(IS_HYDRATION_DOM_REUSE_ENABLED)) {\n const appRef = inject(ApplicationRef);\n const injector = inject(Injector);\n return () => {\n // Wait until an app becomes stable and cleanup all views that\n // were not claimed during the application bootstrap process.\n // The timing is similar to when we start the serialization process\n // on the server.\n //\n // Note: the cleanup task *MUST* be scheduled within the Angular zone in Zone apps\n // to ensure that change detection is properly run afterward.\n whenStableWithTimeout(appRef, injector).then(() => {\n cleanupDehydratedViews(appRef);\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n printHydrationStats(injector);\n }\n });\n };\n }\n return () => {}; // noop\n },\n multi: true\n }]);\n}\n/**\n * Returns a set of providers required to setup support for i18n hydration.\n * Requires hydration to be enabled separately.\n */\nfunction withI18nSupport() {\n return [{\n provide: IS_I18N_HYDRATION_ENABLED,\n useValue: true\n }, {\n provide: ENVIRONMENT_INITIALIZER,\n useValue: () => {\n enableI18nHydrationRuntimeSupport();\n setIsI18nHydrationSupportEnabled(true);\n performanceMarkFeature('NgI18nHydration');\n },\n multi: true\n }];\n}\n/**\n *\n * @param time The time in ms until the stable timedout warning message is logged\n */\nfunction logWarningOnStableTimedout(time, console) {\n const message = `Angular hydration expected the ApplicationRef.isStable() to emit \\`true\\`, but it ` + `didn't happen within ${time}ms. Angular hydration logic depends on the application becoming stable ` + `as a signal to complete hydration process.`;\n console.warn(formatRuntimeError(-506 /* RuntimeErrorCode.HYDRATION_STABLE_TIMEDOUT */, message));\n}\n/**\n * Verifies whether the DOM contains a special marker added during SSR time to make sure\n * there is no SSR'ed contents transformations happen after SSR is completed. Typically that\n * happens either by CDN or during the build process as an optimization to remove comment nodes.\n * Hydration process requires comment nodes produced by Angular to locate correct DOM segments.\n * When this special marker is *not* present - throw an error and do not proceed with hydration,\n * since it will not be able to function correctly.\n *\n * Note: this function is invoked only on the client, so it's safe to use DOM APIs.\n */\nfunction verifySsrContentsIntegrity() {\n const doc = getDocument();\n let hydrationMarker;\n for (const node of doc.body.childNodes) {\n if (node.nodeType === Node.COMMENT_NODE && node.textContent?.trim() === SSR_CONTENT_INTEGRITY_MARKER) {\n hydrationMarker = node;\n break;\n }\n }\n if (!hydrationMarker) {\n throw new RuntimeError(-507 /* RuntimeErrorCode.MISSING_SSR_CONTENT_INTEGRITY_MARKER */, typeof ngDevMode !== 'undefined' && ngDevMode && 'Angular hydration logic detected that HTML content of this page was modified after it ' + 'was produced during server side rendering. Make sure that there are no optimizations ' + 'that remove comment nodes from HTML enabled on your CDN. Angular hydration ' + 'relies on HTML produced by the server, including whitespaces and comment nodes.');\n }\n}\n\n/**\n * Transforms a value (typically a string) to a boolean.\n * Intended to be used as a transform function of an input.\n *\n * @usageNotes\n * ```typescript\n * @Input({ transform: booleanAttribute }) status!: boolean;\n * ```\n * @param value Value to be transformed.\n *\n * @publicApi\n */\nfunction booleanAttribute(value) {\n return typeof value === 'boolean' ? value : value != null && value !== 'false';\n}\n/**\n * Transforms a value (typically a string) to a number.\n * Intended to be used as a transform function of an input.\n * @param value Value to be transformed.\n * @param fallbackValue Value to use if the provided value can't be parsed as a number.\n *\n * @usageNotes\n * ```typescript\n * @Input({ transform: numberAttribute }) id!: number;\n * ```\n *\n * @publicApi\n */\nfunction numberAttribute(value, fallbackValue = NaN) {\n // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\n // and other non-number values as NaN, where Number just uses 0) but it considers the string\n // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\n const isNumberValue = !isNaN(parseFloat(value)) && !isNaN(Number(value));\n return isNumberValue ? Number(value) : fallbackValue;\n}\n\n/**\n * Compiles a partial directive declaration object into a full directive definition object.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareDirective(decl) {\n const compiler = getCompilerFacade({\n usage: 1 /* JitCompilerUsage.PartialDeclaration */,\n kind: 'directive',\n type: decl.type\n });\n return compiler.compileDirectiveDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵfac.js`, decl);\n}\n/**\n * Evaluates the class metadata declaration.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareClassMetadata(decl) {\n setClassMetadata(decl.type, decl.decorators, decl.ctorParameters ?? null, decl.propDecorators ?? null);\n}\n/**\n * Evaluates the class metadata of a component that contains deferred blocks.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareClassMetadataAsync(decl) {\n setClassMetadataAsync(decl.type, decl.resolveDeferredDeps, (...types) => {\n const meta = decl.resolveMetadata(...types);\n setClassMetadata(decl.type, meta.decorators, meta.ctorParameters, meta.propDecorators);\n });\n}\n/**\n * Compiles a partial component declaration object into a full component definition object.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareComponent(decl) {\n const compiler = getCompilerFacade({\n usage: 1 /* JitCompilerUsage.PartialDeclaration */,\n kind: 'component',\n type: decl.type\n });\n return compiler.compileComponentDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵcmp.js`, decl);\n}\n/**\n * Compiles a partial pipe declaration object into a full pipe definition object.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareFactory(decl) {\n const compiler = getCompilerFacade({\n usage: 1 /* JitCompilerUsage.PartialDeclaration */,\n kind: getFactoryKind(decl.target),\n type: decl.type\n });\n return compiler.compileFactoryDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵfac.js`, decl);\n}\nfunction getFactoryKind(target) {\n switch (target) {\n case FactoryTarget.Directive:\n return 'directive';\n case FactoryTarget.Component:\n return 'component';\n case FactoryTarget.Injectable:\n return 'injectable';\n case FactoryTarget.Pipe:\n return 'pipe';\n case FactoryTarget.NgModule:\n return 'NgModule';\n }\n}\n/**\n * Compiles a partial injectable declaration object into a full injectable definition object.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareInjectable(decl) {\n const compiler = getCompilerFacade({\n usage: 1 /* JitCompilerUsage.PartialDeclaration */,\n kind: 'injectable',\n type: decl.type\n });\n return compiler.compileInjectableDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵprov.js`, decl);\n}\n/**\n * Compiles a partial injector declaration object into a full injector definition object.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareInjector(decl) {\n const compiler = getCompilerFacade({\n usage: 1 /* JitCompilerUsage.PartialDeclaration */,\n kind: 'NgModule',\n type: decl.type\n });\n return compiler.compileInjectorDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵinj.js`, decl);\n}\n/**\n * Compiles a partial NgModule declaration object into a full NgModule definition object.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareNgModule(decl) {\n const compiler = getCompilerFacade({\n usage: 1 /* JitCompilerUsage.PartialDeclaration */,\n kind: 'NgModule',\n type: decl.type\n });\n return compiler.compileNgModuleDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵmod.js`, decl);\n}\n/**\n * Compiles a partial pipe declaration object into a full pipe definition object.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclarePipe(decl) {\n const compiler = getCompilerFacade({\n usage: 1 /* JitCompilerUsage.PartialDeclaration */,\n kind: 'pipe',\n type: decl.type\n });\n return compiler.compilePipeDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵpipe.js`, decl);\n}\n\n// we reexport these symbols just so that they are retained during the dead code elimination\n\n/**\n * Create a computed `Signal` which derives a reactive value from an expression.\n */\nfunction computed(computation, options) {\n performanceMarkFeature('NgSignals');\n const getter = createComputed$1(computation);\n if (options?.equal) {\n getter[SIGNAL$1].equal = options.equal;\n }\n if (ngDevMode) {\n getter.toString = () => `[Computed: ${getter()}]`;\n }\n return getter;\n}\n\n/**\n * Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function\n * can, optionally, return a value.\n */\nfunction untracked(nonReactiveReadsFn) {\n const prevConsumer = setActiveConsumer$1(null);\n // We are not trying to catch any particular errors here, just making sure that the consumers\n // stack is restored in case of errors.\n try {\n return nonReactiveReadsFn();\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n}\n\n/**\n * Not public API, which guarantees `EffectScheduler` only ever comes from the application root\n * injector.\n */\nconst APP_EFFECT_SCHEDULER = new InjectionToken('', {\n providedIn: 'root',\n factory: () => inject(EffectScheduler)\n});\n/**\n * A scheduler which manages the execution of effects.\n */\nclass EffectScheduler {\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: EffectScheduler,\n providedIn: 'root',\n factory: () => new ZoneAwareEffectScheduler()\n });\n }\n}\n/**\n * A wrapper around `ZoneAwareQueueingScheduler` that schedules flushing via the microtask queue\n * when.\n */\nclass ZoneAwareEffectScheduler {\n constructor() {\n this.queuedEffectCount = 0;\n this.queues = new Map();\n this.pendingTasks = inject(PendingTasks);\n this.taskId = null;\n }\n scheduleEffect(handle) {\n this.enqueue(handle);\n if (this.taskId === null) {\n const taskId = this.taskId = this.pendingTasks.add();\n queueMicrotask(() => {\n this.flush();\n this.pendingTasks.remove(taskId);\n this.taskId = null;\n });\n }\n }\n enqueue(handle) {\n const zone = handle.creationZone;\n if (!this.queues.has(zone)) {\n this.queues.set(zone, new Set());\n }\n const queue = this.queues.get(zone);\n if (queue.has(handle)) {\n return;\n }\n this.queuedEffectCount++;\n queue.add(handle);\n }\n /**\n * Run all scheduled effects.\n *\n * Execution order of effects within the same zone is guaranteed to be FIFO, but there is no\n * ordering guarantee between effects scheduled in different zones.\n */\n flush() {\n while (this.queuedEffectCount > 0) {\n for (const [zone, queue] of this.queues) {\n // `zone` here must be defined.\n if (zone === null) {\n this.flushQueue(queue);\n } else {\n zone.run(() => this.flushQueue(queue));\n }\n }\n }\n }\n flushQueue(queue) {\n for (const handle of queue) {\n queue.delete(handle);\n this.queuedEffectCount--;\n // TODO: what happens if this throws an error?\n handle.run();\n }\n }\n}\n/**\n * Core reactive node for an Angular effect.\n *\n * `EffectHandle` combines the reactive graph's `Watch` base node for effects with the framework's\n * scheduling abstraction (`EffectScheduler`) as well as automatic cleanup via `DestroyRef` if\n * available/requested.\n */\nclass EffectHandle {\n constructor(scheduler, effectFn, creationZone, destroyRef, injector, allowSignalWrites) {\n this.scheduler = scheduler;\n this.effectFn = effectFn;\n this.creationZone = creationZone;\n this.injector = injector;\n this.watcher = createWatch$1(onCleanup => this.runEffect(onCleanup), () => this.schedule(), allowSignalWrites);\n this.unregisterOnDestroy = destroyRef?.onDestroy(() => this.destroy());\n }\n runEffect(onCleanup) {\n try {\n this.effectFn(onCleanup);\n } catch (err) {\n // Inject the `ErrorHandler` here in order to avoid circular DI error\n // if the effect is used inside of a custom `ErrorHandler`.\n const errorHandler = this.injector.get(ErrorHandler, null, {\n optional: true\n });\n errorHandler?.handleError(err);\n }\n }\n run() {\n this.watcher.run();\n }\n schedule() {\n this.scheduler.scheduleEffect(this);\n }\n destroy() {\n this.watcher.destroy();\n this.unregisterOnDestroy?.();\n // Note: if the effect is currently scheduled, it's not un-scheduled, and so the scheduler will\n // retain a reference to it. Attempting to execute it will be a no-op.\n }\n}\n/**\n * Create a global `Effect` for the given reactive function.\n *\n * @developerPreview\n */\nfunction effect(effectFn, options) {\n performanceMarkFeature('NgSignals');\n ngDevMode && assertNotInReactiveContext(effect, 'Call `effect` outside of a reactive context. For example, schedule the ' + 'effect inside the component constructor.');\n !options?.injector && assertInInjectionContext(effect);\n const injector = options?.injector ?? inject(Injector);\n const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;\n const handle = new EffectHandle(injector.get(APP_EFFECT_SCHEDULER), effectFn, typeof Zone === 'undefined' ? null : Zone.current, destroyRef, injector, options?.allowSignalWrites ?? false);\n // Effects need to be marked dirty manually to trigger their initial run. The timing of this\n // marking matters, because the effects may read signals that track component inputs, which are\n // only available after those components have had their first update pass.\n //\n // We inject `ChangeDetectorRef` optionally, to determine whether this effect is being created in\n // the context of a component or not. If it is, then we check whether the component has already\n // run its update pass, and defer the effect's initial scheduling until the update pass if it\n // hasn't already run.\n const cdr = injector.get(ChangeDetectorRef, null, {\n optional: true\n });\n if (!cdr || !(cdr._lView[FLAGS] & 8 /* LViewFlags.FirstLViewPass */)) {\n // This effect is either not running in a view injector, or the view has already\n // undergone its first change detection pass, which is necessary for any required inputs to be\n // set.\n handle.watcher.notify();\n } else {\n // Delay the initialization of the effect until the view is fully initialized.\n (cdr._lView[EFFECTS_TO_SCHEDULE] ??= []).push(handle.watcher.notify);\n }\n return handle;\n}\n\n// This file exists to allow the set of reactivity exports to be modified in g3, as these APIs are\n\n/**\n * Creates a `ComponentRef` instance based on provided component type and a set of options.\n *\n * @usageNotes\n *\n * The example below demonstrates how the `createComponent` function can be used\n * to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef,\n * so that it gets included into change detection cycles.\n *\n * Note: the example uses standalone components, but the function can also be used for\n * non-standalone components (declared in an NgModule) as well.\n *\n * ```typescript\n * @Component({\n * standalone: true,\n * template: `Hello {{ name }}!`\n * })\n * class HelloComponent {\n * name = 'Angular';\n * }\n *\n * @Component({\n * standalone: true,\n * template: `<div id=\"hello-component-host\"></div>`\n * })\n * class RootComponent {}\n *\n * // Bootstrap an application.\n * const applicationRef = await bootstrapApplication(RootComponent);\n *\n * // Locate a DOM node that would be used as a host.\n * const hostElement = document.getElementById('hello-component-host');\n *\n * // Get an `EnvironmentInjector` instance from the `ApplicationRef`.\n * const environmentInjector = applicationRef.injector;\n *\n * // We can now create a `ComponentRef` instance.\n * const componentRef = createComponent(HelloComponent, {hostElement, environmentInjector});\n *\n * // Last step is to register the newly created ref using the `ApplicationRef` instance\n * // to include the component view into change detection cycles.\n * applicationRef.attachView(componentRef.hostView);\n * componentRef.changeDetectorRef.detectChanges();\n * ```\n *\n * @param component Component class reference.\n * @param options Set of options to use:\n * * `environmentInjector`: An `EnvironmentInjector` instance to be used for the component.\n * * `hostElement` (optional): A DOM node that should act as a host node for the component. If not\n * provided, Angular creates one based on the tag name used in the component selector (and falls\n * back to using `div` if selector doesn't have tag name info).\n * * `elementInjector` (optional): An `ElementInjector` instance, see additional info about it\n * [here](guide/di/hierarchical-dependency-injection#elementinjector).\n * * `projectableNodes` (optional): A list of DOM nodes that should be projected through\n * [`<ng-content>`](api/core/ng-content) of the new component instance.\n * @returns ComponentRef instance that represents a given Component.\n *\n * @publicApi\n */\nfunction createComponent(component, options) {\n ngDevMode && assertComponentDef(component);\n const componentDef = getComponentDef(component);\n const elementInjector = options.elementInjector || getNullInjector();\n const factory = new ComponentFactory(componentDef);\n return factory.create(elementInjector, options.projectableNodes, options.hostElement, options.environmentInjector);\n}\n/**\n * Creates an object that allows to retrieve component metadata.\n *\n * @usageNotes\n *\n * The example below demonstrates how to use the function and how the fields\n * of the returned object map to the component metadata.\n *\n * ```typescript\n * @Component({\n * standalone: true,\n * selector: 'foo-component',\n * template: `\n * <ng-content></ng-content>\n * <ng-content select=\"content-selector-a\"></ng-content>\n * `,\n * })\n * class FooComponent {\n * @Input('inputName') inputPropName: string;\n * @Output('outputName') outputPropName = new EventEmitter<void>();\n * }\n *\n * const mirror = reflectComponentType(FooComponent);\n * expect(mirror.type).toBe(FooComponent);\n * expect(mirror.selector).toBe('foo-component');\n * expect(mirror.isStandalone).toBe(true);\n * expect(mirror.inputs).toEqual([{propName: 'inputName', templateName: 'inputPropName'}]);\n * expect(mirror.outputs).toEqual([{propName: 'outputName', templateName: 'outputPropName'}]);\n * expect(mirror.ngContentSelectors).toEqual([\n * '*', // first `<ng-content>` in a template, the selector defaults to `*`\n * 'content-selector-a' // second `<ng-content>` in a template\n * ]);\n * ```\n *\n * @param component Component class reference.\n * @returns An object that allows to retrieve component metadata.\n *\n * @publicApi\n */\nfunction reflectComponentType(component) {\n const componentDef = getComponentDef(component);\n if (!componentDef) return null;\n const factory = new ComponentFactory(componentDef);\n return {\n get selector() {\n return factory.selector;\n },\n get type() {\n return factory.componentType;\n },\n get inputs() {\n return factory.inputs;\n },\n get outputs() {\n return factory.outputs;\n },\n get ngContentSelectors() {\n return factory.ngContentSelectors;\n },\n get isStandalone() {\n return componentDef.standalone;\n },\n get isSignal() {\n return componentDef.signals;\n }\n };\n}\n\n/**\n * Merge multiple application configurations from left to right.\n *\n * @param configs Two or more configurations to be merged.\n * @returns A merged [ApplicationConfig](api/core/ApplicationConfig).\n *\n * @publicApi\n */\nfunction mergeApplicationConfig(...configs) {\n return configs.reduce((prev, curr) => {\n return Object.assign(prev, curr, {\n providers: [...prev.providers, ...curr.providers]\n });\n }, {\n providers: []\n });\n}\n\n/**\n * @module\n * @description\n * Entry point from which you should import all public core APIs.\n */\nif (typeof ngDevMode !== 'undefined' && ngDevMode) {\n // This helper is to give a reasonable error message to people upgrading to v9 that have not yet\n // installed `@angular/localize` in their app.\n // tslint:disable-next-line: no-toplevel-property-access\n _global.$localize ??= function () {\n throw new Error('It looks like your application or one of its dependencies is using i18n.\\n' + 'Angular 9 introduced a global `$localize()` function that needs to be loaded.\\n' + 'Please run `ng add @angular/localize` from the Angular CLI.\\n' + \"(For non-CLI projects, add `import '@angular/localize/init';` to your `polyfills.ts` file.\\n\" + 'For server-side rendering applications add the import to your `main.server.ts` file.)');\n };\n}\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\n// This file only reexports content of the `src` folder. Keep it that way.\n\n/* This file is not used to build this module. It is only used during editing\n * by the TypeScript language service and during build for verification. `ngc`\n * replaces this file with production index.ts when it rewrites private symbol\n * names.\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AfterRenderPhase, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, DestroyRef, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, ExperimentalPendingTasks, HOST_TAG_NAME, Host, HostAttributeToken, HostBinding, HostListener, INJECTOR$1 as INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, OutputEmitterRef, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, Renderer2, RendererFactory2, RendererStyleFlags2, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TransferState, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, afterNextRender, afterRender, asNativeElements, assertInInjectionContext, assertNotInReactiveContext, assertPlatform, booleanAttribute, computed, contentChild, contentChildren, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, input, isDevMode, isSignal, isStandalone, makeEnvironmentProviders, makeStateKey, mergeApplicationConfig, model, numberAttribute, output, platformCore, provideExperimentalCheckNoChangesForDebug, provideExperimentalZonelessChangeDetection, provideZoneChangeDetection, reflectComponentType, resolveForwardRef, runInInjectionContext, setTestabilityGetter, signal, untracked, viewChild, viewChildren, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, AfterRenderManager as ɵAfterRenderManager, CONTAINER_HEADER_OFFSET as ɵCONTAINER_HEADER_OFFSET, ChangeDetectionScheduler as ɵChangeDetectionScheduler, ChangeDetectionSchedulerImpl as ɵChangeDetectionSchedulerImpl, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG as ɵDEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR as ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DeferBlockBehavior as ɵDeferBlockBehavior, DeferBlockState as ɵDeferBlockState, EffectScheduler as ɵEffectScheduler, IMAGE_CONFIG as ɵIMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS as ɵIMAGE_CONFIG_DEFAULTS, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, ɵINPUT_SIGNAL_BRAND_WRITE_TYPE, INTERNAL_APPLICATION_ERROR_HANDLER as ɵINTERNAL_APPLICATION_ERROR_HANDLER, IS_HYDRATION_DOM_REUSE_ENABLED as ɵIS_HYDRATION_DOM_REUSE_ENABLED, JSACTION_EVENT_CONTRACT as ɵJSACTION_EVENT_CONTRACT, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, PROVIDED_NG_ZONE as ɵPROVIDED_NG_ZONE, PendingTasks as ɵPendingTasks, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, SSR_CONTENT_INTEGRITY_MARKER as ɵSSR_CONTENT_INTEGRITY_MARKER, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, USE_RUNTIME_DEPS_TRACKER_FOR_JIT as ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, ViewRef$1 as ɵViewRef, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, ZONELESS_ENABLED as ɵZONELESS_ENABLED, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, annotateForHydration as ɵannotateForHydration, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, convertToBitFlags as ɵconvertToBitFlags, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, depsTracker as ɵdepsTracker, detectChangesInViewIfRequired as ɵdetectChangesInViewIfRequired, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, generateStandaloneInDeclarationsError as ɵgenerateStandaloneInDeclarationsError, getAsyncClassMetadataFn as ɵgetAsyncClassMetadataFn, getDebugNode as ɵgetDebugNode, getDeferBlocks as ɵgetDeferBlocks, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getOutputDestroyRef as ɵgetOutputDestroyRef, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalCreateApplication as ɵinternalCreateApplication, internalProvideZoneChangeDetection as ɵinternalProvideZoneChangeDetection, isBoundToModule as ɵisBoundToModule, isComponentDefPendingResolution as ɵisComponentDefPendingResolution, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, performanceMarkFeature as ɵperformanceMarkFeature, readHydrationInfo as ɵreadHydrationInfo, registerLocaleData as ɵregisterLocaleData, renderDeferBlockState as ɵrenderDeferBlockState, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, restoreComponentResolutionQueue as ɵrestoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl, ɵsetClassDebugInfo, setClassMetadata as ɵsetClassMetadata, setClassMetadataAsync as ɵsetClassMetadataAsync, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setInjectorProfilerContext as ɵsetInjectorProfilerContext, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, triggerResourceLoading as ɵtriggerResourceLoading, truncateMiddle as ɵtruncateMiddle, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, ɵunwrapWritableSignal, whenStable as ɵwhenStable, withDomHydration as ɵwithDomHydration, withEventReplay as ɵwithEventReplay, withI18nSupport as ɵwithI18nSupport, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵInputTransformsFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵcontentQuery, ɵɵcontentQuerySignal, ɵɵdeclareLet, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareClassMetadataAsync, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryAdvance, ɵɵqueryRefresh, ɵɵreadContextLet, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstoreLet, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵtwoWayBindingSet, ɵɵtwoWayListener, ɵɵtwoWayProperty, ɵɵvalidateIframeAttribute, ɵɵviewQuery, ɵɵviewQuerySignal };","map":{"version":3,"names":["SIGNAL_NODE","SIGNAL_NODE$1","signalSetFn","signalSetFn$1","producerAccessed","producerAccessed$1","SIGNAL","SIGNAL$1","getActiveConsumer","getActiveConsumer$1","setActiveConsumer","setActiveConsumer$1","consumerDestroy","consumerDestroy$1","REACTIVE_NODE","REACTIVE_NODE$1","consumerBeforeComputation","consumerBeforeComputation$1","consumerAfterComputation","consumerAfterComputation$1","consumerPollProducersForChange","consumerPollProducersForChange$1","createSignal","createSignal$1","signalUpdateFn","signalUpdateFn$1","createComputed","createComputed$1","setThrowInvalidWriteToSignalError","setThrowInvalidWriteToSignalError$1","createWatch","createWatch$1","ɵSIGNAL","BehaviorSubject","Subject","Subscription","map","first","Attribute","Attribute$1","EventContract","EventContractContainer","getAppScopedQueuedEventInfos","clearAppScopedEarlyEventContract","EventDispatcher","registerDispatcher","isEarlyEventType","isCaptureEventType","ERROR_DETAILS_PAGE_BASE_URL","XSS_SECURITY_URL","RuntimeError","Error","constructor","code","message","formatRuntimeError","fullCode","Math","abs","errorMessage","ngDevMode","addPeriodSeparator","match","separator","REQUIRED_UNSET_VALUE","Symbol","INPUT_SIGNAL_NODE","transformFn","undefined","applyValueToInputSignal","node","value","ɵINPUT_SIGNAL_BRAND_READ_TYPE","ɵINPUT_SIGNAL_BRAND_WRITE_TYPE","createInputSignal","initialValue","options","Object","create","transform","inputValueFn","toString","noSideEffects","fn","ANNOTATIONS","PARAMETERS","PROP_METADATA","makeDecorator","name","props","parentClass","additionalProcessing","typeFn","metaCtor","makeMetadataCtor","DecoratorFactory","args","call","annotationInstance","TypeDecorator","cls","annotations","hasOwnProperty","defineProperty","push","prototype","ngMetadataName","annotationCls","ctor","values","propName","makeParamDecorator","ParamDecoratorFactory","apply","ParamDecorator","annotation","unusedKey","index","parameters","length","makePropDecorator","PropDecoratorFactory","decoratorInstance","PropDecorator","target","meta","unshift","_global","globalThis","ngDevModeResetPerfCounters","locationString","location","newCounters","namedConstructors","indexOf","firstCreatePass","tNode","tView","rendererCreateTextNode","rendererSetText","rendererCreateElement","rendererAddEventListener","rendererSetAttribute","rendererRemoveAttribute","rendererSetProperty","rendererSetClassName","rendererAddClass","rendererRemoveClass","rendererSetStyle","rendererRemoveStyle","rendererDestroy","rendererDestroyNode","rendererMoveNode","rendererRemoveNode","rendererAppendChild","rendererInsertBefore","rendererCreateComment","hydratedNodes","hydratedComponents","dehydratedViewsRemoved","dehydratedViewsCleanupRuns","componentsSkippedHydration","allowNgDevModeTrue","assign","initNgDevMode","keys","getClosureSafeProperty","objWithPropertyToExtract","key","fillProperties","source","stringify","token","Array","isArray","join","overriddenName","res","newLineIndex","substring","concatStringsWithSpace","before","after","truncateMiddle","str","maxLength","halfLimit","round","__forward_ref__","forwardRef","forwardRefFn","resolveForwardRef","type","isForwardRef","assertNumber","actual","msg","throwError","assertNumberInRange","minInclusive","maxInclusive","assertLessThanOrEqual","assertGreaterThanOrEqual","assertString","assertFunction","assertEqual","expected","assertNotEqual","assertSame","assertNotSame","assertLessThan","assertGreaterThan","assertNotDefined","assertDefined","comparison","assertDomNode","Node","assertElement","Element","assertIndexInRange","arr","maxLen","assertOneOf","validValues","JSON","assertNotReactive","ɵɵdefineInjectable","opts","providedIn","factory","defineInjectable","ɵɵdefineInjector","providers","imports","getInjectableDef","getOwnDefinition","NG_PROV_DEF","NG_INJECTABLE_DEF","isInjectable","field","getInheritedInjectableDef","def","console","warn","getInjectorDef","NG_INJ_DEF","NG_INJECTOR_DEF","ɵprov","ɵinj","ngInjectableDef","ngInjectorDef","InjectionToken","_desc","__NG_ELEMENT_ID__","multi","_injectorProfilerContext","getInjectorProfilerContext","setInjectorProfilerContext","context","previous","injectorProfilerCallback","setInjectorProfiler","injectorProfiler","event","emitProviderConfiguredEvent","eventProvider","isViewProvider","provide","provider","providerRecord","emitInstanceCreatedByInjectorEvent","instance","emitInjectEvent","flags","service","runInInjectorProfilerContext","injector","callback","prevInjectContext","isEnvironmentProviders","ɵproviders","NG_COMP_DEF","ɵcmp","NG_DIR_DEF","ɵdir","NG_PIPE_DEF","ɵpipe","NG_MOD_DEF","ɵmod","NG_FACTORY_DEF","ɵfac","NG_ELEMENT_ID","NG_ENV_ID","__NG_ENV_ID__","renderStringify","String","stringifyForError","debugStringifyTypeForError","componentDef","debugInfo","stringifyTypeFromDebugInfo","filePath","lineNumber","className","throwCyclicDependencyError","path","depPath","throwMixedMultiProviderError","throwInvalidProviderError","ngModuleType","providerDetail","v","ɵfromNgModule","throwProviderNotFoundError","injectorName","InjectFlags","_injectImplementation","getInjectImplementation","setInjectImplementation","impl","injectRootLimpMode","notFoundValue","injectableDef","Optional","assertInjectImplementationNotEqual","_THROW_IF_NOT_FOUND","THROW_IF_NOT_FOUND","DI_DECORATOR_FLAG","NG_TEMP_TOKEN_PATH","NG_TOKEN_PATH","NEW_LINE","NO_NEW_LINE","SOURCE","_currentInjector","getCurrentInjector","setCurrentInjector","former","injectInjectorOnly","Default","get","ɵɵinject","ɵɵinvalidFactoryDep","inject","convertToBitFlags","optional","host","self","skipSelf","injectArgs","types","i","arg","j","flag","getInjectFlag","attachInjectFlag","decorator","catchInjectorError","e","injectorErrorName","tokenPath","formatError","text","obj","charAt","slice","parts","replace","Inject","Self","SkipSelf","Host","getFactoryDef","throwNotFound","hasFactoryDef","arrayEquals","a","b","identityAccessor","valueA","valueB","flatten","list","flat","Number","POSITIVE_INFINITY","deepForEach","input","forEach","addToArray","splice","removeFromArray","pop","newArray","size","arraySplice","array","count","arrayInsert","end","previousEnd","arrayInsert2","value1","value2","arrayIndexOfSorted","_arrayIndexOfSorted","keyValueArraySet","keyValueArray","keyValueArrayIndexOf","keyValueArrayGet","keyValueArrayDelete","shift","start","middle","current","EMPTY_OBJ","EMPTY_ARRAY","freeze","ENVIRONMENT_INITIALIZER","INJECTOR$1","INJECTOR_DEF_TYPES","NullInjector","error","ChangeDetectionStrategy","ViewEncapsulation$1","ViewEncapsulation","InputFlags","classIndexOf","classToSearch","startingIndex","foundIndex","charCodeAt","setUpAttributes","renderer","native","attrs","namespaceURI","attrName","attrVal","setAttribute","isAnimationProp","setProperty","isNameOnlyAttributeMarker","marker","mergeHostAttrs","dst","src","srcMarker","item","mergeHostAttribute","key1","key2","markerInsertPosition","dstValue","NG_TEMPLATE_SELECTOR","isCssClassMatching","cssClassToMatch","isProjectionMode","toLowerCase","isInlineTemplate","hasTagAndTypeMatch","currentSelector","tagNameToCompare","isNodeMatchingSelector","selector","mode","nodeAttrs","nameOnlyMarkerIdx","getNameOnlyMarkerIndex","skipToNextSelector","isPositive","selectorAttrValue","attrIndexInNode","findAttrIndexInNode","nodeAttrValue","bindingsMode","maybeAttrName","matchTemplateAttribute","isNodeMatchingSelectorList","getProjectAsAttrValue","ngProjectAsAttrIdx","nodeAttr","attr","isSelectorInSelectorList","selectorListLoop","currentSelectorInList","maybeWrapInNotSelector","isNegativeMode","chunk","trim","stringifyCSSSelector","result","currentChunk","valueOrMarker","attrValue","stringifyCSSSelectorList","selectorList","extractAttrsAndClassesFromSelector","classes","ɵɵdefineComponent","componentDefinition","baseDef","getNgDirectiveDef","decls","vars","template","consts","ngContentSelectors","onPush","changeDetection","OnPush","directiveDefs","pipeDefs","dependencies","standalone","getStandaloneInjector","signals","data","encapsulation","Emulated","styles","_","schemas","id","initFeatures","extractDefListOrFactory","getComponentId","extractDirectiveDef","getComponentDef","getDirectiveDef","nonNull","ɵɵdefineNgModule","bootstrap","declarations","exports","transitiveCompileScopes","parseAndConvertBindingsForDefinition","declaredInputs","newLookup","minifiedKey","publicName","declaredName","inputFlags","None","ɵɵdefineDirective","directiveDefinition","ɵɵdefinePipe","pipeDef","pure","onDestroy","ngOnDestroy","getPipeDef$1","isStandalone","getNgModuleDef","ngModuleDef","providersResolver","hostBindings","hostVars","hostAttrs","contentQueries","inputTransforms","inputConfig","inputs","exportAs","selectors","viewQuery","features","setInput","findHostDirectiveDefs","hostDirectives","outputs","definition","defExtractor","dep","filter","GENERATED_COMP_IDS","Map","hash","hashSelectors","getOwnPropertyNames","char","imul","compId","has","previousCompDefType","set","makeEnvironmentProviders","importProvidersFrom","sources","internalImportProvidersFrom","checkForStandaloneCmp","providersOut","dedup","Set","injectorTypesWithProviders","collectProviders","cmpDef","internalSource","walkProviderTree","processInjectorTypesWithProviders","typesWithProviders","visitor","ngModule","deepForEachProvider","validateProvider","container","parents","defType","injDef","defName","isDuplicate","add","deps","importTypesWithProviders","imported","useFactory","useValue","defProviders","injectorType","containerType","isTypeProvider","isValueProvider","isFactoryProvider","isExistingProvider","classRef","useClass","USE_VALUE$1","useExisting","isClassProvider","INJECTOR_SCOPE","NOT_YET","CIRCULAR","NULL_INJECTOR","getNullInjector","EnvironmentInjector","R3Injector","destroyed","_destroyed","parent","scopes","records","_ngOnDestroyHooks","_onDestroyHooks","forEachSingleProvider","processProvider","makeRecord","record","injectorDefTypes","destroy","assertNotDestroyed","prevConsumer","onDestroyHooks","hook","clear","removeOnDestroy","runInContext","previousInjector","previousInjectImplementation","couldBeInjectableType","injectableDefInScope","injectableDefOrInjectorDefFactory","hydrate","nextInjector","resolveInjectorInitializers","initializers","initializer","tokens","providerToRecord","multiRecord","existing","hasOnDestroy","destroyCBIdx","Function","getUndecoratedInjectableFactory","paramLength","inheritedInjectableDef","providerToFactory","unwrappedProvider","hasDeps","runInInjectionContext","prevInjectorProfilerContext","prevInjector","isInInjectionContext","assertInInjectionContext","debugFn","FactoryTarget","R3TemplateDependencyKind","getCompilerFacade","request","globalNg","ɵcompilerFacade","kind","usage","angularCoreDiEnv","Type","isType","ES5_DELEGATE_CTOR","ES2015_INHERITED_CLASS","ES2015_INHERITED_CLASS_WITH_CTOR","ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR","isDelegateCtor","typeStr","test","ReflectionCapabilities","reflect","_reflect","t","_zipTypesAndAnnotations","paramTypes","paramAnnotations","concat","_ownParameters","parentCtor","tsickleCtorParams","ctorParameters","ctorParam","convertTsickleDecoratorIntoMetadata","decorators","getOwnMetadata","getParentCtor","_ownAnnotations","typeOrFunc","ownAnnotations","parentAnnotations","_ownPropMetadata","propMetadata","propDecorators","prop","parentPropMetadata","ownPropMetadata","hasLifecycleHook","lcProperty","decoratorInvocations","decoratorInvocation","decoratorType","annotationArgs","parentProto","getPrototypeOf","HOST","TVIEW","FLAGS","PARENT","NEXT","T_HOST","HYDRATION","CLEANUP","CONTEXT","INJECTOR","ENVIRONMENT","RENDERER","CHILD_HEAD","CHILD_TAIL","DECLARATION_VIEW","DECLARATION_COMPONENT_VIEW","DECLARATION_LCONTAINER","PREORDER_HOOK_FLAGS","QUERIES","ID","EMBEDDED_VIEW_INJECTOR","ON_DESTROY_HOOKS","EFFECTS_TO_SCHEDULE","REACTIVE_TEMPLATE_CONSUMER","HEADER_OFFSET","TYPE","DEHYDRATED_VIEWS","NATIVE","VIEW_REFS","MOVED_VIEWS","CONTAINER_HEADER_OFFSET","LContainerFlags","isLView","isLContainer","isContentQueryHost","isComponentHost","componentOffset","isDirectiveHost","isComponentDef","isRootView","isProjectionTNode","hasI18n","lView","isDestroyed","assertTNodeForLView","assertTNodeForTView","assertTNode","tData","assertTIcu","tIcu","currentCaseLViewIndex","assertComponentType","assertNgModuleType","assertCurrentTNodeIsParent","isParent","assertHasParent","assertLContainer","assertLViewOrUndefined","assertLView","assertFirstCreatePass","errMessage","assertFirstUpdatePass","firstUpdatePass","assertDirectiveDef","assertIndexInDeclRange","assertBetween","bindingStartIndex","assertIndexInExpandoRange","expandoStartIndex","lower","upper","assertProjectionSlots","projection","assertParentView","assertNoDuplicateDirectives","directives","seenDirectives","assertNodeInjector","injectorIndex","SimpleChange","previousValue","currentValue","firstChange","isFirstChange","applyValueToInputField","inputSignalNode","privateName","ɵɵNgOnChangesFeature","NgOnChangesFeatureImpl","ngOnChanges","ngOnChangesSetInput","rememberChangeHistoryAndInvokeOnChangesHook","ngInherit","simpleChangesStore","getSimpleChangesStore","setSimpleChangesStore","previousChange","SIMPLE_CHANGES_STORE","store","profilerCallback","setProfiler","profiler","hookOrListener","SVG_NAMESPACE","MATH_ML_NAMESPACE","unwrapRNode","unwrapLView","getNativeByIndex","getNativeByTNode","getNativeByTNodeOrNull","getTNode","load","view","getComponentLViewByIndex","nodeIndex","hostView","slotValue","isCreationMode","viewAttachedToChangeDetector","viewAttachedToContainer","getConstant","resetPreOrderHookFlags","markViewForRefresh","markAncestorsForTraversal","walkUpViews","nestingLevel","currentView","requiresRefreshOrTraversal","dirty","updateAncestorTraversalFlagsOnAttach","changeDetectionScheduler","notify","getLViewParent","storeLViewOnDestroy","onDestroyCallback","removeLViewOnDestroy","instructionState","lFrame","createLFrame","bindingsEnabled","skipHydrationRootTNode","CheckNoChangesMode","_checkNoChangesMode","_isRefreshingViews","specOnlyIsInstructionStateEmpty","getElementDepthCount","elementDepthCount","increaseElementDepthCount","decreaseElementDepthCount","getBindingsEnabled","isInSkipHydrationBlock$1","isSkipHydrationRootTNode","ɵɵenableBindings","enterSkipHydrationBlock","ɵɵdisableBindings","leaveSkipHydrationBlock","getLView","getTView","ɵɵrestoreView","viewToRestore","contextLView","ɵɵresetView","getCurrentTNode","currentTNode","getCurrentTNodePlaceholderOk","getCurrentParentTNode","setCurrentTNode","isCurrentTNodeParent","setCurrentTNodeAsNotParent","getContextLView","isInCheckNoChangesMode","Off","isExhaustiveCheckNoChanges","Exhaustive","setIsInCheckNoChangesMode","isRefreshingViews","setIsRefreshingViews","getBindingRoot","bindingRootIndex","getBindingIndex","bindingIndex","setBindingIndex","nextBindingIndex","incrementBindingIndex","isInI18nBlock","inI18n","setInI18nBlock","setBindingRootForHostBindings","currentDirectiveIndex","setCurrentDirectiveIndex","getCurrentDirectiveIndex","getCurrentDirectiveDef","getCurrentQueryIndex","currentQueryIndex","setCurrentQueryIndex","getDeclarationTNode","declTNode","enterDI","parentTNode","parentLView","allocLFrame","enterView","newView","newLFrame","selectedIndex","currentNamespace","firstChild","currentLFrame","childLFrame","child","leaveViewLight","oldLFrame","leaveDI","leaveView","nextContextImpl","level","getSelectedIndex","setSelectedIndex","getSelectedTNode","ɵɵnamespaceSVG","ɵɵnamespaceMathML","ɵɵnamespaceHTML","namespaceHTMLInternal","getNamespace$1","_wasLastNodeCreated","wasLastNodeCreated","lastNodeWasCreated","registerPreOrderHooks","directiveIndex","directiveDef","ngOnInit","ngDoCheck","wrappedOnChanges","preOrderHooks","preOrderCheckHooks","registerPostOrderHooks","directiveStart","directiveEnd","lifecycleHooks","ngAfterContentInit","ngAfterContentChecked","ngAfterViewInit","ngAfterViewChecked","contentHooks","contentCheckHooks","viewHooks","viewCheckHooks","destroyHooks","executeCheckHooks","hooks","callHooks","executeInitAndCheckHooks","initPhase","incrementInitPhaseFlags","currentNodeIndex","startIndex","nodeIndexLimit","max","lastNodeIndexFound","isInitHook","callHook","callHookInternal","directive","indexWithintInitPhase","NO_PARENT_INJECTOR","NodeInjectorFactory","injectImplementation","resolving","canSeeViewProviders","injectImpl","isFactory","toTNodeTypeAsString","tNodeType","isTNodeShape","insertBeforeIndex","isLetDeclaration","hasClassInput","hasStyleInput","assertTNodeType","expectedTypes","assertPureTNodeType","NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR","ChainedInjector","parentInjector","hasParentInjector","parentLocation","getParentInjectorIndex","parentInjectorIndex","getParentInjectorViewOffset","getParentInjectorView","startView","viewOffset","parentView","isRouterOutletInjector","currentInjector","__ngOutletInjector","includeViewProviders","setIncludeViewProviders","oldValue","BLOOM_SIZE","BLOOM_MASK","BLOOM_BUCKET_BITS","nextNgElementId","NOT_FOUND","bloomAdd","bloomHash","mask","getOrCreateNodeInjectorForNode","existingInjectorIndex","getInjectorIndex","insertBloom","blueprint","parentLoc","getParentInjectorLocation","parentIndex","parentData","footer","declarationViewOffset","lViewCursor","getTNodeFromLView","diPublicInInjector","injectAttributeImpl","attrNameToInject","attrsLength","notFoundValueOrThrow","lookupTokenUsingModuleInjector","moduleInjector","getOrCreateInjectable","embeddedInjectorValue","lookupTokenUsingEmbeddedInjector","lookupTokenUsingNodeInjector","bloomHashBitOrFactory","NodeInjector","previousTView","hostTElementNode","shouldSearchParent","bloomHasToken","searchTokensOnInjector","currentTView","canAccessViewProviders","isHostSpecialCase","injectableIdx","locateDirectiveOrProvider","getNodeInjectable","nodeProviderIndexes","providerIndexes","tInjectables","injectablesStart","directivesStart","cptViewProvidersCount","endIndex","providerTokenOrDef","dirDef","previousIncludeViewProviders","success","tokenId","createNodeInjector","injectorView","isFirstHostTNode","getNodeInjectorLView","nodeInjector","_lView","getNodeInjectorTNode","_tNode","ɵɵgetInheritedFactory","ownConstructor","ownFactory","getFactoryOf","objectPrototype","currentLView","nodeInjectorValue","embeddedViewInjector","embeddedViewInjectorValue","tViewType","ɵɵinjectAttribute","attributeName","getReflect","reflectDependencies","convertDependencies","reflectDependency","attribute","param","proto","compileInjectable","ngFactoryDef","compiler","getInjectableMetadata","compileFactory","typeArgumentCount","Injectable","configurable","USE_VALUE","isUseClassProvider","isUseValueProvider","isUseFactoryProvider","isUseExistingProvider","srcMeta","compilerMeta","createInjector","additionalProviders","createInjectorWithoutInjectorInstances","Injector","NULL","HostAttributeToken","HOST_TAG_NAME","getDevModeNodeName","ERROR_ORIGINAL_ERROR","wrappedError","originalError","getOriginalError","SCHEDULE_IN_ROOT_ZONE_DEFAULT","DestroyRef","injectDestroyRef","NodeInjectorDestroyRef","PendingTasks","taskId","pendingTasks","hasPendingTasks","_hasPendingTasks","next","remove","delete","ExperimentalPendingTasks","internalPendingTasks","EventEmitter_","isAsync","destroyRef","__isAsync","emit","subscribe","observerOrNext","complete","nextFn","errorFn","completeFn","observer","bind","wrapInTimeout","sink","setTimeout","EventEmitter","noop","scheduleCallbackWithRafRace","timeoutId","animationFrameId","cleanup","cancelAnimationFrame","clearTimeout","requestAnimationFrame","scheduleCallbackWithMicrotask","queueMicrotask","AsyncStackTaggingZoneSpec","namePrefix","consoleAsyncStackTaggingImpl","createTask","onScheduleTask","delegate","_current","task","consoleTask","scheduleTask","onInvokeTask","_currentZone","targetZone","applyThis","applyArgs","ret","run","invokeTask","isAngularZoneProperty","angularZoneInstanceIdProperty","ngZoneInstanceId","NgZone","hasPendingMacrotasks","hasPendingMicrotasks","isStable","onUnstable","onMicrotaskEmpty","onStable","onError","enableLongStackTrace","shouldCoalesceEventChangeDetection","shouldCoalesceRunChangeDetection","scheduleInRootZone","Zone","assertZonePatched","_nesting","_outer","_inner","fork","callbackScheduled","forkInnerZoneWithAngularBehavior","isInAngularZone","assertInAngularZone","assertNotInAngularZone","runTask","zone","scheduleEventTask","EMPTY_PAYLOAD","cancelTask","runGuarded","runOutsideAngular","checkStable","delayChangeDetectionForEvents","isCheckStableRunning","scheduleCheckStable","updateMicroTaskStatus","root","delayChangeDetectionForEventsDelegate","instanceId","properties","shouldBeIgnoredByZone","onEnter","onLeave","onInvoke","invoke","isSchedulerTick","onHasTask","hasTaskState","hasTask","change","_hasPendingMicrotasks","microTask","macroTask","onHandleError","handleError","NoopNgZone","hasApplyArgsData","getNgZone","ngZoneToUse","ErrorHandler","_console","_findOriginalError","INTERNAL_APPLICATION_ERROR_HANDLER","userErrorHandler","OutputEmitterRef","listeners","errorHandler","unsubscribe","idx","previousConsumer","listenerFn","err","getOutputDestroyRef","ref","output","inputFunction","inputRequiredFunction","required","injectElementRef","createElementRef","ElementRef","nativeElement","unwrapElementRef","symbolIterator","_results","iterator","QueryList","changes","_changes","_emitDistinctChangesOnly","_onDirty","_changesDetected","last","find","reduce","init","some","toArray","reset","resultsTree","newResultFlat","notifyOnChanges","onDirty","cb","setDirty","SKIP_HYDRATION_ATTR_NAME","SKIP_HYDRATION_ATTR_NAME_LOWER_CASE","hasSkipHydrationAttrOnTNode","mergedAttrs","hasSkipHydrationAttrOnRElement","rNode","hasAttribute","hasInSkipHydrationBlockFlag","isInSkipHydrationBlock","isI18nInSkipHydrationBlock","TRACKED_LVIEWS","uniqueIdCounter","getUniqueLViewId","registerLView","getLViewById","unregisterLView","LContext","lViewId","getLContext","mpValue","readPatchedData","component","isComponentInstance","findViaComponent","isDirectiveInstance","findViaDirective","getDirectivesAtNodeIndex","findViaNativeElement","existingCtx","createLContext","attachPatchData","rElement","parentNode","parentContext","getComponentViewByInstance","componentInstance","patchedData","MONKEY_PATCH_KEY_NAME","attachLViewId","readLView","readPatchedLView","traverseNextElement","componentIndices","components","elementComponentIndex","componentView","rootComponentView","rootComponent","directiveInstance","directiveIndexStart","directiveIndexEnd","results","getComponentAtNodeIndex","discoverLocalRefs","localNames","localIndex","getRootView","componentOrLView","getRootContext","viewOrComponent","rootView","getFirstLContainer","getNearestLContainer","getNextLContainer","viewOrContainer","getComponent$1","element","assertDomElement","getContext","getOwningComponent","elementOrDir","getRootComponents","getInjector","getInjectionTokens","providerTokens","isDirectiveDefHack","getDirectives","Text","getDirectiveMetadata$1","directiveOrComponentInstance","extractInputDebugMetadata","getLocalRefs","localRefs","getHostElement","componentOrDirective","getRenderedText","hostElement","textContent","getListeners","lContext","lCleanup","tCleanup","firstParam","secondParam","listenerElement","useCaptureOrIndx","useCapture","sort","sortListeners","getComponentLView","nodeIndx","componentLView","minifiedName","DOCUMENT","setDocument","document","getDocument","APP_ID","DEFAULT_APP_ID","PLATFORM_INITIALIZER","PLATFORM_ID","PACKAGE_ROOT_URL","ANIMATION_MODULE_TYPE","CSP_NONCE","body","querySelector","getAttribute","IMAGE_CONFIG_DEFAULTS","breakpoints","placeholderResolution","disableImageSizeWarning","disableImageLazyLoadWarning","IMAGE_CONFIG","makeStateKey","initTransferState","transferState","TransferState","retrieveTransferredState","onSerializeCallbacks","defaultValue","hasKey","isEmpty","onSerialize","toJson","doc","appId","script","getElementById","parse","REFERENCE_NODE_HOST","REFERENCE_NODE_BODY","NodeNavigationStep","ELEMENT_CONTAINERS","TEMPLATES","CONTAINERS","MULTIPLIER","NUM_ROOT_NODES","TEMPLATE_ID","NODES","DISCONNECTED_NODES","I18N_DATA","TRANSFER_STATE_TOKEN_ID","NGH_DATA_KEY","NGH_ATTR_NAME","SSR_CONTENT_INTEGRITY_MARKER","_retrieveHydrationInfoImpl","retrieveHydrationInfoImpl","nghAttrValue","componentViewNgh","rootViewNgh","split","rootNgh","remainingNgh","nghData","dehydratedView","setSegmentHead","nextSibling","removeAttribute","markRNodeAsClaimedByHydration","enableRetrieveHydrationInfoImpl","retrieveHydrationInfo","getLNodeForHydration","viewRef","getTextNodeContent","processTextNodeMarkersBeforeHydration","commentNodesIterator","createNodeIterator","NodeFilter","SHOW_COMMENT","acceptNode","content","isTextNodeMarker","FILTER_ACCEPT","FILTER_REJECT","currentNode","nodes","nextNode","replaceWith","createTextNode","HydrationStatus","HYDRATION_INFO_KEY","patchHydrationInfo","info","readHydrationInfo","checkIfAlreadyClaimed","isRNodeClaimedForHydration","status","Hydrated","markRNodeAsSkippedByHydration","Skipped","markRNodeAsHavingHydrationMismatch","expectedNodeDetails","actualNodeDetails","Mismatched","hydrationInfo","segmentHeads","getSegmentHead","getNgContainerSize","calcSerializedContainerSize","isSerializedElementContainer","getSerializedContainerViews","views","numNodes","initDisconnectedNodes","disconnectedNodes","nodeIds","isDisconnectedNode$1","processTextNodeBeforeSerialization","el","corruptedTextNodes","nodeType","TEXT_NODE","IS_HYDRATION_DOM_REUSE_ENABLED","PRESERVE_HOST_CONTENT_DEFAULT","PRESERVE_HOST_CONTENT","IS_I18N_HYDRATION_ENABLED","IS_EVENT_REPLAY_ENABLED","EVENT_REPLAY_ENABLED_DEFAULT","policy$1","getPolicy$1","trustedTypes","createPolicy","createHTML","s","createScript","createScriptURL","trustedHTMLFromString","html","trustedScriptFromString","trustedScriptURLFromString","url","newTrustedFunctionForDev","fnArgs","fnBody","policy","getPolicy","trustedHTMLFromStringBypass","trustedScriptFromStringBypass","trustedScriptURLFromStringBypass","SafeValueImpl","changingThisBreaksApplicationSecurity","SafeHtmlImpl","getTypeName","SafeStyleImpl","SafeScriptImpl","SafeUrlImpl","SafeResourceUrlImpl","unwrapSafeValue","allowSanitizationBypassAndThrow","actualType","getSanitizationBypassType","bypassSanitizationTrustHtml","trustedHtml","bypassSanitizationTrustStyle","trustedStyle","bypassSanitizationTrustScript","trustedScript","bypassSanitizationTrustUrl","trustedUrl","bypassSanitizationTrustResourceUrl","trustedResourceUrl","getInertBodyHelper","defaultDoc","inertDocumentHelper","InertDocumentHelper","isDOMParserAvailable","DOMParserHelper","getInertBodyElement","window","DOMParser","parseFromString","inertDocument","implementation","createHTMLDocument","templateEl","createElement","innerHTML","SAFE_URL_PATTERN","_sanitizeUrl","tagSet","tags","merge","sets","VOID_ELEMENTS","OPTIONAL_END_TAG_BLOCK_ELEMENTS","OPTIONAL_END_TAG_INLINE_ELEMENTS","OPTIONAL_END_TAG_ELEMENTS","BLOCK_ELEMENTS","INLINE_ELEMENTS","VALID_ELEMENTS","URI_ATTRS","HTML_ATTRS","ARIA_ATTRS","VALID_ATTRS","SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS","SanitizingHtmlSerializer","sanitizedSomething","buf","sanitizeChildren","traverseContent","parentNodes","ELEMENT_NODE","startElement","chars","nodeValue","getFirstChild","endElement","getNextSibling","tagName","getNodeName","elAttrs","attributes","elAttr","encodeEntities","isClobberedElement","childNode","compareDocumentPosition","DOCUMENT_POSITION_CONTAINED_BY","previousSibling","clobberedElementError","nodeName","outerHTML","SURROGATE_PAIR_REGEXP","NON_ALPHANUMERIC_REGEXP","hi","low","inertBodyHelper","_sanitizeHtml","unsafeHtmlInput","inertBodyElement","unsafeHtml","mXSSAttempts","parsedHtml","sanitizer","safeHtml","getTemplateContent","isTemplateElement","SecurityContext","ɵɵsanitizeHtml","getSanitizer","sanitize","HTML","ɵɵsanitizeStyle","unsafeStyle","STYLE","ɵɵsanitizeUrl","unsafeUrl","URL","ɵɵsanitizeResourceUrl","unsafeResourceUrl","RESOURCE_URL","ɵɵsanitizeScript","unsafeScript","SCRIPT","ɵɵtrustConstantHtml","raw","ɵɵtrustConstantResourceUrl","getUrlSanitizer","tag","ɵɵsanitizeUrlOrResourceUrl","validateAgainstEventProperties","startsWith","validateAgainstEventAttributes","COMMENT_DISALLOWED","COMMENT_DELIMITER","COMMENT_DELIMITER_ESCAPED","escapeCommentText","normalizeDebugBindingName","camelCaseToDashCase","CAMEL_CASE_REGEXP","m","normalizeDebugBindingValue","CUSTOM_ELEMENTS_SCHEMA","NO_ERRORS_SCHEMA","shouldThrowErrorOnUnknownElement","ɵsetUnknownElementStrictMode","shouldThrow","ɵgetUnknownElementStrictMode","shouldThrowErrorOnUnknownProperty","ɵsetUnknownPropertyStrictMode","ɵgetUnknownPropertyStrictMode","validateElementIsKnown","hasDirectives","isUnknown","HTMLUnknownElement","customElements","matchingSchemas","isHostStandalone","isHostComponentStandalone","templateLocation","getTemplateLocationDetails","isPropertyValid","handleUnknownPropertyError","importLocation","KNOWN_CONTROL_FLOW_DIRECTIVES","correspondingImport","reportUnknownPropertyError","getDeclarationComponentDef","declarationLView","hostComponentDef","componentClassName","schema","ɵɵresolveWindow","ownerDocument","defaultView","ɵɵresolveDocument","ɵɵresolveBody","INTERPOLATION_DELIMITER","maybeUnwrapFn","isPlatformBrowser","VALUE_STRING_LENGTH_LIMIT","assertStandaloneComponentType","assertComponentDef","throwMultipleComponentError","second","throwErrorIfNoChangesMode","creationMode","currValue","formatValue","strValue","constructDetailsForInterpolation","rootIndex","expressionIndex","changedValue","prefix","chunks","newValue","slotIdx","getExpressionChangedErrorDetails","metadata","matches","RegExp","RendererStyleFlags2","_icuContainerIterate","icuContainerIterate","tIcuContainerNode","ensureIcuContainerVisitorLoaded","loader","applyToElementOrContainer","action","lNodeToHandle","beforeNode","lContainer","isComponent","nativeAppendChild","nativeInsertBefore","nativeRemoveNode","destroyNode","applyContainer","createText","updateTextNode","setValue","createCommentNode","createComment","createElementNode","namespace","removeViewFromDOM","detachViewFromDOM","addViewToDOM","parentNativeNode","applyView","destroyViewTree","lViewOrLContainer","cleanUpView","firstView","insertView","indexInContainer","containerLength","declarationLContainer","trackMovedView","lQueries","declarationContainer","movedViews","HasTransplantedViews","insertedComponentLView","declaredComponentLView","detachMovedView","declarationViewIndex","detachView","removeIndex","viewToDetach","removedLView","destroyLView","executeOnDestroys","processCleanups","targetIdx","destroyHooksFn","toCall","callContext","getParentRElement","getClosestRElement","isMove","insertBefore","appendChild","nativeAppendOrInsertBefore","nativeParentNode","nativeNextSibling","getInsertInFrontOfRNode","_getInsertInFrontOfRNodeWithI18n","getInsertInFrontOfRNodeWithNoI18n","_processI18nInsertBefore","setI18nHandling","getInsertInFrontOfRNodeWithI18n","processI18nInsertBefore","childRNode","childTNode","parentRNode","anchorNode","getFirstNativeNode","getBeforeNodeForView","elIcuContainerChild","rNodeOrLContainer","nextRNode","projectionNodes","getProjectionNodes","componentHost","viewIndexInContainer","nextViewIndex","firstTNodeOfView","isHostElement","removeChild","clearElementContents","applyNodes","parentRElement","isProjection","rawSlotValue","applyProjectionRecursive","projectionNext","applyProjection","tProjectionNode","componentNode","nodeToProjectOrRNodes","nodeToProject","projectedComponentLView","anchor","applyStyling","isClassBased","removeClass","addClass","DashCase","removeStyle","isImportant","endsWith","Important","setStyle","writeDirectStyle","writeDirectClass","setupStaticAttributes","NO_CHANGE","__brand__","ɵɵadvance","delta","selectIndexInternal","checkNoChangesMode","hooksInitPhaseCompleted","ɵɵdirectiveInject","ɵɵinvalidFactory","writeToDirectiveInput","SignalBased","HasDecoratorInputTransform","processHostBindingOpCodes","hostBindingOpCodes","opCode","directiveIdx","bindingRootIndx","hostBindingFn","createLView","tHostNode","environment","getOrCreateTNode","createTNodeAtIndex","createTNode","prev","allocExpando","numSlotsToAlloc","allocIdx","executeTemplate","templateFn","rf","prevSelectedIndex","isUpdatePhase","preHookType","postHookType","executeContentQueries","createDirectivesInstances","instantiateAllDirectives","invokeDirectivesHostBindings","saveResolvedLocalsInData","viewData","localRefExtractor","getOrCreateComponentTView","incompleteFirstPass","createTView","pipes","constsOrFactory","ssrId","initialViewLength","createViewBlueprint","queries","fill","staticViewQueries","staticContentQueries","directiveRegistry","pipeRegistry","seal","locateHostElement","elementOrSelector","preserveHostContent","preserveContent","ShadowDom","rootElement","selectRootElement","applyRootElementTransform","_applyRootElementTransformImpl","applyRootElementTransformImpl","enableApplyRootElementTransformImpl","storeCleanupWithContext","cleanupFn","getOrCreateLViewCleanup","getOrCreateTViewCleanup","tParent","directiveStylingLast","propertyBindings","initialInputs","stylesWithoutHost","residualStyles","classesWithoutHost","residualClasses","classBindings","styleBindings","captureNodeBindings","aliasMap","bindingsResult","hostDirectiveAliasMap","internalName","finalPublicName","addPropertyBinding","bindings","initializeInputAndOutputAliases","hostDirectiveDefinitionMap","tViewData","tNodeAttrs","inputsFromAttrs","inputsStore","outputsStore","aliasData","aliasedInputs","aliasedOutputs","generateInitialInputs","mapPropName","elementPropertyInternal","nativeOnly","inputData","dataValue","setInputsForProperty","markDirtyIfOnPush","setNgReflectProperties","viewIndex","childComponentLView","setNgReflectProperty","debugValue","resolveDirectives","exportsMap","matchResult","findDirectiveDefMatches","hostDirectiveDefs","initializeDirectives","cacheMatchingLocalNames","initTNodeFlags","preOrderHooksFound","preOrderCheckHooksFound","configureViewWithDirective","saveNameToExportMap","lifeCycleHooks","registerHostBindingOpCodes","directiveVarsIdx","elementIndx","lastSelectedElementIdx","addComponentLogic","setInputsFromAttrs","elementIndex","dirIndex","invokeHostBindingsInCreationMode","registry","hostDirectiveMatches","markAsComponentHost","hostTNode","numberOfDirectives","directiveFactory","nodeInjectorFactory","rendererFactory","lViewFlags","addToViewTree","createRenderer","elementAttributeInternal","setElementAttribute","initialInputData","inputsToStore","createLContainer","hostNative","refreshContentQueries","queryStartIdx","directiveDefIdx","executeViewQueryFn","viewQueryFn","storePropertyBindingMetadata","propertyName","interpolationParts","propBindingIdxs","bindingMetadata","loadComponentRenderer","currentDef","textBindingInternal","renderComponent","hostLView","componentHostIdx","componentTView","syncViewWithBlueprint","hostRNode","renderView","finishViewCreation","renderChildComponents","createAndRenderEmbeddedLView","templateTNode","embeddedTView","isSignalView","viewFlags","embeddedLView","declarationViewLQueries","createEmbeddedView","getLViewFromLContainer","adjustedIndex","shouldAddViewToDom","addLViewToLContainer","addToDOM","removeLViewFromLContainer","collectNativeNodes","lNode","collectNativeNodesInLContainer","nodesInSlot","lViewInAContainer","lViewFirstChildTNode","freeConsumers","getOrBorrowReactiveLViewConsumer","borrowReactiveLViewConsumer","consumer","REACTIVE_LVIEW_CONSUMER_NODE","maybeReturnReactiveLViewConsumer","consumerIsAlwaysLive","consumerMarkedDirty","consumerOnSignalRead","getOrCreateTemporaryConsumer","TEMPORARY_CONSUMER_NODE","viewShouldHaveReactiveConsumer","MAXIMUM_REFRESH_RERUNS$1","detectChangesInternal","notifyErrorHandler","begin","detectChangesInViewWhileDirty","inlineEffectRunner","flush","lastIsRefreshingViewsValue","detectChangesInView","retries","checkNoChangesInternal","refreshView","isInCheckNoChangesPass","isInExhaustiveCheckNoChangesPass","returnConsumerToPool","currentConsumer","markTransplantedViewsForRefresh","detectChangesInEmbeddedViews","detectChangesInChildComponents","notifyEffect","detectChangesInViewIfAttached","movedLView","detectChangesInComponent","shouldRefreshView","markViewDirty","dirtyBitsToUse","ViewRef$1","rootNodes","_cdRefInjectingView","_appRef","_attachedToViewContainer","viewRefs","markForCheck","detach","reattach","detectChanges","checkNoChanges","OnlyDirtyViews","attachToViewContainerRef","detachFromAppRef","isRoot","attachToAppRef","appRef","TemplateRef","injectTemplateRef","ViewEngineTemplateRef","R3TemplateRef","_declarationLView","_declarationTContainer","elementRef","createEmbeddedViewImpl","createTemplateRef","AT_THIS_LOCATION","getFriendlyStringFromTNodeType","validateMatchingNode","isViewContainerAnchor","expectedNode","shortRNodeDescription","header","expectedDom","describeExpectedDom","componentHostElement","actualNode","actualDom","describeDomFromNode","getHydrationErrorFooter","getHydrationAttributeNote","validateSiblingNodeExists","validateNodeExists","nodeNotFoundError","nodeNotFoundAtPathError","describeRNode","unsupportedProjectionOfDomNodes","invalidSkipHydrationHost","stringifyTNodeAttrs","shorten","internalAttrs","stringifyRNodeAttrs","describeTNode","innerContent","typeAsString","COMMENT_NODE","spacer","componentInfo","stripNewlines","tNodeInsertBeforeIndex","i18nParent","anchorRNode","i18nChild","addTNodeAndUpdateInsertBeforeIndex","previousTNodes","newTNode","existingTNode","isI18nText","isNewTNodeCreatedBefore","getInsertBeforeIndex","setInsertBeforeIndex","getTIcu","setTIcu","setTNodeInsertBeforeIndex","createTNodePlaceholder","getCurrentICUCaseIndex","currentCase","getParentFromIcuCreateOpCode","mergedCode","getRefFromIcuCreateOpCode","getInstructionFromIcuCreateOpCode","icuCreateOpCode","parentIdx","refIdx","isRootTemplateMessage","subTemplateIndex","enterIcu","state","cases","removes","icuContainerIteratorNext","removeOpCode","stack","tIcuIndex","loadIcuContainerVisitor","_state","icuContainerIteratorStart","createIcuIterator","REF_EXTRACTOR_REGEXP","compressNodeLocation","referenceNode","segment","lastIdx","decompressNodeLocation","refNodeId","refNodeName","rest","parseInt","steps","step","matchAll","repeat","isFirstElementInNgContainer","getNoOffsetIndex","isDisconnectedNode","isDisconnectedRNode","isConnected","locateI18nRNodeByIndex","noOffsetIndex","i18nNodes","tryLocateRNodeByPath","locateRNodeByPath","locateNextRNode","previousTNodeParent","previousTNode","noOffsetParentIndex","previousRElement","noOffsetPrevSiblingIndex","segmentHead","numRootNodesToSkip","nodesToSkip","siblingAfter","skip","from","stringifyNavigationInstructions","instructions","r","FirstChild","navigateToNode","NextSibling","navigationInstructions","parentElementId","navigateBetween","finish","parentElement","navigateBetweenSiblings","parentPath","childPath","nav","calcPathBetween","to","fromNodeName","calcPathForNode","excludedParentNodes","referenceNodeName","firstRNode","_isI18nHydrationSupportEnabled","_prepareI18nBlockForHydrationImpl","setIsI18nHydrationSupportEnabled","enabled","isI18nHydrationSupportEnabled","prepareI18nBlockForHydration","enablePrepareI18nBlockForHydrationImpl","prepareI18nBlockForHydrationImpl","isI18nHydrationEnabled","getOrComputeI18nChildren","i18nChildren","collectI18nChildren","children","collectI18nViews","caseNodes","caseNode","tI18n","ast","trySerializeI18nBlock","parentTNodeIndex","serializedI18nBlock","caseQueue","disjointNodes","serializeI18nBlock","prevRNode","serializeI18nNode","isDisjointNode","prevNode","maybeRNode","caseIdx","getFirstNativeNodeForI18nNode","maybeTNode","icuIterator","setCurrentNode","appendI18nNodeToCollection","astNode","skipSiblingNodes","forkHydrationState","findHydrationRoot","rootNode","dehydratedIcuData","collectI18nNodesFromDom","nodeOrNodes","nextState","targetNode","containerSize","selectedCase","childState","case","_claimDehydratedIcuCaseImpl","claimDehydratedIcuCase","icuIndex","caseIndex","enableClaimDehydratedIcuCaseImpl","claimDehydratedIcuCaseImpl","dehydratedIcuDataMap","cleanupI18nHydrationData","cleanupDehydratedIcuData","removeDehydratedViews","removeDehydratedView","nodesRemoved","currentRNode","cleanupLContainer","cleanupLView","cleanupDehydratedViews","_views","locateDehydratedViewsInContainer","serializedViews","dehydratedViews","serializedView","_findMatchingDehydratedViewImpl","findMatchingDehydratedViewImpl","enableFindMatchingDehydratedViewImpl","findMatchingDehydratedView","ChangeDetectionScheduler","ZONELESS_ENABLED","PROVIDED_ZONELESS","ZONELESS_SCHEDULER_DISABLED","SCHEDULE_IN_ROOT_ZONE","ComponentRef$1","ComponentFactory$1","noComponentFactoryError","ERROR_COMPONENT","getComponent","_NullComponentFactoryResolver","resolveComponentFactory","ComponentFactoryResolver$1","RendererFactory2","Renderer2","injectRenderer2","nodeAtIndex","Sanitizer","isModuleWithProviders","isNgModule","isPipe","isDirective","getDependencyTypeForError","verifyStandaloneImport","depType","importingType","USE_RUNTIME_DEPS_TRACKER_FOR_JIT","DepsTracker","ownerNgModule","ngModulesWithSomeUnresolvedDecls","ngModulesScopeCache","standaloneComponentsScopeCache","resolveNgModulesDecls","moduleType","decl","getComponentDependencies","rawImports","scope","getStandaloneComponentScope","compilation","isPoisoned","ngModules","getNgModuleScope","registerNgModule","scopeInfo","clearScopeCacheFor","computeNgModuleScope","exported","importedScope","addSet","exportedScope","ans","computeStandaloneComponentScope","rawImport","isOrphanComponent","cmp","sourceSet","targetSet","depsTracker","TEST_ONLY","computeStaticStyling","writeToHost","style","styleValue","ComponentFactoryResolver","ComponentFactory","toRefArray","isInputMap","templateName","isSignal","getNamespace","elementName","refArray","componentType","isBoundToModule","projectableNodes","rootSelectorOrNode","environmentInjector","ngJitMode","forbidOrphanRendering","realEnvironmentInjector","rootViewInjector","hostRenderer","rootFlags","rootTView","rootLView","tElementNode","rootComponentDef","rootDirectives","createRootComponentTNode","createRootComponentView","setRootNodeAttributes","projectNodes","createRootComponent","LifecycleHooksFeature","ComponentRef","_rootLView","previousInputValues","changeDetectorRef","is","cmpNameForError","applyRootComponentStyling","viewRenderer","hostFeatures","rootTNode","feature","nodesforSlot","ViewContainerRef","injectViewContainerRef","createContainerRef","VE_ViewContainerRef","R3ViewContainerRef","_lContainer","_hostTNode","_hostLView","getViewRefs","templateRef","indexOrOptions","insertImpl","createComponent","componentFactoryOrType","isComponentFactory","ngModuleRef","componentFactory","contextInjector","_injector","componentRef","insert","prevIdx","prevLContainer","prevVCRef","adjustedIdx","_adjustIndex","getOrCreateViewRefs","move","newIndex","viewRefsArr","detachedView","wasDetached","_locateOrCreateAnchorNode","insertAnchorNode","commentNode","parentOfHostNative","createAnchorNode","_populateDehydratedViewsInLContainer","populateDehydratedViewsInLContainer","populateDehydratedViewsInLContainerImpl","isNodeCreationMode","locateOrCreateAnchorNode","enableLocateOrCreateContainerRefImpl","LQuery_","queryList","clone","LQueries_","tQueries","noOfInheritedQueries","viewLQueries","tQuery","getByIndex","parentLQuery","indexInDeclarationView","dirtyQueriesWithMatches","getTQuery","TQueryMetadata_","predicate","read","splitQueryMultiSelectors","TQueries_","elementStart","elementEnd","queriesForTemplateRef","childQueryIndex","tqueryClone","track","tquery","TQuery_","crossesNgTemplate","_appliesToNextNode","_declarationNodeIndex","isApplyingToNode","matchTNode","addMatch","declarationNodeIdx","matchTNodeWithReadOption","getIdxOfMatchingSelector","nodeMatchIdx","directiveOrProviderIdx","tNodeIdx","matchIdx","createResultByTNodeType","createResultForNode","matchingIdx","createSpecialToken","materializeViewResults","queryIndex","lQuery","tQueryMatches","matchedNodeIdx","collectQueryResults","lViewResults","embeddedLViews","loadQueryInternal","createLQuery","createViewQuery","createTQuery","createContentQuery","saveContentQueryAndDirectiveIndex","locator","tViewContentQueries","lastSavedDirectiveIndex","getQueryResults","markedFeatures","performanceMarkFeature","performance","mark","detail","ɵWRITABLE_SIGNAL","ɵunwrapWritableSignal","signal","signalFn","equal","update","updateFn","asReadonly","signalAsReadonlyFn","readonlyFn","isWritableSignal","createQuerySignalFn","firstOnly","_dirtyCounter","refreshSignalQuery","_flatValue","createSingleResultOptionalQuerySignalFn","createSingleResultRequiredQuerySignalFn","createMultiResultQuerySignalFn","bindQueryToSignal","_queryIndex","_queryList","resultChanged","viewChildFn","viewChild","viewChildRequiredFn","viewChildren","contentChildFn","contentChild","contentChildRequiredFn","contentChildren","createModelSignal","emitterRef","getter","assertModelSet","modelFunction","model","modelRequiredFunction","emitDistinctChangesOnlyDefaultValue","Query","ContentChildren","isViewQuery","descendants","emitDistinctChangesOnly","ContentChild","ViewChildren","ViewChild","resolveComponentResources","resourceResolver","componentResolved","urlMap","cachedResourceResolve","promise","resp","then","unwrapResponse","componentResourceResolutionQueue","promises","templateUrl","styleUrl","styleUrls","styleOffset","fullyResolved","Promise","all","componentDefResolved","clearResolutionOfComponentResourcesQueue","componentDefPendingResolution","maybeQueueResolutionOfComponentResources","componentNeedsResolution","isComponentDefPendingResolution","old","restoreComponentResolutionQueue","queue","isComponentResourceResolutionQueueEmpty","response","modules","checkForDuplicateNgModules","assertSameOrNotExisting","incoming","registerNgModuleType","clearModulesForTest","getRegisteredNgModuleType","setAllowDuplicateNgModuleIdsForTest","allowDuplicates","ɵɵvalidateIframeAttribute","iframe","srcdoc","getSuperType","ɵɵInheritDefinitionFeature","superType","shouldInheritFields","inheritanceChain","superDef","writeableDef","maybeUnwrapEmpty","superHostBindings","inheritHostBindings","superViewQuery","superContentQueries","inheritViewQuery","inheritContentQueries","mergeInputsWithTransforms","animation","defData","mergeHostAttrsAcrossInheritance","prevViewQuery","ctx","prevContentQueries","prevHostBindings","COPY_DIRECTIVE_FIELDS","COPY_COMPONENT_FIELDS","ɵɵCopyDefinitionFeature","defAny","ɵɵHostDirectivesFeature","rawHostDirectives","resolved","dir","bindingArrayToMap","matchedDefs","hostDirectiveConfig","hostDirectiveDef","validateHostDirective","patchDeclaredInputs","exposedInputs","remappedPublicName","validateMappings","bindingType","hostDirectiveBindings","ɵɵInputTransformsFeature","NgModuleRef$1","NgModuleFactory$1","createNgModule","NgModuleRef","createNgModuleRef","_parent","runInjectorInitializers","_bootstrapComponents","destroyCbs","componentFactoryResolver","_r3Injector","NgModuleFactory","createNgModuleRefWithProviders","EnvironmentNgModuleRefAdapter","config","debugName","runEnvironmentInitializers","createEnvironmentInjector","adapter","CachedInjectorService","cachedInjectors","getOrCreateInjector","isIterable","isListLikeIterable","isJsObject","areIterablesEqual","comparator","iterator1","iterator2","item1","item2","done","iterateListLike","o","devModeEqual","isListLikeIterableA","isListLikeIterableB","isAObject","isBObject","updateBinding","getBinding","bindingUpdated","oldValueToCompare","details","bindingUpdated2","exp1","exp2","different","bindingUpdated3","exp3","bindingUpdated4","exp4","isDetachedByI18n","templateFirstCreatePass","localRefsIndex","tViewConsts","declareTemplate","declarationTView","comment","_locateOrCreateContainerAnchor","ɵɵtemplate","attrsIndex","createContainerAnchorImpl","locateOrCreateContainerAnchorImpl","viewContainerSize","enableLocateOrCreateContainerAnchorImpl","DeferDependenciesLoadingState","MINIMUM_SLOT","LOADING_AFTER_SLOT","DeferBlockState","DeferBlockInternalState","NEXT_DEFER_BLOCK_STATE","DEFER_BLOCK_STATE","STATE_IS_FROZEN_UNTIL","LOADING_AFTER_CLEANUP_FN","TRIGGER_CLEANUP_FNS","PREFETCH_TRIGGER_CLEANUP_FNS","DeferBlockBehavior","storeTriggerCleanupFn","lDetails","invokeTriggerCleanupFns","cleanupFns","invokeAllTriggerCleanupFns","assertNotInReactiveContext","extraContext","AfterRenderPhase","AfterRenderManager","execute","AfterRenderImpl","ngZone","scheduler","sequences","deferredRegistrations","executing","PHASES","EarlyRead","Write","MixedReadWrite","Read","phase","sequence","erroredOrDestroyed","pipelinedValue","afterRun","once","register","unregister","AfterRenderSequence","unregisterOnDestroy","afterRender","callbackOrSpec","NOOP_AFTER_RENDER_REF","afterRenderImpl","afterNextRender","getHooks","earlyRead","write","mixedReadWrite","manager","manualCleanup","getDeferBlockDataIndex","deferBlockIndex","getLDeferBlockDetails","slotIndex","setLDeferBlockDetails","getTDeferBlockDetails","setTDeferBlockDetails","deferBlockConfig","getTemplateIndexForState","newState","tDetails","Complete","primaryTmplIndex","Loading","loadingTmplIndex","errorTmplIndex","Placeholder","placeholderTmplIndex","getMinimumDurationForState","currentState","placeholderBlockConfig","loadingBlockConfig","getLoadingBlockAfter","addDepsToRegistry","currentDeps","newDeps","currentDepSet","getPrimaryBlockTNode","assertDeferredDependenciesLoaded","loadingState","COMPLETE","isTDeferBlockDetails","eventListenerOptions","passive","capture","hoverTriggers","WeakMap","interactionTriggers","viewportTriggers","interactionEventNames","hoverEventNames","intersectionObserver","observedViewportElements","DeferEventEntry","callbacks","listener","onInteraction","trigger","entry","addEventListener","removeEventListener","onHover","onViewport","IntersectionObserver","entries","isIntersecting","observe","unobserve","disconnect","getTriggerLView","deferredHostLView","deferredTNode","walkUpTimes","deferredContainer","triggerLView","renderedState","getTriggerElement","triggerIndex","registerDomTrigger","initialLView","registerFn","pollDomTrigger","Initial","onIdle","IdleScheduler","_requestIdleCallback","requestIdleCallback","_cancelIdleCallback","cancelIdleCallback","executingCallbacks","idleId","deferred","requestIdleCallbackFn","cancelIdleCallbackFn","scheduleIdleCallback","onTimer","delay","scheduleTimerTrigger","TimerScheduler","invokeTimerAt","addToQueue","Date","now","scheduleTimer","callbackIndex","removeFromQueue","invokeAt","insertAtIndex","invokeQueuedCallbackAt","queuedCallback","lastCallbackIndex","FRAME_DURATION_MS","timeout","DEFER_BLOCK_DEPENDENCY_INTERCEPTOR","DEFER_BLOCK_CONFIG","shouldTriggerDeferBlock","behavior","Manual","applyDeferBlockStateWithSchedulingImpl","ɵɵdeferEnableTimerScheduling","placeholderConfigIndex","loadingConfigIndex","applyDeferBlockStateWithScheduling","ɵɵdefer","dependencyResolverFn","enableTimerScheduling","NOT_STARTED","loadingPromise","cleanupTriggersFn","ɵɵdeferWhen","rawValue","Boolean","renderPlaceholder","triggerDeferBlock","ɵɵdeferPrefetchWhen","triggerPrefetching","ɵɵdeferOnIdle","scheduleDelayedTrigger","ɵɵdeferPrefetchOnIdle","scheduleDelayedPrefetching","ɵɵdeferOnImmediate","ɵɵdeferPrefetchOnImmediate","triggerResourceLoading","ɵɵdeferOnTimer","ɵɵdeferPrefetchOnTimer","ɵɵdeferOnHover","ɵɵdeferPrefetchOnHover","ɵɵdeferOnInteraction","ɵɵdeferPrefetchOnInteraction","ɵɵdeferOnViewport","ɵɵdeferPrefetchOnViewport","scheduleFn","prefetch","renderDeferBlockState","skipTimerScheduling","hostTView","isValidStateChange","needsScheduling","applyStateFn","applyDeferBlockState","getOrCreateEnvironmentInjector","createDeferBlockInjector","origInjector","parentEnvInjector","envInjector","stateTmplIndex","activeBlockTNode","loadingAfter","inLoadingAfterPhase","scheduleDeferBlockUpdate","duration","resolve","primaryBlockTNode","IN_PROGRESS","dependenciesFn","deferDependencyInterceptor","intercept","allSettled","failed","dependency","FAILED","primaryBlockTView","directiveTypes","renderDeferStateAfterResourceLoading","ɵɵattribute","interpolationV","isBindingUpdated","interpolation1","v0","suffix","interpolation2","i0","v1","interpolation3","i1","v2","interpolation4","i2","v3","interpolation5","i3","v4","interpolation6","i4","v5","interpolation7","i5","v6","interpolation8","i6","v7","ɵɵattributeInterpolate1","interpolatedValue","ɵɵattributeInterpolate2","ɵɵattributeInterpolate3","ɵɵattributeInterpolate4","ɵɵattributeInterpolate5","ɵɵattributeInterpolate6","ɵɵattributeInterpolate7","ɵɵattributeInterpolate8","ɵɵattributeInterpolateV","interpolated","interpolationInBetween","toTStylingRange","getTStylingRangePrev","tStylingRange","getTStylingRangePrevDuplicate","setTStylingRangePrev","setTStylingRangePrevDuplicate","getTStylingRangeNext","setTStylingRangeNext","getTStylingRangeNextDuplicate","setTStylingRangeNextDuplicate","getTStylingRangeTail","__unused_const_as_closure_does_not_like_standalone_comment_blocks__","insertTStylingBinding","tStylingKeyWithStatic","isHostBinding","isClassBinding","tBindings","tmplHead","tmplTail","isKeyDuplicateOfStatic","tStylingKey","staticKeyValueArray","hasTemplateBindings","previousNode","markDuplicates","markDuplicateOfResidualStyling","residual","isPrevDir","tStylingAtIndex","isMap","cursor","foundDuplicate","tStylingValueAtCursor","tStyleRangeAtCursor","isStylingMatch","tStylingKeyCursor","parserState","textEnd","keyEnd","valueEnd","getLastParsedKey","getLastParsedValue","parseClassName","resetParserState","parseClassNameNext","consumeWhitespace","consumeClassToken","parseStyle","parseStyleNext","consumeStyleKey","consumeSeparator","consumeStyleValue","ch","malformedStyleError","fromCharCode","ch1","ch2","ch3","lastChIndex","consumeQuotedText","quoteCharCode","expecting","ɵɵproperty","setDirectiveInputsWhichShadowsStyling","property","ɵɵstyleProp","checkStylingProperty","ɵɵclassProp","ɵɵstyleMap","checkStylingMap","styleKeyValueArraySet","styleStringParser","ɵɵclassMap","classKeyValueArraySet","classStringParser","stylingFirstUpdatePass","updateStyling","normalizeSuffix","stringParser","hasStylingInputShadow","isInHostBindings","staticPrefix","updateStylingMap","toStylingKeyValueArray","isHostBindings","wrapInStaticStylingKey","stylingKey","isFirstStylingInstructionInTemplate","collectStylingFromDirectives","collectStylingFromTAttrs","isFirstStylingInstructionInHostBinding","templateStylingKey","getTemplateHeadTStylingKey","setTemplateHeadTStylingKey","collectResidual","currentDirective","desiredMarker","currentMarker","styleKeyValueArray","unwrappedValue","stringKey","includes","oldKeyValueArray","newKeyValueArray","oldIndex","oldKey","newKey","setKey","tRange","higherPriorityValue","findStylingValue","isStylingValuePresent","isPrevDirection","rawKey","containsStatics","isStylingMap","valueAtLViewIndex","ɵɵclassMapInterpolate1","ɵɵclassMapInterpolate2","ɵɵclassMapInterpolate3","ɵɵclassMapInterpolate4","ɵɵclassMapInterpolate5","ɵɵclassMapInterpolate6","ɵɵclassMapInterpolate7","ɵɵclassMapInterpolate8","ɵɵclassMapInterpolateV","ɵɵcomponentInstance","LiveCollection","updateValue","swap","index1","index2","startIdx","min","endIdx","endItem","startItem","attach","prevIndex","newIdx","valuesMatching","liveIdx","liveValue","trackBy","recordDuplicateKeys","keyToIdx","idxSoFar","reconcile","liveCollection","newCollection","trackByFn","detachedItems","liveKeysInTheFuture","liveStartIdx","liveEndIdx","duplicateKeys","newEndIdx","liveStartValue","at","newStartValue","isStartMatching","liveEndValue","newEndValue","isEndMatching","liveStartKey","liveEndKey","newStartKey","newEndKey","UniqueValueMultiKeyMap","initLiveItemsInTheFuture","attachPreviouslyDetached","newItem","createOrAttach","newCollectionIterator","newIterationResult","liveKey","duplicatedKeysMsg","idxSet","prevCollection","kvMap","_vMap","prevValue","vMap","ɵɵconditional","matchingTemplateIndex","contextValue","prevMatchingTemplateIndex","prevContainer","getLContainer","viewInContainerIdx","nextLContainerIndex","nextContainer","getExistingTNode","RepeaterContext","$implicit","$index","$count","ɵɵrepeaterTrackByIndex","ɵɵrepeaterTrackByIdentity","RepeaterMetadata","hasEmptyBlock","ɵɵrepeaterCreate","trackByUsesComponentInstance","emptyTemplateFn","emptyDecls","emptyVars","emptyTagName","emptyAttrsIndex","boundTrackBy","isViewExpensiveToRecreate","OperationsCounter","created","recordCreate","recordDestroy","wasReCreated","collectionLen","LiveCollectionLContainerImpl","operationsCounter","needsIndexUpdate","detachExistingView","updateIndexes","getExistingLViewFromLContainer","ɵɵrepeater","collection","metadataSlotIdx","containerIndex","itemTemplateTNode","isCollectionEmpty","emptyTemplateIndex","lContainerForEmpty","emptyTemplateTNode","existingLView","elementStartFirstCreatePass","ɵɵelementStart","_locateOrCreateElementNode","ɵɵelementEnd","ɵɵelement","locateOrCreateElementNodeImpl","enableLocateOrCreateElementNodeImpl","elementContainerStartFirstCreatePass","ɵɵelementContainerStart","_locateOrCreateElementContainerNode","ɵɵelementContainerEnd","ɵɵelementContainer","locateOrCreateElementContainerNode","ngContainerSize","enableLocateOrCreateElementContainerNodeImpl","ɵɵgetCurrentView","ɵɵhostProperty","ɵɵsyntheticHostProperty","ngI18nClosureMode","goog","getMsg","u","plural","val","n","floor","localeEn","LOCALE_DATA","registerLocaleData","localeId","extraData","LocaleDataIndex","LocaleId","ExtraData","findLocaleData","locale","normalizedLocale","normalizeLocale","getLocaleData","parentLocale","getLocaleCurrencyCode","CurrencyCode","getLocalePluralCase","PluralCase","ng","common","locales","unregisterAllLocaleData","pluralMapping","getPluralCase","DEFAULT_LOCALE_ID","USD_CURRENCY_CODE","ELEMENT_MARKER","ICU_MARKER","I18nCreateOpCode","LOCALE_ID$1","setLocaleId","getLocaleId","changeMask","changeMaskCounter","setMaskBit","hasChange","applyI18n","updateOpCodes","bindingsStartIndex","applyUpdateOpCodes","createNodeWithoutHydration","textOrName","_locateOrCreateNode","locateOrCreateNodeImpl","enableLocateOrCreateI18nNodeImpl","applyCreateOpCodes","createOpCodes","insertInFrontOf","isComment","COMMENT","appendNow","APPEND_EAGERLY","SHIFT","applyMutableOpCodes","mutableOpCodes","rootIdx","rootRNode","textNodeIndex","anchorIdx","elementNodeIndex","commentValue","commentNodeIndex","commentRNode","elementRNode","checkBit","skipCodes","sanitizeFn","tNodeOrTagName","rText","applyIcuSwitchCase","applyIcuUpdateCase","currentIndex","activeCaseIndex","getCaseIndex","applyIcuSwitchCaseRemove","removeCodes","nodeOrIcuIndex","icuExpression","bindingValue","resolvedCase","i18nCreateOpCodesToString","opcodes","lines","i18nUpdateOpCodesToString","parser","OpCodeParser","consumeOpCode","consumeString","sanitizationFn","consumeFunction","hasMore","consumeNumber","statements","statement","consumeNumberOrString","opCodeText","icuCreateOpCodesToString","lastRef","consumeNumberStringOrMarker","line","i18nRemoveOpCodesToString","codes","BINDING_REGEXP","ICU_REGEXP","NESTED_ICU","ICU_BLOCK_REGEXP","MARKER","SUBTEMPLATE_REGEXP","PH_REGEXP","NGSP_UNICODE_REGEXP","replaceNgsp","attachDebugGetter","debugGetter","enumerable","i18nStartFirstCreatePass","existingTNodeStack","astStack","getTranslationForTemplate","msgParts","i18nParseTextIntoPartsAndICU","part","i18nStartFirstCreatePassProcessTextNode","icuContainerTNode","createTNodeAndAddOpCode","mainBinding","icuNodeIndex","icuStart","isClosing","placeholderNode","existingTNodes","isICU","i18nNodeIdx","hasBinding","generateBindingUpdateOpCodes","i18nAttributesFirstPass","previousElement","previousElementIndex","countBindings","destinationNode","bindingStart","maskIndex","sizeIndex","textParts","textValue","toMaskBit","opCodes","removeInnerTemplateTranslation","inTemplate","tagMatched","exec","search","bindingMask","addUpdateIcuSwitch","valueArr","nestedIcus","caseAst","parseIcuCase","addUpdateIcuUpdate","parseICUBlock","pattern","icuType","binding","pos","blocks","prevPos","braceStack","braces","lastIndex","block","caseName","unsafeCaseHtml","inertRootNode","walkIcuTree","sharedUpdateOpCodes","depth","addCreateNodeAndAppend","lowerAttrName","addCreateAttribute","elementNode","addRemoveNode","isNestedIcu","nestedIcuIndex","addRemoveNestedIcu","appendToParentIdx","createAtIdx","ROOT_TEMPLATE_ID","PP_MULTI_VALUE_PLACEHOLDERS_REGEXP","PP_PLACEHOLDERS_REGEXP","PP_ICU_VARS_REGEXP","PP_ICU_PLACEHOLDERS_REGEXP","PP_ICUS_REGEXP","PP_CLOSE_TEMPLATE_REGEXP","PP_TEMPLATE_ID_REGEXP","i18nPostprocess","replacements","templateIdsStack","phs","tmpl","placeholders","placeholder","templateId","isCloseTemplateTag","currentTemplateId","_type","_idx","ɵɵi18nStart","messageIndex","sameViewParentTNode","ɵɵi18nEnd","ɵɵi18n","ɵɵi18nAttributes","ɵɵi18nExp","ɵɵi18nApply","ɵɵi18nPostprocess","stashEventListener","eventName","setStashFn","ɵɵlistener","eventTargetResolver","listenerInternal","ɵɵsyntheticHostListener","findExistingListener","cleanupEventName","listenerIdxInLCleanup","isTNodeDirectiveHost","processOutputs","lCleanupIndex","idxOrTargetGetter","existingListener","lastListenerFn","__ngLastListenerFn__","__ngNextListenerFn__","wrapListener","listen","propsLength","isOutputSubscribable","subscription","executeListenerWithErrorHandling","wrapListenerIn_markDirtyAndPreventDefault","nextListenerFn","ɵɵnextContext","matchingProjectionSlotIndex","projectionSlots","wildcardNgContentIndex","ngProjectAsAttrVal","ɵɵprojectionDef","numProjectionSlots","projectionHeads","tails","componentChild","ɵɵprojection","selectorIndex","fallbackTemplateFn","fallbackDecls","fallbackVars","fallbackIndex","componentHostNode","insertFallbackContent","fallbackTNode","fallbackLContainer","fallbackLView","ɵɵpropertyInterpolate","ɵɵpropertyInterpolate1","ɵɵpropertyInterpolate2","ɵɵpropertyInterpolate3","ɵɵpropertyInterpolate4","ɵɵpropertyInterpolate5","ɵɵpropertyInterpolate6","ɵɵpropertyInterpolate7","ɵɵpropertyInterpolate8","ɵɵpropertyInterpolateV","ɵɵcontentQuery","ɵɵviewQuery","ɵɵqueryRefresh","ɵɵloadQuery","ɵɵcontentQuerySignal","ɵɵviewQuerySignal","ɵɵqueryAdvance","indexOffset","ɵɵreference","ɵɵstyleMapInterpolate1","ɵɵstyleMapInterpolate2","ɵɵstyleMapInterpolate3","ɵɵstyleMapInterpolate4","ɵɵstyleMapInterpolate5","ɵɵstyleMapInterpolate6","ɵɵstyleMapInterpolate7","ɵɵstyleMapInterpolate8","ɵɵstyleMapInterpolateV","ɵɵstylePropInterpolate1","valueSuffix","ɵɵstylePropInterpolate2","ɵɵstylePropInterpolate3","ɵɵstylePropInterpolate4","ɵɵstylePropInterpolate5","ɵɵstylePropInterpolate6","ɵɵstylePropInterpolate7","ɵɵstylePropInterpolate8","ɵɵstylePropInterpolateV","ɵɵtext","textNative","_locateOrCreateTextNode","locateOrCreateTextNodeImpl","enableLocateOrCreateTextNodeImpl","ɵɵtextInterpolate","ɵɵtextInterpolate1","ɵɵtextInterpolate2","ɵɵtextInterpolate3","ɵɵtextInterpolate4","ɵɵtextInterpolate5","ɵɵtextInterpolate6","ɵɵtextInterpolate7","ɵɵtextInterpolate8","ɵɵtextInterpolateV","ɵɵtwoWayProperty","ɵɵtwoWayBindingSet","canWrite","ɵɵtwoWayListener","UNINITIALIZED_LET","ɵɵdeclareLet","ɵɵstoreLet","ɵɵreadContextLet","viewProviders","resolveProvider","lInjectablesBlueprint","providerFactory","beginIndex","existingFactoryIndex","registerDestroyHooksIfSupported","existingProvidersFactoryIndex","existingViewProvidersFactoryIndex","doesProvidersFactoryExist","doesViewProvidersFactoryExist","multiFactory","multiViewProvidersFactoryResolver","multiProvidersFactoryResolver","indexInFactory","multiFactoryAdd","componentProviders","contextIndex","providerIsTypeProvider","providerIsClassProvider","classToken","existingCallbacksIndex","isComponentProvider","lData","multiResolve","factories","componentCount","multiProviders","factoryFn","f","ɵɵProvidersFeature","processProvidersFn","StandaloneService","getOrCreateStandaloneInjector","standaloneInjector","ɵɵStandaloneFeature","ɵɵsetComponentScope","ɵɵsetNgModuleScope","convertToTypeArray","flattenValues","maybeUnwrapModuleWithProviders","ASYNC_COMPONENT_METADATA_FN","getAsyncClassMetadataFn","componentClass","setClassMetadataAsync","dependencyLoaderFn","metadataSetterFn","setClassMetadata","clazz","ɵɵpureFunction0","slotOffset","pureFn","thisArg","ɵɵpureFunction1","exp","pureFunction1Internal","ɵɵpureFunction2","pureFunction2Internal","ɵɵpureFunction3","pureFunction3Internal","ɵɵpureFunction4","pureFunction4Internal","ɵɵpureFunction5","exp5","ɵɵpureFunction6","exp6","ɵɵpureFunction7","exp7","ɵɵpureFunction8","exp8","ɵɵpureFunctionV","exps","pureFunctionVInternal","getPureFunctionReturnValue","returnValueIndex","lastReturnValue","bindingRoot","ɵɵpipe","pipeName","getPipeDef","pipeFactory","previousInjectorProfilerContext","pipeInstance","pipe","getMultipleMatchingPipesMessage","getPipeNotFoundErrorMessage","hostIsStandalone","componentInfoMessage","verifyMessage","ɵɵpipeBind1","offset","isPure","ɵɵpipeBind2","ɵɵpipeBind3","ɵɵpipeBind4","ɵɵpipeBindV","ɵɵtemplateRefExtractor","ɵɵgetComponentDepsFactory","ɵsetClassDebugInfo","angularCoreEnv","jitOptions","setJitOptions","defaultEncapsulation","preserveWhitespaces","getJitOptions","resetJitOptions","patchModuleCompilation","moduleQueue","enqueueModuleForDelayedScoping","flushingModuleQueue","flushModuleScopingQueueAsMuchAsPossible","every","isResolvedDeclaration","setScopeOnDeclaredComponents","declaration","compileNgModule","compileNgModuleDefs","allowDuplicateDeclarationsInRoot","expandModuleWithProviders","NgModule","verifySemanticsOfNgModuleDef","compileInjector","generateStandaloneInDeclarationsError","importingModule","verifiedNgModule","errors","unwrapModuleWithProvidersImports","modOrStandaloneCmpt","verifySemanticsOfNgModuleImport","verifyDeclarationsHaveDefinitions","verifyDirectivesHaveSelector","declarationType","verifyNotStandalone","combinedDeclarations","computeCombinedExports","verifyExportsAreDeclaredOrReExported","verifyDeclarationIsUnique","getAnnotation","mod","verifyCorrectBootstrapType","verifyComponentIsPartOfNgModule","lastIndexOf","suppressErrors","existingModule","typeOrWithProviders","collect","__annotations__","readAnnotation","resetCompiledComponents","transitiveScopes","transitiveScopesFor","patchComponentDefWithScope","ngSelectorScope","transitiveScopesForNgModule","declared","declaredWithDefs","exportedType","compilationDepth","compileComponent","ngComponentDef","addDirectiveFactoryDef","directiveMetadata","typeSourceSpan","createParseSourceSpan","animations","interpolation","usesInheritance","addDirectiveDefToUndecoratedParents","getStandaloneDefFunctions","hasSelectorScope","cachedDirectiveDefs","cachedPipeDefs","seen","rawDep","p","d","compileDirective","ngDirectiveDef","getDirectiveMetadata","sourceMapUrl","facade","Directive","extendsDirectlyFromObject","extractQueriesMetadata","isContentQuery","lifecycle","usesOnChanges","extractExportAs","viewQueries","objPrototype","shouldAddAbstractDirective","convertToR3QueryPredicate","splitByComma","convertToR3QueryMetadata","ann","static","isQueryAnn","queriesMeta","isInputAnnotation","piece","LIFECYCLE_HOOKS","hookName","metadataName","compilePipe","ngPipeDef","getPipeMetadata","Pipe","Component","c","Input","alias","Output","HostBinding","hostPropertyName","HostListener","Version","full","major","minor","patch","VERSION","ITS_JUST_ANGULAR","Console","log","Console_Factory","__ngFactoryType__","DIDebugData","resolverToTokenToDependencies","resolverToProviders","standaloneInjectorToComponent","frameworkDIDebugData","getFrameworkDIDebugData","setupFrameworkInjectorProfiler","injectorProfilerEvent","handleInjectorProfilerEvent","handleInjectEvent","handleInstanceCreatedByInjectorEvent","handleProviderConfiguredEvent","diResolver","getDIResolver","diResolverToInstantiatedToken","canBeHeldWeakly","instantiatedTokenToDependencies","injectedIn","getNodeInjectorContext","standaloneComponent","isStandaloneComponent","applyChanges","getDependenciesFromInjectable","unformattedDependencies","getDependenciesForTokenInInjector","resolutionPath","getInjectorResolutionPath","formattedDependency","injectorToCheck","firstInjector","lookupFromFirstInjector","tokenDependencyMap","dependencyNode","instanceNode","getProviderImportsContainer","defTypeRef","getNodeInjectorProviders","getProviderImportPaths","providerImportsContainer","providerToPath","visitedContainers","walkProviderTreeToDiscoverImportPaths","prov","existingImportPath","containerDef","lastContainerAddedToPath","isNextStepInPath","moduleImport","getEnvironmentInjectorProviders","providerRecordsWithoutImportPaths","isPlatformInjector","providerRecords","importPath","getInjectorProviders","getInjectorMetadata","getInjectorResolutionPathHelper","getInjectorParent","getModuleInjectorOfNodeInjector","parentTView","chainedInjector","injectorParent","inj","GLOBAL_PUBLISH_EXPANDO_KEY","globalUtilsFunctions","_published","publishDefaultGlobalUtils$1","methodName","method","publishGlobalUtil","COMPILED","w","TESTABILITY","TESTABILITY_GETTER","Testability","_ngZone","testabilityGetter","_isZoneStable","_callbacks","taskTrackingZone","_testabilityGetter","setTestabilityGetter","addToWindow","_watchAngularEvents","_runCallbacksIfReady","doneCb","pending","getPendingTasks","updateCb","macroTasks","creationLocation","addCallback","whenStable","registerApplication","unregisterApplication","findProviders","using","exactMatch","Testability_Factory","TestabilityRegistry","_applications","testability","unregisterAllApplications","getTestability","elem","getAllTestabilities","getAllRootElements","findTestabilityInTree","findInAncestors","TestabilityRegistry_Factory","isPromise","isSubscribable","APP_INITIALIZER","ApplicationInitStatus","initialized","donePromise","rej","reject","appInits","runInitializers","asyncInitPromises","initResult","observableAsPromise","catch","ApplicationInitStatus_Factory","APP_BOOTSTRAP_LISTENER","publishDefaultGlobalUtils","publishSignalConfiguration","cf","NgProbeToken","MAXIMUM_REFRESH_RERUNS","_callAndReportToErrorHandler","optionsReducer","objs","ApplicationRef","_bootstrapListeners","_runningTick","_destroyListeners","internalErrorHandler","afterRenderManager","zonelessEnabled","dirtyFlags","deferredDirtyFlags","externalTestViews","beforeRender","afterTick","componentTypes","allViews","stable","finally","componentOrFactory","warnIfDestroyed","initStatus","resolver","selectorOrNode","compRef","_loadComponent","tick","_tick","synchronize","runs","synchronizeOnce","useGlobalCheck","detectChangesInViewIfRequired","syncDirtyFlagsWithViews","attachView","viewCount","ApplicationRef_Factory","whenStableStore","applicationRef","cachedWhenStable","whenStablePromise","toPromise","isFirstPass","ModuleWithComponentFactories","ngModuleFactory","componentFactories","Compiler","compileModuleSync","compileModuleAsync","compileModuleAndAllComponentsSync","moduleDef","compileModuleAndAllComponentsAsync","clearCache","clearCacheFor","getModuleId","Compiler_Factory","COMPILER_OPTIONS","CompilerFactory","compileNgModuleFactory","moduleFactory","compilerOptions","_lastDefined","compilerProviders","flatMap","option","compilerInjector","resourceLoader","ResourceLoader","NgZoneChangeDetectionScheduler","initialize","_onMicrotaskEmptySubscription","runningTick","NgZoneChangeDetectionScheduler_Factory","PROVIDED_NG_ZONE","internalProvideZoneChangeDetection","ngZoneFactory","ignoreChangesOutsideZone","getNgZoneOptions","ngZoneChangeDetectionScheduler","ZoneStablePendingTask","provideZoneChangeDetection","zoneProviders","ngZoneOptions","eventCoalescing","runCoalescing","ZoneStablePendingTask_Factory","CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT","consecutiveMicrotaskNotifications","stackFromLastFewNotifications","trackMicrotaskNotificationForDebugging","ChangeDetectionSchedulerImpl","taskService","disableScheduling","zoneIsDefined","schedulerTickApplyArgs","subscriptions","angularZoneId","cancelScheduledCallback","useMicrotaskScheduler","pendingRenderTaskId","shouldScheduleTick","scheduleCallback","ChangeDetectionSchedulerImpl_Factory","provideExperimentalZonelessChangeDetection","getGlobalLocale","LOCALE","$localize","LOCALE_ID","DEFAULT_CURRENCY_CODE","TRANSLATIONS","TRANSLATIONS_FORMAT","MissingTranslationStrategy","SCAN_DELAY","OVERSIZED_IMAGE_TOLERANCE","ImagePerformanceWarning","isBrowser","PerformanceObserver","initPerformanceObserver","win","waitToScan","scanImages","setup","readyState","entryList","getEntries","lcpElement","imgSrc","lcpImageUrl","buffered","images","querySelectorAll","lcpElementFound","lcpElementLoadedCorrectly","image","isOversized","logOversizedImageWarning","loading","logLazyLCPWarning","nonOversizedImageExtentions","imageSource","extension","computedStyle","getComputedStyle","renderedWidth","parseFloat","getPropertyValue","renderedHeight","boxSizing","objectFit","paddingTop","paddingRight","paddingBottom","paddingLeft","intrinsicWidth","naturalWidth","intrinsicHeight","naturalHeight","recommendedWidth","devicePixelRatio","recommendedHeight","oversizedWidth","oversizedHeight","ImagePerformanceWarning_Factory","PLATFORM_DESTROY_LISTENERS","isApplicationBootstrapConfig","moduleRef","r3Injector","exceptionHandler","onErrorSubscription","destroyListener","onPlatformDestroyListeners","platformInjector","allPlatformModules","imagePerformanceService","moduleDoBootstrap","ngDoBootstrap","PlatformRef","_modules","bootstrapModuleFactory","ngZoneEventCoalescing","ngZoneRunCoalescing","allAppProviders","bootstrapModule","module","destroyListeners","PlatformRef_Factory","_platformInjector","ALLOW_MULTIPLE_PLATFORMS","createPlatform","platform","runPlatformInitializers","createPlatformFactory","parentPlatformFactory","desc","extraProviders","getPlatform","platformProviders","createPlatformInjector","assertPlatform","requiredToken","destroyPlatform","createOrReusePlatformInjector","inits","provideExperimentalCheckNoChangesForDebug","interval","useNgZoneOnStable","exhaustive","DebugNgZoneForCheckNoChanges","exhaustiveCheckNoChangesInterval","checkApplicationViews","scheduleCheckNoChanges","isDevMode","enableProdMode","getModuleFactory","noModuleError","getNgModuleById","ChangeDetectorRef","injectChangeDetectorRef","createViewRef","hostComponentView","ViewRef","EmbeddedViewRef","ng_module_factory_loader_impl","DebugEventListener","asNativeElements","debugEls","DebugNode","nativeNode","DebugElement","references","copyDomProperties","collectPropertyBindings","lowercaseTNodeAttrs","baseVal","childNodes","getDebugNode","query","queryAll","_queryAll","queryAllNodes","triggerEventHandler","eventObj","invokedListeners","eventListeners","unwrappedListener","NodePrototype","descriptors","getOwnPropertyDescriptors","isPrimitiveValue","elementsOnly","_queryNodeChildren","_queryNativeNodeDescendants","rootNativeNode","_addQueryMatch","nodeOrContainer","_queryNodeChildrenInContainer","head","nextLView","nextTNode","childView","debugNode","bindingIndexes","metadataParts","_nativeNodeToDebugNode","NG_DEBUG_PROPERTY","getAllDebugNodes","indexDebugNode","removeDebugNodeFromIndex","DefaultIterableDifferFactory","supports","DefaultIterableDiffer","trackByIdentity","_linkedRecords","_unlinkedRecords","_previousItHead","_itHead","_itTail","_additionsHead","_additionsTail","_movesHead","_movesTail","_removalsHead","_removalsTail","_identityChangesHead","_identityChangesTail","_trackByFn","forEachItem","_next","forEachOperation","nextIt","nextRemove","addRemoveOffset","moveOffsets","getPreviousIndex","adjPreviousIndex","_nextRemoved","previousIndex","localMovePreviousIndex","localCurrentIndex","forEachPreviousItem","_nextPrevious","forEachAddedItem","_nextAdded","forEachMovedItem","_nextMoved","forEachRemovedItem","forEachIdentityChange","_nextIdentityChange","diff","check","_reset","mayBeDirty","itemTrackBy","trackById","_mismatch","_verifyReinsertion","_addIdentityChange","_truncate","isDirty","previousRecord","_prev","_remove","_reinsertAfter","_moveAfter","_addAfter","IterableChangeRecord_","reinsertRecord","_addToMoves","nextRecord","_addToRemovals","_unlink","prevRecord","_prevRemoved","_insertAfter","_DuplicateMap","put","toIndex","_prevDup","_nextDup","_DuplicateItemRecordList","_head","_tail","atOrAfterIndex","duplicates","recordList","moveOffset","DefaultKeyValueDifferFactory","DefaultKeyValueDiffer","_records","_mapHead","_appendAfter","_previousMapHead","_changesHead","_changesTail","forEachChangedItem","_nextChanged","_forEach","_maybeAddToChanges","_getOrCreateRecordForKey","_insertBeforeOrAppend","KeyValueChangeRecord_","_addToAdditions","_addToChanges","k","defaultIterableDiffersFactory","IterableDiffers","copied","extend","iterable","getTypeNameForDebugging","defaultKeyValueDiffersFactory","KeyValueDiffers","kv","keyValDiff","iterableDiff","defaultIterableDiffers","defaultKeyValueDiffers","platformCore","ApplicationModule","ApplicationModule_Factory","defaultEquals","activeConsumer","inNotificationPhase","epoch","isInNotificationPhase","isReactive","version","lastCleanEpoch","producerNode","producerLastReadVersion","producerIndexOfThis","nextProducerIndex","liveConsumerNode","liveConsumerIndexOfThis","consumerAllowSignalWrites","producerMustRecompute","producerRecomputeValue","assertConsumerNode","consumerIsLive","staleProducer","producerRemoveLiveConsumerAtIndex","producerAddLiveConsumer","producerIncrementEpoch","producerUpdateValueVersion","producerNotifyConsumers","consumerMarkDirty","producerUpdatesAllowed","producer","seenVersion","indexOfThis","assertProducerNode","isConsumerNode","idxProducer","computation","COMPUTED_NODE","computed","ERRORED","UNSET","COMPUTING","defaultThrowError","throwInvalidWriteToSignalErrorFn","throwInvalidWriteToSignalError","postSignalSetFn","setPostSignalSetFn","signalGetFn","signalValueChanged","updater","runPostSignalSetFn","schedule","allowSignalWrites","WATCH_NODE","registerOnCleanup","isWatchNodeDestroyed","destroyWatchNode","NOOP_CLEANUP_FN","hasRun","setAlternateWeakRefImpl","internalCreateApplication","appProviders","getDeferBlocks","deferBlocks","isLast","invokeRegisteredListeners","handlerFns","currentTarget","__jsaction_fns","handler","setJSActionAttributes","eventTypes","curr","existingAttr","JSACTION","sharedStashFunction","rEl","eventType","eventListenerMap","removeListeners","JSACTION_EVENT_CONTRACT","jsactionSet","shouldEnableEventReplay","withEventReplay","isEnabled","_ejsas","eventContractDetails","initEventReplay","eventDelegation","earlyJsactionData","eventContract","et","addEvent","etc","eventInfos","replayEarlyEventInfos","dispatcher","collectDomEventsInfo","eventTypesToReplay","domEventsInfo","regular","isDomEvent","SerializedViewCollection","indexByContent","viewAsString","getAll","tViewSsrId","getSsrId","calcNumRootNodes","calcNumRootNodesInLContainer","annotateComponentLViewForHydration","annotateHostElementForHydration","annotateLContainerForHydration","componentLViewNghIndex","rootLViewNghIndex","finalIndex","annotateForHydration","isI18nHydrationEnabledVal","serializedViewCollection","shouldReplayEvents","insertCorruptedTextNodeMarkers","serializeLContainer","lastViewAsString","childLView","numRootNodes","childTView","serializeLView","currentViewAsString","previousView","appendSerializedNodePath","ngh","appendDisconnectedNodeIndex","tNodeOrNoOffsetIndex","nativeElementsToEventTypes","i18nData","nodeNoOffsetIndex","isContentProjectedNode","projectionHeadTNode","conditionallyAnnotateNodePath","hostNode","componentUsesShadowDomEncapsulation","textNode","isHydrationSupportEnabled","isI18nHydrationRuntimeSupportEnabled","APPLICATION_IS_STABLE_TIMEOUT","enableHydrationRuntimeSupport","enableI18nHydrationRuntimeSupport","printHydrationStats","whenStableWithTimeout","timeoutTime","logWarningOnStableTimedout","withDomHydration","verifySsrContentsIntegrity","withI18nSupport","time","hydrationMarker","booleanAttribute","numberAttribute","fallbackValue","NaN","isNumberValue","isNaN","ɵɵngDeclareDirective","compileDirectiveDeclaration","ɵɵngDeclareClassMetadata","ɵɵngDeclareClassMetadataAsync","resolveDeferredDeps","resolveMetadata","ɵɵngDeclareComponent","compileComponentDeclaration","ɵɵngDeclareFactory","getFactoryKind","compileFactoryDeclaration","ɵɵngDeclareInjectable","compileInjectableDeclaration","ɵɵngDeclareInjector","compileInjectorDeclaration","ɵɵngDeclareNgModule","compileNgModuleDeclaration","ɵɵngDeclarePipe","compilePipeDeclaration","untracked","nonReactiveReadsFn","APP_EFFECT_SCHEDULER","EffectScheduler","ZoneAwareEffectScheduler","queuedEffectCount","queues","scheduleEffect","handle","enqueue","creationZone","flushQueue","EffectHandle","effectFn","watcher","onCleanup","runEffect","effect","cdr","elementInjector","reflectComponentType","mergeApplicationConfig","configs","ɵALLOW_MULTIPLE_PLATFORMS","ɵAfterRenderManager","ɵCONTAINER_HEADER_OFFSET","ɵChangeDetectionScheduler","ɵChangeDetectionSchedulerImpl","ɵComponentFactory","ɵConsole","ɵDEFAULT_LOCALE_ID","ɵDEFER_BLOCK_CONFIG","ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR","ɵDeferBlockBehavior","ɵDeferBlockState","ɵEffectScheduler","ɵIMAGE_CONFIG","ɵIMAGE_CONFIG_DEFAULTS","ɵINJECTOR_SCOPE","ɵINTERNAL_APPLICATION_ERROR_HANDLER","ɵIS_HYDRATION_DOM_REUSE_ENABLED","ɵJSACTION_EVENT_CONTRACT","ɵLContext","ɵLifecycleHooksFeature","ɵLocaleDataIndex","ɵNG_COMP_DEF","ɵNG_DIR_DEF","ɵNG_ELEMENT_ID","ɵNG_INJ_DEF","ɵNG_MOD_DEF","ɵNG_PIPE_DEF","ɵNG_PROV_DEF","ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR","ɵNO_CHANGE","ɵNgModuleFactory","ɵNoopNgZone","ɵPROVIDED_NG_ZONE","ɵPendingTasks","ɵReflectionCapabilities","ɵRender3ComponentFactory","ɵRender3ComponentRef","ɵRender3NgModuleRef","ɵRuntimeError","ɵSSR_CONTENT_INTEGRITY_MARKER","ɵTESTABILITY","ɵTESTABILITY_GETTER","ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT","ɵViewRef","ɵXSS_SECURITY_URL","ɵZONELESS_ENABLED","ɵ_sanitizeHtml","ɵ_sanitizeUrl","ɵallowSanitizationBypassAndThrow","ɵannotateForHydration","ɵbypassSanitizationTrustHtml","ɵbypassSanitizationTrustResourceUrl","ɵbypassSanitizationTrustScript","ɵbypassSanitizationTrustStyle","ɵbypassSanitizationTrustUrl","ɵclearResolutionOfComponentResourcesQueue","ɵcompileComponent","ɵcompileDirective","ɵcompileNgModule","ɵcompileNgModuleDefs","ɵcompileNgModuleFactory","ɵcompilePipe","ɵconvertToBitFlags","ɵcreateInjector","ɵdefaultIterableDiffers","ɵdefaultKeyValueDiffers","ɵdepsTracker","ɵdetectChangesInViewIfRequired","ɵdevModeEqual","ɵfindLocaleData","ɵflushModuleScopingQueueAsMuchAsPossible","ɵformatRuntimeError","ɵgenerateStandaloneInDeclarationsError","ɵgetAsyncClassMetadataFn","ɵgetDebugNode","ɵgetDeferBlocks","ɵgetDirectives","ɵgetHostElement","ɵgetInjectableDef","ɵgetLContext","ɵgetLocaleCurrencyCode","ɵgetLocalePluralCase","ɵgetOutputDestroyRef","ɵgetSanitizationBypassType","ɵglobal","ɵinjectChangeDetectorRef","ɵinternalCreateApplication","ɵinternalProvideZoneChangeDetection","ɵisBoundToModule","ɵisComponentDefPendingResolution","ɵisEnvironmentProviders","ɵisInjectable","ɵisNgModule","ɵisPromise","ɵisSubscribable","ɵnoSideEffects","ɵpatchComponentDefWithScope","ɵperformanceMarkFeature","ɵreadHydrationInfo","ɵregisterLocaleData","ɵrenderDeferBlockState","ɵresetCompiledComponents","ɵresetJitOptions","ɵresolveComponentResources","ɵrestoreComponentResolutionQueue","ɵsetAllowDuplicateNgModuleIdsForTest","ɵsetAlternateWeakRefImpl","ɵsetClassMetadata","ɵsetClassMetadataAsync","ɵsetCurrentInjector","ɵsetDocument","ɵsetInjectorProfilerContext","ɵsetLocaleId","ɵstore","ɵstringify","ɵtransitiveScopesFor","ɵtriggerResourceLoading","ɵtruncateMiddle","ɵunregisterLocaleData","ɵunwrapSafeValue","ɵwhenStable","ɵwithDomHydration","ɵwithEventReplay","ɵwithI18nSupport","ɵɵFactoryTarget","ɵɵregisterNgModuleType"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/@angular/core/fesm2022/core.mjs"],"sourcesContent":["/**\n * @license Angular v18.2.10\n * (c) 2010-2024 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport { SIGNAL_NODE as SIGNAL_NODE$1, signalSetFn as signalSetFn$1, producerAccessed as producerAccessed$1, SIGNAL as SIGNAL$1, getActiveConsumer as getActiveConsumer$1, setActiveConsumer as setActiveConsumer$1, consumerDestroy as consumerDestroy$1, REACTIVE_NODE as REACTIVE_NODE$1, consumerBeforeComputation as consumerBeforeComputation$1, consumerAfterComputation as consumerAfterComputation$1, consumerPollProducersForChange as consumerPollProducersForChange$1, createSignal as createSignal$1, signalUpdateFn as signalUpdateFn$1, createComputed as createComputed$1, setThrowInvalidWriteToSignalError as setThrowInvalidWriteToSignalError$1, createWatch as createWatch$1 } from '@angular/core/primitives/signals';\nexport { SIGNAL as ɵSIGNAL } from '@angular/core/primitives/signals';\nimport { BehaviorSubject, Subject, Subscription } from 'rxjs';\nimport { map, first } from 'rxjs/operators';\nimport { Attribute as Attribute$1, EventContract, EventContractContainer, getAppScopedQueuedEventInfos, clearAppScopedEarlyEventContract, EventDispatcher, registerDispatcher, isEarlyEventType, isCaptureEventType } from '@angular/core/primitives/event-dispatch';\n\n/**\n * Base URL for the error details page.\n *\n * Keep this constant in sync across:\n * - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts\n * - packages/core/src/error_details_base_url.ts\n */\nconst ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.dev/errors';\n/**\n * URL for the XSS security documentation.\n */\nconst XSS_SECURITY_URL = 'https://g.co/ng/security#xss';\n\n/**\n * Class that represents a runtime error.\n * Formats and outputs the error message in a consistent way.\n *\n * Example:\n * ```\n * throw new RuntimeError(\n * RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED,\n * ngDevMode && 'Injector has already been destroyed.');\n * ```\n *\n * Note: the `message` argument contains a descriptive error message as a string in development\n * mode (when the `ngDevMode` is defined). In production mode (after tree-shaking pass), the\n * `message` argument becomes `false`, thus we account for it in the typings and the runtime\n * logic.\n */\nclass RuntimeError extends Error {\n constructor(code, message) {\n super(formatRuntimeError(code, message));\n this.code = code;\n }\n}\n/**\n * Called to format a runtime error.\n * See additional info on the `message` argument type in the `RuntimeError` class description.\n */\nfunction formatRuntimeError(code, message) {\n // Error code might be a negative number, which is a special marker that instructs the logic to\n // generate a link to the error details page on angular.io.\n // We also prepend `0` to non-compile-time errors.\n const fullCode = `NG0${Math.abs(code)}`;\n let errorMessage = `${fullCode}${message ? ': ' + message : ''}`;\n if (ngDevMode && code < 0) {\n const addPeriodSeparator = !errorMessage.match(/[.,;!?\\n]$/);\n const separator = addPeriodSeparator ? '.' : '';\n errorMessage = `${errorMessage}${separator} Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`;\n }\n return errorMessage;\n}\n\nconst REQUIRED_UNSET_VALUE = /* @__PURE__ */ Symbol('InputSignalNode#UNSET');\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst INPUT_SIGNAL_NODE = /* @__PURE__ */ (() => {\n return {\n ...SIGNAL_NODE$1,\n transformFn: undefined,\n applyValueToInputSignal(node, value) {\n signalSetFn$1(node, value);\n },\n };\n})();\n\nconst ɵINPUT_SIGNAL_BRAND_READ_TYPE = /* @__PURE__ */ Symbol();\nconst ɵINPUT_SIGNAL_BRAND_WRITE_TYPE = /* @__PURE__ */ Symbol();\n/**\n * Creates an input signal.\n *\n * @param initialValue The initial value.\n * Can be set to {@link REQUIRED_UNSET_VALUE} for required inputs.\n * @param options Additional options for the input. e.g. a transform, or an alias.\n */\nfunction createInputSignal(initialValue, options) {\n const node = Object.create(INPUT_SIGNAL_NODE);\n node.value = initialValue;\n // Perf note: Always set `transformFn` here to ensure that `node` always\n // has the same v8 class shape, allowing monomorphic reads on input signals.\n node.transformFn = options?.transform;\n function inputValueFn() {\n // Record that someone looked at this signal.\n producerAccessed$1(node);\n if (node.value === REQUIRED_UNSET_VALUE) {\n throw new RuntimeError(-950 /* RuntimeErrorCode.REQUIRED_INPUT_NO_VALUE */, ngDevMode && 'Input is required but no value is available yet.');\n }\n return node.value;\n }\n inputValueFn[SIGNAL$1] = node;\n if (ngDevMode) {\n inputValueFn.toString = () => `[Input Signal: ${inputValueFn()}]`;\n }\n return inputValueFn;\n}\n\n/**\n * Convince closure compiler that the wrapped function has no side-effects.\n *\n * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to\n * allow us to execute a function but have closure compiler mark the call as no-side-effects.\n * It is important that the return value for the `noSideEffects` function be assigned\n * to something which is retained otherwise the call to `noSideEffects` will be removed by closure\n * compiler.\n */\nfunction noSideEffects(fn) {\n return { toString: fn }.toString();\n}\n\nconst ANNOTATIONS = '__annotations__';\nconst PARAMETERS = '__parameters__';\nconst PROP_METADATA = '__prop__metadata__';\n/**\n * @suppress {globalThis}\n */\nfunction makeDecorator(name, props, parentClass, additionalProcessing, typeFn) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function DecoratorFactory(...args) {\n if (this instanceof DecoratorFactory) {\n metaCtor.call(this, ...args);\n return this;\n }\n const annotationInstance = new DecoratorFactory(...args);\n return function TypeDecorator(cls) {\n if (typeFn)\n typeFn(cls, ...args);\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const annotations = cls.hasOwnProperty(ANNOTATIONS)\n ? cls[ANNOTATIONS]\n : Object.defineProperty(cls, ANNOTATIONS, { value: [] })[ANNOTATIONS];\n annotations.push(annotationInstance);\n if (additionalProcessing)\n additionalProcessing(cls);\n return cls;\n };\n }\n if (parentClass) {\n DecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n DecoratorFactory.prototype.ngMetadataName = name;\n DecoratorFactory.annotationCls = DecoratorFactory;\n return DecoratorFactory;\n });\n}\nfunction makeMetadataCtor(props) {\n return function ctor(...args) {\n if (props) {\n const values = props(...args);\n for (const propName in values) {\n this[propName] = values[propName];\n }\n }\n };\n}\nfunction makeParamDecorator(name, props, parentClass) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function ParamDecoratorFactory(...args) {\n if (this instanceof ParamDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const annotationInstance = new ParamDecoratorFactory(...args);\n ParamDecorator.annotation = annotationInstance;\n return ParamDecorator;\n function ParamDecorator(cls, unusedKey, index) {\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const parameters = cls.hasOwnProperty(PARAMETERS)\n ? cls[PARAMETERS]\n : Object.defineProperty(cls, PARAMETERS, { value: [] })[PARAMETERS];\n // there might be gaps if some in between parameters do not have annotations.\n // we pad with nulls.\n while (parameters.length <= index) {\n parameters.push(null);\n }\n (parameters[index] = parameters[index] || []).push(annotationInstance);\n return cls;\n }\n }\n if (parentClass) {\n ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n ParamDecoratorFactory.prototype.ngMetadataName = name;\n ParamDecoratorFactory.annotationCls = ParamDecoratorFactory;\n return ParamDecoratorFactory;\n });\n}\nfunction makePropDecorator(name, props, parentClass, additionalProcessing) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function PropDecoratorFactory(...args) {\n if (this instanceof PropDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const decoratorInstance = new PropDecoratorFactory(...args);\n function PropDecorator(target, name) {\n // target is undefined with standard decorators. This case is not supported and will throw\n // if this decorator is used in JIT mode with standard decorators.\n if (target === undefined) {\n throw new Error('Standard Angular field decorators are not supported in JIT mode.');\n }\n const constructor = target.constructor;\n // Use of Object.defineProperty is important because it creates a non-enumerable property\n // which prevents the property from being copied during subclassing.\n const meta = constructor.hasOwnProperty(PROP_METADATA)\n ? constructor[PROP_METADATA]\n : Object.defineProperty(constructor, PROP_METADATA, { value: {} })[PROP_METADATA];\n meta[name] = (meta.hasOwnProperty(name) && meta[name]) || [];\n meta[name].unshift(decoratorInstance);\n if (additionalProcessing)\n additionalProcessing(target, name, ...args);\n }\n return PropDecorator;\n }\n if (parentClass) {\n PropDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n PropDecoratorFactory.prototype.ngMetadataName = name;\n PropDecoratorFactory.annotationCls = PropDecoratorFactory;\n return PropDecoratorFactory;\n });\n}\n\nconst _global = globalThis;\n\nfunction ngDevModeResetPerfCounters() {\n const locationString = typeof location !== 'undefined' ? location.toString() : '';\n const newCounters = {\n namedConstructors: locationString.indexOf('ngDevMode=namedConstructors') != -1,\n firstCreatePass: 0,\n tNode: 0,\n tView: 0,\n rendererCreateTextNode: 0,\n rendererSetText: 0,\n rendererCreateElement: 0,\n rendererAddEventListener: 0,\n rendererSetAttribute: 0,\n rendererRemoveAttribute: 0,\n rendererSetProperty: 0,\n rendererSetClassName: 0,\n rendererAddClass: 0,\n rendererRemoveClass: 0,\n rendererSetStyle: 0,\n rendererRemoveStyle: 0,\n rendererDestroy: 0,\n rendererDestroyNode: 0,\n rendererMoveNode: 0,\n rendererRemoveNode: 0,\n rendererAppendChild: 0,\n rendererInsertBefore: 0,\n rendererCreateComment: 0,\n hydratedNodes: 0,\n hydratedComponents: 0,\n dehydratedViewsRemoved: 0,\n dehydratedViewsCleanupRuns: 0,\n componentsSkippedHydration: 0,\n };\n // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.\n const allowNgDevModeTrue = locationString.indexOf('ngDevMode=false') === -1;\n if (!allowNgDevModeTrue) {\n _global['ngDevMode'] = false;\n }\n else {\n if (typeof _global['ngDevMode'] !== 'object') {\n _global['ngDevMode'] = {};\n }\n Object.assign(_global['ngDevMode'], newCounters);\n }\n return newCounters;\n}\n/**\n * This function checks to see if the `ngDevMode` has been set. If yes,\n * then we honor it, otherwise we default to dev mode with additional checks.\n *\n * The idea is that unless we are doing production build where we explicitly\n * set `ngDevMode == false` we should be helping the developer by providing\n * as much early warning and errors as possible.\n *\n * `ɵɵdefineComponent` is guaranteed to have been called before any component template functions\n * (and thus Ivy instructions), so a single initialization there is sufficient to ensure ngDevMode\n * is defined for the entire instruction set.\n *\n * When checking `ngDevMode` on toplevel, always init it before referencing it\n * (e.g. `((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode())`), otherwise you can\n * get a `ReferenceError` like in https://github.com/angular/angular/issues/31595.\n *\n * Details on possible values for `ngDevMode` can be found on its docstring.\n *\n * NOTE:\n * - changes to the `ngDevMode` name must be synced with `compiler-cli/src/tooling.ts`.\n */\nfunction initNgDevMode() {\n // The below checks are to ensure that calling `initNgDevMode` multiple times does not\n // reset the counters.\n // If the `ngDevMode` is not an object, then it means we have not created the perf counters\n // yet.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (typeof ngDevMode !== 'object' || Object.keys(ngDevMode).length === 0) {\n ngDevModeResetPerfCounters();\n }\n return typeof ngDevMode !== 'undefined' && !!ngDevMode;\n }\n return false;\n}\n\nfunction getClosureSafeProperty(objWithPropertyToExtract) {\n for (let key in objWithPropertyToExtract) {\n if (objWithPropertyToExtract[key] === getClosureSafeProperty) {\n return key;\n }\n }\n throw Error('Could not find renamed property on target object.');\n}\n/**\n * Sets properties on a target object from a source object, but only if\n * the property doesn't already exist on the target object.\n * @param target The target to set properties on\n * @param source The source of the property keys and values to set\n */\nfunction fillProperties(target, source) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}\n\nfunction stringify(token) {\n if (typeof token === 'string') {\n return token;\n }\n if (Array.isArray(token)) {\n return '[' + token.map(stringify).join(', ') + ']';\n }\n if (token == null) {\n return '' + token;\n }\n if (token.overriddenName) {\n return `${token.overriddenName}`;\n }\n if (token.name) {\n return `${token.name}`;\n }\n const res = token.toString();\n if (res == null) {\n return '' + res;\n }\n const newLineIndex = res.indexOf('\\n');\n return newLineIndex === -1 ? res : res.substring(0, newLineIndex);\n}\n/**\n * Concatenates two strings with separator, allocating new strings only when necessary.\n *\n * @param before before string.\n * @param separator separator string.\n * @param after after string.\n * @returns concatenated string.\n */\nfunction concatStringsWithSpace(before, after) {\n return before == null || before === ''\n ? after === null\n ? ''\n : after\n : after == null || after === ''\n ? before\n : before + ' ' + after;\n}\n/**\n * Ellipses the string in the middle when longer than the max length\n *\n * @param string\n * @param maxLength of the output string\n * @returns ellipsed string with ... in the middle\n */\nfunction truncateMiddle(str, maxLength = 100) {\n if (!str || maxLength < 1 || str.length <= maxLength)\n return str;\n if (maxLength == 1)\n return str.substring(0, 1) + '...';\n const halfLimit = Math.round(maxLength / 2);\n return str.substring(0, halfLimit) + '...' + str.substring(str.length - halfLimit);\n}\n\nconst __forward_ref__ = getClosureSafeProperty({ __forward_ref__: getClosureSafeProperty });\n/**\n * Allows to refer to references which are not yet defined.\n *\n * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of\n * DI is declared, but not yet defined. It is also used when the `token` which we use when creating\n * a query is not yet defined.\n *\n * `forwardRef` is also used to break circularities in standalone components imports.\n *\n * @usageNotes\n * ### Circular dependency example\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}\n *\n * ### Circular standalone reference import example\n * ```ts\n * @Component({\n * standalone: true,\n * imports: [ChildComponent],\n * selector: 'app-parent',\n * template: `<app-child [hideParent]=\"hideParent\"></app-child>`,\n * })\n * export class ParentComponent {\n * @Input() hideParent: boolean;\n * }\n *\n *\n * @Component({\n * standalone: true,\n * imports: [CommonModule, forwardRef(() => ParentComponent)],\n * selector: 'app-child',\n * template: `<app-parent *ngIf=\"!hideParent\"></app-parent>`,\n * })\n * export class ChildComponent {\n * @Input() hideParent: boolean;\n * }\n * ```\n *\n * @publicApi\n */\nfunction forwardRef(forwardRefFn) {\n forwardRefFn.__forward_ref__ = forwardRef;\n forwardRefFn.toString = function () {\n return stringify(this());\n };\n return forwardRefFn;\n}\n/**\n * Lazily retrieves the reference value from a forwardRef.\n *\n * Acts as the identity function when given a non-forward-ref value.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}\n *\n * @see {@link forwardRef}\n * @publicApi\n */\nfunction resolveForwardRef(type) {\n return isForwardRef(type) ? type() : type;\n}\n/** Checks whether a function is wrapped by a `forwardRef`. */\nfunction isForwardRef(fn) {\n return (typeof fn === 'function' &&\n fn.hasOwnProperty(__forward_ref__) &&\n fn.__forward_ref__ === forwardRef);\n}\n\n// The functions in this file verify that the assumptions we are making\nfunction assertNumber(actual, msg) {\n if (!(typeof actual === 'number')) {\n throwError(msg, typeof actual, 'number', '===');\n }\n}\nfunction assertNumberInRange(actual, minInclusive, maxInclusive) {\n assertNumber(actual, 'Expected a number');\n assertLessThanOrEqual(actual, maxInclusive, 'Expected number to be less than or equal to');\n assertGreaterThanOrEqual(actual, minInclusive, 'Expected number to be greater than or equal to');\n}\nfunction assertString(actual, msg) {\n if (!(typeof actual === 'string')) {\n throwError(msg, actual === null ? 'null' : typeof actual, 'string', '===');\n }\n}\nfunction assertFunction(actual, msg) {\n if (!(typeof actual === 'function')) {\n throwError(msg, actual === null ? 'null' : typeof actual, 'function', '===');\n }\n}\nfunction assertEqual(actual, expected, msg) {\n if (!(actual == expected)) {\n throwError(msg, actual, expected, '==');\n }\n}\nfunction assertNotEqual(actual, expected, msg) {\n if (!(actual != expected)) {\n throwError(msg, actual, expected, '!=');\n }\n}\nfunction assertSame(actual, expected, msg) {\n if (!(actual === expected)) {\n throwError(msg, actual, expected, '===');\n }\n}\nfunction assertNotSame(actual, expected, msg) {\n if (!(actual !== expected)) {\n throwError(msg, actual, expected, '!==');\n }\n}\nfunction assertLessThan(actual, expected, msg) {\n if (!(actual < expected)) {\n throwError(msg, actual, expected, '<');\n }\n}\nfunction assertLessThanOrEqual(actual, expected, msg) {\n if (!(actual <= expected)) {\n throwError(msg, actual, expected, '<=');\n }\n}\nfunction assertGreaterThan(actual, expected, msg) {\n if (!(actual > expected)) {\n throwError(msg, actual, expected, '>');\n }\n}\nfunction assertGreaterThanOrEqual(actual, expected, msg) {\n if (!(actual >= expected)) {\n throwError(msg, actual, expected, '>=');\n }\n}\nfunction assertNotDefined(actual, msg) {\n if (actual != null) {\n throwError(msg, actual, null, '==');\n }\n}\nfunction assertDefined(actual, msg) {\n if (actual == null) {\n throwError(msg, actual, null, '!=');\n }\n}\nfunction throwError(msg, actual, expected, comparison) {\n throw new Error(`ASSERTION ERROR: ${msg}` +\n (comparison == null ? '' : ` [Expected=> ${expected} ${comparison} ${actual} <=Actual]`));\n}\nfunction assertDomNode(node) {\n if (!(node instanceof Node)) {\n throwError(`The provided value must be an instance of a DOM Node but got ${stringify(node)}`);\n }\n}\nfunction assertElement(node) {\n if (!(node instanceof Element)) {\n throwError(`The provided value must be an element but got ${stringify(node)}`);\n }\n}\nfunction assertIndexInRange(arr, index) {\n assertDefined(arr, 'Array must be defined.');\n const maxLen = arr.length;\n if (index < 0 || index >= maxLen) {\n throwError(`Index expected to be less than ${maxLen} but got ${index}`);\n }\n}\nfunction assertOneOf(value, ...validValues) {\n if (validValues.indexOf(value) !== -1)\n return true;\n throwError(`Expected value to be one of ${JSON.stringify(validValues)} but was ${JSON.stringify(value)}.`);\n}\nfunction assertNotReactive(fn) {\n if (getActiveConsumer$1() !== null) {\n throwError(`${fn}() should never be called in a reactive context.`);\n }\n}\n\n/**\n * Construct an injectable definition which defines how a token will be constructed by the DI\n * system, and in which injectors (if any) it will be available.\n *\n * This should be assigned to a static `ɵprov` field on a type, which will then be an\n * `InjectableType`.\n *\n * Options:\n * * `providedIn` determines which injectors will include the injectable, by either associating it\n * with an `@NgModule` or other `InjectorType`, or by specifying that this injectable should be\n * provided in the `'root'` injector, which will be the application-level injector in most apps.\n * * `factory` gives the zero argument function which will create an instance of the injectable.\n * The factory can call [`inject`](api/core/inject) to access the `Injector` and request injection\n * of dependencies.\n *\n * @codeGenApi\n * @publicApi This instruction has been emitted by ViewEngine for some time and is deployed to npm.\n */\nfunction ɵɵdefineInjectable(opts) {\n return {\n token: opts.token,\n providedIn: opts.providedIn || null,\n factory: opts.factory,\n value: undefined,\n };\n}\n/**\n * @deprecated in v8, delete after v10. This API should be used only by generated code, and that\n * code should now use ɵɵdefineInjectable instead.\n * @publicApi\n */\nconst defineInjectable = ɵɵdefineInjectable;\n/**\n * Construct an `InjectorDef` which configures an injector.\n *\n * This should be assigned to a static injector def (`ɵinj`) field on a type, which will then be an\n * `InjectorType`.\n *\n * Options:\n *\n * * `providers`: an optional array of providers to add to the injector. Each provider must\n * either have a factory or point to a type which has a `ɵprov` static property (the\n * type must be an `InjectableType`).\n * * `imports`: an optional array of imports of other `InjectorType`s or `InjectorTypeWithModule`s\n * whose providers will also be added to the injector. Locally provided types will override\n * providers from imports.\n *\n * @codeGenApi\n */\nfunction ɵɵdefineInjector(options) {\n return { providers: options.providers || [], imports: options.imports || [] };\n}\n/**\n * Read the injectable def (`ɵprov`) for `type` in a way which is immune to accidentally reading\n * inherited value.\n *\n * @param type A type which may have its own (non-inherited) `ɵprov`.\n */\nfunction getInjectableDef(type) {\n return getOwnDefinition(type, NG_PROV_DEF) || getOwnDefinition(type, NG_INJECTABLE_DEF);\n}\nfunction isInjectable(type) {\n return getInjectableDef(type) !== null;\n}\n/**\n * Return definition only if it is defined directly on `type` and is not inherited from a base\n * class of `type`.\n */\nfunction getOwnDefinition(type, field) {\n return type.hasOwnProperty(field) ? type[field] : null;\n}\n/**\n * Read the injectable def (`ɵprov`) for `type` or read the `ɵprov` from one of its ancestors.\n *\n * @param type A type which may have `ɵprov`, via inheritance.\n *\n * @deprecated Will be removed in a future version of Angular, where an error will occur in the\n * scenario if we find the `ɵprov` on an ancestor only.\n */\nfunction getInheritedInjectableDef(type) {\n const def = type && (type[NG_PROV_DEF] || type[NG_INJECTABLE_DEF]);\n if (def) {\n ngDevMode &&\n console.warn(`DEPRECATED: DI is instantiating a token \"${type.name}\" that inherits its @Injectable decorator but does not provide one itself.\\n` +\n `This will become an error in a future version of Angular. Please add @Injectable() to the \"${type.name}\" class.`);\n return def;\n }\n else {\n return null;\n }\n}\n/**\n * Read the injector def type in a way which is immune to accidentally reading inherited value.\n *\n * @param type type which may have an injector def (`ɵinj`)\n */\nfunction getInjectorDef(type) {\n return type && (type.hasOwnProperty(NG_INJ_DEF) || type.hasOwnProperty(NG_INJECTOR_DEF))\n ? type[NG_INJ_DEF]\n : null;\n}\nconst NG_PROV_DEF = getClosureSafeProperty({ ɵprov: getClosureSafeProperty });\nconst NG_INJ_DEF = getClosureSafeProperty({ ɵinj: getClosureSafeProperty });\n// We need to keep these around so we can read off old defs if new defs are unavailable\nconst NG_INJECTABLE_DEF = getClosureSafeProperty({ ngInjectableDef: getClosureSafeProperty });\nconst NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafeProperty });\n\n/**\n * Creates a token that can be used in a DI Provider.\n *\n * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a\n * runtime representation) such as when injecting an interface, callable type, array or\n * parameterized type.\n *\n * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by\n * the `Injector`. This provides an additional level of type safety.\n *\n * <div class=\"alert is-helpful\">\n *\n * **Important Note**: Ensure that you use the same instance of the `InjectionToken` in both the\n * provider and the injection call. Creating a new instance of `InjectionToken` in different places,\n * even with the same description, will be treated as different tokens by Angular's DI system,\n * leading to a `NullInjectorError`.\n *\n * </div>\n *\n * <code-example format=\"typescript\" language=\"typescript\" path=\"injection-token/src/main.ts\"\n * region=\"InjectionToken\"></code-example>\n *\n * When creating an `InjectionToken`, you can optionally specify a factory function which returns\n * (possibly by creating) a default value of the parameterized type `T`. This sets up the\n * `InjectionToken` using this factory as a provider as if it was defined explicitly in the\n * application's root injector. If the factory function, which takes zero arguments, needs to inject\n * dependencies, it can do so using the [`inject`](api/core/inject) function.\n * As you can see in the Tree-shakable InjectionToken example below.\n *\n * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which\n * overrides the above behavior and marks the token as belonging to a particular `@NgModule` (note:\n * this option is now deprecated). As mentioned above, `'root'` is the default value for\n * `providedIn`.\n *\n * The `providedIn: NgModule` and `providedIn: 'any'` options are deprecated.\n *\n * @usageNotes\n * ### Basic Examples\n *\n * ### Plain InjectionToken\n *\n * {@example core/di/ts/injector_spec.ts region='InjectionToken'}\n *\n * ### Tree-shakable InjectionToken\n *\n * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}\n *\n * @publicApi\n */\nclass InjectionToken {\n /**\n * @param _desc Description for the token,\n * used only for debugging purposes,\n * it should but does not need to be unique\n * @param options Options for the token's usage, as described above\n */\n constructor(_desc, options) {\n this._desc = _desc;\n /** @internal */\n this.ngMetadataName = 'InjectionToken';\n this.ɵprov = undefined;\n if (typeof options == 'number') {\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n assertLessThan(options, 0, 'Only negative numbers are supported here');\n // This is a special hack to assign __NG_ELEMENT_ID__ to this instance.\n // See `InjectorMarkers`\n this.__NG_ELEMENT_ID__ = options;\n }\n else if (options !== undefined) {\n this.ɵprov = ɵɵdefineInjectable({\n token: this,\n providedIn: options.providedIn || 'root',\n factory: options.factory,\n });\n }\n }\n /**\n * @internal\n */\n get multi() {\n return this;\n }\n toString() {\n return `InjectionToken ${this._desc}`;\n }\n}\n\nlet _injectorProfilerContext;\nfunction getInjectorProfilerContext() {\n !ngDevMode && throwError('getInjectorProfilerContext should never be called in production mode');\n return _injectorProfilerContext;\n}\nfunction setInjectorProfilerContext(context) {\n !ngDevMode && throwError('setInjectorProfilerContext should never be called in production mode');\n const previous = _injectorProfilerContext;\n _injectorProfilerContext = context;\n return previous;\n}\nlet injectorProfilerCallback = null;\n/**\n * Sets the callback function which will be invoked during certain DI events within the\n * runtime (for example: injecting services, creating injectable instances, configuring providers)\n *\n * Warning: this function is *INTERNAL* and should not be relied upon in application's code.\n * The contract of the function might be changed in any release and/or the function can be removed\n * completely.\n *\n * @param profiler function provided by the caller or null value to disable profiling.\n */\nconst setInjectorProfiler = (injectorProfiler) => {\n !ngDevMode && throwError('setInjectorProfiler should never be called in production mode');\n injectorProfilerCallback = injectorProfiler;\n};\n/**\n * Injector profiler function which emits on DI events executed by the runtime.\n *\n * @param event InjectorProfilerEvent corresponding to the DI event being emitted\n */\nfunction injectorProfiler(event) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n if (injectorProfilerCallback != null /* both `null` and `undefined` */) {\n injectorProfilerCallback(event);\n }\n}\n/**\n * Emits an InjectorProfilerEventType.ProviderConfigured to the injector profiler. The data in the\n * emitted event includes the raw provider, as well as the token that provider is providing.\n *\n * @param eventProvider A provider object\n */\nfunction emitProviderConfiguredEvent(eventProvider, isViewProvider = false) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n let token;\n // if the provider is a TypeProvider (typeof provider is function) then the token is the\n // provider itself\n if (typeof eventProvider === 'function') {\n token = eventProvider;\n }\n // if the provider is an injection token, then the token is the injection token.\n else if (eventProvider instanceof InjectionToken) {\n token = eventProvider;\n }\n // in all other cases we can access the token via the `provide` property of the provider\n else {\n token = resolveForwardRef(eventProvider.provide);\n }\n let provider = eventProvider;\n // Injection tokens may define their own default provider which gets attached to the token itself\n // as `ɵprov`. In this case, we want to emit the provider that is attached to the token, not the\n // token itself.\n if (eventProvider instanceof InjectionToken) {\n provider = eventProvider.ɵprov || eventProvider;\n }\n injectorProfiler({\n type: 2 /* InjectorProfilerEventType.ProviderConfigured */,\n context: getInjectorProfilerContext(),\n providerRecord: { token, provider, isViewProvider },\n });\n}\n/**\n * Emits an event to the injector profiler with the instance that was created. Note that\n * the injector associated with this emission can be accessed by using getDebugInjectContext()\n *\n * @param instance an object created by an injector\n */\nfunction emitInstanceCreatedByInjectorEvent(instance) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n injectorProfiler({\n type: 1 /* InjectorProfilerEventType.InstanceCreatedByInjector */,\n context: getInjectorProfilerContext(),\n instance: { value: instance },\n });\n}\n/**\n * @param token DI token associated with injected service\n * @param value the instance of the injected service (i.e the result of `inject(token)`)\n * @param flags the flags that the token was injected with\n */\nfunction emitInjectEvent(token, value, flags) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n injectorProfiler({\n type: 0 /* InjectorProfilerEventType.Inject */,\n context: getInjectorProfilerContext(),\n service: { token, value, flags },\n });\n}\nfunction runInInjectorProfilerContext(injector, token, callback) {\n !ngDevMode &&\n throwError('runInInjectorProfilerContext should never be called in production mode');\n const prevInjectContext = setInjectorProfilerContext({ injector, token });\n try {\n callback();\n }\n finally {\n setInjectorProfilerContext(prevInjectContext);\n }\n}\n\nfunction isEnvironmentProviders(value) {\n return value && !!value.ɵproviders;\n}\n\nconst NG_COMP_DEF = getClosureSafeProperty({ ɵcmp: getClosureSafeProperty });\nconst NG_DIR_DEF = getClosureSafeProperty({ ɵdir: getClosureSafeProperty });\nconst NG_PIPE_DEF = getClosureSafeProperty({ ɵpipe: getClosureSafeProperty });\nconst NG_MOD_DEF = getClosureSafeProperty({ ɵmod: getClosureSafeProperty });\nconst NG_FACTORY_DEF = getClosureSafeProperty({ ɵfac: getClosureSafeProperty });\n/**\n * If a directive is diPublic, bloomAdd sets a property on the type with this constant as\n * the key and the directive's unique ID as the value. This allows us to map directives to their\n * bloom filter bit for DI.\n */\n// TODO(misko): This is wrong. The NG_ELEMENT_ID should never be minified.\nconst NG_ELEMENT_ID = getClosureSafeProperty({ __NG_ELEMENT_ID__: getClosureSafeProperty });\n/**\n * The `NG_ENV_ID` field on a DI token indicates special processing in the `EnvironmentInjector`:\n * getting such tokens from the `EnvironmentInjector` will bypass the standard DI resolution\n * strategy and instead will return implementation produced by the `NG_ENV_ID` factory function.\n *\n * This particular retrieval of DI tokens is mostly done to eliminate circular dependencies and\n * improve tree-shaking.\n */\nconst NG_ENV_ID = getClosureSafeProperty({ __NG_ENV_ID__: getClosureSafeProperty });\n\n/**\n * Used for stringify render output in Ivy.\n * Important! This function is very performance-sensitive and we should\n * be extra careful not to introduce megamorphic reads in it.\n * Check `core/test/render3/perf/render_stringify` for benchmarks and alternate implementations.\n */\nfunction renderStringify(value) {\n if (typeof value === 'string')\n return value;\n if (value == null)\n return '';\n // Use `String` so that it invokes the `toString` method of the value. Note that this\n // appears to be faster than calling `value.toString` (see `render_stringify` benchmark).\n return String(value);\n}\n/**\n * Used to stringify a value so that it can be displayed in an error message.\n *\n * Important! This function contains a megamorphic read and should only be\n * used for error messages.\n */\nfunction stringifyForError(value) {\n if (typeof value === 'function')\n return value.name || value.toString();\n if (typeof value === 'object' && value != null && typeof value.type === 'function') {\n return value.type.name || value.type.toString();\n }\n return renderStringify(value);\n}\n/**\n * Used to stringify a `Type` and including the file path and line number in which it is defined, if\n * possible, for better debugging experience.\n *\n * Important! This function contains a megamorphic read and should only be used for error messages.\n */\nfunction debugStringifyTypeForError(type) {\n // TODO(pmvald): Do some refactoring so that we can use getComponentDef here without creating\n // circular deps.\n let componentDef = type[NG_COMP_DEF] || null;\n if (componentDef !== null && componentDef.debugInfo) {\n return stringifyTypeFromDebugInfo(componentDef.debugInfo);\n }\n return stringifyForError(type);\n}\n// TODO(pmvald): Do some refactoring so that we can use the type ClassDebugInfo for the param\n// debugInfo here without creating circular deps.\nfunction stringifyTypeFromDebugInfo(debugInfo) {\n if (!debugInfo.filePath || !debugInfo.lineNumber) {\n return debugInfo.className;\n }\n else {\n return `${debugInfo.className} (at ${debugInfo.filePath}:${debugInfo.lineNumber})`;\n }\n}\n\n/** Called when directives inject each other (creating a circular dependency) */\nfunction throwCyclicDependencyError(token, path) {\n const depPath = path ? `. Dependency path: ${path.join(' > ')} > ${token}` : '';\n throw new RuntimeError(-200 /* RuntimeErrorCode.CYCLIC_DI_DEPENDENCY */, ngDevMode ? `Circular dependency in DI detected for ${token}${depPath}` : token);\n}\nfunction throwMixedMultiProviderError() {\n throw new Error(`Cannot mix multi providers and regular providers`);\n}\nfunction throwInvalidProviderError(ngModuleType, providers, provider) {\n if (ngModuleType && providers) {\n const providerDetail = providers.map((v) => (v == provider ? '?' + provider + '?' : '...'));\n throw new Error(`Invalid provider for the NgModule '${stringify(ngModuleType)}' - only instances of Provider and Type are allowed, got: [${providerDetail.join(', ')}]`);\n }\n else if (isEnvironmentProviders(provider)) {\n if (provider.ɵfromNgModule) {\n throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, `Invalid providers from 'importProvidersFrom' present in a non-environment injector. 'importProvidersFrom' can't be used for component providers.`);\n }\n else {\n throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, `Invalid providers present in a non-environment injector. 'EnvironmentProviders' can't be used for component providers.`);\n }\n }\n else {\n throw new Error('Invalid provider');\n }\n}\n/** Throws an error when a token is not found in DI. */\nfunction throwProviderNotFoundError(token, injectorName) {\n const errorMessage = ngDevMode &&\n `No provider for ${stringifyForError(token)} found${injectorName ? ` in ${injectorName}` : ''}`;\n throw new RuntimeError(-201 /* RuntimeErrorCode.PROVIDER_NOT_FOUND */, errorMessage);\n}\n\n/**\n * Injection flags for DI.\n *\n * @publicApi\n * @deprecated use an options object for [`inject`](api/core/inject) instead.\n */\nvar InjectFlags;\n(function (InjectFlags) {\n // TODO(alxhub): make this 'const' (and remove `InternalInjectFlags` enum) when ngc no longer\n // writes exports of it into ngfactory files.\n /** Check self and check parent injector if needed */\n InjectFlags[InjectFlags[\"Default\"] = 0] = \"Default\";\n /**\n * Specifies that an injector should retrieve a dependency from any injector until reaching the\n * host element of the current component. (Only used with Element Injector)\n */\n InjectFlags[InjectFlags[\"Host\"] = 1] = \"Host\";\n /** Don't ascend to ancestors of the node requesting injection. */\n InjectFlags[InjectFlags[\"Self\"] = 2] = \"Self\";\n /** Skip the node that is requesting injection. */\n InjectFlags[InjectFlags[\"SkipSelf\"] = 4] = \"SkipSelf\";\n /** Inject `defaultValue` instead if token not found. */\n InjectFlags[InjectFlags[\"Optional\"] = 8] = \"Optional\";\n})(InjectFlags || (InjectFlags = {}));\n\n/**\n * Current implementation of inject.\n *\n * By default, it is `injectInjectorOnly`, which makes it `Injector`-only aware. It can be changed\n * to `directiveInject`, which brings in the `NodeInjector` system of ivy. It is designed this\n * way for two reasons:\n * 1. `Injector` should not depend on ivy logic.\n * 2. To maintain tree shake-ability we don't want to bring in unnecessary code.\n */\nlet _injectImplementation;\nfunction getInjectImplementation() {\n return _injectImplementation;\n}\n/**\n * Sets the current inject implementation.\n */\nfunction setInjectImplementation(impl) {\n const previous = _injectImplementation;\n _injectImplementation = impl;\n return previous;\n}\n/**\n * Injects `root` tokens in limp mode.\n *\n * If no injector exists, we can still inject tree-shakable providers which have `providedIn` set to\n * `\"root\"`. This is known as the limp mode injection. In such case the value is stored in the\n * injectable definition.\n */\nfunction injectRootLimpMode(token, notFoundValue, flags) {\n const injectableDef = getInjectableDef(token);\n if (injectableDef && injectableDef.providedIn == 'root') {\n return injectableDef.value === undefined\n ? (injectableDef.value = injectableDef.factory())\n : injectableDef.value;\n }\n if (flags & InjectFlags.Optional)\n return null;\n if (notFoundValue !== undefined)\n return notFoundValue;\n throwProviderNotFoundError(token, 'Injector');\n}\n/**\n * Assert that `_injectImplementation` is not `fn`.\n *\n * This is useful, to prevent infinite recursion.\n *\n * @param fn Function which it should not equal to\n */\nfunction assertInjectImplementationNotEqual(fn) {\n ngDevMode &&\n assertNotEqual(_injectImplementation, fn, 'Calling ɵɵinject would cause infinite recursion');\n}\n\nconst _THROW_IF_NOT_FOUND = {};\nconst THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;\n/*\n * Name of a property (that we patch onto DI decorator), which is used as an annotation of which\n * InjectFlag this decorator represents. This allows to avoid direct references to the DI decorators\n * in the code, thus making them tree-shakable.\n */\nconst DI_DECORATOR_FLAG = '__NG_DI_FLAG__';\nconst NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';\nconst NG_TOKEN_PATH = 'ngTokenPath';\nconst NEW_LINE = /\\n/gm;\nconst NO_NEW_LINE = 'ɵ';\nconst SOURCE = '__source';\n/**\n * Current injector value used by `inject`.\n * - `undefined`: it is an error to call `inject`\n * - `null`: `inject` can be called but there is no injector (limp-mode).\n * - Injector instance: Use the injector for resolution.\n */\nlet _currentInjector = undefined;\nfunction getCurrentInjector() {\n return _currentInjector;\n}\nfunction setCurrentInjector(injector) {\n const former = _currentInjector;\n _currentInjector = injector;\n return former;\n}\nfunction injectInjectorOnly(token, flags = InjectFlags.Default) {\n if (_currentInjector === undefined) {\n throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode &&\n `inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \\`runInInjectionContext\\`.`);\n }\n else if (_currentInjector === null) {\n return injectRootLimpMode(token, undefined, flags);\n }\n else {\n const value = _currentInjector.get(token, flags & InjectFlags.Optional ? null : undefined, flags);\n ngDevMode && emitInjectEvent(token, value, flags);\n return value;\n }\n}\nfunction ɵɵinject(token, flags = InjectFlags.Default) {\n return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags);\n}\n/**\n * Throws an error indicating that a factory function could not be generated by the compiler for a\n * particular class.\n *\n * The name of the class is not mentioned here, but will be in the generated factory function name\n * and thus in the stack trace.\n *\n * @codeGenApi\n */\nfunction ɵɵinvalidFactoryDep(index) {\n throw new RuntimeError(202 /* RuntimeErrorCode.INVALID_FACTORY_DEPENDENCY */, ngDevMode &&\n `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.\nThis can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.\n\nPlease check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`);\n}\n/**\n * Injects a token from the currently active injector.\n * `inject` is only supported in an [injection context](guide/di/dependency-injection-context). It\n * can be used during:\n * - Construction (via the `constructor`) of a class being instantiated by the DI system, such\n * as an `@Injectable` or `@Component`.\n * - In the initializer for fields of such classes.\n * - In the factory function specified for `useFactory` of a `Provider` or an `@Injectable`.\n * - In the `factory` function specified for an `InjectionToken`.\n * - In a stackframe of a function call in a DI context\n *\n * @param token A token that represents a dependency that should be injected.\n * @param flags Optional flags that control how injection is executed.\n * The flags correspond to injection strategies that can be specified with\n * parameter decorators `@Host`, `@Self`, `@SkipSelf`, and `@Optional`.\n * @returns the injected value if operation is successful, `null` otherwise.\n * @throws if called outside of a supported context.\n *\n * @usageNotes\n * In practice the `inject()` calls are allowed in a constructor, a constructor parameter and a\n * field initializer:\n *\n * ```typescript\n * @Injectable({providedIn: 'root'})\n * export class Car {\n * radio: Radio|undefined;\n * // OK: field initializer\n * spareTyre = inject(Tyre);\n *\n * constructor() {\n * // OK: constructor body\n * this.radio = inject(Radio);\n * }\n * }\n * ```\n *\n * It is also legal to call `inject` from a provider's factory:\n *\n * ```typescript\n * providers: [\n * {provide: Car, useFactory: () => {\n * // OK: a class factory\n * const engine = inject(Engine);\n * return new Car(engine);\n * }}\n * ]\n * ```\n *\n * Calls to the `inject()` function outside of the class creation context will result in error. Most\n * notably, calls to `inject()` are disallowed after a class instance was created, in methods\n * (including lifecycle hooks):\n *\n * ```typescript\n * @Component({ ... })\n * export class CarComponent {\n * ngOnInit() {\n * // ERROR: too late, the component instance was already created\n * const engine = inject(Engine);\n * engine.start();\n * }\n * }\n * ```\n *\n * @publicApi\n */\nfunction inject(token, flags = InjectFlags.Default) {\n // The `as any` here _shouldn't_ be necessary, but without it JSCompiler\n // throws a disambiguation error due to the multiple signatures.\n return ɵɵinject(token, convertToBitFlags(flags));\n}\n// Converts object-based DI flags (`InjectOptions`) to bit flags (`InjectFlags`).\nfunction convertToBitFlags(flags) {\n if (typeof flags === 'undefined' || typeof flags === 'number') {\n return flags;\n }\n // While TypeScript doesn't accept it without a cast, bitwise OR with false-y values in\n // JavaScript is a no-op. We can use that for a very codesize-efficient conversion from\n // `InjectOptions` to `InjectFlags`.\n return (0 /* InternalInjectFlags.Default */ | // comment to force a line break in the formatter\n (flags.optional && 8 /* InternalInjectFlags.Optional */) |\n (flags.host && 1 /* InternalInjectFlags.Host */) |\n (flags.self && 2 /* InternalInjectFlags.Self */) |\n (flags.skipSelf && 4 /* InternalInjectFlags.SkipSelf */));\n}\nfunction injectArgs(types) {\n const args = [];\n for (let i = 0; i < types.length; i++) {\n const arg = resolveForwardRef(types[i]);\n if (Array.isArray(arg)) {\n if (arg.length === 0) {\n throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode && 'Arguments array must have arguments.');\n }\n let type = undefined;\n let flags = InjectFlags.Default;\n for (let j = 0; j < arg.length; j++) {\n const meta = arg[j];\n const flag = getInjectFlag(meta);\n if (typeof flag === 'number') {\n // Special case when we handle @Inject decorator.\n if (flag === -1 /* DecoratorFlags.Inject */) {\n type = meta.token;\n }\n else {\n flags |= flag;\n }\n }\n else {\n type = meta;\n }\n }\n args.push(ɵɵinject(type, flags));\n }\n else {\n args.push(ɵɵinject(arg));\n }\n }\n return args;\n}\n/**\n * Attaches a given InjectFlag to a given decorator using monkey-patching.\n * Since DI decorators can be used in providers `deps` array (when provider is configured using\n * `useFactory`) without initialization (e.g. `Host`) and as an instance (e.g. `new Host()`), we\n * attach the flag to make it available both as a static property and as a field on decorator\n * instance.\n *\n * @param decorator Provided DI decorator.\n * @param flag InjectFlag that should be applied.\n */\nfunction attachInjectFlag(decorator, flag) {\n decorator[DI_DECORATOR_FLAG] = flag;\n decorator.prototype[DI_DECORATOR_FLAG] = flag;\n return decorator;\n}\n/**\n * Reads monkey-patched property that contains InjectFlag attached to a decorator.\n *\n * @param token Token that may contain monkey-patched DI flags property.\n */\nfunction getInjectFlag(token) {\n return token[DI_DECORATOR_FLAG];\n}\nfunction catchInjectorError(e, token, injectorErrorName, source) {\n const tokenPath = e[NG_TEMP_TOKEN_PATH];\n if (token[SOURCE]) {\n tokenPath.unshift(token[SOURCE]);\n }\n e.message = formatError('\\n' + e.message, tokenPath, injectorErrorName, source);\n e[NG_TOKEN_PATH] = tokenPath;\n e[NG_TEMP_TOKEN_PATH] = null;\n throw e;\n}\nfunction formatError(text, obj, injectorErrorName, source = null) {\n text = text && text.charAt(0) === '\\n' && text.charAt(1) == NO_NEW_LINE ? text.slice(2) : text;\n let context = stringify(obj);\n if (Array.isArray(obj)) {\n context = obj.map(stringify).join(' -> ');\n }\n else if (typeof obj === 'object') {\n let parts = [];\n for (let key in obj) {\n if (obj.hasOwnProperty(key)) {\n let value = obj[key];\n parts.push(key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));\n }\n }\n context = `{${parts.join(', ')}}`;\n }\n return `${injectorErrorName}${source ? '(' + source + ')' : ''}[${context}]: ${text.replace(NEW_LINE, '\\n ')}`;\n}\n\n/**\n * Inject decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Inject = attachInjectFlag(\n// Disable tslint because `DecoratorFlags` is a const enum which gets inlined.\nmakeParamDecorator('Inject', (token) => ({ token })), -1 /* DecoratorFlags.Inject */);\n/**\n * Optional decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Optional = \n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('Optional'), 8 /* InternalInjectFlags.Optional */);\n/**\n * Self decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Self = \n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('Self'), 2 /* InternalInjectFlags.Self */);\n/**\n * `SkipSelf` decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst SkipSelf = \n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('SkipSelf'), 4 /* InternalInjectFlags.SkipSelf */);\n/**\n * Host decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Host = \n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('Host'), 1 /* InternalInjectFlags.Host */);\n\nfunction getFactoryDef(type, throwNotFound) {\n const hasFactoryDef = type.hasOwnProperty(NG_FACTORY_DEF);\n if (!hasFactoryDef && throwNotFound === true && ngDevMode) {\n throw new Error(`Type ${stringify(type)} does not have 'ɵfac' property.`);\n }\n return hasFactoryDef ? type[NG_FACTORY_DEF] : null;\n}\n\n/**\n * Determines if the contents of two arrays is identical\n *\n * @param a first array\n * @param b second array\n * @param identityAccessor Optional function for extracting stable object identity from a value in\n * the array.\n */\nfunction arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n let valueA = a[i];\n let valueB = b[i];\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n if (valueB !== valueA) {\n return false;\n }\n }\n return true;\n}\n/**\n * Flattens an array.\n */\nfunction flatten(list) {\n return list.flat(Number.POSITIVE_INFINITY);\n}\nfunction deepForEach(input, fn) {\n input.forEach((value) => (Array.isArray(value) ? deepForEach(value, fn) : fn(value)));\n}\nfunction addToArray(arr, index, value) {\n // perf: array.push is faster than array.splice!\n if (index >= arr.length) {\n arr.push(value);\n }\n else {\n arr.splice(index, 0, value);\n }\n}\nfunction removeFromArray(arr, index) {\n // perf: array.pop is faster than array.splice!\n if (index >= arr.length - 1) {\n return arr.pop();\n }\n else {\n return arr.splice(index, 1)[0];\n }\n}\nfunction newArray(size, value) {\n const list = [];\n for (let i = 0; i < size; i++) {\n list.push(value);\n }\n return list;\n}\n/**\n * Remove item from array (Same as `Array.splice()` but faster.)\n *\n * `Array.splice()` is not as fast because it has to allocate an array for the elements which were\n * removed. This causes memory pressure and slows down code when most of the time we don't\n * care about the deleted items array.\n *\n * https://jsperf.com/fast-array-splice (About 20x faster)\n *\n * @param array Array to splice\n * @param index Index of element in array to remove.\n * @param count Number of items to remove.\n */\nfunction arraySplice(array, index, count) {\n const length = array.length - count;\n while (index < length) {\n array[index] = array[index + count];\n index++;\n }\n while (count--) {\n array.pop(); // shrink the array\n }\n}\n/**\n * Same as `Array.splice(index, 0, value)` but faster.\n *\n * `Array.splice()` is not fast because it has to allocate an array for the elements which were\n * removed. This causes memory pressure and slows down code when most of the time we don't\n * care about the deleted items array.\n *\n * @param array Array to splice.\n * @param index Index in array where the `value` should be added.\n * @param value Value to add to array.\n */\nfunction arrayInsert(array, index, value) {\n ngDevMode && assertLessThanOrEqual(index, array.length, \"Can't insert past array end.\");\n let end = array.length;\n while (end > index) {\n const previousEnd = end - 1;\n array[end] = array[previousEnd];\n end = previousEnd;\n }\n array[index] = value;\n}\n/**\n * Same as `Array.splice2(index, 0, value1, value2)` but faster.\n *\n * `Array.splice()` is not fast because it has to allocate an array for the elements which were\n * removed. This causes memory pressure and slows down code when most of the time we don't\n * care about the deleted items array.\n *\n * @param array Array to splice.\n * @param index Index in array where the `value` should be added.\n * @param value1 Value to add to array.\n * @param value2 Value to add to array.\n */\nfunction arrayInsert2(array, index, value1, value2) {\n ngDevMode && assertLessThanOrEqual(index, array.length, \"Can't insert past array end.\");\n let end = array.length;\n if (end == index) {\n // inserting at the end.\n array.push(value1, value2);\n }\n else if (end === 1) {\n // corner case when we have less items in array than we have items to insert.\n array.push(value2, array[0]);\n array[0] = value1;\n }\n else {\n end--;\n array.push(array[end - 1], array[end]);\n while (end > index) {\n const previousEnd = end - 2;\n array[end] = array[previousEnd];\n end--;\n }\n array[index] = value1;\n array[index + 1] = value2;\n }\n}\n/**\n * Get an index of an `value` in a sorted `array`.\n *\n * NOTE:\n * - This uses binary search algorithm for fast removals.\n *\n * @param array A sorted array to binary search.\n * @param value The value to look for.\n * @returns index of the value.\n * - positive index if value found.\n * - negative index if value not found. (`~index` to get the value where it should have been\n * located)\n */\nfunction arrayIndexOfSorted(array, value) {\n return _arrayIndexOfSorted(array, value, 0);\n}\n/**\n * Set a `value` for a `key`.\n *\n * @param keyValueArray to modify.\n * @param key The key to locate or create.\n * @param value The value to set for a `key`.\n * @returns index (always even) of where the value vas set.\n */\nfunction keyValueArraySet(keyValueArray, key, value) {\n let index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it set it.\n keyValueArray[index | 1] = value;\n }\n else {\n index = ~index;\n arrayInsert2(keyValueArray, index, key, value);\n }\n return index;\n}\n/**\n * Retrieve a `value` for a `key` (on `undefined` if not found.)\n *\n * @param keyValueArray to search.\n * @param key The key to locate.\n * @return The `value` stored at the `key` location or `undefined if not found.\n */\nfunction keyValueArrayGet(keyValueArray, key) {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1];\n }\n return undefined;\n}\n/**\n * Retrieve a `key` index value in the array or `-1` if not found.\n *\n * @param keyValueArray to search.\n * @param key The key to locate.\n * @returns index of where the key is (or should have been.)\n * - positive (even) index if key found.\n * - negative index if key not found. (`~index` (even) to get the index where it should have\n * been inserted.)\n */\nfunction keyValueArrayIndexOf(keyValueArray, key) {\n return _arrayIndexOfSorted(keyValueArray, key, 1);\n}\n/**\n * Delete a `key` (and `value`) from the `KeyValueArray`.\n *\n * @param keyValueArray to modify.\n * @param key The key to locate or delete (if exist).\n * @returns index of where the key was (or should have been.)\n * - positive (even) index if key found and deleted.\n * - negative index if key not found. (`~index` (even) to get the index where it should have\n * been.)\n */\nfunction keyValueArrayDelete(keyValueArray, key) {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it remove it.\n arraySplice(keyValueArray, index, 2);\n }\n return index;\n}\n/**\n * INTERNAL: Get an index of an `value` in a sorted `array` by grouping search by `shift`.\n *\n * NOTE:\n * - This uses binary search algorithm for fast removals.\n *\n * @param array A sorted array to binary search.\n * @param value The value to look for.\n * @param shift grouping shift.\n * - `0` means look at every location\n * - `1` means only look at every other (even) location (the odd locations are to be ignored as\n * they are values.)\n * @returns index of the value.\n * - positive index if value found.\n * - negative index if value not found. (`~index` to get the value where it should have been\n * inserted)\n */\nfunction _arrayIndexOfSorted(array, value, shift) {\n ngDevMode && assertEqual(Array.isArray(array), true, 'Expecting an array');\n let start = 0;\n let end = array.length >> shift;\n while (end !== start) {\n const middle = start + ((end - start) >> 1); // find the middle.\n const current = array[middle << shift];\n if (value === current) {\n return middle << shift;\n }\n else if (current > value) {\n end = middle;\n }\n else {\n start = middle + 1; // We already searched middle so make it non-inclusive by adding 1\n }\n }\n return ~(end << shift);\n}\n\n/**\n * This file contains reuseable \"empty\" symbols that can be used as default return values\n * in different parts of the rendering code. Because the same symbols are returned, this\n * allows for identity checks against these values to be consistently used by the framework\n * code.\n */\nconst EMPTY_OBJ = {};\nconst EMPTY_ARRAY = [];\n// freezing the values prevents any code from accidentally inserting new values in\nif ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) {\n // These property accesses can be ignored because ngDevMode will be set to false\n // when optimizing code and the whole if statement will be dropped.\n // tslint:disable-next-line:no-toplevel-property-access\n Object.freeze(EMPTY_OBJ);\n // tslint:disable-next-line:no-toplevel-property-access\n Object.freeze(EMPTY_ARRAY);\n}\n\n/**\n * A multi-provider token for initialization functions that will run upon construction of an\n * environment injector.\n *\n * Note: As opposed to the `APP_INITIALIZER` token, the `ENVIRONMENT_INITIALIZER` functions are not awaited,\n * hence they should not be `async`.\n *\n * @publicApi\n */\nconst ENVIRONMENT_INITIALIZER = new InjectionToken(ngDevMode ? 'ENVIRONMENT_INITIALIZER' : '');\n\n/**\n * An InjectionToken that gets the current `Injector` for `createInjector()`-style injectors.\n *\n * Requesting this token instead of `Injector` allows `StaticInjector` to be tree-shaken from a\n * project.\n *\n * @publicApi\n */\nconst INJECTOR$1 = new InjectionToken(ngDevMode ? 'INJECTOR' : '', \n// Disable tslint because this is const enum which gets inlined not top level prop access.\n// tslint:disable-next-line: no-toplevel-property-access\n-1 /* InjectorMarkers.Injector */);\n\nconst INJECTOR_DEF_TYPES = new InjectionToken(ngDevMode ? 'INJECTOR_DEF_TYPES' : '');\n\nclass NullInjector {\n get(token, notFoundValue = THROW_IF_NOT_FOUND) {\n if (notFoundValue === THROW_IF_NOT_FOUND) {\n const error = new Error(`NullInjectorError: No provider for ${stringify(token)}!`);\n error.name = 'NullInjectorError';\n throw error;\n }\n return notFoundValue;\n }\n}\n\n/**\n * The strategy that the default change detector uses to detect changes.\n * When set, takes effect the next time change detection is triggered.\n *\n * @see [Change detection usage](/api/core/ChangeDetectorRef?tab=usage-notes)\n * @see [Skipping component subtrees](/best-practices/skipping-subtrees)\n *\n * @publicApi\n */\nvar ChangeDetectionStrategy;\n(function (ChangeDetectionStrategy) {\n /**\n * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated\n * until reactivated by setting the strategy to `Default` (`CheckAlways`).\n * Change detection can still be explicitly invoked.\n * This strategy applies to all child directives and cannot be overridden.\n */\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"OnPush\"] = 0] = \"OnPush\";\n /**\n * Use the default `CheckAlways` strategy, in which change detection is automatic until\n * explicitly deactivated.\n */\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"Default\"] = 1] = \"Default\";\n})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));\n\n/**\n * Defines the CSS styles encapsulation policies for the {@link Component} decorator's\n * `encapsulation` option.\n *\n * See {@link Component#encapsulation encapsulation}.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/ts/metadata/encapsulation.ts region='longform'}\n *\n * @publicApi\n */\nvar ViewEncapsulation$1;\n(function (ViewEncapsulation) {\n // TODO: consider making `ViewEncapsulation` a `const enum` instead. See\n // https://github.com/angular/angular/issues/44119 for additional information.\n /**\n * Emulates a native Shadow DOM encapsulation behavior by adding a specific attribute to the\n * component's host element and applying the same attribute to all the CSS selectors provided\n * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls}.\n *\n * This is the default option.\n */\n ViewEncapsulation[ViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n /**\n * Doesn't provide any sort of CSS style encapsulation, meaning that all the styles provided\n * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls} are applicable\n * to any HTML element of the application regardless of their host Component.\n */\n ViewEncapsulation[ViewEncapsulation[\"None\"] = 2] = \"None\";\n /**\n * Uses the browser's native Shadow DOM API to encapsulate CSS styles, meaning that it creates\n * a ShadowRoot for the component's host element which is then used to encapsulate\n * all the Component's styling.\n */\n ViewEncapsulation[ViewEncapsulation[\"ShadowDom\"] = 3] = \"ShadowDom\";\n})(ViewEncapsulation$1 || (ViewEncapsulation$1 = {}));\n\n/** Flags describing an input for a directive. */\nvar InputFlags;\n(function (InputFlags) {\n InputFlags[InputFlags[\"None\"] = 0] = \"None\";\n InputFlags[InputFlags[\"SignalBased\"] = 1] = \"SignalBased\";\n InputFlags[InputFlags[\"HasDecoratorInputTransform\"] = 2] = \"HasDecoratorInputTransform\";\n})(InputFlags || (InputFlags = {}));\n\n/**\n * Returns an index of `classToSearch` in `className` taking token boundaries into account.\n *\n * `classIndexOf('AB A', 'A', 0)` will be 3 (not 0 since `AB!==A`)\n *\n * @param className A string containing classes (whitespace separated)\n * @param classToSearch A class name to locate\n * @param startingIndex Starting location of search\n * @returns an index of the located class (or -1 if not found)\n */\nfunction classIndexOf(className, classToSearch, startingIndex) {\n ngDevMode && assertNotEqual(classToSearch, '', 'can not look for \"\" string.');\n let end = className.length;\n while (true) {\n const foundIndex = className.indexOf(classToSearch, startingIndex);\n if (foundIndex === -1)\n return foundIndex;\n if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= 32 /* CharCode.SPACE */) {\n // Ensure that it has leading whitespace\n const length = classToSearch.length;\n if (foundIndex + length === end ||\n className.charCodeAt(foundIndex + length) <= 32 /* CharCode.SPACE */) {\n // Ensure that it has trailing whitespace\n return foundIndex;\n }\n }\n // False positive, keep searching from where we left off.\n startingIndex = foundIndex + 1;\n }\n}\n\n/**\n * Assigns all attribute values to the provided element via the inferred renderer.\n *\n * This function accepts two forms of attribute entries:\n *\n * default: (key, value):\n * attrs = [key1, value1, key2, value2]\n *\n * namespaced: (NAMESPACE_MARKER, uri, name, value)\n * attrs = [NAMESPACE_MARKER, uri, name, value, NAMESPACE_MARKER, uri, name, value]\n *\n * The `attrs` array can contain a mix of both the default and namespaced entries.\n * The \"default\" values are set without a marker, but if the function comes across\n * a marker value then it will attempt to set a namespaced value. If the marker is\n * not of a namespaced value then the function will quit and return the index value\n * where it stopped during the iteration of the attrs array.\n *\n * See [AttributeMarker] to understand what the namespace marker value is.\n *\n * Note that this instruction does not support assigning style and class values to\n * an element. See `elementStart` and `elementHostAttrs` to learn how styling values\n * are applied to an element.\n * @param renderer The renderer to be used\n * @param native The element that the attributes will be assigned to\n * @param attrs The attribute array of values that will be assigned to the element\n * @returns the index value that was last accessed in the attributes array\n */\nfunction setUpAttributes(renderer, native, attrs) {\n let i = 0;\n while (i < attrs.length) {\n const value = attrs[i];\n if (typeof value === 'number') {\n // only namespaces are supported. Other value types (such as style/class\n // entries) are not supported in this function.\n if (value !== 0 /* AttributeMarker.NamespaceURI */) {\n break;\n }\n // we just landed on the marker value ... therefore\n // we should skip to the next entry\n i++;\n const namespaceURI = attrs[i++];\n const attrName = attrs[i++];\n const attrVal = attrs[i++];\n ngDevMode && ngDevMode.rendererSetAttribute++;\n renderer.setAttribute(native, attrName, attrVal, namespaceURI);\n }\n else {\n // attrName is string;\n const attrName = value;\n const attrVal = attrs[++i];\n // Standard attributes\n ngDevMode && ngDevMode.rendererSetAttribute++;\n if (isAnimationProp(attrName)) {\n renderer.setProperty(native, attrName, attrVal);\n }\n else {\n renderer.setAttribute(native, attrName, attrVal);\n }\n i++;\n }\n }\n // another piece of code may iterate over the same attributes array. Therefore\n // it may be helpful to return the exact spot where the attributes array exited\n // whether by running into an unsupported marker or if all the static values were\n // iterated over.\n return i;\n}\n/**\n * Test whether the given value is a marker that indicates that the following\n * attribute values in a `TAttributes` array are only the names of attributes,\n * and not name-value pairs.\n * @param marker The attribute marker to test.\n * @returns true if the marker is a \"name-only\" marker (e.g. `Bindings`, `Template` or `I18n`).\n */\nfunction isNameOnlyAttributeMarker(marker) {\n return (marker === 3 /* AttributeMarker.Bindings */ ||\n marker === 4 /* AttributeMarker.Template */ ||\n marker === 6 /* AttributeMarker.I18n */);\n}\nfunction isAnimationProp(name) {\n // Perf note: accessing charCodeAt to check for the first character of a string is faster as\n // compared to accessing a character at index 0 (ex. name[0]). The main reason for this is that\n // charCodeAt doesn't allocate memory to return a substring.\n return name.charCodeAt(0) === 64 /* CharCode.AT_SIGN */;\n}\n/**\n * Merges `src` `TAttributes` into `dst` `TAttributes` removing any duplicates in the process.\n *\n * This merge function keeps the order of attrs same.\n *\n * @param dst Location of where the merged `TAttributes` should end up.\n * @param src `TAttributes` which should be appended to `dst`\n */\nfunction mergeHostAttrs(dst, src) {\n if (src === null || src.length === 0) {\n // do nothing\n }\n else if (dst === null || dst.length === 0) {\n // We have source, but dst is empty, just make a copy.\n dst = src.slice();\n }\n else {\n let srcMarker = -1 /* AttributeMarker.ImplicitAttributes */;\n for (let i = 0; i < src.length; i++) {\n const item = src[i];\n if (typeof item === 'number') {\n srcMarker = item;\n }\n else {\n if (srcMarker === 0 /* AttributeMarker.NamespaceURI */) {\n // Case where we need to consume `key1`, `key2`, `value` items.\n }\n else if (srcMarker === -1 /* AttributeMarker.ImplicitAttributes */ ||\n srcMarker === 2 /* AttributeMarker.Styles */) {\n // Case where we have to consume `key1` and `value` only.\n mergeHostAttribute(dst, srcMarker, item, null, src[++i]);\n }\n else {\n // Case where we have to consume `key1` only.\n mergeHostAttribute(dst, srcMarker, item, null, null);\n }\n }\n }\n }\n return dst;\n}\n/**\n * Append `key`/`value` to existing `TAttributes` taking region marker and duplicates into account.\n *\n * @param dst `TAttributes` to append to.\n * @param marker Region where the `key`/`value` should be added.\n * @param key1 Key to add to `TAttributes`\n * @param key2 Key to add to `TAttributes` (in case of `AttributeMarker.NamespaceURI`)\n * @param value Value to add or to overwrite to `TAttributes` Only used if `marker` is not Class.\n */\nfunction mergeHostAttribute(dst, marker, key1, key2, value) {\n let i = 0;\n // Assume that new markers will be inserted at the end.\n let markerInsertPosition = dst.length;\n // scan until correct type.\n if (marker === -1 /* AttributeMarker.ImplicitAttributes */) {\n markerInsertPosition = -1;\n }\n else {\n while (i < dst.length) {\n const dstValue = dst[i++];\n if (typeof dstValue === 'number') {\n if (dstValue === marker) {\n markerInsertPosition = -1;\n break;\n }\n else if (dstValue > marker) {\n // We need to save this as we want the markers to be inserted in specific order.\n markerInsertPosition = i - 1;\n break;\n }\n }\n }\n }\n // search until you find place of insertion\n while (i < dst.length) {\n const item = dst[i];\n if (typeof item === 'number') {\n // since `i` started as the index after the marker, we did not find it if we are at the next\n // marker\n break;\n }\n else if (item === key1) {\n // We already have same token\n if (key2 === null) {\n if (value !== null) {\n dst[i + 1] = value;\n }\n return;\n }\n else if (key2 === dst[i + 1]) {\n dst[i + 2] = value;\n return;\n }\n }\n // Increment counter.\n i++;\n if (key2 !== null)\n i++;\n if (value !== null)\n i++;\n }\n // insert at location.\n if (markerInsertPosition !== -1) {\n dst.splice(markerInsertPosition, 0, marker);\n i = markerInsertPosition + 1;\n }\n dst.splice(i++, 0, key1);\n if (key2 !== null) {\n dst.splice(i++, 0, key2);\n }\n if (value !== null) {\n dst.splice(i++, 0, value);\n }\n}\n\nconst NG_TEMPLATE_SELECTOR = 'ng-template';\n/**\n * Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)\n *\n * @param tNode static data of the node to match\n * @param attrs `TAttributes` to search through.\n * @param cssClassToMatch class to match (lowercase)\n * @param isProjectionMode Whether or not class matching should look into the attribute `class` in\n * addition to the `AttributeMarker.Classes`.\n */\nfunction isCssClassMatching(tNode, attrs, cssClassToMatch, isProjectionMode) {\n ngDevMode &&\n assertEqual(cssClassToMatch, cssClassToMatch.toLowerCase(), 'Class name expected to be lowercase.');\n let i = 0;\n if (isProjectionMode) {\n for (; i < attrs.length && typeof attrs[i] === 'string'; i += 2) {\n // Search for an implicit `class` attribute and check if its value matches `cssClassToMatch`.\n if (attrs[i] === 'class' &&\n classIndexOf(attrs[i + 1].toLowerCase(), cssClassToMatch, 0) !== -1) {\n return true;\n }\n }\n }\n else if (isInlineTemplate(tNode)) {\n // Matching directives (i.e. when not matching for projection mode) should not consider the\n // class bindings that are present on inline templates, as those class bindings only target\n // the root node of the template, not the template itself.\n return false;\n }\n // Resume the search for classes after the `Classes` marker.\n i = attrs.indexOf(1 /* AttributeMarker.Classes */, i);\n if (i > -1) {\n // We found the classes section. Start searching for the class.\n let item;\n while (++i < attrs.length && typeof (item = attrs[i]) === 'string') {\n if (item.toLowerCase() === cssClassToMatch) {\n return true;\n }\n }\n }\n return false;\n}\n/**\n * Checks whether the `tNode` represents an inline template (e.g. `*ngFor`).\n *\n * @param tNode current TNode\n */\nfunction isInlineTemplate(tNode) {\n return tNode.type === 4 /* TNodeType.Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n}\n/**\n * Function that checks whether a given tNode matches tag-based selector and has a valid type.\n *\n * Matching can be performed in 2 modes: projection mode (when we project nodes) and regular\n * directive matching mode:\n * - in the \"directive matching\" mode we do _not_ take TContainer's tagName into account if it is\n * different from NG_TEMPLATE_SELECTOR (value different from NG_TEMPLATE_SELECTOR indicates that a\n * tag name was extracted from * syntax so we would match the same directive twice);\n * - in the \"projection\" mode, we use a tag name potentially extracted from the * syntax processing\n * (applicable to TNodeType.Container only).\n */\nfunction hasTagAndTypeMatch(tNode, currentSelector, isProjectionMode) {\n const tagNameToCompare = tNode.type === 4 /* TNodeType.Container */ && !isProjectionMode ? NG_TEMPLATE_SELECTOR : tNode.value;\n return currentSelector === tagNameToCompare;\n}\n/**\n * A utility function to match an Ivy node static data against a simple CSS selector\n *\n * @param tNode static data of the node to match\n * @param selector The selector to try matching against the node.\n * @param isProjectionMode if `true` we are matching for content projection, otherwise we are doing\n * directive matching.\n * @returns true if node matches the selector.\n */\nfunction isNodeMatchingSelector(tNode, selector, isProjectionMode) {\n ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');\n let mode = 4 /* SelectorFlags.ELEMENT */;\n const nodeAttrs = tNode.attrs;\n // Find the index of first attribute that has no value, only a name.\n const nameOnlyMarkerIdx = nodeAttrs !== null ? getNameOnlyMarkerIndex(nodeAttrs) : 0;\n // When processing \":not\" selectors, we skip to the next \":not\" if the\n // current one doesn't match\n let skipToNextSelector = false;\n for (let i = 0; i < selector.length; i++) {\n const current = selector[i];\n if (typeof current === 'number') {\n // If we finish processing a :not selector and it hasn't failed, return false\n if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) {\n return false;\n }\n // If we are skipping to the next :not() and this mode flag is positive,\n // it's a part of the current :not() selector, and we should keep skipping\n if (skipToNextSelector && isPositive(current))\n continue;\n skipToNextSelector = false;\n mode = current | (mode & 1 /* SelectorFlags.NOT */);\n continue;\n }\n if (skipToNextSelector)\n continue;\n if (mode & 4 /* SelectorFlags.ELEMENT */) {\n mode = 2 /* SelectorFlags.ATTRIBUTE */ | (mode & 1 /* SelectorFlags.NOT */);\n if ((current !== '' && !hasTagAndTypeMatch(tNode, current, isProjectionMode)) ||\n (current === '' && selector.length === 1)) {\n if (isPositive(mode))\n return false;\n skipToNextSelector = true;\n }\n }\n else if (mode & 8 /* SelectorFlags.CLASS */) {\n if (nodeAttrs === null || !isCssClassMatching(tNode, nodeAttrs, current, isProjectionMode)) {\n if (isPositive(mode))\n return false;\n skipToNextSelector = true;\n }\n }\n else {\n const selectorAttrValue = selector[++i];\n const attrIndexInNode = findAttrIndexInNode(current, nodeAttrs, isInlineTemplate(tNode), isProjectionMode);\n if (attrIndexInNode === -1) {\n if (isPositive(mode))\n return false;\n skipToNextSelector = true;\n continue;\n }\n if (selectorAttrValue !== '') {\n let nodeAttrValue;\n if (attrIndexInNode > nameOnlyMarkerIdx) {\n nodeAttrValue = '';\n }\n else {\n ngDevMode &&\n assertNotEqual(nodeAttrs[attrIndexInNode], 0 /* AttributeMarker.NamespaceURI */, 'We do not match directives on namespaced attributes');\n // we lowercase the attribute value to be able to match\n // selectors without case-sensitivity\n // (selectors are already in lowercase when generated)\n nodeAttrValue = nodeAttrs[attrIndexInNode + 1].toLowerCase();\n }\n if (mode & 2 /* SelectorFlags.ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) {\n if (isPositive(mode))\n return false;\n skipToNextSelector = true;\n }\n }\n }\n }\n return isPositive(mode) || skipToNextSelector;\n}\nfunction isPositive(mode) {\n return (mode & 1 /* SelectorFlags.NOT */) === 0;\n}\n/**\n * Examines the attribute's definition array for a node to find the index of the\n * attribute that matches the given `name`.\n *\n * NOTE: This will not match namespaced attributes.\n *\n * Attribute matching depends upon `isInlineTemplate` and `isProjectionMode`.\n * The following table summarizes which types of attributes we attempt to match:\n *\n * ===========================================================================================================\n * Modes | Normal Attributes | Bindings Attributes | Template Attributes | I18n\n * Attributes\n * ===========================================================================================================\n * Inline + Projection | YES | YES | NO | YES\n * -----------------------------------------------------------------------------------------------------------\n * Inline + Directive | NO | NO | YES | NO\n * -----------------------------------------------------------------------------------------------------------\n * Non-inline + Projection | YES | YES | NO | YES\n * -----------------------------------------------------------------------------------------------------------\n * Non-inline + Directive | YES | YES | NO | YES\n * ===========================================================================================================\n *\n * @param name the name of the attribute to find\n * @param attrs the attribute array to examine\n * @param isInlineTemplate true if the node being matched is an inline template (e.g. `*ngFor`)\n * rather than a manually expanded template node (e.g `<ng-template>`).\n * @param isProjectionMode true if we are matching against content projection otherwise we are\n * matching against directives.\n */\nfunction findAttrIndexInNode(name, attrs, isInlineTemplate, isProjectionMode) {\n if (attrs === null)\n return -1;\n let i = 0;\n if (isProjectionMode || !isInlineTemplate) {\n let bindingsMode = false;\n while (i < attrs.length) {\n const maybeAttrName = attrs[i];\n if (maybeAttrName === name) {\n return i;\n }\n else if (maybeAttrName === 3 /* AttributeMarker.Bindings */ ||\n maybeAttrName === 6 /* AttributeMarker.I18n */) {\n bindingsMode = true;\n }\n else if (maybeAttrName === 1 /* AttributeMarker.Classes */ ||\n maybeAttrName === 2 /* AttributeMarker.Styles */) {\n let value = attrs[++i];\n // We should skip classes here because we have a separate mechanism for\n // matching classes in projection mode.\n while (typeof value === 'string') {\n value = attrs[++i];\n }\n continue;\n }\n else if (maybeAttrName === 4 /* AttributeMarker.Template */) {\n // We do not care about Template attributes in this scenario.\n break;\n }\n else if (maybeAttrName === 0 /* AttributeMarker.NamespaceURI */) {\n // Skip the whole namespaced attribute and value. This is by design.\n i += 4;\n continue;\n }\n // In binding mode there are only names, rather than name-value pairs.\n i += bindingsMode ? 1 : 2;\n }\n // We did not match the attribute\n return -1;\n }\n else {\n return matchTemplateAttribute(attrs, name);\n }\n}\nfunction isNodeMatchingSelectorList(tNode, selector, isProjectionMode = false) {\n for (let i = 0; i < selector.length; i++) {\n if (isNodeMatchingSelector(tNode, selector[i], isProjectionMode)) {\n return true;\n }\n }\n return false;\n}\nfunction getProjectAsAttrValue(tNode) {\n const nodeAttrs = tNode.attrs;\n if (nodeAttrs != null) {\n const ngProjectAsAttrIdx = nodeAttrs.indexOf(5 /* AttributeMarker.ProjectAs */);\n // only check for ngProjectAs in attribute names, don't accidentally match attribute's value\n // (attribute names are stored at even indexes)\n if ((ngProjectAsAttrIdx & 1) === 0) {\n return nodeAttrs[ngProjectAsAttrIdx + 1];\n }\n }\n return null;\n}\nfunction getNameOnlyMarkerIndex(nodeAttrs) {\n for (let i = 0; i < nodeAttrs.length; i++) {\n const nodeAttr = nodeAttrs[i];\n if (isNameOnlyAttributeMarker(nodeAttr)) {\n return i;\n }\n }\n return nodeAttrs.length;\n}\nfunction matchTemplateAttribute(attrs, name) {\n let i = attrs.indexOf(4 /* AttributeMarker.Template */);\n if (i > -1) {\n i++;\n while (i < attrs.length) {\n const attr = attrs[i];\n // Return in case we checked all template attrs and are switching to the next section in the\n // attrs array (that starts with a number that represents an attribute marker).\n if (typeof attr === 'number')\n return -1;\n if (attr === name)\n return i;\n i++;\n }\n }\n return -1;\n}\n/**\n * Checks whether a selector is inside a CssSelectorList\n * @param selector Selector to be checked.\n * @param list List in which to look for the selector.\n */\nfunction isSelectorInSelectorList(selector, list) {\n selectorListLoop: for (let i = 0; i < list.length; i++) {\n const currentSelectorInList = list[i];\n if (selector.length !== currentSelectorInList.length) {\n continue;\n }\n for (let j = 0; j < selector.length; j++) {\n if (selector[j] !== currentSelectorInList[j]) {\n continue selectorListLoop;\n }\n }\n return true;\n }\n return false;\n}\nfunction maybeWrapInNotSelector(isNegativeMode, chunk) {\n return isNegativeMode ? ':not(' + chunk.trim() + ')' : chunk;\n}\nfunction stringifyCSSSelector(selector) {\n let result = selector[0];\n let i = 1;\n let mode = 2 /* SelectorFlags.ATTRIBUTE */;\n let currentChunk = '';\n let isNegativeMode = false;\n while (i < selector.length) {\n let valueOrMarker = selector[i];\n if (typeof valueOrMarker === 'string') {\n if (mode & 2 /* SelectorFlags.ATTRIBUTE */) {\n const attrValue = selector[++i];\n currentChunk +=\n '[' + valueOrMarker + (attrValue.length > 0 ? '=\"' + attrValue + '\"' : '') + ']';\n }\n else if (mode & 8 /* SelectorFlags.CLASS */) {\n currentChunk += '.' + valueOrMarker;\n }\n else if (mode & 4 /* SelectorFlags.ELEMENT */) {\n currentChunk += ' ' + valueOrMarker;\n }\n }\n else {\n //\n // Append current chunk to the final result in case we come across SelectorFlag, which\n // indicates that the previous section of a selector is over. We need to accumulate content\n // between flags to make sure we wrap the chunk later in :not() selector if needed, e.g.\n // ```\n // ['', Flags.CLASS, '.classA', Flags.CLASS | Flags.NOT, '.classB', '.classC']\n // ```\n // should be transformed to `.classA :not(.classB .classC)`.\n //\n // Note: for negative selector part, we accumulate content between flags until we find the\n // next negative flag. This is needed to support a case where `:not()` rule contains more than\n // one chunk, e.g. the following selector:\n // ```\n // ['', Flags.ELEMENT | Flags.NOT, 'p', Flags.CLASS, 'foo', Flags.CLASS | Flags.NOT, 'bar']\n // ```\n // should be stringified to `:not(p.foo) :not(.bar)`\n //\n if (currentChunk !== '' && !isPositive(valueOrMarker)) {\n result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n currentChunk = '';\n }\n mode = valueOrMarker;\n // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative\n // mode is maintained for remaining chunks of a selector.\n isNegativeMode = isNegativeMode || !isPositive(mode);\n }\n i++;\n }\n if (currentChunk !== '') {\n result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n }\n return result;\n}\n/**\n * Generates string representation of CSS selector in parsed form.\n *\n * ComponentDef and DirectiveDef are generated with the selector in parsed form to avoid doing\n * additional parsing at runtime (for example, for directive matching). However in some cases (for\n * example, while bootstrapping a component), a string version of the selector is required to query\n * for the host element on the page. This function takes the parsed form of a selector and returns\n * its string representation.\n *\n * @param selectorList selector in parsed form\n * @returns string representation of a given selector\n */\nfunction stringifyCSSSelectorList(selectorList) {\n return selectorList.map(stringifyCSSSelector).join(',');\n}\n/**\n * Extracts attributes and classes information from a given CSS selector.\n *\n * This function is used while creating a component dynamically. In this case, the host element\n * (that is created dynamically) should contain attributes and classes specified in component's CSS\n * selector.\n *\n * @param selector CSS selector in parsed form (in a form of array)\n * @returns object with `attrs` and `classes` fields that contain extracted information\n */\nfunction extractAttrsAndClassesFromSelector(selector) {\n const attrs = [];\n const classes = [];\n let i = 1;\n let mode = 2 /* SelectorFlags.ATTRIBUTE */;\n while (i < selector.length) {\n let valueOrMarker = selector[i];\n if (typeof valueOrMarker === 'string') {\n if (mode === 2 /* SelectorFlags.ATTRIBUTE */) {\n if (valueOrMarker !== '') {\n attrs.push(valueOrMarker, selector[++i]);\n }\n }\n else if (mode === 8 /* SelectorFlags.CLASS */) {\n classes.push(valueOrMarker);\n }\n }\n else {\n // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative\n // mode is maintained for remaining chunks of a selector. Since attributes and classes are\n // extracted only for \"positive\" part of the selector, we can stop here.\n if (!isPositive(mode))\n break;\n mode = valueOrMarker;\n }\n i++;\n }\n return { attrs, classes };\n}\n\n/**\n * Create a component definition object.\n *\n *\n * # Example\n * ```\n * class MyComponent {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ɵcmp = defineComponent({\n * ...\n * });\n * }\n * ```\n * @codeGenApi\n */\nfunction ɵɵdefineComponent(componentDefinition) {\n return noSideEffects(() => {\n // Initialize ngDevMode. This must be the first statement in ɵɵdefineComponent.\n // See the `initNgDevMode` docstring for more information.\n (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();\n const baseDef = getNgDirectiveDef(componentDefinition);\n const def = {\n ...baseDef,\n decls: componentDefinition.decls,\n vars: componentDefinition.vars,\n template: componentDefinition.template,\n consts: componentDefinition.consts || null,\n ngContentSelectors: componentDefinition.ngContentSelectors,\n onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,\n directiveDefs: null, // assigned in noSideEffects\n pipeDefs: null, // assigned in noSideEffects\n dependencies: (baseDef.standalone && componentDefinition.dependencies) || null,\n getStandaloneInjector: null,\n signals: componentDefinition.signals ?? false,\n data: componentDefinition.data || {},\n encapsulation: componentDefinition.encapsulation || ViewEncapsulation$1.Emulated,\n styles: componentDefinition.styles || EMPTY_ARRAY,\n _: null,\n schemas: componentDefinition.schemas || null,\n tView: null,\n id: '',\n };\n initFeatures(def);\n const dependencies = componentDefinition.dependencies;\n def.directiveDefs = extractDefListOrFactory(dependencies, /* pipeDef */ false);\n def.pipeDefs = extractDefListOrFactory(dependencies, /* pipeDef */ true);\n def.id = getComponentId(def);\n return def;\n });\n}\nfunction extractDirectiveDef(type) {\n return getComponentDef(type) || getDirectiveDef(type);\n}\nfunction nonNull(value) {\n return value !== null;\n}\n/**\n * @codeGenApi\n */\nfunction ɵɵdefineNgModule(def) {\n return noSideEffects(() => {\n const res = {\n type: def.type,\n bootstrap: def.bootstrap || EMPTY_ARRAY,\n declarations: def.declarations || EMPTY_ARRAY,\n imports: def.imports || EMPTY_ARRAY,\n exports: def.exports || EMPTY_ARRAY,\n transitiveCompileScopes: null,\n schemas: def.schemas || null,\n id: def.id || null,\n };\n return res;\n });\n}\nfunction parseAndConvertBindingsForDefinition(obj, declaredInputs) {\n if (obj == null)\n return EMPTY_OBJ;\n const newLookup = {};\n for (const minifiedKey in obj) {\n if (obj.hasOwnProperty(minifiedKey)) {\n const value = obj[minifiedKey];\n let publicName;\n let declaredName;\n let inputFlags = InputFlags.None;\n if (Array.isArray(value)) {\n inputFlags = value[0];\n publicName = value[1];\n declaredName = value[2] ?? publicName; // declared name might not be set to save bytes.\n }\n else {\n publicName = value;\n declaredName = value;\n }\n // For inputs, capture the declared name, or if some flags are set.\n if (declaredInputs) {\n // Perf note: An array is only allocated for the input if there are flags.\n newLookup[publicName] =\n inputFlags !== InputFlags.None ? [minifiedKey, inputFlags] : minifiedKey;\n declaredInputs[publicName] = declaredName;\n }\n else {\n newLookup[publicName] = minifiedKey;\n }\n }\n }\n return newLookup;\n}\n/**\n * Create a directive definition object.\n *\n * # Example\n * ```ts\n * class MyDirective {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ɵdir = ɵɵdefineDirective({\n * ...\n * });\n * }\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵdefineDirective(directiveDefinition) {\n return noSideEffects(() => {\n const def = getNgDirectiveDef(directiveDefinition);\n initFeatures(def);\n return def;\n });\n}\n/**\n * Create a pipe definition object.\n *\n * # Example\n * ```\n * class MyPipe implements PipeTransform {\n * // Generated by Angular Template Compiler\n * static ɵpipe = definePipe({\n * ...\n * });\n * }\n * ```\n * @param pipeDef Pipe definition generated by the compiler\n *\n * @codeGenApi\n */\nfunction ɵɵdefinePipe(pipeDef) {\n return {\n type: pipeDef.type,\n name: pipeDef.name,\n factory: null,\n pure: pipeDef.pure !== false,\n standalone: pipeDef.standalone === true,\n onDestroy: pipeDef.type.prototype.ngOnDestroy || null,\n };\n}\n/**\n * The following getter methods retrieve the definition from the type. Currently the retrieval\n * honors inheritance, but in the future we may change the rule to require that definitions are\n * explicit. This would require some sort of migration strategy.\n */\nfunction getComponentDef(type) {\n return type[NG_COMP_DEF] || null;\n}\nfunction getDirectiveDef(type) {\n return type[NG_DIR_DEF] || null;\n}\nfunction getPipeDef$1(type) {\n return type[NG_PIPE_DEF] || null;\n}\n/**\n * Checks whether a given Component, Directive or Pipe is marked as standalone.\n * This will return false if passed anything other than a Component, Directive, or Pipe class\n * See [this guide](guide/components/importing) for additional information:\n *\n * @param type A reference to a Component, Directive or Pipe.\n * @publicApi\n */\nfunction isStandalone(type) {\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);\n return def !== null ? def.standalone : false;\n}\nfunction getNgModuleDef(type, throwNotFound) {\n const ngModuleDef = type[NG_MOD_DEF] || null;\n if (!ngModuleDef && throwNotFound === true) {\n throw new Error(`Type ${stringify(type)} does not have 'ɵmod' property.`);\n }\n return ngModuleDef;\n}\nfunction getNgDirectiveDef(directiveDefinition) {\n const declaredInputs = {};\n return {\n type: directiveDefinition.type,\n providersResolver: null,\n factory: null,\n hostBindings: directiveDefinition.hostBindings || null,\n hostVars: directiveDefinition.hostVars || 0,\n hostAttrs: directiveDefinition.hostAttrs || null,\n contentQueries: directiveDefinition.contentQueries || null,\n declaredInputs: declaredInputs,\n inputTransforms: null,\n inputConfig: directiveDefinition.inputs || EMPTY_OBJ,\n exportAs: directiveDefinition.exportAs || null,\n standalone: directiveDefinition.standalone === true,\n signals: directiveDefinition.signals === true,\n selectors: directiveDefinition.selectors || EMPTY_ARRAY,\n viewQuery: directiveDefinition.viewQuery || null,\n features: directiveDefinition.features || null,\n setInput: null,\n findHostDirectiveDefs: null,\n hostDirectives: null,\n inputs: parseAndConvertBindingsForDefinition(directiveDefinition.inputs, declaredInputs),\n outputs: parseAndConvertBindingsForDefinition(directiveDefinition.outputs),\n debugInfo: null,\n };\n}\nfunction initFeatures(definition) {\n definition.features?.forEach((fn) => fn(definition));\n}\nfunction extractDefListOrFactory(dependencies, pipeDef) {\n if (!dependencies) {\n return null;\n }\n const defExtractor = pipeDef ? getPipeDef$1 : extractDirectiveDef;\n return () => (typeof dependencies === 'function' ? dependencies() : dependencies)\n .map((dep) => defExtractor(dep))\n .filter(nonNull);\n}\n/**\n * A map that contains the generated component IDs and type.\n */\nconst GENERATED_COMP_IDS = new Map();\n/**\n * A method can returns a component ID from the component definition using a variant of DJB2 hash\n * algorithm.\n */\nfunction getComponentId(componentDef) {\n let hash = 0;\n // We cannot rely solely on the component selector as the same selector can be used in different\n // modules.\n //\n // `componentDef.style` is not used, due to it causing inconsistencies. Ex: when server\n // component styles has no sourcemaps and browsers do.\n //\n // Example:\n // https://github.com/angular/components/blob/d9f82c8f95309e77a6d82fd574c65871e91354c2/src/material/core/option/option.ts#L248\n // https://github.com/angular/components/blob/285f46dc2b4c5b127d356cb7c4714b221f03ce50/src/material/legacy-core/option/option.ts#L32\n const hashSelectors = [\n componentDef.selectors,\n componentDef.ngContentSelectors,\n componentDef.hostVars,\n componentDef.hostAttrs,\n componentDef.consts,\n componentDef.vars,\n componentDef.decls,\n componentDef.encapsulation,\n componentDef.standalone,\n componentDef.signals,\n componentDef.exportAs,\n JSON.stringify(componentDef.inputs),\n JSON.stringify(componentDef.outputs),\n // We cannot use 'componentDef.type.name' as the name of the symbol will change and will not\n // match in the server and browser bundles.\n Object.getOwnPropertyNames(componentDef.type.prototype),\n !!componentDef.contentQueries,\n !!componentDef.viewQuery,\n ].join('|');\n for (const char of hashSelectors) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) << 0;\n }\n // Force positive number hash.\n // 2147483647 = equivalent of Integer.MAX_VALUE.\n hash += 2147483647 + 1;\n const compId = 'c' + hash;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (GENERATED_COMP_IDS.has(compId)) {\n const previousCompDefType = GENERATED_COMP_IDS.get(compId);\n if (previousCompDefType !== componentDef.type) {\n console.warn(formatRuntimeError(-912 /* RuntimeErrorCode.COMPONENT_ID_COLLISION */, `Component ID generation collision detected. Components '${previousCompDefType.name}' and '${componentDef.type.name}' with selector '${stringifyCSSSelectorList(componentDef.selectors)}' generated the same component ID. To fix this, you can change the selector of one of those components or add an extra host attribute to force a different ID.`));\n }\n }\n else {\n GENERATED_COMP_IDS.set(compId, componentDef.type);\n }\n }\n return compId;\n}\n\n/**\n * Wrap an array of `Provider`s into `EnvironmentProviders`, preventing them from being accidentally\n * referenced in `@Component` in a component injector.\n */\nfunction makeEnvironmentProviders(providers) {\n return {\n ɵproviders: providers,\n };\n}\n/**\n * Collects providers from all NgModules and standalone components, including transitively imported\n * ones.\n *\n * Providers extracted via `importProvidersFrom` are only usable in an application injector or\n * another environment injector (such as a route injector). They should not be used in component\n * providers.\n *\n * More information about standalone components can be found in [this\n * guide](guide/components/importing).\n *\n * @usageNotes\n * The results of the `importProvidersFrom` call can be used in the `bootstrapApplication` call:\n *\n * ```typescript\n * await bootstrapApplication(RootComponent, {\n * providers: [\n * importProvidersFrom(NgModuleOne, NgModuleTwo)\n * ]\n * });\n * ```\n *\n * You can also use the `importProvidersFrom` results in the `providers` field of a route, when a\n * standalone component is used:\n *\n * ```typescript\n * export const ROUTES: Route[] = [\n * {\n * path: 'foo',\n * providers: [\n * importProvidersFrom(NgModuleOne, NgModuleTwo)\n * ],\n * component: YourStandaloneComponent\n * }\n * ];\n * ```\n *\n * @returns Collected providers from the specified list of types.\n * @publicApi\n */\nfunction importProvidersFrom(...sources) {\n return {\n ɵproviders: internalImportProvidersFrom(true, sources),\n ɵfromNgModule: true,\n };\n}\nfunction internalImportProvidersFrom(checkForStandaloneCmp, ...sources) {\n const providersOut = [];\n const dedup = new Set(); // already seen types\n let injectorTypesWithProviders;\n const collectProviders = (provider) => {\n providersOut.push(provider);\n };\n deepForEach(sources, (source) => {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && checkForStandaloneCmp) {\n const cmpDef = getComponentDef(source);\n if (cmpDef?.standalone) {\n throw new RuntimeError(800 /* RuntimeErrorCode.IMPORT_PROVIDERS_FROM_STANDALONE */, `Importing providers supports NgModule or ModuleWithProviders but got a standalone component \"${stringifyForError(source)}\"`);\n }\n }\n // Narrow `source` to access the internal type analogue for `ModuleWithProviders`.\n const internalSource = source;\n if (walkProviderTree(internalSource, collectProviders, [], dedup)) {\n injectorTypesWithProviders ||= [];\n injectorTypesWithProviders.push(internalSource);\n }\n });\n // Collect all providers from `ModuleWithProviders` types.\n if (injectorTypesWithProviders !== undefined) {\n processInjectorTypesWithProviders(injectorTypesWithProviders, collectProviders);\n }\n return providersOut;\n}\n/**\n * Collects all providers from the list of `ModuleWithProviders` and appends them to the provided\n * array.\n */\nfunction processInjectorTypesWithProviders(typesWithProviders, visitor) {\n for (let i = 0; i < typesWithProviders.length; i++) {\n const { ngModule, providers } = typesWithProviders[i];\n deepForEachProvider(providers, (provider) => {\n ngDevMode && validateProvider(provider, providers || EMPTY_ARRAY, ngModule);\n visitor(provider, ngModule);\n });\n }\n}\n/**\n * The logic visits an `InjectorType`, an `InjectorTypeWithProviders`, or a standalone\n * `ComponentType`, and all of its transitive providers and collects providers.\n *\n * If an `InjectorTypeWithProviders` that declares providers besides the type is specified,\n * the function will return \"true\" to indicate that the providers of the type definition need\n * to be processed. This allows us to process providers of injector types after all imports of\n * an injector definition are processed. (following View Engine semantics: see FW-1349)\n */\nfunction walkProviderTree(container, visitor, parents, dedup) {\n container = resolveForwardRef(container);\n if (!container)\n return false;\n // The actual type which had the definition. Usually `container`, but may be an unwrapped type\n // from `InjectorTypeWithProviders`.\n let defType = null;\n let injDef = getInjectorDef(container);\n const cmpDef = !injDef && getComponentDef(container);\n if (!injDef && !cmpDef) {\n // `container` is not an injector type or a component type. It might be:\n // * An `InjectorTypeWithProviders` that wraps an injector type.\n // * A standalone directive or pipe that got pulled in from a standalone component's\n // dependencies.\n // Try to unwrap it as an `InjectorTypeWithProviders` first.\n const ngModule = container\n .ngModule;\n injDef = getInjectorDef(ngModule);\n if (injDef) {\n defType = ngModule;\n }\n else {\n // Not a component or injector type, so ignore it.\n return false;\n }\n }\n else if (cmpDef && !cmpDef.standalone) {\n return false;\n }\n else {\n defType = container;\n }\n // Check for circular dependencies.\n if (ngDevMode && parents.indexOf(defType) !== -1) {\n const defName = stringify(defType);\n const path = parents.map(stringify);\n throwCyclicDependencyError(defName, path);\n }\n // Check for multiple imports of the same module\n const isDuplicate = dedup.has(defType);\n if (cmpDef) {\n if (isDuplicate) {\n // This component definition has already been processed.\n return false;\n }\n dedup.add(defType);\n if (cmpDef.dependencies) {\n const deps = typeof cmpDef.dependencies === 'function' ? cmpDef.dependencies() : cmpDef.dependencies;\n for (const dep of deps) {\n walkProviderTree(dep, visitor, parents, dedup);\n }\n }\n }\n else if (injDef) {\n // First, include providers from any imports.\n if (injDef.imports != null && !isDuplicate) {\n // Before processing defType's imports, add it to the set of parents. This way, if it ends\n // up deeply importing itself, this can be detected.\n ngDevMode && parents.push(defType);\n // Add it to the set of dedups. This way we can detect multiple imports of the same module\n dedup.add(defType);\n let importTypesWithProviders;\n try {\n deepForEach(injDef.imports, (imported) => {\n if (walkProviderTree(imported, visitor, parents, dedup)) {\n importTypesWithProviders ||= [];\n // If the processed import is an injector type with providers, we store it in the\n // list of import types with providers, so that we can process those afterwards.\n importTypesWithProviders.push(imported);\n }\n });\n }\n finally {\n // Remove it from the parents set when finished.\n ngDevMode && parents.pop();\n }\n // Imports which are declared with providers (TypeWithProviders) need to be processed\n // after all imported modules are processed. This is similar to how View Engine\n // processes/merges module imports in the metadata resolver. See: FW-1349.\n if (importTypesWithProviders !== undefined) {\n processInjectorTypesWithProviders(importTypesWithProviders, visitor);\n }\n }\n if (!isDuplicate) {\n // Track the InjectorType and add a provider for it.\n // It's important that this is done after the def's imports.\n const factory = getFactoryDef(defType) || (() => new defType());\n // Append extra providers to make more info available for consumers (to retrieve an injector\n // type), as well as internally (to calculate an injection scope correctly and eagerly\n // instantiate a `defType` when an injector is created).\n // Provider to create `defType` using its factory.\n visitor({ provide: defType, useFactory: factory, deps: EMPTY_ARRAY }, defType);\n // Make this `defType` available to an internal logic that calculates injector scope.\n visitor({ provide: INJECTOR_DEF_TYPES, useValue: defType, multi: true }, defType);\n // Provider to eagerly instantiate `defType` via `INJECTOR_INITIALIZER`.\n visitor({ provide: ENVIRONMENT_INITIALIZER, useValue: () => ɵɵinject(defType), multi: true }, defType);\n }\n // Next, include providers listed on the definition itself.\n const defProviders = injDef.providers;\n if (defProviders != null && !isDuplicate) {\n const injectorType = container;\n deepForEachProvider(defProviders, (provider) => {\n ngDevMode && validateProvider(provider, defProviders, injectorType);\n visitor(provider, injectorType);\n });\n }\n }\n else {\n // Should not happen, but just in case.\n return false;\n }\n return (defType !== container && container.providers !== undefined);\n}\nfunction validateProvider(provider, providers, containerType) {\n if (isTypeProvider(provider) ||\n isValueProvider(provider) ||\n isFactoryProvider(provider) ||\n isExistingProvider(provider)) {\n return;\n }\n // Here we expect the provider to be a `useClass` provider (by elimination).\n const classRef = resolveForwardRef(provider && (provider.useClass || provider.provide));\n if (!classRef) {\n throwInvalidProviderError(containerType, providers, provider);\n }\n}\nfunction deepForEachProvider(providers, fn) {\n for (let provider of providers) {\n if (isEnvironmentProviders(provider)) {\n provider = provider.ɵproviders;\n }\n if (Array.isArray(provider)) {\n deepForEachProvider(provider, fn);\n }\n else {\n fn(provider);\n }\n }\n}\nconst USE_VALUE$1 = getClosureSafeProperty({\n provide: String,\n useValue: getClosureSafeProperty,\n});\nfunction isValueProvider(value) {\n return value !== null && typeof value == 'object' && USE_VALUE$1 in value;\n}\nfunction isExistingProvider(value) {\n return !!(value && value.useExisting);\n}\nfunction isFactoryProvider(value) {\n return !!(value && value.useFactory);\n}\nfunction isTypeProvider(value) {\n return typeof value === 'function';\n}\nfunction isClassProvider(value) {\n return !!value.useClass;\n}\n\n/**\n * An internal token whose presence in an injector indicates that the injector should treat itself\n * as a root scoped injector when processing requests for unknown tokens which may indicate\n * they are provided in the root scope.\n */\nconst INJECTOR_SCOPE = new InjectionToken(ngDevMode ? 'Set Injector scope.' : '');\n\n/**\n * Marker which indicates that a value has not yet been created from the factory function.\n */\nconst NOT_YET = {};\n/**\n * Marker which indicates that the factory function for a token is in the process of being called.\n *\n * If the injector is asked to inject a token with its value set to CIRCULAR, that indicates\n * injection of a dependency has recursively attempted to inject the original token, and there is\n * a circular dependency among the providers.\n */\nconst CIRCULAR = {};\n/**\n * A lazily initialized NullInjector.\n */\nlet NULL_INJECTOR = undefined;\nfunction getNullInjector() {\n if (NULL_INJECTOR === undefined) {\n NULL_INJECTOR = new NullInjector();\n }\n return NULL_INJECTOR;\n}\n/**\n * An `Injector` that's part of the environment injector hierarchy, which exists outside of the\n * component tree.\n */\nclass EnvironmentInjector {\n}\nclass R3Injector extends EnvironmentInjector {\n /**\n * Flag indicating that this injector was previously destroyed.\n */\n get destroyed() {\n return this._destroyed;\n }\n constructor(providers, parent, source, scopes) {\n super();\n this.parent = parent;\n this.source = source;\n this.scopes = scopes;\n /**\n * Map of tokens to records which contain the instances of those tokens.\n * - `null` value implies that we don't have the record. Used by tree-shakable injectors\n * to prevent further searches.\n */\n this.records = new Map();\n /**\n * Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.\n */\n this._ngOnDestroyHooks = new Set();\n this._onDestroyHooks = [];\n this._destroyed = false;\n // Start off by creating Records for every provider.\n forEachSingleProvider(providers, (provider) => this.processProvider(provider));\n // Make sure the INJECTOR token provides this injector.\n this.records.set(INJECTOR$1, makeRecord(undefined, this));\n // And `EnvironmentInjector` if the current injector is supposed to be env-scoped.\n if (scopes.has('environment')) {\n this.records.set(EnvironmentInjector, makeRecord(undefined, this));\n }\n // Detect whether this injector has the APP_ROOT_SCOPE token and thus should provide\n // any injectable scoped to APP_ROOT_SCOPE.\n const record = this.records.get(INJECTOR_SCOPE);\n if (record != null && typeof record.value === 'string') {\n this.scopes.add(record.value);\n }\n this.injectorDefTypes = new Set(this.get(INJECTOR_DEF_TYPES, EMPTY_ARRAY, InjectFlags.Self));\n }\n /**\n * Destroy the injector and release references to every instance or provider associated with it.\n *\n * Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a\n * hook was found.\n */\n destroy() {\n this.assertNotDestroyed();\n // Set destroyed = true first, in case lifecycle hooks re-enter destroy().\n this._destroyed = true;\n const prevConsumer = setActiveConsumer$1(null);\n try {\n // Call all the lifecycle hooks.\n for (const service of this._ngOnDestroyHooks) {\n service.ngOnDestroy();\n }\n const onDestroyHooks = this._onDestroyHooks;\n // Reset the _onDestroyHooks array before iterating over it to prevent hooks that unregister\n // themselves from mutating the array during iteration.\n this._onDestroyHooks = [];\n for (const hook of onDestroyHooks) {\n hook();\n }\n }\n finally {\n // Release all references.\n this.records.clear();\n this._ngOnDestroyHooks.clear();\n this.injectorDefTypes.clear();\n setActiveConsumer$1(prevConsumer);\n }\n }\n onDestroy(callback) {\n this.assertNotDestroyed();\n this._onDestroyHooks.push(callback);\n return () => this.removeOnDestroy(callback);\n }\n runInContext(fn) {\n this.assertNotDestroyed();\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n let prevInjectContext;\n if (ngDevMode) {\n prevInjectContext = setInjectorProfilerContext({ injector: this, token: null });\n }\n try {\n return fn();\n }\n finally {\n setCurrentInjector(previousInjector);\n setInjectImplementation(previousInjectImplementation);\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n }\n }\n get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {\n this.assertNotDestroyed();\n if (token.hasOwnProperty(NG_ENV_ID)) {\n return token[NG_ENV_ID](this);\n }\n flags = convertToBitFlags(flags);\n // Set the injection context.\n let prevInjectContext;\n if (ngDevMode) {\n prevInjectContext = setInjectorProfilerContext({ injector: this, token: token });\n }\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n // Check for the SkipSelf flag.\n if (!(flags & InjectFlags.SkipSelf)) {\n // SkipSelf isn't set, check if the record belongs to this injector.\n let record = this.records.get(token);\n if (record === undefined) {\n // No record, but maybe the token is scoped to this injector. Look for an injectable\n // def with a scope matching this injector.\n const def = couldBeInjectableType(token) && getInjectableDef(token);\n if (def && this.injectableDefInScope(def)) {\n // Found an injectable def and it's scoped to this injector. Pretend as if it was here\n // all along.\n if (ngDevMode) {\n runInInjectorProfilerContext(this, token, () => {\n emitProviderConfiguredEvent(token);\n });\n }\n record = makeRecord(injectableDefOrInjectorDefFactory(token), NOT_YET);\n }\n else {\n record = null;\n }\n this.records.set(token, record);\n }\n // If a record was found, get the instance for it and return it.\n if (record != null /* NOT null || undefined */) {\n return this.hydrate(token, record);\n }\n }\n // Select the next injector based on the Self flag - if self is set, the next injector is\n // the NullInjector, otherwise it's the parent.\n const nextInjector = !(flags & InjectFlags.Self) ? this.parent : getNullInjector();\n // Set the notFoundValue based on the Optional flag - if optional is set and notFoundValue\n // is undefined, the value is null, otherwise it's the notFoundValue.\n notFoundValue =\n flags & InjectFlags.Optional && notFoundValue === THROW_IF_NOT_FOUND ? null : notFoundValue;\n return nextInjector.get(token, notFoundValue);\n }\n catch (e) {\n if (e.name === 'NullInjectorError') {\n const path = (e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || []);\n path.unshift(stringify(token));\n if (previousInjector) {\n // We still have a parent injector, keep throwing\n throw e;\n }\n else {\n // Format & throw the final error message when we don't have any previous injector\n return catchInjectorError(e, token, 'R3InjectorError', this.source);\n }\n }\n else {\n throw e;\n }\n }\n finally {\n // Lastly, restore the previous injection context.\n setInjectImplementation(previousInjectImplementation);\n setCurrentInjector(previousInjector);\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n }\n }\n /** @internal */\n resolveInjectorInitializers() {\n const prevConsumer = setActiveConsumer$1(null);\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n let prevInjectContext;\n if (ngDevMode) {\n prevInjectContext = setInjectorProfilerContext({ injector: this, token: null });\n }\n try {\n const initializers = this.get(ENVIRONMENT_INITIALIZER, EMPTY_ARRAY, InjectFlags.Self);\n if (ngDevMode && !Array.isArray(initializers)) {\n throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `ENVIRONMENT_INITIALIZER` token value ' +\n `(expected an array, but got ${typeof initializers}). ` +\n 'Please check that the `ENVIRONMENT_INITIALIZER` token is configured as a ' +\n '`multi: true` provider.');\n }\n for (const initializer of initializers) {\n initializer();\n }\n }\n finally {\n setCurrentInjector(previousInjector);\n setInjectImplementation(previousInjectImplementation);\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n setActiveConsumer$1(prevConsumer);\n }\n }\n toString() {\n const tokens = [];\n const records = this.records;\n for (const token of records.keys()) {\n tokens.push(stringify(token));\n }\n return `R3Injector[${tokens.join(', ')}]`;\n }\n assertNotDestroyed() {\n if (this._destroyed) {\n throw new RuntimeError(205 /* RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED */, ngDevMode && 'Injector has already been destroyed.');\n }\n }\n /**\n * Process a `SingleProvider` and add it.\n */\n processProvider(provider) {\n // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n // property.\n provider = resolveForwardRef(provider);\n let token = isTypeProvider(provider)\n ? provider\n : resolveForwardRef(provider && provider.provide);\n // Construct a `Record` for the provider.\n const record = providerToRecord(provider);\n if (ngDevMode) {\n runInInjectorProfilerContext(this, token, () => {\n // Emit InjectorProfilerEventType.Create if provider is a value provider because\n // these are the only providers that do not go through the value hydration logic\n // where this event would normally be emitted from.\n if (isValueProvider(provider)) {\n emitInstanceCreatedByInjectorEvent(provider.useValue);\n }\n emitProviderConfiguredEvent(provider);\n });\n }\n if (!isTypeProvider(provider) && provider.multi === true) {\n // If the provider indicates that it's a multi-provider, process it specially.\n // First check whether it's been defined already.\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n // It has. Throw a nice error if\n if (ngDevMode && multiRecord.multi === undefined) {\n throwMixedMultiProviderError();\n }\n }\n else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord.multi);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi.push(provider);\n }\n else {\n if (ngDevMode) {\n const existing = this.records.get(token);\n if (existing && existing.multi !== undefined) {\n throwMixedMultiProviderError();\n }\n }\n }\n this.records.set(token, record);\n }\n hydrate(token, record) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n if (ngDevMode && record.value === CIRCULAR) {\n throwCyclicDependencyError(stringify(token));\n }\n else if (record.value === NOT_YET) {\n record.value = CIRCULAR;\n if (ngDevMode) {\n runInInjectorProfilerContext(this, token, () => {\n record.value = record.factory();\n emitInstanceCreatedByInjectorEvent(record.value);\n });\n }\n else {\n record.value = record.factory();\n }\n }\n if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {\n this._ngOnDestroyHooks.add(record.value);\n }\n return record.value;\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n injectableDefInScope(def) {\n if (!def.providedIn) {\n return false;\n }\n const providedIn = resolveForwardRef(def.providedIn);\n if (typeof providedIn === 'string') {\n return providedIn === 'any' || this.scopes.has(providedIn);\n }\n else {\n return this.injectorDefTypes.has(providedIn);\n }\n }\n removeOnDestroy(callback) {\n const destroyCBIdx = this._onDestroyHooks.indexOf(callback);\n if (destroyCBIdx !== -1) {\n this._onDestroyHooks.splice(destroyCBIdx, 1);\n }\n }\n}\nfunction injectableDefOrInjectorDefFactory(token) {\n // Most tokens will have an injectable def directly on them, which specifies a factory directly.\n const injectableDef = getInjectableDef(token);\n const factory = injectableDef !== null ? injectableDef.factory : getFactoryDef(token);\n if (factory !== null) {\n return factory;\n }\n // InjectionTokens should have an injectable def (ɵprov) and thus should be handled above.\n // If it's missing that, it's an error.\n if (token instanceof InjectionToken) {\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Token ${stringify(token)} is missing a ɵprov definition.`);\n }\n // Undecorated types can sometimes be created if they have no constructor arguments.\n if (token instanceof Function) {\n return getUndecoratedInjectableFactory(token);\n }\n // There was no way to resolve a factory for this token.\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && 'unreachable');\n}\nfunction getUndecoratedInjectableFactory(token) {\n // If the token has parameters then it has dependencies that we cannot resolve implicitly.\n const paramLength = token.length;\n if (paramLength > 0) {\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode &&\n `Can't resolve all parameters for ${stringify(token)}: (${newArray(paramLength, '?').join(', ')}).`);\n }\n // The constructor function appears to have no parameters.\n // This might be because it inherits from a super-class. In which case, use an injectable\n // def from an ancestor if there is one.\n // Otherwise this really is a simple class with no dependencies, so return a factory that\n // just instantiates the zero-arg constructor.\n const inheritedInjectableDef = getInheritedInjectableDef(token);\n if (inheritedInjectableDef !== null) {\n return () => inheritedInjectableDef.factory(token);\n }\n else {\n return () => new token();\n }\n}\nfunction providerToRecord(provider) {\n if (isValueProvider(provider)) {\n return makeRecord(undefined, provider.useValue);\n }\n else {\n const factory = providerToFactory(provider);\n return makeRecord(factory, NOT_YET);\n }\n}\n/**\n * Converts a `SingleProvider` into a factory function.\n *\n * @param provider provider to convert to factory\n */\nfunction providerToFactory(provider, ngModuleType, providers) {\n let factory = undefined;\n if (ngDevMode && isEnvironmentProviders(provider)) {\n throwInvalidProviderError(undefined, providers, provider);\n }\n if (isTypeProvider(provider)) {\n const unwrappedProvider = resolveForwardRef(provider);\n return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);\n }\n else {\n if (isValueProvider(provider)) {\n factory = () => resolveForwardRef(provider.useValue);\n }\n else if (isFactoryProvider(provider)) {\n factory = () => provider.useFactory(...injectArgs(provider.deps || []));\n }\n else if (isExistingProvider(provider)) {\n factory = () => ɵɵinject(resolveForwardRef(provider.useExisting));\n }\n else {\n const classRef = resolveForwardRef(provider &&\n (provider.useClass || provider.provide));\n if (ngDevMode && !classRef) {\n throwInvalidProviderError(ngModuleType, providers, provider);\n }\n if (hasDeps(provider)) {\n factory = () => new classRef(...injectArgs(provider.deps));\n }\n else {\n return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef);\n }\n }\n }\n return factory;\n}\nfunction makeRecord(factory, value, multi = false) {\n return {\n factory: factory,\n value: value,\n multi: multi ? [] : undefined,\n };\n}\nfunction hasDeps(value) {\n return !!value.deps;\n}\nfunction hasOnDestroy(value) {\n return (value !== null &&\n typeof value === 'object' &&\n typeof value.ngOnDestroy === 'function');\n}\nfunction couldBeInjectableType(value) {\n return (typeof value === 'function' || (typeof value === 'object' && value instanceof InjectionToken));\n}\nfunction forEachSingleProvider(providers, fn) {\n for (const provider of providers) {\n if (Array.isArray(provider)) {\n forEachSingleProvider(provider, fn);\n }\n else if (provider && isEnvironmentProviders(provider)) {\n forEachSingleProvider(provider.ɵproviders, fn);\n }\n else {\n fn(provider);\n }\n }\n}\n\n/**\n * Runs the given function in the [context](guide/di/dependency-injection-context) of the given\n * `Injector`.\n *\n * Within the function's stack frame, [`inject`](api/core/inject) can be used to inject dependencies\n * from the given `Injector`. Note that `inject` is only usable synchronously, and cannot be used in\n * any asynchronous callbacks or after any `await` points.\n *\n * @param injector the injector which will satisfy calls to [`inject`](api/core/inject) while `fn`\n * is executing\n * @param fn the closure to be run in the context of `injector`\n * @returns the return value of the function, if any\n * @publicApi\n */\nfunction runInInjectionContext(injector, fn) {\n if (injector instanceof R3Injector) {\n injector.assertNotDestroyed();\n }\n let prevInjectorProfilerContext;\n if (ngDevMode) {\n prevInjectorProfilerContext = setInjectorProfilerContext({ injector, token: null });\n }\n const prevInjector = setCurrentInjector(injector);\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n return fn();\n }\n finally {\n setCurrentInjector(prevInjector);\n ngDevMode && setInjectorProfilerContext(prevInjectorProfilerContext);\n setInjectImplementation(previousInjectImplementation);\n }\n}\n/**\n * Whether the current stack frame is inside an injection context.\n */\nfunction isInInjectionContext() {\n return getInjectImplementation() !== undefined || getCurrentInjector() != null;\n}\n/**\n * Asserts that the current stack frame is within an [injection\n * context](guide/di/dependency-injection-context) and has access to `inject`.\n *\n * @param debugFn a reference to the function making the assertion (used for the error message).\n *\n * @publicApi\n */\nfunction assertInInjectionContext(debugFn) {\n // Taking a `Function` instead of a string name here prevents the unminified name of the function\n // from being retained in the bundle regardless of minification.\n if (!isInInjectionContext()) {\n throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode &&\n debugFn.name +\n '() can only be used within an injection context such as a constructor, a factory function, a field initializer, or a function used with `runInInjectionContext`');\n }\n}\n\nvar FactoryTarget;\n(function (FactoryTarget) {\n FactoryTarget[FactoryTarget[\"Directive\"] = 0] = \"Directive\";\n FactoryTarget[FactoryTarget[\"Component\"] = 1] = \"Component\";\n FactoryTarget[FactoryTarget[\"Injectable\"] = 2] = \"Injectable\";\n FactoryTarget[FactoryTarget[\"Pipe\"] = 3] = \"Pipe\";\n FactoryTarget[FactoryTarget[\"NgModule\"] = 4] = \"NgModule\";\n})(FactoryTarget || (FactoryTarget = {}));\nvar R3TemplateDependencyKind;\n(function (R3TemplateDependencyKind) {\n R3TemplateDependencyKind[R3TemplateDependencyKind[\"Directive\"] = 0] = \"Directive\";\n R3TemplateDependencyKind[R3TemplateDependencyKind[\"Pipe\"] = 1] = \"Pipe\";\n R3TemplateDependencyKind[R3TemplateDependencyKind[\"NgModule\"] = 2] = \"NgModule\";\n})(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));\nvar ViewEncapsulation;\n(function (ViewEncapsulation) {\n ViewEncapsulation[ViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n ViewEncapsulation[ViewEncapsulation[\"None\"] = 2] = \"None\";\n ViewEncapsulation[ViewEncapsulation[\"ShadowDom\"] = 3] = \"ShadowDom\";\n})(ViewEncapsulation || (ViewEncapsulation = {}));\n\nfunction getCompilerFacade(request) {\n const globalNg = _global['ng'];\n if (globalNg && globalNg.ɵcompilerFacade) {\n return globalNg.ɵcompilerFacade;\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Log the type as an error so that a developer can easily navigate to the type from the\n // console.\n console.error(`JIT compilation failed for ${request.kind}`, request.type);\n let message = `The ${request.kind} '${request.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\\n\\n`;\n if (request.usage === 1 /* JitCompilerUsage.PartialDeclaration */) {\n message += `The ${request.kind} is part of a library that has been partially compiled.\\n`;\n message += `However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\\n`;\n message += '\\n';\n message += `Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\\n`;\n }\n else {\n message += `JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\\n`;\n }\n message += `Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\\n`;\n message += `or manually provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.`;\n throw new Error(message);\n }\n else {\n throw new Error('JIT compiler unavailable');\n }\n}\n\n/**\n * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.\n *\n * This should be kept up to date with the public exports of @angular/core.\n */\nconst angularCoreDiEnv = {\n 'ɵɵdefineInjectable': ɵɵdefineInjectable,\n 'ɵɵdefineInjector': ɵɵdefineInjector,\n 'ɵɵinject': ɵɵinject,\n 'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,\n 'resolveForwardRef': resolveForwardRef,\n};\n\n/**\n * @description\n *\n * Represents a type that a Component or other object is instances of.\n *\n * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is represented by\n * the `MyCustomComponent` constructor function.\n *\n * @publicApi\n */\nconst Type = Function;\nfunction isType(v) {\n return typeof v === 'function';\n}\n\n/*\n * #########################\n * Attention: These Regular expressions have to hold even if the code is minified!\n * ##########################\n */\n/**\n * Regular expression that detects pass-through constructors for ES5 output. This Regex\n * intends to capture the common delegation pattern emitted by TypeScript and Babel. Also\n * it intends to capture the pattern where existing constructors have been downleveled from\n * ES2015 to ES5 using TypeScript w/ downlevel iteration. e.g.\n *\n * ```\n * function MyClass() {\n * var _this = _super.apply(this, arguments) || this;\n * ```\n *\n * downleveled to ES5 with `downlevelIteration` for TypeScript < 4.2:\n * ```\n * function MyClass() {\n * var _this = _super.apply(this, __spread(arguments)) || this;\n * ```\n *\n * or downleveled to ES5 with `downlevelIteration` for TypeScript >= 4.2:\n * ```\n * function MyClass() {\n * var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;\n * ```\n *\n * More details can be found in: https://github.com/angular/angular/issues/38453.\n */\nconst ES5_DELEGATE_CTOR = /^function\\s+\\S+\\(\\)\\s*{[\\s\\S]+\\.apply\\(this,\\s*(arguments|(?:[^()]+\\(\\[\\],)?[^()]+\\(arguments\\).*)\\)/;\n/** Regular expression that detects ES2015 classes which extend from other classes. */\nconst ES2015_INHERITED_CLASS = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{/;\n/**\n * Regular expression that detects ES2015 classes which extend from other classes and\n * have an explicit constructor defined.\n */\nconst ES2015_INHERITED_CLASS_WITH_CTOR = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(/;\n/**\n * Regular expression that detects ES2015 classes which extend from other classes\n * and inherit a constructor.\n */\nconst ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(\\)\\s*{[^}]*super\\(\\.\\.\\.arguments\\)/;\n/**\n * Determine whether a stringified type is a class which delegates its constructor\n * to its parent.\n *\n * This is not trivial since compiled code can actually contain a constructor function\n * even if the original source code did not. For instance, when the child class contains\n * an initialized instance property.\n */\nfunction isDelegateCtor(typeStr) {\n return (ES5_DELEGATE_CTOR.test(typeStr) ||\n ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||\n (ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr)));\n}\nclass ReflectionCapabilities {\n constructor(reflect) {\n this._reflect = reflect || _global['Reflect'];\n }\n factory(t) {\n return (...args) => new t(...args);\n }\n /** @internal */\n _zipTypesAndAnnotations(paramTypes, paramAnnotations) {\n let result;\n if (typeof paramTypes === 'undefined') {\n result = newArray(paramAnnotations.length);\n }\n else {\n result = newArray(paramTypes.length);\n }\n for (let i = 0; i < result.length; i++) {\n // TS outputs Object for parameters without types, while Traceur omits\n // the annotations. For now we preserve the Traceur behavior to aid\n // migration, but this can be revisited.\n if (typeof paramTypes === 'undefined') {\n result[i] = [];\n }\n else if (paramTypes[i] && paramTypes[i] != Object) {\n result[i] = [paramTypes[i]];\n }\n else {\n result[i] = [];\n }\n if (paramAnnotations && paramAnnotations[i] != null) {\n result[i] = result[i].concat(paramAnnotations[i]);\n }\n }\n return result;\n }\n _ownParameters(type, parentCtor) {\n const typeStr = type.toString();\n // If we have no decorators, we only have function.length as metadata.\n // In that case, to detect whether a child class declared an own constructor or not,\n // we need to look inside of that constructor to check whether it is\n // just calling the parent.\n // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439\n // that sets 'design:paramtypes' to []\n // if a class inherits from another class but has no ctor declared itself.\n if (isDelegateCtor(typeStr)) {\n return null;\n }\n // Prefer the direct API.\n if (type.parameters && type.parameters !== parentCtor.parameters) {\n return type.parameters;\n }\n // API of tsickle for lowering decorators to properties on the class.\n const tsickleCtorParams = type.ctorParameters;\n if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {\n // Newer tsickle uses a function closure\n // Retain the non-function case for compatibility with older tsickle\n const ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;\n const paramTypes = ctorParameters.map((ctorParam) => ctorParam && ctorParam.type);\n const paramAnnotations = ctorParameters.map((ctorParam) => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n // API for metadata created by invoking the decorators.\n const paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS];\n const paramTypes = this._reflect &&\n this._reflect.getOwnMetadata &&\n this._reflect.getOwnMetadata('design:paramtypes', type);\n if (paramTypes || paramAnnotations) {\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n // If a class has no decorators, at least create metadata\n // based on function.length.\n // Note: We know that this is a real constructor as we checked\n // the content of the constructor above.\n return newArray(type.length);\n }\n parameters(type) {\n // Note: only report metadata if we have at least one class decorator\n // to stay in sync with the static reflector.\n if (!isType(type)) {\n return [];\n }\n const parentCtor = getParentCtor(type);\n let parameters = this._ownParameters(type, parentCtor);\n if (!parameters && parentCtor !== Object) {\n parameters = this.parameters(parentCtor);\n }\n return parameters || [];\n }\n _ownAnnotations(typeOrFunc, parentCtor) {\n // Prefer the direct API.\n if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) {\n let annotations = typeOrFunc.annotations;\n if (typeof annotations === 'function' && annotations.annotations) {\n annotations = annotations.annotations;\n }\n return annotations;\n }\n // API of tsickle for lowering decorators to properties on the class.\n if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) {\n return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators);\n }\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {\n return typeOrFunc[ANNOTATIONS];\n }\n return null;\n }\n annotations(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return [];\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];\n const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];\n return parentAnnotations.concat(ownAnnotations);\n }\n _ownPropMetadata(typeOrFunc, parentCtor) {\n // Prefer the direct API.\n if (typeOrFunc.propMetadata &&\n typeOrFunc.propMetadata !== parentCtor.propMetadata) {\n let propMetadata = typeOrFunc.propMetadata;\n if (typeof propMetadata === 'function' && propMetadata.propMetadata) {\n propMetadata = propMetadata.propMetadata;\n }\n return propMetadata;\n }\n // API of tsickle for lowering decorators to properties on the class.\n if (typeOrFunc.propDecorators &&\n typeOrFunc.propDecorators !== parentCtor.propDecorators) {\n const propDecorators = typeOrFunc.propDecorators;\n const propMetadata = {};\n Object.keys(propDecorators).forEach((prop) => {\n propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);\n });\n return propMetadata;\n }\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {\n return typeOrFunc[PROP_METADATA];\n }\n return null;\n }\n propMetadata(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return {};\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const propMetadata = {};\n if (parentCtor !== Object) {\n const parentPropMetadata = this.propMetadata(parentCtor);\n Object.keys(parentPropMetadata).forEach((propName) => {\n propMetadata[propName] = parentPropMetadata[propName];\n });\n }\n const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);\n if (ownPropMetadata) {\n Object.keys(ownPropMetadata).forEach((propName) => {\n const decorators = [];\n if (propMetadata.hasOwnProperty(propName)) {\n decorators.push(...propMetadata[propName]);\n }\n decorators.push(...ownPropMetadata[propName]);\n propMetadata[propName] = decorators;\n });\n }\n return propMetadata;\n }\n ownPropMetadata(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return {};\n }\n return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};\n }\n hasLifecycleHook(type, lcProperty) {\n return type instanceof Type && lcProperty in type.prototype;\n }\n}\nfunction convertTsickleDecoratorIntoMetadata(decoratorInvocations) {\n if (!decoratorInvocations) {\n return [];\n }\n return decoratorInvocations.map((decoratorInvocation) => {\n const decoratorType = decoratorInvocation.type;\n const annotationCls = decoratorType.annotationCls;\n const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];\n return new annotationCls(...annotationArgs);\n });\n}\nfunction getParentCtor(ctor) {\n const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;\n const parentCtor = parentProto ? parentProto.constructor : null;\n // Note: We always use `Object` as the null value\n // to simplify checking later on.\n return parentCtor || Object;\n}\n\n// Below are constants for LView indices to help us look up LView members\n// without having to remember the specific indices.\n// Uglify will inline these when minifying so there shouldn't be a cost.\nconst HOST = 0;\nconst TVIEW = 1;\n// Shared with LContainer\nconst FLAGS = 2;\nconst PARENT = 3;\nconst NEXT = 4;\nconst T_HOST = 5;\n// End shared with LContainer\nconst HYDRATION = 6;\nconst CLEANUP = 7;\nconst CONTEXT = 8;\nconst INJECTOR = 9;\nconst ENVIRONMENT = 10;\nconst RENDERER = 11;\nconst CHILD_HEAD = 12;\nconst CHILD_TAIL = 13;\n// FIXME(misko): Investigate if the three declarations aren't all same thing.\nconst DECLARATION_VIEW = 14;\nconst DECLARATION_COMPONENT_VIEW = 15;\nconst DECLARATION_LCONTAINER = 16;\nconst PREORDER_HOOK_FLAGS = 17;\nconst QUERIES = 18;\nconst ID = 19;\nconst EMBEDDED_VIEW_INJECTOR = 20;\nconst ON_DESTROY_HOOKS = 21;\nconst EFFECTS_TO_SCHEDULE = 22;\nconst REACTIVE_TEMPLATE_CONSUMER = 23;\n/**\n * Size of LView's header. Necessary to adjust for it when setting slots.\n *\n * IMPORTANT: `HEADER_OFFSET` should only be referred to the in the `ɵɵ*` instructions to translate\n * instruction index into `LView` index. All other indexes should be in the `LView` index space and\n * there should be no need to refer to `HEADER_OFFSET` anywhere else.\n */\nconst HEADER_OFFSET = 25;\n\n/**\n * Special location which allows easy identification of type. If we have an array which was\n * retrieved from the `LView` and that array has `true` at `TYPE` location, we know it is\n * `LContainer`.\n */\nconst TYPE = 1;\n/**\n * Below are constants for LContainer indices to help us look up LContainer members\n * without having to remember the specific indices.\n * Uglify will inline these when minifying so there shouldn't be a cost.\n */\n// FLAGS, PARENT, NEXT, and T_HOST are indices 2, 3, 4, and 5\n// As we already have these constants in LView, we don't need to re-create them.\nconst DEHYDRATED_VIEWS = 6;\nconst NATIVE = 7;\nconst VIEW_REFS = 8;\nconst MOVED_VIEWS = 9;\n/**\n * Size of LContainer's header. Represents the index after which all views in the\n * container will be inserted. We need to keep a record of current views so we know\n * which views are already in the DOM (and don't need to be re-added) and so we can\n * remove views from the DOM when they are no longer required.\n */\nconst CONTAINER_HEADER_OFFSET = 10;\n/** Flags associated with an LContainer (saved in LContainer[FLAGS]) */\nvar LContainerFlags;\n(function (LContainerFlags) {\n LContainerFlags[LContainerFlags[\"None\"] = 0] = \"None\";\n /**\n * Flag to signify that this `LContainer` may have transplanted views which need to be change\n * detected. (see: `LView[DECLARATION_COMPONENT_VIEW])`.\n *\n * This flag, once set, is never unset for the `LContainer`.\n */\n LContainerFlags[LContainerFlags[\"HasTransplantedViews\"] = 2] = \"HasTransplantedViews\";\n})(LContainerFlags || (LContainerFlags = {}));\n\n/**\n * True if `value` is `LView`.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nfunction isLView(value) {\n return Array.isArray(value) && typeof value[TYPE] === 'object';\n}\n/**\n * True if `value` is `LContainer`.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nfunction isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}\nfunction isContentQueryHost(tNode) {\n return (tNode.flags & 4 /* TNodeFlags.hasContentQuery */) !== 0;\n}\nfunction isComponentHost(tNode) {\n return tNode.componentOffset > -1;\n}\nfunction isDirectiveHost(tNode) {\n return (tNode.flags & 1 /* TNodeFlags.isDirectiveHost */) === 1 /* TNodeFlags.isDirectiveHost */;\n}\nfunction isComponentDef(def) {\n return !!def.template;\n}\nfunction isRootView(target) {\n return (target[FLAGS] & 512 /* LViewFlags.IsRoot */) !== 0;\n}\nfunction isProjectionTNode(tNode) {\n return (tNode.type & 16 /* TNodeType.Projection */) === 16 /* TNodeType.Projection */;\n}\nfunction hasI18n(lView) {\n return (lView[FLAGS] & 32 /* LViewFlags.HasI18n */) === 32 /* LViewFlags.HasI18n */;\n}\nfunction isDestroyed(lView) {\n return (lView[FLAGS] & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */;\n}\n\n// [Assert functions do not constraint type when they are guarded by a truthy\n// expression.](https://github.com/microsoft/TypeScript/issues/37295)\nfunction assertTNodeForLView(tNode, lView) {\n assertTNodeForTView(tNode, lView[TVIEW]);\n}\nfunction assertTNodeForTView(tNode, tView) {\n assertTNode(tNode);\n const tData = tView.data;\n for (let i = HEADER_OFFSET; i < tData.length; i++) {\n if (tData[i] === tNode) {\n return;\n }\n }\n throwError('This TNode does not belong to this TView.');\n}\nfunction assertTNode(tNode) {\n assertDefined(tNode, 'TNode must be defined');\n if (!(tNode && typeof tNode === 'object' && tNode.hasOwnProperty('directiveStylingLast'))) {\n throwError('Not of type TNode, got: ' + tNode);\n }\n}\nfunction assertTIcu(tIcu) {\n assertDefined(tIcu, 'Expected TIcu to be defined');\n if (!(typeof tIcu.currentCaseLViewIndex === 'number')) {\n throwError('Object is not of TIcu type.');\n }\n}\nfunction assertComponentType(actual, msg = \"Type passed in is not ComponentType, it does not have 'ɵcmp' property.\") {\n if (!getComponentDef(actual)) {\n throwError(msg);\n }\n}\nfunction assertNgModuleType(actual, msg = \"Type passed in is not NgModuleType, it does not have 'ɵmod' property.\") {\n if (!getNgModuleDef(actual)) {\n throwError(msg);\n }\n}\nfunction assertCurrentTNodeIsParent(isParent) {\n assertEqual(isParent, true, 'currentTNode should be a parent');\n}\nfunction assertHasParent(tNode) {\n assertDefined(tNode, 'currentTNode should exist!');\n assertDefined(tNode.parent, 'currentTNode should have a parent');\n}\nfunction assertLContainer(value) {\n assertDefined(value, 'LContainer must be defined');\n assertEqual(isLContainer(value), true, 'Expecting LContainer');\n}\nfunction assertLViewOrUndefined(value) {\n value && assertEqual(isLView(value), true, 'Expecting LView or undefined or null');\n}\nfunction assertLView(value) {\n assertDefined(value, 'LView must be defined');\n assertEqual(isLView(value), true, 'Expecting LView');\n}\nfunction assertFirstCreatePass(tView, errMessage) {\n assertEqual(tView.firstCreatePass, true, errMessage || 'Should only be called in first create pass.');\n}\nfunction assertFirstUpdatePass(tView, errMessage) {\n assertEqual(tView.firstUpdatePass, true, errMessage || 'Should only be called in first update pass.');\n}\n/**\n * This is a basic sanity check that an object is probably a directive def. DirectiveDef is\n * an interface, so we can't do a direct instanceof check.\n */\nfunction assertDirectiveDef(obj) {\n if (obj.type === undefined || obj.selectors == undefined || obj.inputs === undefined) {\n throwError(`Expected a DirectiveDef/ComponentDef and this object does not seem to have the expected shape.`);\n }\n}\nfunction assertIndexInDeclRange(tView, index) {\n assertBetween(HEADER_OFFSET, tView.bindingStartIndex, index);\n}\nfunction assertIndexInExpandoRange(lView, index) {\n const tView = lView[1];\n assertBetween(tView.expandoStartIndex, lView.length, index);\n}\nfunction assertBetween(lower, upper, index) {\n if (!(lower <= index && index < upper)) {\n throwError(`Index out of range (expecting ${lower} <= ${index} < ${upper})`);\n }\n}\nfunction assertProjectionSlots(lView, errMessage) {\n assertDefined(lView[DECLARATION_COMPONENT_VIEW], 'Component views should exist.');\n assertDefined(lView[DECLARATION_COMPONENT_VIEW][T_HOST].projection, errMessage ||\n 'Components with projection nodes (<ng-content>) must have projection slots defined.');\n}\nfunction assertParentView(lView, errMessage) {\n assertDefined(lView, errMessage || \"Component views should always have a parent view (component's host view)\");\n}\nfunction assertNoDuplicateDirectives(directives) {\n // The array needs at least two elements in order to have duplicates.\n if (directives.length < 2) {\n return;\n }\n const seenDirectives = new Set();\n for (const current of directives) {\n if (seenDirectives.has(current)) {\n throw new RuntimeError(309 /* RuntimeErrorCode.DUPLICATE_DIRECTIVE */, `Directive ${current.type.name} matches multiple times on the same element. ` +\n `Directives can only match an element once.`);\n }\n seenDirectives.add(current);\n }\n}\n/**\n * This is a basic sanity check that the `injectorIndex` seems to point to what looks like a\n * NodeInjector data structure.\n *\n * @param lView `LView` which should be checked.\n * @param injectorIndex index into the `LView` where the `NodeInjector` is expected.\n */\nfunction assertNodeInjector(lView, injectorIndex) {\n assertIndexInExpandoRange(lView, injectorIndex);\n assertIndexInExpandoRange(lView, injectorIndex + 8 /* NodeInjectorOffset.PARENT */);\n assertNumber(lView[injectorIndex + 0], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 1], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 2], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 3], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 4], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 5], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 6], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 7], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */], 'injectorIndex should point to parent injector');\n}\n\n/**\n * Represents a basic change from a previous to a new value for a single\n * property on a directive instance. Passed as a value in a\n * {@link SimpleChanges} object to the `ngOnChanges` hook.\n *\n * @see {@link OnChanges}\n *\n * @publicApi\n */\nclass SimpleChange {\n constructor(previousValue, currentValue, firstChange) {\n this.previousValue = previousValue;\n this.currentValue = currentValue;\n this.firstChange = firstChange;\n }\n /**\n * Check whether the new value is the first value assigned.\n */\n isFirstChange() {\n return this.firstChange;\n }\n}\n\nfunction applyValueToInputField(instance, inputSignalNode, privateName, value) {\n if (inputSignalNode !== null) {\n inputSignalNode.applyValueToInputSignal(inputSignalNode, value);\n }\n else {\n instance[privateName] = value;\n }\n}\n\n/**\n * The NgOnChangesFeature decorates a component with support for the ngOnChanges\n * lifecycle hook, so it should be included in any component that implements\n * that hook.\n *\n * If the component or directive uses inheritance, the NgOnChangesFeature MUST\n * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise\n * inherited properties will not be propagated to the ngOnChanges lifecycle\n * hook.\n *\n * Example usage:\n *\n * ```\n * static ɵcmp = defineComponent({\n * ...\n * inputs: {name: 'publicName'},\n * features: [NgOnChangesFeature]\n * });\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵNgOnChangesFeature() {\n return NgOnChangesFeatureImpl;\n}\nfunction NgOnChangesFeatureImpl(definition) {\n if (definition.type.prototype.ngOnChanges) {\n definition.setInput = ngOnChangesSetInput;\n }\n return rememberChangeHistoryAndInvokeOnChangesHook;\n}\n// This option ensures that the ngOnChanges lifecycle hook will be inherited\n// from superclasses (in InheritDefinitionFeature).\n/** @nocollapse */\n// tslint:disable-next-line:no-toplevel-property-access\nɵɵNgOnChangesFeature.ngInherit = true;\n/**\n * This is a synthetic lifecycle hook which gets inserted into `TView.preOrderHooks` to simulate\n * `ngOnChanges`.\n *\n * The hook reads the `NgSimpleChangesStore` data from the component instance and if changes are\n * found it invokes `ngOnChanges` on the component instance.\n *\n * @param this Component instance. Because this function gets inserted into `TView.preOrderHooks`,\n * it is guaranteed to be called with component instance.\n */\nfunction rememberChangeHistoryAndInvokeOnChangesHook() {\n const simpleChangesStore = getSimpleChangesStore(this);\n const current = simpleChangesStore?.current;\n if (current) {\n const previous = simpleChangesStore.previous;\n if (previous === EMPTY_OBJ) {\n simpleChangesStore.previous = current;\n }\n else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (let key in current) {\n previous[key] = current[key];\n }\n }\n simpleChangesStore.current = null;\n this.ngOnChanges(current);\n }\n}\nfunction ngOnChangesSetInput(instance, inputSignalNode, value, publicName, privateName) {\n const declaredName = this.declaredInputs[publicName];\n ngDevMode && assertString(declaredName, 'Name of input in ngOnChanges has to be a string');\n const simpleChangesStore = getSimpleChangesStore(instance) ||\n setSimpleChangesStore(instance, { previous: EMPTY_OBJ, current: null });\n const current = simpleChangesStore.current || (simpleChangesStore.current = {});\n const previous = simpleChangesStore.previous;\n const previousChange = previous[declaredName];\n current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ);\n applyValueToInputField(instance, inputSignalNode, privateName, value);\n}\nconst SIMPLE_CHANGES_STORE = '__ngSimpleChanges__';\nfunction getSimpleChangesStore(instance) {\n return instance[SIMPLE_CHANGES_STORE] || null;\n}\nfunction setSimpleChangesStore(instance, store) {\n return (instance[SIMPLE_CHANGES_STORE] = store);\n}\n\nlet profilerCallback = null;\n/**\n * Sets the callback function which will be invoked before and after performing certain actions at\n * runtime (for example, before and after running change detection).\n *\n * Warning: this function is *INTERNAL* and should not be relied upon in application's code.\n * The contract of the function might be changed in any release and/or the function can be removed\n * completely.\n *\n * @param profiler function provided by the caller or null value to disable profiling.\n */\nconst setProfiler = (profiler) => {\n profilerCallback = profiler;\n};\n/**\n * Profiler function which wraps user code executed by the runtime.\n *\n * @param event ProfilerEvent corresponding to the execution context\n * @param instance component instance\n * @param hookOrListener lifecycle hook function or output listener. The value depends on the\n * execution context\n * @returns\n */\nconst profiler = function (event, instance, hookOrListener) {\n if (profilerCallback != null /* both `null` and `undefined` */) {\n profilerCallback(event, instance, hookOrListener);\n }\n};\n\nconst SVG_NAMESPACE = 'svg';\nconst MATH_ML_NAMESPACE = 'math';\n\n/**\n * For efficiency reasons we often put several different data types (`RNode`, `LView`, `LContainer`)\n * in same location in `LView`. This is because we don't want to pre-allocate space for it\n * because the storage is sparse. This file contains utilities for dealing with such data types.\n *\n * How do we know what is stored at a given location in `LView`.\n * - `Array.isArray(value) === false` => `RNode` (The normal storage value)\n * - `Array.isArray(value) === true` => then the `value[0]` represents the wrapped value.\n * - `typeof value[TYPE] === 'object'` => `LView`\n * - This happens when we have a component at a given location\n * - `typeof value[TYPE] === true` => `LContainer`\n * - This happens when we have `LContainer` binding at a given location.\n *\n *\n * NOTE: it is assumed that `Array.isArray` and `typeof` operations are very efficient.\n */\n/**\n * Returns `RNode`.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nfunction unwrapRNode(value) {\n while (Array.isArray(value)) {\n value = value[HOST];\n }\n return value;\n}\n/**\n * Returns `LView` or `null` if not found.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nfunction unwrapLView(value) {\n while (Array.isArray(value)) {\n // This check is same as `isLView()` but we don't call at as we don't want to call\n // `Array.isArray()` twice and give JITer more work for inlining.\n if (typeof value[TYPE] === 'object')\n return value;\n value = value[HOST];\n }\n return null;\n}\n/**\n * Retrieves an element value from the provided `viewData`, by unwrapping\n * from any containers, component views, or style contexts.\n */\nfunction getNativeByIndex(index, lView) {\n ngDevMode && assertIndexInRange(lView, index);\n ngDevMode && assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Expected to be past HEADER_OFFSET');\n return unwrapRNode(lView[index]);\n}\n/**\n * Retrieve an `RNode` for a given `TNode` and `LView`.\n *\n * This function guarantees in dev mode to retrieve a non-null `RNode`.\n *\n * @param tNode\n * @param lView\n */\nfunction getNativeByTNode(tNode, lView) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n ngDevMode && assertIndexInRange(lView, tNode.index);\n const node = unwrapRNode(lView[tNode.index]);\n return node;\n}\n/**\n * Retrieve an `RNode` or `null` for a given `TNode` and `LView`.\n *\n * Some `TNode`s don't have associated `RNode`s. For example `Projection`\n *\n * @param tNode\n * @param lView\n */\nfunction getNativeByTNodeOrNull(tNode, lView) {\n const index = tNode === null ? -1 : tNode.index;\n if (index !== -1) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n const node = unwrapRNode(lView[index]);\n return node;\n }\n return null;\n}\n// fixme(misko): The return Type should be `TNode|null`\nfunction getTNode(tView, index) {\n ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode');\n ngDevMode && assertLessThan(index, tView.data.length, 'wrong index for TNode');\n const tNode = tView.data[index];\n ngDevMode && tNode !== null && assertTNode(tNode);\n return tNode;\n}\n/** Retrieves a value from any `LView` or `TData`. */\nfunction load(view, index) {\n ngDevMode && assertIndexInRange(view, index);\n return view[index];\n}\nfunction getComponentLViewByIndex(nodeIndex, hostView) {\n // Could be an LView or an LContainer. If LContainer, unwrap to find LView.\n ngDevMode && assertIndexInRange(hostView, nodeIndex);\n const slotValue = hostView[nodeIndex];\n const lView = isLView(slotValue) ? slotValue : slotValue[HOST];\n return lView;\n}\n/** Checks whether a given view is in creation mode */\nfunction isCreationMode(view) {\n return (view[FLAGS] & 4 /* LViewFlags.CreationMode */) === 4 /* LViewFlags.CreationMode */;\n}\n/**\n * Returns a boolean for whether the view is attached to the change detection tree.\n *\n * Note: This determines whether a view should be checked, not whether it's inserted\n * into a container. For that, you'll want `viewAttachedToContainer` below.\n */\nfunction viewAttachedToChangeDetector(view) {\n return (view[FLAGS] & 128 /* LViewFlags.Attached */) === 128 /* LViewFlags.Attached */;\n}\n/** Returns a boolean for whether the view is attached to a container. */\nfunction viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}\nfunction getConstant(consts, index) {\n if (index === null || index === undefined)\n return null;\n ngDevMode && assertIndexInRange(consts, index);\n return consts[index];\n}\n/**\n * Resets the pre-order hook flags of the view.\n * @param lView the LView on which the flags are reset\n */\nfunction resetPreOrderHookFlags(lView) {\n lView[PREORDER_HOOK_FLAGS] = 0;\n}\n/**\n * Adds the `RefreshView` flag from the lView and updates HAS_CHILD_VIEWS_TO_REFRESH flag of\n * parents.\n */\nfunction markViewForRefresh(lView) {\n if (lView[FLAGS] & 1024 /* LViewFlags.RefreshView */) {\n return;\n }\n lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;\n if (viewAttachedToChangeDetector(lView)) {\n markAncestorsForTraversal(lView);\n }\n}\n/**\n * Walks up the LView hierarchy.\n * @param nestingLevel Number of times to walk up in hierarchy.\n * @param currentView View from which to start the lookup.\n */\nfunction walkUpViews(nestingLevel, currentView) {\n while (nestingLevel > 0) {\n ngDevMode &&\n assertDefined(currentView[DECLARATION_VIEW], 'Declaration view should be defined if nesting level is greater than 0.');\n currentView = currentView[DECLARATION_VIEW];\n nestingLevel--;\n }\n return currentView;\n}\nfunction requiresRefreshOrTraversal(lView) {\n return !!(lView[FLAGS] & (1024 /* LViewFlags.RefreshView */ | 8192 /* LViewFlags.HasChildViewsToRefresh */) ||\n lView[REACTIVE_TEMPLATE_CONSUMER]?.dirty);\n}\n/**\n * Updates the `HasChildViewsToRefresh` flag on the parents of the `LView` as well as the\n * parents above.\n */\nfunction updateAncestorTraversalFlagsOnAttach(lView) {\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(8 /* NotificationSource.ViewAttached */);\n if (lView[FLAGS] & 64 /* LViewFlags.Dirty */) {\n lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;\n }\n if (requiresRefreshOrTraversal(lView)) {\n markAncestorsForTraversal(lView);\n }\n}\n/**\n * Ensures views above the given `lView` are traversed during change detection even when they are\n * not dirty.\n *\n * This is done by setting the `HAS_CHILD_VIEWS_TO_REFRESH` flag up to the root, stopping when the\n * flag is already `true` or the `lView` is detached.\n */\nfunction markAncestorsForTraversal(lView) {\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(0 /* NotificationSource.MarkAncestorsForTraversal */);\n let parent = getLViewParent(lView);\n while (parent !== null) {\n // We stop adding markers to the ancestors once we reach one that already has the marker. This\n // is to avoid needlessly traversing all the way to the root when the marker already exists.\n if (parent[FLAGS] & 8192 /* LViewFlags.HasChildViewsToRefresh */) {\n break;\n }\n parent[FLAGS] |= 8192 /* LViewFlags.HasChildViewsToRefresh */;\n if (!viewAttachedToChangeDetector(parent)) {\n break;\n }\n parent = getLViewParent(parent);\n }\n}\n/**\n * Stores a LView-specific destroy callback.\n */\nfunction storeLViewOnDestroy(lView, onDestroyCallback) {\n if ((lView[FLAGS] & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */) {\n throw new RuntimeError(911 /* RuntimeErrorCode.VIEW_ALREADY_DESTROYED */, ngDevMode && 'View has already been destroyed.');\n }\n if (lView[ON_DESTROY_HOOKS] === null) {\n lView[ON_DESTROY_HOOKS] = [];\n }\n lView[ON_DESTROY_HOOKS].push(onDestroyCallback);\n}\n/**\n * Removes previously registered LView-specific destroy callback.\n */\nfunction removeLViewOnDestroy(lView, onDestroyCallback) {\n if (lView[ON_DESTROY_HOOKS] === null)\n return;\n const destroyCBIdx = lView[ON_DESTROY_HOOKS].indexOf(onDestroyCallback);\n if (destroyCBIdx !== -1) {\n lView[ON_DESTROY_HOOKS].splice(destroyCBIdx, 1);\n }\n}\n/**\n * Gets the parent LView of the passed LView, if the PARENT is an LContainer, will get the parent of\n * that LContainer, which is an LView\n * @param lView the lView whose parent to get\n */\nfunction getLViewParent(lView) {\n ngDevMode && assertLView(lView);\n const parent = lView[PARENT];\n return isLContainer(parent) ? parent[PARENT] : parent;\n}\n\nconst instructionState = {\n lFrame: createLFrame(null),\n bindingsEnabled: true,\n skipHydrationRootTNode: null,\n};\nvar CheckNoChangesMode;\n(function (CheckNoChangesMode) {\n CheckNoChangesMode[CheckNoChangesMode[\"Off\"] = 0] = \"Off\";\n CheckNoChangesMode[CheckNoChangesMode[\"Exhaustive\"] = 1] = \"Exhaustive\";\n CheckNoChangesMode[CheckNoChangesMode[\"OnlyDirtyViews\"] = 2] = \"OnlyDirtyViews\";\n})(CheckNoChangesMode || (CheckNoChangesMode = {}));\n/**\n * In this mode, any changes in bindings will throw an ExpressionChangedAfterChecked error.\n *\n * Necessary to support ChangeDetectorRef.checkNoChanges().\n *\n * The `checkNoChanges` function is invoked only in ngDevMode=true and verifies that no unintended\n * changes exist in the change detector or its children.\n */\nlet _checkNoChangesMode = 0; /* CheckNoChangesMode.Off */\n/**\n * Flag used to indicate that we are in the middle running change detection on a view\n *\n * @see detectChangesInViewWhileDirty\n */\nlet _isRefreshingViews = false;\n/**\n * Returns true if the instruction state stack is empty.\n *\n * Intended to be called from tests only (tree shaken otherwise).\n */\nfunction specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}\nfunction getElementDepthCount() {\n return instructionState.lFrame.elementDepthCount;\n}\nfunction increaseElementDepthCount() {\n instructionState.lFrame.elementDepthCount++;\n}\nfunction decreaseElementDepthCount() {\n instructionState.lFrame.elementDepthCount--;\n}\nfunction getBindingsEnabled() {\n return instructionState.bindingsEnabled;\n}\n/**\n * Returns true if currently inside a skip hydration block.\n * @returns boolean\n */\nfunction isInSkipHydrationBlock$1() {\n return instructionState.skipHydrationRootTNode !== null;\n}\n/**\n * Returns true if this is the root TNode of the skip hydration block.\n * @param tNode the current TNode\n * @returns boolean\n */\nfunction isSkipHydrationRootTNode(tNode) {\n return instructionState.skipHydrationRootTNode === tNode;\n}\n/**\n * Enables directive matching on elements.\n *\n * * Example:\n * ```\n * <my-comp my-directive>\n * Should match component / directive.\n * </my-comp>\n * <div ngNonBindable>\n * <!-- ɵɵdisableBindings() -->\n * <my-comp my-directive>\n * Should not match component / directive because we are in ngNonBindable.\n * </my-comp>\n * <!-- ɵɵenableBindings() -->\n * </div>\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵenableBindings() {\n instructionState.bindingsEnabled = true;\n}\n/**\n * Sets a flag to specify that the TNode is in a skip hydration block.\n * @param tNode the current TNode\n */\nfunction enterSkipHydrationBlock(tNode) {\n instructionState.skipHydrationRootTNode = tNode;\n}\n/**\n * Disables directive matching on element.\n *\n * * Example:\n * ```\n * <my-comp my-directive>\n * Should match component / directive.\n * </my-comp>\n * <div ngNonBindable>\n * <!-- ɵɵdisableBindings() -->\n * <my-comp my-directive>\n * Should not match component / directive because we are in ngNonBindable.\n * </my-comp>\n * <!-- ɵɵenableBindings() -->\n * </div>\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵdisableBindings() {\n instructionState.bindingsEnabled = false;\n}\n/**\n * Clears the root skip hydration node when leaving a skip hydration block.\n */\nfunction leaveSkipHydrationBlock() {\n instructionState.skipHydrationRootTNode = null;\n}\n/**\n * Return the current `LView`.\n */\nfunction getLView() {\n return instructionState.lFrame.lView;\n}\n/**\n * Return the current `TView`.\n */\nfunction getTView() {\n return instructionState.lFrame.tView;\n}\n/**\n * Restores `contextViewData` to the given OpaqueViewState instance.\n *\n * Used in conjunction with the getCurrentView() instruction to save a snapshot\n * of the current view and restore it when listeners are invoked. This allows\n * walking the declaration view tree in listeners to get vars from parent views.\n *\n * @param viewToRestore The OpaqueViewState instance to restore.\n * @returns Context of the restored OpaqueViewState instance.\n *\n * @codeGenApi\n */\nfunction ɵɵrestoreView(viewToRestore) {\n instructionState.lFrame.contextLView = viewToRestore;\n return viewToRestore[CONTEXT];\n}\n/**\n * Clears the view set in `ɵɵrestoreView` from memory. Returns the passed in\n * value so that it can be used as a return value of an instruction.\n *\n * @codeGenApi\n */\nfunction ɵɵresetView(value) {\n instructionState.lFrame.contextLView = null;\n return value;\n}\nfunction getCurrentTNode() {\n let currentTNode = getCurrentTNodePlaceholderOk();\n while (currentTNode !== null && currentTNode.type === 64 /* TNodeType.Placeholder */) {\n currentTNode = currentTNode.parent;\n }\n return currentTNode;\n}\nfunction getCurrentTNodePlaceholderOk() {\n return instructionState.lFrame.currentTNode;\n}\nfunction getCurrentParentTNode() {\n const lFrame = instructionState.lFrame;\n const currentTNode = lFrame.currentTNode;\n return lFrame.isParent ? currentTNode : currentTNode.parent;\n}\nfunction setCurrentTNode(tNode, isParent) {\n ngDevMode && tNode && assertTNodeForTView(tNode, instructionState.lFrame.tView);\n const lFrame = instructionState.lFrame;\n lFrame.currentTNode = tNode;\n lFrame.isParent = isParent;\n}\nfunction isCurrentTNodeParent() {\n return instructionState.lFrame.isParent;\n}\nfunction setCurrentTNodeAsNotParent() {\n instructionState.lFrame.isParent = false;\n}\nfunction getContextLView() {\n const contextLView = instructionState.lFrame.contextLView;\n ngDevMode && assertDefined(contextLView, 'contextLView must be defined.');\n return contextLView;\n}\nfunction isInCheckNoChangesMode() {\n !ngDevMode && throwError('Must never be called in production mode');\n return _checkNoChangesMode !== CheckNoChangesMode.Off;\n}\nfunction isExhaustiveCheckNoChanges() {\n !ngDevMode && throwError('Must never be called in production mode');\n return _checkNoChangesMode === CheckNoChangesMode.Exhaustive;\n}\nfunction setIsInCheckNoChangesMode(mode) {\n !ngDevMode && throwError('Must never be called in production mode');\n _checkNoChangesMode = mode;\n}\nfunction isRefreshingViews() {\n return _isRefreshingViews;\n}\nfunction setIsRefreshingViews(mode) {\n _isRefreshingViews = mode;\n}\n// top level variables should not be exported for performance reasons (PERF_NOTES.md)\nfunction getBindingRoot() {\n const lFrame = instructionState.lFrame;\n let index = lFrame.bindingRootIndex;\n if (index === -1) {\n index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;\n }\n return index;\n}\nfunction getBindingIndex() {\n return instructionState.lFrame.bindingIndex;\n}\nfunction setBindingIndex(value) {\n return (instructionState.lFrame.bindingIndex = value);\n}\nfunction nextBindingIndex() {\n return instructionState.lFrame.bindingIndex++;\n}\nfunction incrementBindingIndex(count) {\n const lFrame = instructionState.lFrame;\n const index = lFrame.bindingIndex;\n lFrame.bindingIndex = lFrame.bindingIndex + count;\n return index;\n}\nfunction isInI18nBlock() {\n return instructionState.lFrame.inI18n;\n}\nfunction setInI18nBlock(isInI18nBlock) {\n instructionState.lFrame.inI18n = isInI18nBlock;\n}\n/**\n * Set a new binding root index so that host template functions can execute.\n *\n * Bindings inside the host template are 0 index. But because we don't know ahead of time\n * how many host bindings we have we can't pre-compute them. For this reason they are all\n * 0 index and we just shift the root so that they match next available location in the LView.\n *\n * @param bindingRootIndex Root index for `hostBindings`\n * @param currentDirectiveIndex `TData[currentDirectiveIndex]` will point to the current directive\n * whose `hostBindings` are being processed.\n */\nfunction setBindingRootForHostBindings(bindingRootIndex, currentDirectiveIndex) {\n const lFrame = instructionState.lFrame;\n lFrame.bindingIndex = lFrame.bindingRootIndex = bindingRootIndex;\n setCurrentDirectiveIndex(currentDirectiveIndex);\n}\n/**\n * When host binding is executing this points to the directive index.\n * `TView.data[getCurrentDirectiveIndex()]` is `DirectiveDef`\n * `LView[getCurrentDirectiveIndex()]` is directive instance.\n */\nfunction getCurrentDirectiveIndex() {\n return instructionState.lFrame.currentDirectiveIndex;\n}\n/**\n * Sets an index of a directive whose `hostBindings` are being processed.\n *\n * @param currentDirectiveIndex `TData` index where current directive instance can be found.\n */\nfunction setCurrentDirectiveIndex(currentDirectiveIndex) {\n instructionState.lFrame.currentDirectiveIndex = currentDirectiveIndex;\n}\n/**\n * Retrieve the current `DirectiveDef` which is active when `hostBindings` instruction is being\n * executed.\n *\n * @param tData Current `TData` where the `DirectiveDef` will be looked up at.\n */\nfunction getCurrentDirectiveDef(tData) {\n const currentDirectiveIndex = instructionState.lFrame.currentDirectiveIndex;\n return currentDirectiveIndex === -1 ? null : tData[currentDirectiveIndex];\n}\nfunction getCurrentQueryIndex() {\n return instructionState.lFrame.currentQueryIndex;\n}\nfunction setCurrentQueryIndex(value) {\n instructionState.lFrame.currentQueryIndex = value;\n}\n/**\n * Returns a `TNode` of the location where the current `LView` is declared at.\n *\n * @param lView an `LView` that we want to find parent `TNode` for.\n */\nfunction getDeclarationTNode(lView) {\n const tView = lView[TVIEW];\n // Return the declaration parent for embedded views\n if (tView.type === 2 /* TViewType.Embedded */) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode;\n }\n // Components don't have `TView.declTNode` because each instance of component could be\n // inserted in different location, hence `TView.declTNode` is meaningless.\n // Falling back to `T_HOST` in case we cross component boundary.\n if (tView.type === 1 /* TViewType.Component */) {\n return lView[T_HOST];\n }\n // Remaining TNode type is `TViewType.Root` which doesn't have a parent TNode.\n return null;\n}\n/**\n * This is a light weight version of the `enterView` which is needed by the DI system.\n *\n * @param lView `LView` location of the DI context.\n * @param tNode `TNode` for DI context\n * @param flags DI context flags. if `SkipSelf` flag is set than we walk up the declaration\n * tree from `tNode` until we find parent declared `TElementNode`.\n * @returns `true` if we have successfully entered DI associated with `tNode` (or with declared\n * `TNode` if `flags` has `SkipSelf`). Failing to enter DI implies that no associated\n * `NodeInjector` can be found and we should instead use `ModuleInjector`.\n * - If `true` than this call must be fallowed by `leaveDI`\n * - If `false` than this call failed and we should NOT call `leaveDI`\n */\nfunction enterDI(lView, tNode, flags) {\n ngDevMode && assertLViewOrUndefined(lView);\n if (flags & InjectFlags.SkipSelf) {\n ngDevMode && assertTNodeForTView(tNode, lView[TVIEW]);\n let parentTNode = tNode;\n let parentLView = lView;\n while (true) {\n ngDevMode && assertDefined(parentTNode, 'Parent TNode should be defined');\n parentTNode = parentTNode.parent;\n if (parentTNode === null && !(flags & InjectFlags.Host)) {\n parentTNode = getDeclarationTNode(parentLView);\n if (parentTNode === null)\n break;\n // In this case, a parent exists and is definitely an element. So it will definitely\n // have an existing lView as the declaration view, which is why we can assume it's defined.\n ngDevMode && assertDefined(parentLView, 'Parent LView should be defined');\n parentLView = parentLView[DECLARATION_VIEW];\n // In Ivy there are Comment nodes that correspond to ngIf and NgFor embedded directives\n // We want to skip those and look only at Elements and ElementContainers to ensure\n // we're looking at true parent nodes, and not content or other types.\n if (parentTNode.type & (2 /* TNodeType.Element */ | 8 /* TNodeType.ElementContainer */)) {\n break;\n }\n }\n else {\n break;\n }\n }\n if (parentTNode === null) {\n // If we failed to find a parent TNode this means that we should use module injector.\n return false;\n }\n else {\n tNode = parentTNode;\n lView = parentLView;\n }\n }\n ngDevMode && assertTNodeForLView(tNode, lView);\n const lFrame = (instructionState.lFrame = allocLFrame());\n lFrame.currentTNode = tNode;\n lFrame.lView = lView;\n return true;\n}\n/**\n * Swap the current lView with a new lView.\n *\n * For performance reasons we store the lView in the top level of the module.\n * This way we minimize the number of properties to read. Whenever a new view\n * is entered we have to store the lView for later, and when the view is\n * exited the state has to be restored\n *\n * @param newView New lView to become active\n * @returns the previously active lView;\n */\nfunction enterView(newView) {\n ngDevMode && assertNotEqual(newView[0], newView[1], '????');\n ngDevMode && assertLViewOrUndefined(newView);\n const newLFrame = allocLFrame();\n if (ngDevMode) {\n assertEqual(newLFrame.isParent, true, 'Expected clean LFrame');\n assertEqual(newLFrame.lView, null, 'Expected clean LFrame');\n assertEqual(newLFrame.tView, null, 'Expected clean LFrame');\n assertEqual(newLFrame.selectedIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.elementDepthCount, 0, 'Expected clean LFrame');\n assertEqual(newLFrame.currentDirectiveIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.currentNamespace, null, 'Expected clean LFrame');\n assertEqual(newLFrame.bindingRootIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.currentQueryIndex, 0, 'Expected clean LFrame');\n }\n const tView = newView[TVIEW];\n instructionState.lFrame = newLFrame;\n ngDevMode && tView.firstChild && assertTNodeForTView(tView.firstChild, tView);\n newLFrame.currentTNode = tView.firstChild;\n newLFrame.lView = newView;\n newLFrame.tView = tView;\n newLFrame.contextLView = newView;\n newLFrame.bindingIndex = tView.bindingStartIndex;\n newLFrame.inI18n = false;\n}\n/**\n * Allocates next free LFrame. This function tries to reuse the `LFrame`s to lower memory pressure.\n */\nfunction allocLFrame() {\n const currentLFrame = instructionState.lFrame;\n const childLFrame = currentLFrame === null ? null : currentLFrame.child;\n const newLFrame = childLFrame === null ? createLFrame(currentLFrame) : childLFrame;\n return newLFrame;\n}\nfunction createLFrame(parent) {\n const lFrame = {\n currentTNode: null,\n isParent: true,\n lView: null,\n tView: null,\n selectedIndex: -1,\n contextLView: null,\n elementDepthCount: 0,\n currentNamespace: null,\n currentDirectiveIndex: -1,\n bindingRootIndex: -1,\n bindingIndex: -1,\n currentQueryIndex: 0,\n parent: parent,\n child: null,\n inI18n: false,\n };\n parent !== null && (parent.child = lFrame); // link the new LFrame for reuse.\n return lFrame;\n}\n/**\n * A lightweight version of leave which is used with DI.\n *\n * This function only resets `currentTNode` and `LView` as those are the only properties\n * used with DI (`enterDI()`).\n *\n * NOTE: This function is reexported as `leaveDI`. However `leaveDI` has return type of `void` where\n * as `leaveViewLight` has `LFrame`. This is so that `leaveViewLight` can be used in `leaveView`.\n */\nfunction leaveViewLight() {\n const oldLFrame = instructionState.lFrame;\n instructionState.lFrame = oldLFrame.parent;\n oldLFrame.currentTNode = null;\n oldLFrame.lView = null;\n return oldLFrame;\n}\n/**\n * This is a lightweight version of the `leaveView` which is needed by the DI system.\n *\n * NOTE: this function is an alias so that we can change the type of the function to have `void`\n * return type.\n */\nconst leaveDI = leaveViewLight;\n/**\n * Leave the current `LView`\n *\n * This pops the `LFrame` with the associated `LView` from the stack.\n *\n * IMPORTANT: We must zero out the `LFrame` values here otherwise they will be retained. This is\n * because for performance reasons we don't release `LFrame` but rather keep it for next use.\n */\nfunction leaveView() {\n const oldLFrame = leaveViewLight();\n oldLFrame.isParent = true;\n oldLFrame.tView = null;\n oldLFrame.selectedIndex = -1;\n oldLFrame.contextLView = null;\n oldLFrame.elementDepthCount = 0;\n oldLFrame.currentDirectiveIndex = -1;\n oldLFrame.currentNamespace = null;\n oldLFrame.bindingRootIndex = -1;\n oldLFrame.bindingIndex = -1;\n oldLFrame.currentQueryIndex = 0;\n}\nfunction nextContextImpl(level) {\n const contextLView = (instructionState.lFrame.contextLView = walkUpViews(level, instructionState.lFrame.contextLView));\n return contextLView[CONTEXT];\n}\n/**\n * Gets the currently selected element index.\n *\n * Used with {@link property} instruction (and more in the future) to identify the index in the\n * current `LView` to act on.\n */\nfunction getSelectedIndex() {\n return instructionState.lFrame.selectedIndex;\n}\n/**\n * Sets the most recent index passed to {@link select}\n *\n * Used with {@link property} instruction (and more in the future) to identify the index in the\n * current `LView` to act on.\n *\n * (Note that if an \"exit function\" was set earlier (via `setElementExitFn()`) then that will be\n * run if and when the provided `index` value is different from the current selected index value.)\n */\nfunction setSelectedIndex(index) {\n ngDevMode &&\n index !== -1 &&\n assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Index must be past HEADER_OFFSET (or -1).');\n ngDevMode &&\n assertLessThan(index, instructionState.lFrame.lView.length, \"Can't set index passed end of LView\");\n instructionState.lFrame.selectedIndex = index;\n}\n/**\n * Gets the `tNode` that represents currently selected element.\n */\nfunction getSelectedTNode() {\n const lFrame = instructionState.lFrame;\n return getTNode(lFrame.tView, lFrame.selectedIndex);\n}\n/**\n * Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state.\n *\n * @codeGenApi\n */\nfunction ɵɵnamespaceSVG() {\n instructionState.lFrame.currentNamespace = SVG_NAMESPACE;\n}\n/**\n * Sets the namespace used to create elements to `'http://www.w3.org/1998/MathML/'` in global state.\n *\n * @codeGenApi\n */\nfunction ɵɵnamespaceMathML() {\n instructionState.lFrame.currentNamespace = MATH_ML_NAMESPACE;\n}\n/**\n * Sets the namespace used to create elements to `null`, which forces element creation to use\n * `createElement` rather than `createElementNS`.\n *\n * @codeGenApi\n */\nfunction ɵɵnamespaceHTML() {\n namespaceHTMLInternal();\n}\n/**\n * Sets the namespace used to create elements to `null`, which forces element creation to use\n * `createElement` rather than `createElementNS`.\n */\nfunction namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}\nfunction getNamespace$1() {\n return instructionState.lFrame.currentNamespace;\n}\nlet _wasLastNodeCreated = true;\n/**\n * Retrieves a global flag that indicates whether the most recent DOM node\n * was created or hydrated.\n */\nfunction wasLastNodeCreated() {\n return _wasLastNodeCreated;\n}\n/**\n * Sets a global flag to indicate whether the most recent DOM node\n * was created or hydrated.\n */\nfunction lastNodeWasCreated(flag) {\n _wasLastNodeCreated = flag;\n}\n\n/**\n * Adds all directive lifecycle hooks from the given `DirectiveDef` to the given `TView`.\n *\n * Must be run *only* on the first template pass.\n *\n * Sets up the pre-order hooks on the provided `tView`,\n * see {@link HookData} for details about the data structure.\n *\n * @param directiveIndex The index of the directive in LView\n * @param directiveDef The definition containing the hooks to setup in tView\n * @param tView The current TView\n */\nfunction registerPreOrderHooks(directiveIndex, directiveDef, tView) {\n ngDevMode && assertFirstCreatePass(tView);\n const { ngOnChanges, ngOnInit, ngDoCheck } = directiveDef.type.prototype;\n if (ngOnChanges) {\n const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);\n (tView.preOrderHooks ??= []).push(directiveIndex, wrappedOnChanges);\n (tView.preOrderCheckHooks ??= []).push(directiveIndex, wrappedOnChanges);\n }\n if (ngOnInit) {\n (tView.preOrderHooks ??= []).push(0 - directiveIndex, ngOnInit);\n }\n if (ngDoCheck) {\n (tView.preOrderHooks ??= []).push(directiveIndex, ngDoCheck);\n (tView.preOrderCheckHooks ??= []).push(directiveIndex, ngDoCheck);\n }\n}\n/**\n *\n * Loops through the directives on the provided `tNode` and queues hooks to be\n * run that are not initialization hooks.\n *\n * Should be executed during `elementEnd()` and similar to\n * preserve hook execution order. Content, view, and destroy hooks for projected\n * components and directives must be called *before* their hosts.\n *\n * Sets up the content, view, and destroy hooks on the provided `tView`,\n * see {@link HookData} for details about the data structure.\n *\n * NOTE: This does not set up `onChanges`, `onInit` or `doCheck`, those are set up\n * separately at `elementStart`.\n *\n * @param tView The current TView\n * @param tNode The TNode whose directives are to be searched for hooks to queue\n */\nfunction registerPostOrderHooks(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n // It's necessary to loop through the directives at elementEnd() (rather than processing in\n // directiveCreate) so we can preserve the current hook order. Content, view, and destroy\n // hooks for projected components and directives must be called *before* their hosts.\n for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) {\n const directiveDef = tView.data[i];\n ngDevMode && assertDefined(directiveDef, 'Expecting DirectiveDef');\n const lifecycleHooks = directiveDef.type.prototype;\n const { ngAfterContentInit, ngAfterContentChecked, ngAfterViewInit, ngAfterViewChecked, ngOnDestroy, } = lifecycleHooks;\n if (ngAfterContentInit) {\n (tView.contentHooks ??= []).push(-i, ngAfterContentInit);\n }\n if (ngAfterContentChecked) {\n (tView.contentHooks ??= []).push(i, ngAfterContentChecked);\n (tView.contentCheckHooks ??= []).push(i, ngAfterContentChecked);\n }\n if (ngAfterViewInit) {\n (tView.viewHooks ??= []).push(-i, ngAfterViewInit);\n }\n if (ngAfterViewChecked) {\n (tView.viewHooks ??= []).push(i, ngAfterViewChecked);\n (tView.viewCheckHooks ??= []).push(i, ngAfterViewChecked);\n }\n if (ngOnDestroy != null) {\n (tView.destroyHooks ??= []).push(i, ngOnDestroy);\n }\n }\n}\n/**\n * Executing hooks requires complex logic as we need to deal with 2 constraints.\n *\n * 1. Init hooks (ngOnInit, ngAfterContentInit, ngAfterViewInit) must all be executed once and only\n * once, across many change detection cycles. This must be true even if some hooks throw, or if\n * some recursively trigger a change detection cycle.\n * To solve that, it is required to track the state of the execution of these init hooks.\n * This is done by storing and maintaining flags in the view: the {@link InitPhaseState},\n * and the index within that phase. They can be seen as a cursor in the following structure:\n * [[onInit1, onInit2], [afterContentInit1], [afterViewInit1, afterViewInit2, afterViewInit3]]\n * They are stored as flags in LView[FLAGS].\n *\n * 2. Pre-order hooks can be executed in batches, because of the select instruction.\n * To be able to pause and resume their execution, we also need some state about the hook's array\n * that is being processed:\n * - the index of the next hook to be executed\n * - the number of init hooks already found in the processed part of the array\n * They are stored as flags in LView[PREORDER_HOOK_FLAGS].\n */\n/**\n * Executes pre-order check hooks ( OnChanges, DoChanges) given a view where all the init hooks were\n * executed once. This is a light version of executeInitAndCheckPreOrderHooks where we can skip read\n * / write of the init-hooks related flags.\n * @param lView The LView where hooks are defined\n * @param hooks Hooks to be run\n * @param nodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction executeCheckHooks(lView, hooks, nodeIndex) {\n callHooks(lView, hooks, 3 /* InitPhaseState.InitPhaseCompleted */, nodeIndex);\n}\n/**\n * Executes post-order init and check hooks (one of AfterContentInit, AfterContentChecked,\n * AfterViewInit, AfterViewChecked) given a view where there are pending init hooks to be executed.\n * @param lView The LView where hooks are defined\n * @param hooks Hooks to be run\n * @param initPhase A phase for which hooks should be run\n * @param nodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) {\n ngDevMode &&\n assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init pre-order hooks should not be called more than once');\n if ((lView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n callHooks(lView, hooks, initPhase, nodeIndex);\n }\n}\nfunction incrementInitPhaseFlags(lView, initPhase) {\n ngDevMode &&\n assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init hooks phase should not be incremented after all init hooks have been run.');\n let flags = lView[FLAGS];\n if ((flags & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n flags &= 16383 /* LViewFlags.IndexWithinInitPhaseReset */;\n flags += 1 /* LViewFlags.InitPhaseStateIncrementer */;\n lView[FLAGS] = flags;\n }\n}\n/**\n * Calls lifecycle hooks with their contexts, skipping init hooks if it's not\n * the first LView pass\n *\n * @param currentView The current view\n * @param arr The array in which the hooks are found\n * @param initPhaseState the current state of the init phase\n * @param currentNodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction callHooks(currentView, arr, initPhase, currentNodeIndex) {\n ngDevMode &&\n assertEqual(isInCheckNoChangesMode(), false, 'Hooks should never be run when in check no changes mode.');\n const startIndex = currentNodeIndex !== undefined\n ? currentView[PREORDER_HOOK_FLAGS] & 65535 /* PreOrderHookFlags.IndexOfTheNextPreOrderHookMaskMask */\n : 0;\n const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1;\n const max = arr.length - 1; // Stop the loop at length - 1, because we look for the hook at i + 1\n let lastNodeIndexFound = 0;\n for (let i = startIndex; i < max; i++) {\n const hook = arr[i + 1];\n if (typeof hook === 'number') {\n lastNodeIndexFound = arr[i];\n if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) {\n break;\n }\n }\n else {\n const isInitHook = arr[i] < 0;\n if (isInitHook) {\n currentView[PREORDER_HOOK_FLAGS] += 65536 /* PreOrderHookFlags.NumberOfInitHooksCalledIncrementer */;\n }\n if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {\n callHook(currentView, initPhase, arr, i);\n currentView[PREORDER_HOOK_FLAGS] =\n (currentView[PREORDER_HOOK_FLAGS] & 4294901760 /* PreOrderHookFlags.NumberOfInitHooksCalledMask */) +\n i +\n 2;\n }\n i++;\n }\n }\n}\n/**\n * Executes a single lifecycle hook, making sure that:\n * - it is called in the non-reactive context;\n * - profiling data are registered.\n */\nfunction callHookInternal(directive, hook) {\n profiler(4 /* ProfilerEvent.LifecycleHookStart */, directive, hook);\n const prevConsumer = setActiveConsumer$1(null);\n try {\n hook.call(directive);\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n profiler(5 /* ProfilerEvent.LifecycleHookEnd */, directive, hook);\n }\n}\n/**\n * Execute one hook against the current `LView`.\n *\n * @param currentView The current view\n * @param initPhaseState the current state of the init phase\n * @param arr The array in which the hooks are found\n * @param i The current index within the hook data array\n */\nfunction callHook(currentView, initPhase, arr, i) {\n const isInitHook = arr[i] < 0;\n const hook = arr[i + 1];\n const directiveIndex = isInitHook ? -arr[i] : arr[i];\n const directive = currentView[directiveIndex];\n if (isInitHook) {\n const indexWithintInitPhase = currentView[FLAGS] >> 14 /* LViewFlags.IndexWithinInitPhaseShift */;\n // The init phase state must be always checked here as it may have been recursively updated.\n if (indexWithintInitPhase <\n currentView[PREORDER_HOOK_FLAGS] >> 16 /* PreOrderHookFlags.NumberOfInitHooksCalledShift */ &&\n (currentView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n currentView[FLAGS] += 16384 /* LViewFlags.IndexWithinInitPhaseIncrementer */;\n callHookInternal(directive, hook);\n }\n }\n else {\n callHookInternal(directive, hook);\n }\n}\n\nconst NO_PARENT_INJECTOR = -1;\n/**\n * Each injector is saved in 9 contiguous slots in `LView` and 9 contiguous slots in\n * `TView.data`. This allows us to store information about the current node's tokens (which\n * can be shared in `TView`) as well as the tokens of its ancestor nodes (which cannot be\n * shared, so they live in `LView`).\n *\n * Each of these slots (aside from the last slot) contains a bloom filter. This bloom filter\n * determines whether a directive is available on the associated node or not. This prevents us\n * from searching the directives array at this level unless it's probable the directive is in it.\n *\n * See: https://en.wikipedia.org/wiki/Bloom_filter for more about bloom filters.\n *\n * Because all injectors have been flattened into `LView` and `TViewData`, they cannot typed\n * using interfaces as they were previously. The start index of each `LInjector` and `TInjector`\n * will differ based on where it is flattened into the main array, so it's not possible to know\n * the indices ahead of time and save their types here. The interfaces are still included here\n * for documentation purposes.\n *\n * export interface LInjector extends Array<any> {\n *\n * // Cumulative bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Cumulative bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Cumulative bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Cumulative bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Cumulative bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Cumulative bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Cumulative bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Cumulative bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // We need to store a reference to the injector's parent so DI can keep looking up\n * // the injector tree until it finds the dependency it's looking for.\n * [PARENT_INJECTOR]: number;\n * }\n *\n * export interface TInjector extends Array<any> {\n *\n * // Shared node bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Shared node bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Shared node bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Shared node bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Shared node bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Shared node bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Shared node bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Shared node bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // Necessary to find directive indices for a particular node.\n * [TNODE]: TElementNode|TElementContainerNode|TContainerNode;\n * }\n */\n/**\n * Factory for creating instances of injectors in the NodeInjector.\n *\n * This factory is complicated by the fact that it can resolve `multi` factories as well.\n *\n * NOTE: Some of the fields are optional which means that this class has two hidden classes.\n * - One without `multi` support (most common)\n * - One with `multi` values, (rare).\n *\n * Since VMs can cache up to 4 inline hidden classes this is OK.\n *\n * - Single factory: Only `resolving` and `factory` is defined.\n * - `providers` factory: `componentProviders` is a number and `index = -1`.\n * - `viewProviders` factory: `componentProviders` is a number and `index` points to `providers`.\n */\nclass NodeInjectorFactory {\n constructor(\n /**\n * Factory to invoke in order to create a new instance.\n */\n factory, \n /**\n * Set to `true` if the token is declared in `viewProviders` (or if it is component).\n */\n isViewProvider, injectImplementation) {\n this.factory = factory;\n /**\n * Marker set to true during factory invocation to see if we get into recursive loop.\n * Recursive loop causes an error to be displayed.\n */\n this.resolving = false;\n ngDevMode && assertDefined(factory, 'Factory not specified');\n ngDevMode && assertEqual(typeof factory, 'function', 'Expected factory function.');\n this.canSeeViewProviders = isViewProvider;\n this.injectImpl = injectImplementation;\n }\n}\nfunction isFactory(obj) {\n return obj instanceof NodeInjectorFactory;\n}\n\n/**\n * Converts `TNodeType` into human readable text.\n * Make sure this matches with `TNodeType`\n */\nfunction toTNodeTypeAsString(tNodeType) {\n let text = '';\n tNodeType & 1 /* TNodeType.Text */ && (text += '|Text');\n tNodeType & 2 /* TNodeType.Element */ && (text += '|Element');\n tNodeType & 4 /* TNodeType.Container */ && (text += '|Container');\n tNodeType & 8 /* TNodeType.ElementContainer */ && (text += '|ElementContainer');\n tNodeType & 16 /* TNodeType.Projection */ && (text += '|Projection');\n tNodeType & 32 /* TNodeType.Icu */ && (text += '|IcuContainer');\n tNodeType & 64 /* TNodeType.Placeholder */ && (text += '|Placeholder');\n tNodeType & 128 /* TNodeType.LetDeclaration */ && (text += '|LetDeclaration');\n return text.length > 0 ? text.substring(1) : text;\n}\n/**\n * Helper function to detect if a given value matches a `TNode` shape.\n *\n * The logic uses the `insertBeforeIndex` and its possible values as\n * a way to differentiate a TNode shape from other types of objects\n * within the `TView.data`. This is not a perfect check, but it can\n * be a reasonable differentiator, since we control the shapes of objects\n * within `TView.data`.\n */\nfunction isTNodeShape(value) {\n return (value != null &&\n typeof value === 'object' &&\n (value.insertBeforeIndex === null ||\n typeof value.insertBeforeIndex === 'number' ||\n Array.isArray(value.insertBeforeIndex)));\n}\nfunction isLetDeclaration(tNode) {\n return !!(tNode.type & 128 /* TNodeType.LetDeclaration */);\n}\n/**\n * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.\n *\n * ```\n * <div my-dir [class]=\"exp\"></div>\n * ```\n * and\n * ```\n * @Directive({\n * })\n * class MyDirective {\n * @Input()\n * class: string;\n * }\n * ```\n *\n * In the above case it is necessary to write the reconciled styling information into the\n * directive's input.\n *\n * @param tNode\n */\nfunction hasClassInput(tNode) {\n return (tNode.flags & 8 /* TNodeFlags.hasClassInput */) !== 0;\n}\n/**\n * Returns `true` if the `TNode` has a directive which has `@Input()` for `style` binding.\n *\n * ```\n * <div my-dir [style]=\"exp\"></div>\n * ```\n * and\n * ```\n * @Directive({\n * })\n * class MyDirective {\n * @Input()\n * class: string;\n * }\n * ```\n *\n * In the above case it is necessary to write the reconciled styling information into the\n * directive's input.\n *\n * @param tNode\n */\nfunction hasStyleInput(tNode) {\n return (tNode.flags & 16 /* TNodeFlags.hasStyleInput */) !== 0;\n}\n\nfunction assertTNodeType(tNode, expectedTypes, message) {\n assertDefined(tNode, 'should be called with a TNode');\n if ((tNode.type & expectedTypes) === 0) {\n throwError(message ||\n `Expected [${toTNodeTypeAsString(expectedTypes)}] but got ${toTNodeTypeAsString(tNode.type)}.`);\n }\n}\nfunction assertPureTNodeType(type) {\n if (!(type === 2 /* TNodeType.Element */ ||\n type === 1 /* TNodeType.Text */ ||\n type === 4 /* TNodeType.Container */ ||\n type === 8 /* TNodeType.ElementContainer */ ||\n type === 32 /* TNodeType.Icu */ ||\n type === 16 /* TNodeType.Projection */ ||\n type === 64 /* TNodeType.Placeholder */ ||\n type === 128 /* TNodeType.LetDeclaration */)) {\n throwError(`Expected TNodeType to have only a single type selected, but got ${toTNodeTypeAsString(type)}.`);\n }\n}\n\n// This default value is when checking the hierarchy for a token.\n//\n// It means both:\n// - the token is not provided by the current injector,\n// - only the element injectors should be checked (ie do not check module injectors\n//\n// mod1\n// /\n// el1 mod2\n// \\ /\n// el2\n//\n// When requesting el2.injector.get(token), we should check in the following order and return the\n// first found value:\n// - el2.injector.get(token, default)\n// - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module\n// - mod2.injector.get(token, default)\nconst NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};\n\n/**\n * Injector that looks up a value using a specific injector, before falling back to the module\n * injector. Used primarily when creating components or embedded views dynamically.\n */\nclass ChainedInjector {\n constructor(injector, parentInjector) {\n this.injector = injector;\n this.parentInjector = parentInjector;\n }\n get(token, notFoundValue, flags) {\n flags = convertToBitFlags(flags);\n const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);\n if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||\n notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n // Return the value from the root element injector when\n // - it provides it\n // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n // - the module injector should not be checked\n // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n return value;\n }\n return this.parentInjector.get(token, notFoundValue, flags);\n }\n}\n\n/// Parent Injector Utils ///////////////////////////////////////////////////////////////\nfunction hasParentInjector(parentLocation) {\n return parentLocation !== NO_PARENT_INJECTOR;\n}\nfunction getParentInjectorIndex(parentLocation) {\n if (ngDevMode) {\n assertNumber(parentLocation, 'Number expected');\n assertNotEqual(parentLocation, -1, 'Not a valid state.');\n const parentInjectorIndex = parentLocation & 32767 /* RelativeInjectorLocationFlags.InjectorIndexMask */;\n assertGreaterThan(parentInjectorIndex, HEADER_OFFSET, 'Parent injector must be pointing past HEADER_OFFSET.');\n }\n return parentLocation & 32767 /* RelativeInjectorLocationFlags.InjectorIndexMask */;\n}\nfunction getParentInjectorViewOffset(parentLocation) {\n return parentLocation >> 16 /* RelativeInjectorLocationFlags.ViewOffsetShift */;\n}\n/**\n * Unwraps a parent injector location number to find the view offset from the current injector,\n * then walks up the declaration view tree until the view is found that contains the parent\n * injector.\n *\n * @param location The location of the parent injector, which contains the view offset\n * @param startView The LView instance from which to start walking up the view tree\n * @returns The LView instance that contains the parent injector\n */\nfunction getParentInjectorView(location, startView) {\n let viewOffset = getParentInjectorViewOffset(location);\n let parentView = startView;\n // For most cases, the parent injector can be found on the host node (e.g. for component\n // or container), but we must keep the loop here to support the rarer case of deeply nested\n // <ng-template> tags or inline views, where the parent injector might live many views\n // above the child injector.\n while (viewOffset > 0) {\n parentView = parentView[DECLARATION_VIEW];\n viewOffset--;\n }\n return parentView;\n}\n/**\n * Detects whether an injector is an instance of a `ChainedInjector`,\n * created based on the `OutletInjector`.\n */\nfunction isRouterOutletInjector(currentInjector) {\n return (currentInjector instanceof ChainedInjector &&\n typeof currentInjector.injector.__ngOutletInjector === 'function');\n}\n\n/**\n * Defines if the call to `inject` should include `viewProviders` in its resolution.\n *\n * This is set to true when we try to instantiate a component. This value is reset in\n * `getNodeInjectable` to a value which matches the declaration location of the token about to be\n * instantiated. This is done so that if we are injecting a token which was declared outside of\n * `viewProviders` we don't accidentally pull `viewProviders` in.\n *\n * Example:\n *\n * ```\n * @Injectable()\n * class MyService {\n * constructor(public value: String) {}\n * }\n *\n * @Component({\n * providers: [\n * MyService,\n * {provide: String, value: 'providers' }\n * ]\n * viewProviders: [\n * {provide: String, value: 'viewProviders'}\n * ]\n * })\n * class MyComponent {\n * constructor(myService: MyService, value: String) {\n * // We expect that Component can see into `viewProviders`.\n * expect(value).toEqual('viewProviders');\n * // `MyService` was not declared in `viewProviders` hence it can't see it.\n * expect(myService.value).toEqual('providers');\n * }\n * }\n *\n * ```\n */\nlet includeViewProviders = true;\nfunction setIncludeViewProviders(v) {\n const oldValue = includeViewProviders;\n includeViewProviders = v;\n return oldValue;\n}\n/**\n * The number of slots in each bloom filter (used by DI). The larger this number, the fewer\n * directives that will share slots, and thus, the fewer false positives when checking for\n * the existence of a directive.\n */\nconst BLOOM_SIZE = 256;\nconst BLOOM_MASK = BLOOM_SIZE - 1;\n/**\n * The number of bits that is represented by a single bloom bucket. JS bit operations are 32 bits,\n * so each bucket represents 32 distinct tokens which accounts for log2(32) = 5 bits of a bloom hash\n * number.\n */\nconst BLOOM_BUCKET_BITS = 5;\n/** Counter used to generate unique IDs for directives. */\nlet nextNgElementId = 0;\n/** Value used when something wasn't found by an injector. */\nconst NOT_FOUND = {};\n/**\n * Registers this directive as present in its node's injector by flipping the directive's\n * corresponding bit in the injector's bloom filter.\n *\n * @param injectorIndex The index of the node injector where this token should be registered\n * @param tView The TView for the injector's bloom filters\n * @param type The directive token to register\n */\nfunction bloomAdd(injectorIndex, tView, type) {\n ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true');\n let id;\n if (typeof type === 'string') {\n id = type.charCodeAt(0) || 0;\n }\n else if (type.hasOwnProperty(NG_ELEMENT_ID)) {\n id = type[NG_ELEMENT_ID];\n }\n // Set a unique ID on the directive type, so if something tries to inject the directive,\n // we can easily retrieve the ID and hash it into the bloom bit that should be checked.\n if (id == null) {\n id = type[NG_ELEMENT_ID] = nextNgElementId++;\n }\n // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),\n // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.\n const bloomHash = id & BLOOM_MASK;\n // Create a mask that targets the specific bit associated with the directive.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n // Each bloom bucket in `tData` represents `BLOOM_BUCKET_BITS` number of bits of `bloomHash`.\n // Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset that the mask\n // should be written to.\n tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;\n}\n/**\n * Creates (or gets an existing) injector for a given element or container.\n *\n * @param tNode for which an injector should be retrieved / created.\n * @param lView View where the node is stored\n * @returns Node injector\n */\nfunction getOrCreateNodeInjectorForNode(tNode, lView) {\n const existingInjectorIndex = getInjectorIndex(tNode, lView);\n if (existingInjectorIndex !== -1) {\n return existingInjectorIndex;\n }\n const tView = lView[TVIEW];\n if (tView.firstCreatePass) {\n tNode.injectorIndex = lView.length;\n insertBloom(tView.data, tNode); // foundation for node bloom\n insertBloom(lView, null); // foundation for cumulative bloom\n insertBloom(tView.blueprint, null);\n }\n const parentLoc = getParentInjectorLocation(tNode, lView);\n const injectorIndex = tNode.injectorIndex;\n // If a parent injector can't be found, its location is set to -1.\n // In that case, we don't need to set up a cumulative bloom\n if (hasParentInjector(parentLoc)) {\n const parentIndex = getParentInjectorIndex(parentLoc);\n const parentLView = getParentInjectorView(parentLoc, lView);\n const parentData = parentLView[TVIEW].data;\n // Creates a cumulative bloom filter that merges the parent's bloom filter\n // and its own cumulative bloom (which contains tokens for all ancestors)\n for (let i = 0; i < 8 /* NodeInjectorOffset.BLOOM_SIZE */; i++) {\n lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];\n }\n }\n lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */] = parentLoc;\n return injectorIndex;\n}\nfunction insertBloom(arr, footer) {\n arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);\n}\nfunction getInjectorIndex(tNode, lView) {\n if (tNode.injectorIndex === -1 ||\n // If the injector index is the same as its parent's injector index, then the index has been\n // copied down from the parent node. No injector has been created yet on this node.\n (tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex) ||\n // After the first template pass, the injector index might exist but the parent values\n // might not have been calculated yet for this instance\n lView[tNode.injectorIndex + 8 /* NodeInjectorOffset.PARENT */] === null) {\n return -1;\n }\n else {\n ngDevMode && assertIndexInRange(lView, tNode.injectorIndex);\n return tNode.injectorIndex;\n }\n}\n/**\n * Finds the index of the parent injector, with a view offset if applicable. Used to set the\n * parent injector initially.\n *\n * @returns Returns a number that is the combination of the number of LViews that we have to go up\n * to find the LView containing the parent inject AND the index of the injector within that LView.\n */\nfunction getParentInjectorLocation(tNode, lView) {\n if (tNode.parent && tNode.parent.injectorIndex !== -1) {\n // If we have a parent `TNode` and there is an injector associated with it we are done, because\n // the parent injector is within the current `LView`.\n return tNode.parent.injectorIndex; // ViewOffset is 0\n }\n // When parent injector location is computed it may be outside of the current view. (ie it could\n // be pointing to a declared parent location). This variable stores number of declaration parents\n // we need to walk up in order to find the parent injector location.\n let declarationViewOffset = 0;\n let parentTNode = null;\n let lViewCursor = lView;\n // The parent injector is not in the current `LView`. We will have to walk the declared parent\n // `LView` hierarchy and look for it. If we walk of the top, that means that there is no parent\n // `NodeInjector`.\n while (lViewCursor !== null) {\n parentTNode = getTNodeFromLView(lViewCursor);\n if (parentTNode === null) {\n // If we have no parent, than we are done.\n return NO_PARENT_INJECTOR;\n }\n ngDevMode && parentTNode && assertTNodeForLView(parentTNode, lViewCursor[DECLARATION_VIEW]);\n // Every iteration of the loop requires that we go to the declared parent.\n declarationViewOffset++;\n lViewCursor = lViewCursor[DECLARATION_VIEW];\n if (parentTNode.injectorIndex !== -1) {\n // We found a NodeInjector which points to something.\n return (parentTNode.injectorIndex |\n (declarationViewOffset <<\n 16 /* RelativeInjectorLocationFlags.ViewOffsetShift */));\n }\n }\n return NO_PARENT_INJECTOR;\n}\n/**\n * Makes a type or an injection token public to the DI system by adding it to an\n * injector's bloom filter.\n *\n * @param di The node injector in which a directive will be added\n * @param token The type or the injection token to be made public\n */\nfunction diPublicInInjector(injectorIndex, tView, token) {\n bloomAdd(injectorIndex, tView, token);\n}\n/**\n * Inject static attribute value into directive constructor.\n *\n * This method is used with `factory` functions which are generated as part of\n * `defineDirective` or `defineComponent`. The method retrieves the static value\n * of an attribute. (Dynamic attributes are not supported since they are not resolved\n * at the time of injection and can change over time.)\n *\n * # Example\n * Given:\n * ```\n * @Component(...)\n * class MyComponent {\n * constructor(@Attribute('title') title: string) { ... }\n * }\n * ```\n * When instantiated with\n * ```\n * <my-component title=\"Hello\"></my-component>\n * ```\n *\n * Then factory method generated is:\n * ```\n * MyComponent.ɵcmp = defineComponent({\n * factory: () => new MyComponent(injectAttribute('title'))\n * ...\n * })\n * ```\n *\n * @publicApi\n */\nfunction injectAttributeImpl(tNode, attrNameToInject) {\n ngDevMode && assertTNodeType(tNode, 12 /* TNodeType.AnyContainer */ | 3 /* TNodeType.AnyRNode */);\n ngDevMode && assertDefined(tNode, 'expecting tNode');\n if (attrNameToInject === 'class') {\n return tNode.classes;\n }\n if (attrNameToInject === 'style') {\n return tNode.styles;\n }\n const attrs = tNode.attrs;\n if (attrs) {\n const attrsLength = attrs.length;\n let i = 0;\n while (i < attrsLength) {\n const value = attrs[i];\n // If we hit a `Bindings` or `Template` marker then we are done.\n if (isNameOnlyAttributeMarker(value))\n break;\n // Skip namespaced attributes\n if (value === 0 /* AttributeMarker.NamespaceURI */) {\n // we skip the next two values\n // as namespaced attributes looks like\n // [..., AttributeMarker.NamespaceURI, 'http://someuri.com/test', 'test:exist',\n // 'existValue', ...]\n i = i + 2;\n }\n else if (typeof value === 'number') {\n // Skip to the first value of the marked attribute.\n i++;\n while (i < attrsLength && typeof attrs[i] === 'string') {\n i++;\n }\n }\n else if (value === attrNameToInject) {\n return attrs[i + 1];\n }\n else {\n i = i + 2;\n }\n }\n }\n return null;\n}\nfunction notFoundValueOrThrow(notFoundValue, token, flags) {\n if (flags & InjectFlags.Optional || notFoundValue !== undefined) {\n return notFoundValue;\n }\n else {\n throwProviderNotFoundError(token, 'NodeInjector');\n }\n}\n/**\n * Returns the value associated to the given token from the ModuleInjector or throws exception\n *\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector or throws an exception\n */\nfunction lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) {\n if (flags & InjectFlags.Optional && notFoundValue === undefined) {\n // This must be set or the NullInjector will throw for optional deps\n notFoundValue = null;\n }\n if ((flags & (InjectFlags.Self | InjectFlags.Host)) === 0) {\n const moduleInjector = lView[INJECTOR];\n // switch to `injectInjectorOnly` implementation for module injector, since module injector\n // should not have access to Component/Directive DI scope (that may happen through\n // `directiveInject` implementation)\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n if (moduleInjector) {\n return moduleInjector.get(token, notFoundValue, flags & InjectFlags.Optional);\n }\n else {\n return injectRootLimpMode(token, notFoundValue, flags & InjectFlags.Optional);\n }\n }\n finally {\n setInjectImplementation(previousInjectImplementation);\n }\n }\n return notFoundValueOrThrow(notFoundValue, token, flags);\n}\n/**\n * Returns the value associated to the given token from the NodeInjectors => ModuleInjector.\n *\n * Look for the injector providing the token by walking up the node injector tree and then\n * the module injector tree.\n *\n * This function patches `token` with `__NG_ELEMENT_ID__` which contains the id for the bloom\n * filter. `-1` is reserved for injecting `Injector` (implemented by `NodeInjector`)\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction getOrCreateInjectable(tNode, lView, token, flags = InjectFlags.Default, notFoundValue) {\n if (tNode !== null) {\n // If the view or any of its ancestors have an embedded\n // view injector, we have to look it up there first.\n if (lView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */ &&\n // The token must be present on the current node injector when the `Self`\n // flag is set, so the lookup on embedded view injector(s) can be skipped.\n !(flags & InjectFlags.Self)) {\n const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND);\n if (embeddedInjectorValue !== NOT_FOUND) {\n return embeddedInjectorValue;\n }\n }\n // Otherwise try the node injector.\n const value = lookupTokenUsingNodeInjector(tNode, lView, token, flags, NOT_FOUND);\n if (value !== NOT_FOUND) {\n return value;\n }\n }\n // Finally, fall back to the module injector.\n return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n}\n/**\n * Returns the value associated to the given token from the node injector.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) {\n const bloomHash = bloomHashBitOrFactory(token);\n // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef\n // so just call the factory function to create it.\n if (typeof bloomHash === 'function') {\n if (!enterDI(lView, tNode, flags)) {\n // Failed to enter DI, try module injector instead. If a token is injected with the @Host\n // flag, the module injector is not searched for that token in Ivy.\n return flags & InjectFlags.Host\n ? notFoundValueOrThrow(notFoundValue, token, flags)\n : lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n }\n try {\n let value;\n if (ngDevMode) {\n runInInjectorProfilerContext(new NodeInjector(getCurrentTNode(), getLView()), token, () => {\n value = bloomHash(flags);\n if (value != null) {\n emitInstanceCreatedByInjectorEvent(value);\n }\n });\n }\n else {\n value = bloomHash(flags);\n }\n if (value == null && !(flags & InjectFlags.Optional)) {\n throwProviderNotFoundError(token);\n }\n else {\n return value;\n }\n }\n finally {\n leaveDI();\n }\n }\n else if (typeof bloomHash === 'number') {\n // A reference to the previous injector TView that was found while climbing the element\n // injector tree. This is used to know if viewProviders can be accessed on the current\n // injector.\n let previousTView = null;\n let injectorIndex = getInjectorIndex(tNode, lView);\n let parentLocation = NO_PARENT_INJECTOR;\n let hostTElementNode = flags & InjectFlags.Host ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;\n // If we should skip this injector, or if there is no injector on this node, start by\n // searching the parent injector.\n if (injectorIndex === -1 || flags & InjectFlags.SkipSelf) {\n parentLocation =\n injectorIndex === -1\n ? getParentInjectorLocation(tNode, lView)\n : lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];\n if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {\n injectorIndex = -1;\n }\n else {\n previousTView = lView[TVIEW];\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n }\n }\n // Traverse up the injector tree until we find a potential match or until we know there\n // *isn't* a match.\n while (injectorIndex !== -1) {\n ngDevMode && assertNodeInjector(lView, injectorIndex);\n // Check the current injector. If it matches, see if it contains token.\n const tView = lView[TVIEW];\n ngDevMode &&\n assertTNodeForLView(tView.data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */], lView);\n if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {\n // At this point, we have an injector which *may* contain the token, so we step through\n // the providers and directives associated with the injector's corresponding node to get\n // the instance.\n const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode);\n if (instance !== NOT_FOUND) {\n return instance;\n }\n }\n parentLocation = lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];\n if (parentLocation !== NO_PARENT_INJECTOR &&\n shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */] === hostTElementNode) &&\n bloomHasToken(bloomHash, injectorIndex, lView)) {\n // The def wasn't found anywhere on this node, so it was a false positive.\n // Traverse up the tree and continue searching.\n previousTView = tView;\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n }\n else {\n // If we should not search parent OR If the ancestor bloom filter value does not have the\n // bit corresponding to the directive we can give up on traversing up to find the specific\n // injector.\n injectorIndex = -1;\n }\n }\n }\n return notFoundValue;\n}\nfunction searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {\n const currentTView = lView[TVIEW];\n const tNode = currentTView.data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];\n // First, we need to determine if view providers can be accessed by the starting element.\n // There are two possibilities\n const canAccessViewProviders = previousTView == null\n ? // 1) This is the first invocation `previousTView == null` which means that we are at the\n // `TNode` of where injector is starting to look. In such a case the only time we are allowed\n // to look into the ViewProviders is if:\n // - we are on a component\n // - AND the injector set `includeViewProviders` to true (implying that the token can see\n // ViewProviders because it is the Component or a Service which itself was declared in\n // ViewProviders)\n isComponentHost(tNode) && includeViewProviders\n : // 2) `previousTView != null` which means that we are now walking across the parent nodes.\n // In such a case we are only allowed to look into the ViewProviders if:\n // - We just crossed from child View to Parent View `previousTView != currentTView`\n // - AND the parent TNode is an Element.\n // This means that we just came from the Component's View and therefore are allowed to see\n // into the ViewProviders.\n previousTView != currentTView && (tNode.type & 3 /* TNodeType.AnyRNode */) !== 0;\n // This special case happens when there is a @host on the inject and when we are searching\n // on the host element node.\n const isHostSpecialCase = flags & InjectFlags.Host && hostTElementNode === tNode;\n const injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase);\n if (injectableIdx !== null) {\n return getNodeInjectable(lView, currentTView, injectableIdx, tNode);\n }\n else {\n return NOT_FOUND;\n }\n}\n/**\n * Searches for the given token among the node's directives and providers.\n *\n * @param tNode TNode on which directives are present.\n * @param tView The tView we are currently processing\n * @param token Provider token or type of a directive to look for.\n * @param canAccessViewProviders Whether view providers should be considered.\n * @param isHostSpecialCase Whether the host special case applies.\n * @returns Index of a found directive or provider, or null when none found.\n */\nfunction locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {\n const nodeProviderIndexes = tNode.providerIndexes;\n const tInjectables = tView.data;\n const injectablesStart = nodeProviderIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;\n const directivesStart = tNode.directiveStart;\n const directiveEnd = tNode.directiveEnd;\n const cptViewProvidersCount = nodeProviderIndexes >> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */;\n const startingIndex = canAccessViewProviders\n ? injectablesStart\n : injectablesStart + cptViewProvidersCount;\n // When the host special case applies, only the viewProviders and the component are visible\n const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;\n for (let i = startingIndex; i < endIndex; i++) {\n const providerTokenOrDef = tInjectables[i];\n if ((i < directivesStart && token === providerTokenOrDef) ||\n (i >= directivesStart && providerTokenOrDef.type === token)) {\n return i;\n }\n }\n if (isHostSpecialCase) {\n const dirDef = tInjectables[directivesStart];\n if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {\n return directivesStart;\n }\n }\n return null;\n}\n/**\n * Retrieve or instantiate the injectable from the `LView` at particular `index`.\n *\n * This function checks to see if the value has already been instantiated and if so returns the\n * cached `injectable`. Otherwise if it detects that the value is still a factory it\n * instantiates the `injectable` and caches the value.\n */\nfunction getNodeInjectable(lView, tView, index, tNode) {\n let value = lView[index];\n const tData = tView.data;\n if (isFactory(value)) {\n const factory = value;\n if (factory.resolving) {\n throwCyclicDependencyError(stringifyForError(tData[index]));\n }\n const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);\n factory.resolving = true;\n let prevInjectContext;\n if (ngDevMode) {\n // tData indexes mirror the concrete instances in its corresponding LView.\n // lView[index] here is either the injectable instace itself or a factory,\n // therefore tData[index] is the constructor of that injectable or a\n // definition object that contains the constructor in a `.type` field.\n const token = tData[index].type || tData[index];\n const injector = new NodeInjector(tNode, lView);\n prevInjectContext = setInjectorProfilerContext({ injector, token });\n }\n const previousInjectImplementation = factory.injectImpl\n ? setInjectImplementation(factory.injectImpl)\n : null;\n const success = enterDI(lView, tNode, InjectFlags.Default);\n ngDevMode &&\n assertEqual(success, true, \"Because flags do not contain `SkipSelf' we expect this to always succeed.\");\n try {\n value = lView[index] = factory.factory(undefined, tData, lView, tNode);\n ngDevMode && emitInstanceCreatedByInjectorEvent(value);\n // This code path is hit for both directives and providers.\n // For perf reasons, we want to avoid searching for hooks on providers.\n // It does no harm to try (the hooks just won't exist), but the extra\n // checks are unnecessary and this is a hot path. So we check to see\n // if the index of the dependency is in the directive range for this\n // tNode. If it's not, we know it's a provider and skip hook registration.\n if (tView.firstCreatePass && index >= tNode.directiveStart) {\n ngDevMode && assertDirectiveDef(tData[index]);\n registerPreOrderHooks(index, tData[index], tView);\n }\n }\n finally {\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n previousInjectImplementation !== null &&\n setInjectImplementation(previousInjectImplementation);\n setIncludeViewProviders(previousIncludeViewProviders);\n factory.resolving = false;\n leaveDI();\n }\n }\n return value;\n}\n/**\n * Returns the bit in an injector's bloom filter that should be used to determine whether or not\n * the directive might be provided by the injector.\n *\n * When a directive is public, it is added to the bloom filter and given a unique ID that can be\n * retrieved on the Type. When the directive isn't public or the token is not a directive `null`\n * is returned as the node injector can not possibly provide that token.\n *\n * @param token the injection token\n * @returns the matching bit to check in the bloom filter or `null` if the token is not known.\n * When the returned value is negative then it represents special values such as `Injector`.\n */\nfunction bloomHashBitOrFactory(token) {\n ngDevMode && assertDefined(token, 'token must be defined');\n if (typeof token === 'string') {\n return token.charCodeAt(0) || 0;\n }\n const tokenId = \n // First check with `hasOwnProperty` so we don't get an inherited ID.\n token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : undefined;\n // Negative token IDs are used for special objects such as `Injector`\n if (typeof tokenId === 'number') {\n if (tokenId >= 0) {\n return tokenId & BLOOM_MASK;\n }\n else {\n ngDevMode &&\n assertEqual(tokenId, -1 /* InjectorMarkers.Injector */, 'Expecting to get Special Injector Id');\n return createNodeInjector;\n }\n }\n else {\n return tokenId;\n }\n}\nfunction bloomHasToken(bloomHash, injectorIndex, injectorView) {\n // Create a mask that targets the specific bit associated with the directive we're looking for.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n // Each bloom bucket in `injectorView` represents `BLOOM_BUCKET_BITS` number of bits of\n // `bloomHash`. Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset\n // that should be used.\n const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];\n // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,\n // this injector is a potential match.\n return !!(value & mask);\n}\n/** Returns true if flags prevent parent injector from being searched for tokens */\nfunction shouldSearchParent(flags, isFirstHostTNode) {\n return !(flags & InjectFlags.Self) && !(flags & InjectFlags.Host && isFirstHostTNode);\n}\nfunction getNodeInjectorLView(nodeInjector) {\n return nodeInjector._lView;\n}\nfunction getNodeInjectorTNode(nodeInjector) {\n return nodeInjector._tNode;\n}\nclass NodeInjector {\n constructor(_tNode, _lView) {\n this._tNode = _tNode;\n this._lView = _lView;\n }\n get(token, notFoundValue, flags) {\n return getOrCreateInjectable(this._tNode, this._lView, token, convertToBitFlags(flags), notFoundValue);\n }\n}\n/** Creates a `NodeInjector` for the current node. */\nfunction createNodeInjector() {\n return new NodeInjector(getCurrentTNode(), getLView());\n}\n/**\n * @codeGenApi\n */\nfunction ɵɵgetInheritedFactory(type) {\n return noSideEffects(() => {\n const ownConstructor = type.prototype.constructor;\n const ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor);\n const objectPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objectPrototype) {\n const factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent);\n // If we hit something that has a factory and the factory isn't the same as the type,\n // we've found the inherited factory. Note the check that the factory isn't the type's\n // own factory is redundant in most cases, but if the user has custom decorators on the\n // class, this lookup will start one level down in the prototype chain, causing us to\n // find the own factory first and potentially triggering an infinite loop downstream.\n if (factory && factory !== ownFactory) {\n return factory;\n }\n parent = Object.getPrototypeOf(parent);\n }\n // There is no factory defined. Either this was improper usage of inheritance\n // (no Angular decorator on the superclass) or there is no constructor at all\n // in the inheritance chain. Since the two cases cannot be distinguished, the\n // latter has to be assumed.\n return (t) => new t();\n });\n}\nfunction getFactoryOf(type) {\n if (isForwardRef(type)) {\n return () => {\n const factory = getFactoryOf(resolveForwardRef(type));\n return factory && factory();\n };\n }\n return getFactoryDef(type);\n}\n/**\n * Returns a value from the closest embedded or node injector.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundValue) {\n let currentTNode = tNode;\n let currentLView = lView;\n // When an LView with an embedded view injector is inserted, it'll likely be interlaced with\n // nodes who may have injectors (e.g. node injector -> embedded view injector -> node injector).\n // Since the bloom filters for the node injectors have already been constructed and we don't\n // have a way of extracting the records from an injector, the only way to maintain the correct\n // hierarchy when resolving the value is to walk it node-by-node while attempting to resolve\n // the token at each level.\n while (currentTNode !== null &&\n currentLView !== null &&\n currentLView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */ &&\n !(currentLView[FLAGS] & 512 /* LViewFlags.IsRoot */)) {\n ngDevMode && assertTNodeForLView(currentTNode, currentLView);\n // Note that this lookup on the node injector is using the `Self` flag, because\n // we don't want the node injector to look at any parent injectors since we\n // may hit the embedded view injector first.\n const nodeInjectorValue = lookupTokenUsingNodeInjector(currentTNode, currentLView, token, flags | InjectFlags.Self, NOT_FOUND);\n if (nodeInjectorValue !== NOT_FOUND) {\n return nodeInjectorValue;\n }\n // Has an explicit type due to a TS bug: https://github.com/microsoft/TypeScript/issues/33191\n let parentTNode = currentTNode.parent;\n // `TNode.parent` includes the parent within the current view only. If it doesn't exist,\n // it means that we've hit the view boundary and we need to go up to the next view.\n if (!parentTNode) {\n // Before we go to the next LView, check if the token exists on the current embedded injector.\n const embeddedViewInjector = currentLView[EMBEDDED_VIEW_INJECTOR];\n if (embeddedViewInjector) {\n const embeddedViewInjectorValue = embeddedViewInjector.get(token, NOT_FOUND, flags);\n if (embeddedViewInjectorValue !== NOT_FOUND) {\n return embeddedViewInjectorValue;\n }\n }\n // Otherwise keep going up the tree.\n parentTNode = getTNodeFromLView(currentLView);\n currentLView = currentLView[DECLARATION_VIEW];\n }\n currentTNode = parentTNode;\n }\n return notFoundValue;\n}\n/** Gets the TNode associated with an LView inside of the declaration view. */\nfunction getTNodeFromLView(lView) {\n const tView = lView[TVIEW];\n const tViewType = tView.type;\n // The parent pointer differs based on `TView.type`.\n if (tViewType === 2 /* TViewType.Embedded */) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode;\n }\n else if (tViewType === 1 /* TViewType.Component */) {\n // Components don't have `TView.declTNode` because each instance of component could be\n // inserted in different location, hence `TView.declTNode` is meaningless.\n return lView[T_HOST];\n }\n return null;\n}\n\n/**\n * Facade for the attribute injection from DI.\n *\n * @codeGenApi\n */\nfunction ɵɵinjectAttribute(attrNameToInject) {\n return injectAttributeImpl(getCurrentTNode(), attrNameToInject);\n}\n\n/**\n * Attribute decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Attribute = makeParamDecorator('Attribute', (attributeName) => ({\n attributeName,\n __NG_ELEMENT_ID__: () => ɵɵinjectAttribute(attributeName),\n}));\n\nlet _reflect = null;\nfunction getReflect() {\n return (_reflect = _reflect || new ReflectionCapabilities());\n}\nfunction reflectDependencies(type) {\n return convertDependencies(getReflect().parameters(type));\n}\nfunction convertDependencies(deps) {\n return deps.map((dep) => reflectDependency(dep));\n}\nfunction reflectDependency(dep) {\n const meta = {\n token: null,\n attribute: null,\n host: false,\n optional: false,\n self: false,\n skipSelf: false,\n };\n if (Array.isArray(dep) && dep.length > 0) {\n for (let j = 0; j < dep.length; j++) {\n const param = dep[j];\n if (param === undefined) {\n // param may be undefined if type of dep is not set by ngtsc\n continue;\n }\n const proto = Object.getPrototypeOf(param);\n if (param instanceof Optional || proto.ngMetadataName === 'Optional') {\n meta.optional = true;\n }\n else if (param instanceof SkipSelf || proto.ngMetadataName === 'SkipSelf') {\n meta.skipSelf = true;\n }\n else if (param instanceof Self || proto.ngMetadataName === 'Self') {\n meta.self = true;\n }\n else if (param instanceof Host || proto.ngMetadataName === 'Host') {\n meta.host = true;\n }\n else if (param instanceof Inject) {\n meta.token = param.token;\n }\n else if (param instanceof Attribute) {\n if (param.attributeName === undefined) {\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Attribute name must be defined.`);\n }\n meta.attribute = param.attributeName;\n }\n else {\n meta.token = param;\n }\n }\n }\n else if (dep === undefined || (Array.isArray(dep) && dep.length === 0)) {\n meta.token = null;\n }\n else {\n meta.token = dep;\n }\n return meta;\n}\n\n/**\n * Compile an Angular injectable according to its `Injectable` metadata, and patch the resulting\n * injectable def (`ɵprov`) onto the injectable type.\n */\nfunction compileInjectable(type, meta) {\n let ngInjectableDef = null;\n let ngFactoryDef = null;\n // if NG_PROV_DEF is already defined on this class then don't overwrite it\n if (!type.hasOwnProperty(NG_PROV_DEF)) {\n Object.defineProperty(type, NG_PROV_DEF, {\n get: () => {\n if (ngInjectableDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'injectable',\n type,\n });\n ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, `ng:///${type.name}/ɵprov.js`, getInjectableMetadata(type, meta));\n }\n return ngInjectableDef;\n },\n });\n }\n // if NG_FACTORY_DEF is already defined on this class then don't overwrite it\n if (!type.hasOwnProperty(NG_FACTORY_DEF)) {\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'injectable',\n type,\n });\n ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ɵfac.js`, {\n name: type.name,\n type,\n typeArgumentCount: 0, // In JIT mode types are not available nor used.\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Injectable,\n });\n }\n return ngFactoryDef;\n },\n // Leave this configurable so that the factories from directives or pipes can take precedence.\n configurable: true,\n });\n }\n}\nconst USE_VALUE = getClosureSafeProperty({\n provide: String,\n useValue: getClosureSafeProperty,\n});\nfunction isUseClassProvider(meta) {\n return meta.useClass !== undefined;\n}\nfunction isUseValueProvider(meta) {\n return USE_VALUE in meta;\n}\nfunction isUseFactoryProvider(meta) {\n return meta.useFactory !== undefined;\n}\nfunction isUseExistingProvider(meta) {\n return meta.useExisting !== undefined;\n}\nfunction getInjectableMetadata(type, srcMeta) {\n // Allow the compilation of a class with a `@Injectable()` decorator without parameters\n const meta = srcMeta || { providedIn: null };\n const compilerMeta = {\n name: type.name,\n type: type,\n typeArgumentCount: 0,\n providedIn: meta.providedIn,\n };\n if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== undefined) {\n compilerMeta.deps = convertDependencies(meta.deps);\n }\n // Check to see if the user explicitly provided a `useXxxx` property.\n if (isUseClassProvider(meta)) {\n compilerMeta.useClass = meta.useClass;\n }\n else if (isUseValueProvider(meta)) {\n compilerMeta.useValue = meta.useValue;\n }\n else if (isUseFactoryProvider(meta)) {\n compilerMeta.useFactory = meta.useFactory;\n }\n else if (isUseExistingProvider(meta)) {\n compilerMeta.useExisting = meta.useExisting;\n }\n return compilerMeta;\n}\n\n/**\n * Injectable decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Injectable = makeDecorator('Injectable', undefined, undefined, undefined, (type, meta) => compileInjectable(type, meta));\n\n/**\n * Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s.\n */\nfunction createInjector(defType, parent = null, additionalProviders = null, name) {\n const injector = createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name);\n injector.resolveInjectorInitializers();\n return injector;\n}\n/**\n * Creates a new injector without eagerly resolving its injector types. Can be used in places\n * where resolving the injector types immediately can lead to an infinite loop. The injector types\n * should be resolved at a later point by calling `_resolveInjectorDefTypes`.\n */\nfunction createInjectorWithoutInjectorInstances(defType, parent = null, additionalProviders = null, name, scopes = new Set()) {\n const providers = [additionalProviders || EMPTY_ARRAY, importProvidersFrom(defType)];\n name = name || (typeof defType === 'object' ? undefined : stringify(defType));\n return new R3Injector(providers, parent || getNullInjector(), name || null, scopes);\n}\n\n/**\n * Concrete injectors implement this interface. Injectors are configured\n * with [providers](guide/di/dependency-injection-providers) that associate\n * dependencies of various types with [injection tokens](guide/di/dependency-injection-providers).\n *\n * @see [DI Providers](guide/di/dependency-injection-providers).\n * @see {@link StaticProvider}\n *\n * @usageNotes\n *\n * The following example creates a service injector instance.\n *\n * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}\n *\n * ### Usage example\n *\n * {@example core/di/ts/injector_spec.ts region='Injector'}\n *\n * `Injector` returns itself when given `Injector` as a token:\n *\n * {@example core/di/ts/injector_spec.ts region='injectInjector'}\n *\n * @publicApi\n */\nclass Injector {\n static { this.THROW_IF_NOT_FOUND = THROW_IF_NOT_FOUND; }\n static { this.NULL = new NullInjector(); }\n static create(options, parent) {\n if (Array.isArray(options)) {\n return createInjector({ name: '' }, parent, options, '');\n }\n else {\n const name = options.name ?? '';\n return createInjector({ name }, options.parent, options.providers, name);\n }\n }\n /** @nocollapse */\n static { this.ɵprov = ɵɵdefineInjectable({\n token: Injector,\n providedIn: 'any',\n factory: () => ɵɵinject(INJECTOR$1),\n }); }\n /**\n * @internal\n * @nocollapse\n */\n static { this.__NG_ELEMENT_ID__ = -1 /* InjectorMarkers.Injector */; }\n}\n\n/*!\n * @license\n * Copyright Google LLC 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.dev/license\n */\n/**\n * Creates a token that can be used to inject static attributes of the host node.\n *\n * @usageNotes\n * ### Injecting an attribute that is known to exist\n * ```typescript\n * @Directive()\n * class MyDir {\n * attr: string = inject(new HostAttributeToken('some-attr'));\n * }\n * ```\n *\n * ### Optionally injecting an attribute\n * ```typescript\n * @Directive()\n * class MyDir {\n * attr: string | null = inject(new HostAttributeToken('some-attr'), {optional: true});\n * }\n * ```\n * @publicApi\n */\nclass HostAttributeToken {\n constructor(attributeName) {\n this.attributeName = attributeName;\n /** @internal */\n this.__NG_ELEMENT_ID__ = () => ɵɵinjectAttribute(this.attributeName);\n }\n toString() {\n return `HostAttributeToken ${this.attributeName}`;\n }\n}\n\n/**\n * A token that can be used to inject the tag name of the host node.\n *\n * @usageNotes\n * ### Injecting a tag name that is known to exist\n * ```typescript\n * @Directive()\n * class MyDir {\n * tagName: string = inject(HOST_TAG_NAME);\n * }\n * ```\n *\n * ### Optionally injecting a tag name\n * ```typescript\n * @Directive()\n * class MyDir {\n * tagName: string | null = inject(HOST_TAG_NAME, {optional: true});\n * }\n * ```\n * @publicApi\n */\nconst HOST_TAG_NAME = new InjectionToken(ngDevMode ? 'HOST_TAG_NAME' : '');\n// HOST_TAG_NAME should be resolved at the current node, similar to e.g. ElementRef,\n// so we manually specify __NG_ELEMENT_ID__ here, instead of using a factory.\n// tslint:disable-next-line:no-toplevel-property-access\nHOST_TAG_NAME.__NG_ELEMENT_ID__ = (flags) => {\n const tNode = getCurrentTNode();\n if (tNode === null) {\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode &&\n 'HOST_TAG_NAME can only be injected in directives and components ' +\n 'during construction time (in a class constructor or as a class field initializer)');\n }\n if (tNode.type & 2 /* TNodeType.Element */) {\n return tNode.value;\n }\n if (flags & InjectFlags.Optional) {\n return null;\n }\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode &&\n `HOST_TAG_NAME was used on ${getDevModeNodeName(tNode)} which doesn't have an underlying element in the DOM. ` +\n `This is invalid, and so the dependency should be marked as optional.`);\n};\nfunction getDevModeNodeName(tNode) {\n if (tNode.type & 8 /* TNodeType.ElementContainer */) {\n return 'an <ng-container>';\n }\n else if (tNode.type & 4 /* TNodeType.Container */) {\n return 'an <ng-template>';\n }\n else if (tNode.type & 128 /* TNodeType.LetDeclaration */) {\n return 'an @let declaration';\n }\n else {\n return 'a node';\n }\n}\n\n/**\n * @module\n * @description\n * The `di` module provides dependency injection container services.\n */\n\n/**\n * This file should not be necessary because node resolution should just default to `./di/index`!\n *\n * However it does not seem to work and it breaks:\n * - //packages/animations/browser/test:test_web_chromium-local\n * - //packages/compiler-cli/test:extract_i18n\n * - //packages/compiler-cli/test:ngc\n * - //packages/compiler-cli/test:perform_watch\n * - //packages/compiler-cli/test/diagnostics:check_types\n * - //packages/compiler-cli/test/transformers:test\n * - //packages/compiler/test:test\n * - //tools/public_api_guard:core_api\n *\n * Remove this file once the above is solved or wait until `ngc` is deleted and then it should be\n * safe to delete this file.\n */\n\nconst ERROR_ORIGINAL_ERROR = 'ngOriginalError';\nfunction wrappedError(message, originalError) {\n const msg = `${message} caused by: ${originalError instanceof Error ? originalError.message : originalError}`;\n const error = Error(msg);\n error[ERROR_ORIGINAL_ERROR] = originalError;\n return error;\n}\nfunction getOriginalError(error) {\n return error[ERROR_ORIGINAL_ERROR];\n}\n\nconst SCHEDULE_IN_ROOT_ZONE_DEFAULT = true;\n\n/**\n * `DestroyRef` lets you set callbacks to run for any cleanup or destruction behavior.\n * The scope of this destruction depends on where `DestroyRef` is injected. If `DestroyRef`\n * is injected in a component or directive, the callbacks run when that component or\n * directive is destroyed. Otherwise the callbacks run when a corresponding injector is destroyed.\n *\n * @publicApi\n */\nclass DestroyRef {\n /**\n * @internal\n * @nocollapse\n */\n static { this.__NG_ELEMENT_ID__ = injectDestroyRef; }\n /**\n * @internal\n * @nocollapse\n */\n static { this.__NG_ENV_ID__ = (injector) => injector; }\n}\nclass NodeInjectorDestroyRef extends DestroyRef {\n constructor(_lView) {\n super();\n this._lView = _lView;\n }\n onDestroy(callback) {\n storeLViewOnDestroy(this._lView, callback);\n return () => removeLViewOnDestroy(this._lView, callback);\n }\n}\nfunction injectDestroyRef() {\n return new NodeInjectorDestroyRef(getLView());\n}\n\n/**\n * Internal implementation of the pending tasks service.\n */\nclass PendingTasks {\n constructor() {\n this.taskId = 0;\n this.pendingTasks = new Set();\n this.hasPendingTasks = new BehaviorSubject(false);\n }\n get _hasPendingTasks() {\n return this.hasPendingTasks.value;\n }\n add() {\n if (!this._hasPendingTasks) {\n this.hasPendingTasks.next(true);\n }\n const taskId = this.taskId++;\n this.pendingTasks.add(taskId);\n return taskId;\n }\n remove(taskId) {\n this.pendingTasks.delete(taskId);\n if (this.pendingTasks.size === 0 && this._hasPendingTasks) {\n this.hasPendingTasks.next(false);\n }\n }\n ngOnDestroy() {\n this.pendingTasks.clear();\n if (this._hasPendingTasks) {\n this.hasPendingTasks.next(false);\n }\n }\n /** @nocollapse */\n static { this.ɵprov = ɵɵdefineInjectable({\n token: PendingTasks,\n providedIn: 'root',\n factory: () => new PendingTasks(),\n }); }\n}\n/**\n * Experimental service that keeps track of pending tasks contributing to the stableness of Angular\n * application. While several existing Angular services (ex.: `HttpClient`) will internally manage\n * tasks influencing stability, this API gives control over stability to library and application\n * developers for specific cases not covered by Angular internals.\n *\n * The concept of stability comes into play in several important scenarios:\n * - SSR process needs to wait for the application stability before serializing and sending rendered\n * HTML;\n * - tests might want to delay assertions until the application becomes stable;\n *\n * @usageNotes\n * ```typescript\n * const pendingTasks = inject(ExperimentalPendingTasks);\n * const taskCleanup = pendingTasks.add();\n * // do work that should block application's stability and then:\n * taskCleanup();\n * ```\n *\n * This API is experimental. Neither the shape, nor the underlying behavior is stable and can change\n * in patch versions. We will iterate on the exact API based on the feedback and our understanding\n * of the problem and solution space.\n *\n * @publicApi\n * @experimental\n */\nclass ExperimentalPendingTasks {\n constructor() {\n this.internalPendingTasks = inject(PendingTasks);\n }\n /**\n * Adds a new task that should block application's stability.\n * @returns A cleanup function that removes a task when called.\n */\n add() {\n const taskId = this.internalPendingTasks.add();\n return () => this.internalPendingTasks.remove(taskId);\n }\n /** @nocollapse */\n static { this.ɵprov = ɵɵdefineInjectable({\n token: ExperimentalPendingTasks,\n providedIn: 'root',\n factory: () => new ExperimentalPendingTasks(),\n }); }\n}\n\nclass EventEmitter_ extends Subject {\n constructor(isAsync = false) {\n super();\n this.destroyRef = undefined;\n this.pendingTasks = undefined;\n this.__isAsync = isAsync;\n // Attempt to retrieve a `DestroyRef` and `PendingTasks` optionally.\n // For backwards compatibility reasons, this cannot be required.\n if (isInInjectionContext()) {\n // `DestroyRef` is optional because it is not available in all contexts.\n // But it is useful to properly complete the `EventEmitter` if used with `outputToObservable`\n // when the component/directive is destroyed. (See `outputToObservable` for more details.)\n this.destroyRef = inject(DestroyRef, { optional: true }) ?? undefined;\n this.pendingTasks = inject(PendingTasks, { optional: true }) ?? undefined;\n }\n }\n emit(value) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n super.next(value);\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n subscribe(observerOrNext, error, complete) {\n let nextFn = observerOrNext;\n let errorFn = error || (() => null);\n let completeFn = complete;\n if (observerOrNext && typeof observerOrNext === 'object') {\n const observer = observerOrNext;\n nextFn = observer.next?.bind(observer);\n errorFn = observer.error?.bind(observer);\n completeFn = observer.complete?.bind(observer);\n }\n if (this.__isAsync) {\n errorFn = this.wrapInTimeout(errorFn);\n if (nextFn) {\n nextFn = this.wrapInTimeout(nextFn);\n }\n if (completeFn) {\n completeFn = this.wrapInTimeout(completeFn);\n }\n }\n const sink = super.subscribe({ next: nextFn, error: errorFn, complete: completeFn });\n if (observerOrNext instanceof Subscription) {\n observerOrNext.add(sink);\n }\n return sink;\n }\n wrapInTimeout(fn) {\n return (value) => {\n const taskId = this.pendingTasks?.add();\n setTimeout(() => {\n fn(value);\n if (taskId !== undefined) {\n this.pendingTasks?.remove(taskId);\n }\n });\n };\n }\n}\n/**\n * @publicApi\n */\nconst EventEmitter = EventEmitter_;\n\nfunction noop(...args) {\n // Do nothing.\n}\n\n/**\n * Gets a scheduling function that runs the callback after the first of setTimeout and\n * requestAnimationFrame resolves.\n *\n * - `requestAnimationFrame` ensures that change detection runs ahead of a browser repaint.\n * This ensures that the create and update passes of a change detection always happen\n * in the same frame.\n * - When the browser is resource-starved, `rAF` can execute _before_ a `setTimeout` because\n * rendering is a very high priority process. This means that `setTimeout` cannot guarantee\n * same-frame create and update pass, when `setTimeout` is used to schedule the update phase.\n * - While `rAF` gives us the desirable same-frame updates, it has two limitations that\n * prevent it from being used alone. First, it does not run in background tabs, which would\n * prevent Angular from initializing an application when opened in a new tab (for example).\n * Second, repeated calls to requestAnimationFrame will execute at the refresh rate of the\n * hardware (~16ms for a 60Hz display). This would cause significant slowdown of tests that\n * are written with several updates and asserts in the form of \"update; await stable; assert;\".\n * - Both `setTimeout` and `rAF` are able to \"coalesce\" several events from a single user\n * interaction into a single change detection. Importantly, this reduces view tree traversals when\n * compared to an alternative timing mechanism like `queueMicrotask`, where change detection would\n * then be interleaves between each event.\n *\n * By running change detection after the first of `setTimeout` and `rAF` to execute, we get the\n * best of both worlds.\n *\n * @returns a function to cancel the scheduled callback\n */\nfunction scheduleCallbackWithRafRace(callback) {\n let timeoutId;\n let animationFrameId;\n function cleanup() {\n callback = noop;\n try {\n if (animationFrameId !== undefined && typeof cancelAnimationFrame === 'function') {\n cancelAnimationFrame(animationFrameId);\n }\n if (timeoutId !== undefined) {\n clearTimeout(timeoutId);\n }\n }\n catch {\n // Clearing/canceling can fail in tests due to the timing of functions being patched and unpatched\n // Just ignore the errors - we protect ourselves from this issue by also making the callback a no-op.\n }\n }\n timeoutId = setTimeout(() => {\n callback();\n cleanup();\n });\n if (typeof requestAnimationFrame === 'function') {\n animationFrameId = requestAnimationFrame(() => {\n callback();\n cleanup();\n });\n }\n return () => cleanup();\n}\nfunction scheduleCallbackWithMicrotask(callback) {\n queueMicrotask(() => callback());\n return () => {\n callback = noop;\n };\n}\n\nclass AsyncStackTaggingZoneSpec {\n constructor(namePrefix, consoleAsyncStackTaggingImpl = console) {\n this.name = 'asyncStackTagging for ' + namePrefix;\n this.createTask = consoleAsyncStackTaggingImpl?.createTask ?? (() => null);\n }\n onScheduleTask(delegate, _current, target, task) {\n task.consoleTask = this.createTask(`Zone - ${task.source || task.type}`);\n return delegate.scheduleTask(target, task);\n }\n onInvokeTask(delegate, _currentZone, targetZone, task, applyThis, applyArgs) {\n let ret;\n if (task.consoleTask) {\n ret = task.consoleTask.run(() => delegate.invokeTask(targetZone, task, applyThis, applyArgs));\n }\n else {\n ret = delegate.invokeTask(targetZone, task, applyThis, applyArgs);\n }\n return ret;\n }\n}\n\nconst isAngularZoneProperty = 'isAngularZone';\nconst angularZoneInstanceIdProperty = isAngularZoneProperty + '_ID';\nlet ngZoneInstanceId = 0;\n/**\n * An injectable service for executing work inside or outside of the Angular zone.\n *\n * The most common use of this service is to optimize performance when starting a work consisting of\n * one or more asynchronous tasks that don't require UI updates or error handling to be handled by\n * Angular. Such tasks can be kicked off via {@link #runOutsideAngular} and if needed, these tasks\n * can reenter the Angular zone via {@link #run}.\n *\n * <!-- TODO: add/fix links to:\n * - docs explaining zones and the use of zones in Angular and change-detection\n * - link to runOutsideAngular/run (throughout this file!)\n * -->\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * import {Component, NgZone} from '@angular/core';\n * import {NgIf} from '@angular/common';\n *\n * @Component({\n * selector: 'ng-zone-demo',\n * template: `\n * <h2>Demo: NgZone</h2>\n *\n * <p>Progress: {{progress}}%</p>\n * <p *ngIf=\"progress >= 100\">Done processing {{label}} of Angular zone!</p>\n *\n * <button (click)=\"processWithinAngularZone()\">Process within Angular zone</button>\n * <button (click)=\"processOutsideOfAngularZone()\">Process outside of Angular zone</button>\n * `,\n * })\n * export class NgZoneDemo {\n * progress: number = 0;\n * label: string;\n *\n * constructor(private _ngZone: NgZone) {}\n *\n * // Loop inside the Angular zone\n * // so the UI DOES refresh after each setTimeout cycle\n * processWithinAngularZone() {\n * this.label = 'inside';\n * this.progress = 0;\n * this._increaseProgress(() => console.log('Inside Done!'));\n * }\n *\n * // Loop outside of the Angular zone\n * // so the UI DOES NOT refresh after each setTimeout cycle\n * processOutsideOfAngularZone() {\n * this.label = 'outside';\n * this.progress = 0;\n * this._ngZone.runOutsideAngular(() => {\n * this._increaseProgress(() => {\n * // reenter the Angular zone and display done\n * this._ngZone.run(() => { console.log('Outside Done!'); });\n * });\n * });\n * }\n *\n * _increaseProgress(doneCallback: () => void) {\n * this.progress += 1;\n * console.log(`Current progress: ${this.progress}%`);\n *\n * if (this.progress < 100) {\n * window.setTimeout(() => this._increaseProgress(doneCallback), 10);\n * } else {\n * doneCallback();\n * }\n * }\n * }\n * ```\n *\n * @publicApi\n */\nclass NgZone {\n constructor(options) {\n this.hasPendingMacrotasks = false;\n this.hasPendingMicrotasks = false;\n /**\n * Whether there are no outstanding microtasks or macrotasks.\n */\n this.isStable = true;\n /**\n * Notifies when code enters Angular Zone. This gets fired first on VM Turn.\n */\n this.onUnstable = new EventEmitter(false);\n /**\n * Notifies when there is no more microtasks enqueued in the current VM Turn.\n * This is a hint for Angular to do change detection, which may enqueue more microtasks.\n * For this reason this event can fire multiple times per VM Turn.\n */\n this.onMicrotaskEmpty = new EventEmitter(false);\n /**\n * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which\n * implies we are about to relinquish VM turn.\n * This event gets called just once.\n */\n this.onStable = new EventEmitter(false);\n /**\n * Notifies that an error has been delivered.\n */\n this.onError = new EventEmitter(false);\n const { enableLongStackTrace = false, shouldCoalesceEventChangeDetection = false, shouldCoalesceRunChangeDetection = false, scheduleInRootZone = SCHEDULE_IN_ROOT_ZONE_DEFAULT, } = options;\n if (typeof Zone == 'undefined') {\n throw new RuntimeError(908 /* RuntimeErrorCode.MISSING_ZONEJS */, ngDevMode && `In this configuration Angular requires Zone.js`);\n }\n Zone.assertZonePatched();\n const self = this;\n self._nesting = 0;\n self._outer = self._inner = Zone.current;\n // AsyncStackTaggingZoneSpec provides `linked stack traces` to show\n // where the async operation is scheduled. For more details, refer\n // to this article, https://developer.chrome.com/blog/devtools-better-angular-debugging/\n // And we only import this AsyncStackTaggingZoneSpec in development mode,\n // in the production mode, the AsyncStackTaggingZoneSpec will be tree shaken away.\n if (ngDevMode) {\n self._inner = self._inner.fork(new AsyncStackTaggingZoneSpec('Angular'));\n }\n if (Zone['TaskTrackingZoneSpec']) {\n self._inner = self._inner.fork(new Zone['TaskTrackingZoneSpec']());\n }\n if (enableLongStackTrace && Zone['longStackTraceZoneSpec']) {\n self._inner = self._inner.fork(Zone['longStackTraceZoneSpec']);\n }\n // if shouldCoalesceRunChangeDetection is true, all tasks including event tasks will be\n // coalesced, so shouldCoalesceEventChangeDetection option is not necessary and can be skipped.\n self.shouldCoalesceEventChangeDetection =\n !shouldCoalesceRunChangeDetection && shouldCoalesceEventChangeDetection;\n self.shouldCoalesceRunChangeDetection = shouldCoalesceRunChangeDetection;\n self.callbackScheduled = false;\n self.scheduleInRootZone = scheduleInRootZone;\n forkInnerZoneWithAngularBehavior(self);\n }\n /**\n This method checks whether the method call happens within an Angular Zone instance.\n */\n static isInAngularZone() {\n // Zone needs to be checked, because this method might be called even when NoopNgZone is used.\n return typeof Zone !== 'undefined' && Zone.current.get(isAngularZoneProperty) === true;\n }\n /**\n Assures that the method is called within the Angular Zone, otherwise throws an error.\n */\n static assertInAngularZone() {\n if (!NgZone.isInAngularZone()) {\n throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to be in Angular Zone, but it is not!');\n }\n }\n /**\n Assures that the method is called outside of the Angular Zone, otherwise throws an error.\n */\n static assertNotInAngularZone() {\n if (NgZone.isInAngularZone()) {\n throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to not be in Angular Zone, but it is!');\n }\n }\n /**\n * Executes the `fn` function synchronously within the Angular zone and returns value returned by\n * the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n run(fn, applyThis, applyArgs) {\n return this._inner.run(fn, applyThis, applyArgs);\n }\n /**\n * Executes the `fn` function synchronously within the Angular zone as a task and returns value\n * returned by the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n runTask(fn, applyThis, applyArgs, name) {\n const zone = this._inner;\n const task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);\n try {\n return zone.runTask(task, applyThis, applyArgs);\n }\n finally {\n zone.cancelTask(task);\n }\n }\n /**\n * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not\n * rethrown.\n */\n runGuarded(fn, applyThis, applyArgs) {\n return this._inner.runGuarded(fn, applyThis, applyArgs);\n }\n /**\n * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by\n * the function.\n *\n * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do\n * work that\n * doesn't trigger Angular change-detection or is subject to Angular's error handling.\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * outside of the Angular zone.\n *\n * Use {@link #run} to reenter the Angular zone and do work that updates the application model.\n */\n runOutsideAngular(fn) {\n return this._outer.run(fn);\n }\n}\nconst EMPTY_PAYLOAD = {};\nfunction checkStable(zone) {\n // TODO: @JiaLiPassion, should check zone.isCheckStableRunning to prevent\n // re-entry. The case is:\n //\n // @Component({...})\n // export class AppComponent {\n // constructor(private ngZone: NgZone) {\n // this.ngZone.onStable.subscribe(() => {\n // this.ngZone.run(() => console.log('stable'););\n // });\n // }\n //\n // The onStable subscriber run another function inside ngZone\n // which causes `checkStable()` re-entry.\n // But this fix causes some issues in g3, so this fix will be\n // launched in another PR.\n if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {\n try {\n zone._nesting++;\n zone.onMicrotaskEmpty.emit(null);\n }\n finally {\n zone._nesting--;\n if (!zone.hasPendingMicrotasks) {\n try {\n zone.runOutsideAngular(() => zone.onStable.emit(null));\n }\n finally {\n zone.isStable = true;\n }\n }\n }\n }\n}\nfunction delayChangeDetectionForEvents(zone) {\n /**\n * We also need to check _nesting here\n * Consider the following case with shouldCoalesceRunChangeDetection = true\n *\n * ngZone.run(() => {});\n * ngZone.run(() => {});\n *\n * We want the two `ngZone.run()` only trigger one change detection\n * when shouldCoalesceRunChangeDetection is true.\n * And because in this case, change detection run in async way(requestAnimationFrame),\n * so we also need to check the _nesting here to prevent multiple\n * change detections.\n */\n if (zone.isCheckStableRunning || zone.callbackScheduled) {\n return;\n }\n zone.callbackScheduled = true;\n function scheduleCheckStable() {\n scheduleCallbackWithRafRace(() => {\n zone.callbackScheduled = false;\n updateMicroTaskStatus(zone);\n zone.isCheckStableRunning = true;\n checkStable(zone);\n zone.isCheckStableRunning = false;\n });\n }\n if (zone.scheduleInRootZone) {\n Zone.root.run(() => {\n scheduleCheckStable();\n });\n }\n else {\n zone._outer.run(() => {\n scheduleCheckStable();\n });\n }\n updateMicroTaskStatus(zone);\n}\nfunction forkInnerZoneWithAngularBehavior(zone) {\n const delayChangeDetectionForEventsDelegate = () => {\n delayChangeDetectionForEvents(zone);\n };\n const instanceId = ngZoneInstanceId++;\n zone._inner = zone._inner.fork({\n name: 'angular',\n properties: {\n [isAngularZoneProperty]: true,\n [angularZoneInstanceIdProperty]: instanceId,\n [angularZoneInstanceIdProperty + instanceId]: true,\n },\n onInvokeTask: (delegate, current, target, task, applyThis, applyArgs) => {\n // Prevent triggering change detection when the flag is detected.\n if (shouldBeIgnoredByZone(applyArgs)) {\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n }\n try {\n onEnter(zone);\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n }\n finally {\n if ((zone.shouldCoalesceEventChangeDetection && task.type === 'eventTask') ||\n zone.shouldCoalesceRunChangeDetection) {\n delayChangeDetectionForEventsDelegate();\n }\n onLeave(zone);\n }\n },\n onInvoke: (delegate, current, target, callback, applyThis, applyArgs, source) => {\n try {\n onEnter(zone);\n return delegate.invoke(target, callback, applyThis, applyArgs, source);\n }\n finally {\n if (zone.shouldCoalesceRunChangeDetection &&\n // Do not delay change detection when the task is the scheduler's tick.\n // We need to synchronously trigger the stability logic so that the\n // zone-based scheduler can prevent a duplicate ApplicationRef.tick\n // by first checking if the scheduler tick is running. This does seem a bit roundabout,\n // but we _do_ still want to trigger all the correct events when we exit the zone.run\n // (`onMicrotaskEmpty` and `onStable` _should_ emit; developers can have code which\n // relies on these events happening after change detection runs).\n // Note: `zone.callbackScheduled` is already in delayChangeDetectionForEventsDelegate\n // but is added here as well to prevent reads of applyArgs when not necessary\n !zone.callbackScheduled &&\n !isSchedulerTick(applyArgs)) {\n delayChangeDetectionForEventsDelegate();\n }\n onLeave(zone);\n }\n },\n onHasTask: (delegate, current, target, hasTaskState) => {\n delegate.hasTask(target, hasTaskState);\n if (current === target) {\n // We are only interested in hasTask events which originate from our zone\n // (A child hasTask event is not interesting to us)\n if (hasTaskState.change == 'microTask') {\n zone._hasPendingMicrotasks = hasTaskState.microTask;\n updateMicroTaskStatus(zone);\n checkStable(zone);\n }\n else if (hasTaskState.change == 'macroTask') {\n zone.hasPendingMacrotasks = hasTaskState.macroTask;\n }\n }\n },\n onHandleError: (delegate, current, target, error) => {\n delegate.handleError(target, error);\n zone.runOutsideAngular(() => zone.onError.emit(error));\n return false;\n },\n });\n}\nfunction updateMicroTaskStatus(zone) {\n if (zone._hasPendingMicrotasks ||\n ((zone.shouldCoalesceEventChangeDetection || zone.shouldCoalesceRunChangeDetection) &&\n zone.callbackScheduled === true)) {\n zone.hasPendingMicrotasks = true;\n }\n else {\n zone.hasPendingMicrotasks = false;\n }\n}\nfunction onEnter(zone) {\n zone._nesting++;\n if (zone.isStable) {\n zone.isStable = false;\n zone.onUnstable.emit(null);\n }\n}\nfunction onLeave(zone) {\n zone._nesting--;\n checkStable(zone);\n}\n/**\n * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls\n * to framework to perform rendering.\n */\nclass NoopNgZone {\n constructor() {\n this.hasPendingMicrotasks = false;\n this.hasPendingMacrotasks = false;\n this.isStable = true;\n this.onUnstable = new EventEmitter();\n this.onMicrotaskEmpty = new EventEmitter();\n this.onStable = new EventEmitter();\n this.onError = new EventEmitter();\n }\n run(fn, applyThis, applyArgs) {\n return fn.apply(applyThis, applyArgs);\n }\n runGuarded(fn, applyThis, applyArgs) {\n return fn.apply(applyThis, applyArgs);\n }\n runOutsideAngular(fn) {\n return fn();\n }\n runTask(fn, applyThis, applyArgs, name) {\n return fn.apply(applyThis, applyArgs);\n }\n}\nfunction shouldBeIgnoredByZone(applyArgs) {\n return hasApplyArgsData(applyArgs, '__ignore_ng_zone__');\n}\nfunction isSchedulerTick(applyArgs) {\n return hasApplyArgsData(applyArgs, '__scheduler_tick__');\n}\nfunction hasApplyArgsData(applyArgs, key) {\n if (!Array.isArray(applyArgs)) {\n return false;\n }\n // We should only ever get 1 arg passed through to invokeTask.\n // Short circuit here incase that behavior changes.\n if (applyArgs.length !== 1) {\n return false;\n }\n return applyArgs[0]?.data?.[key] === true;\n}\nfunction getNgZone(ngZoneToUse = 'zone.js', options) {\n if (ngZoneToUse === 'noop') {\n return new NoopNgZone();\n }\n if (ngZoneToUse === 'zone.js') {\n return new NgZone(options);\n }\n return ngZoneToUse;\n}\n\n// Public API for Zone\n\n/**\n * Provides a hook for centralized exception handling.\n *\n * The default implementation of `ErrorHandler` prints error messages to the `console`. To\n * intercept error handling, write a custom exception handler that replaces this default as\n * appropriate for your app.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * class MyErrorHandler implements ErrorHandler {\n * handleError(error) {\n * // do something with the exception\n * }\n * }\n *\n * @NgModule({\n * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]\n * })\n * class MyModule {}\n * ```\n *\n * @publicApi\n */\nclass ErrorHandler {\n constructor() {\n /**\n * @internal\n */\n this._console = console;\n }\n handleError(error) {\n const originalError = this._findOriginalError(error);\n this._console.error('ERROR', error);\n if (originalError) {\n this._console.error('ORIGINAL ERROR', originalError);\n }\n }\n /** @internal */\n _findOriginalError(error) {\n let e = error && getOriginalError(error);\n while (e && getOriginalError(e)) {\n e = getOriginalError(e);\n }\n return e || null;\n }\n}\n/**\n * `InjectionToken` used to configure how to call the `ErrorHandler`.\n *\n * `NgZone` is provided by default today so the default (and only) implementation for this\n * is calling `ErrorHandler.handleError` outside of the Angular zone.\n */\nconst INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'internal error handler' : '', {\n providedIn: 'root',\n factory: () => {\n const zone = inject(NgZone);\n const userErrorHandler = inject(ErrorHandler);\n return (e) => zone.runOutsideAngular(() => userErrorHandler.handleError(e));\n },\n});\n\n/**\n * An `OutputEmitterRef` is created by the `output()` function and can be\n * used to emit values to consumers of your directive or component.\n *\n * Consumers of your directive/component can bind to the output and\n * subscribe to changes via the bound event syntax. For example:\n *\n * ```html\n * <my-comp (valueChange)=\"processNewValue($event)\" />\n * ```\n *\n * @developerPreview\n */\nclass OutputEmitterRef {\n constructor() {\n this.destroyed = false;\n this.listeners = null;\n this.errorHandler = inject(ErrorHandler, { optional: true });\n /** @internal */\n this.destroyRef = inject(DestroyRef);\n // Clean-up all listeners and mark as destroyed upon destroy.\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n this.listeners = null;\n });\n }\n subscribe(callback) {\n if (this.destroyed) {\n throw new RuntimeError(953 /* RuntimeErrorCode.OUTPUT_REF_DESTROYED */, ngDevMode &&\n 'Unexpected subscription to destroyed `OutputRef`. ' +\n 'The owning directive/component is destroyed.');\n }\n (this.listeners ??= []).push(callback);\n return {\n unsubscribe: () => {\n const idx = this.listeners?.indexOf(callback);\n if (idx !== undefined && idx !== -1) {\n this.listeners?.splice(idx, 1);\n }\n },\n };\n }\n /** Emits a new value to the output. */\n emit(value) {\n if (this.destroyed) {\n throw new RuntimeError(953 /* RuntimeErrorCode.OUTPUT_REF_DESTROYED */, ngDevMode &&\n 'Unexpected emit for destroyed `OutputRef`. ' +\n 'The owning directive/component is destroyed.');\n }\n if (this.listeners === null) {\n return;\n }\n const previousConsumer = setActiveConsumer$1(null);\n try {\n for (const listenerFn of this.listeners) {\n try {\n listenerFn(value);\n }\n catch (err) {\n this.errorHandler?.handleError(err);\n }\n }\n }\n finally {\n setActiveConsumer$1(previousConsumer);\n }\n }\n}\n/** Gets the owning `DestroyRef` for the given output. */\nfunction getOutputDestroyRef(ref) {\n return ref.destroyRef;\n}\n\n/**\n * The `output` function allows declaration of Angular outputs in\n * directives and components.\n *\n * You can use outputs to emit values to parent directives and component.\n * Parents can subscribe to changes via:\n *\n * - template event bindings. For example, `(myOutput)=\"doSomething($event)\"`\n * - programmatic subscription by using `OutputRef#subscribe`.\n *\n * @usageNotes\n *\n * To use `output()`, import the function from `@angular/core`.\n *\n * ```ts\n * import {output} from '@angular/core';\n * ```\n *\n * Inside your component, introduce a new class member and initialize\n * it with a call to `output`.\n *\n * ```ts\n * @Directive({\n * ...\n * })\n * export class MyDir {\n * nameChange = output<string>(); // OutputEmitterRef<string>\n * onClick = output(); // OutputEmitterRef<void>\n * }\n * ```\n *\n * You can emit values to consumers of your directive, by using\n * the `emit` method from `OutputEmitterRef`.\n *\n * ```ts\n * updateName(newName: string): void {\n * this.nameChange.emit(newName);\n * }\n * ```\n *\n * @developerPreview\n * @initializerApiFunction {\"showTypesInSignaturePreview\": true}\n */\nfunction output(opts) {\n ngDevMode && assertInInjectionContext(output);\n return new OutputEmitterRef();\n}\n\nfunction inputFunction(initialValue, opts) {\n ngDevMode && assertInInjectionContext(input);\n return createInputSignal(initialValue, opts);\n}\nfunction inputRequiredFunction(opts) {\n ngDevMode && assertInInjectionContext(input);\n return createInputSignal(REQUIRED_UNSET_VALUE, opts);\n}\n/**\n * The `input` function allows declaration of Angular inputs in directives\n * and components.\n *\n * There are two variants of inputs that can be declared:\n *\n * 1. **Optional inputs** with an initial value.\n * 2. **Required inputs** that consumers need to set.\n *\n * By default, the `input` function will declare optional inputs that\n * always have an initial value. Required inputs can be declared\n * using the `input.required()` function.\n *\n * Inputs are signals. The values of an input are exposed as a `Signal`.\n * The signal always holds the latest value of the input that is bound\n * from the parent.\n *\n * @usageNotes\n * To use signal-based inputs, import `input` from `@angular/core`.\n *\n * ```\n * import {input} from '@angular/core`;\n * ```\n *\n * Inside your component, introduce a new class member and initialize\n * it with a call to `input` or `input.required`.\n *\n * ```ts\n * @Component({\n * ...\n * })\n * export class UserProfileComponent {\n * firstName = input<string>(); // Signal<string|undefined>\n * lastName = input.required<string>(); // Signal<string>\n * age = input(0) // Signal<number>\n * }\n * ```\n *\n * Inside your component template, you can display values of the inputs\n * by calling the signal.\n *\n * ```html\n * <span>{{firstName()}}</span>\n * ```\n *\n * @developerPreview\n * @initializerApiFunction\n */\nconst input = (() => {\n // Note: This may be considered a side-effect, but nothing will depend on\n // this assignment, unless this `input` constant export is accessed. It's a\n // self-contained side effect that is local to the user facing`input` export.\n inputFunction.required = inputRequiredFunction;\n return inputFunction;\n})();\n\n/**\n * Creates an ElementRef from the most recent node.\n *\n * @returns The ElementRef instance to use\n */\nfunction injectElementRef() {\n return createElementRef(getCurrentTNode(), getLView());\n}\n/**\n * Creates an ElementRef given a node.\n *\n * @param tNode The node for which you'd like an ElementRef\n * @param lView The view to which the node belongs\n * @returns The ElementRef instance to use\n */\nfunction createElementRef(tNode, lView) {\n return new ElementRef(getNativeByTNode(tNode, lView));\n}\n/**\n * A wrapper around a native element inside of a View.\n *\n * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM\n * element.\n *\n * @security Permitting direct access to the DOM can make your application more vulnerable to\n * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the\n * [Security Guide](https://g.co/ng/security).\n *\n * @publicApi\n */\n// Note: We don't expose things like `Injector`, `ViewContainer`, ... here,\n// i.e. users have to ask for what they need. With that, we can build better analysis tools\n// and could do better codegen in the future.\nclass ElementRef {\n constructor(nativeElement) {\n this.nativeElement = nativeElement;\n }\n /**\n * @internal\n * @nocollapse\n */\n static { this.__NG_ELEMENT_ID__ = injectElementRef; }\n}\n/**\n * Unwraps `ElementRef` and return the `nativeElement`.\n *\n * @param value value to unwrap\n * @returns `nativeElement` if `ElementRef` otherwise returns value as is.\n */\nfunction unwrapElementRef(value) {\n return value instanceof ElementRef ? value.nativeElement : value;\n}\n\nfunction symbolIterator() {\n // @ts-expect-error accessing a private member\n return this._results[Symbol.iterator]();\n}\n/**\n * An unmodifiable list of items that Angular keeps up to date when the state\n * of the application changes.\n *\n * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}\n * provide.\n *\n * Implements an iterable interface, therefore it can be used in both ES6\n * javascript `for (var i of items)` loops as well as in Angular templates with\n * `*ngFor=\"let i of myList\"`.\n *\n * Changes can be observed by subscribing to the changes `Observable`.\n *\n * NOTE: In the future this class will implement an `Observable` interface.\n *\n * @usageNotes\n * ### Example\n * ```typescript\n * @Component({...})\n * class Container {\n * @ViewChildren(Item) items:QueryList<Item>;\n * }\n * ```\n *\n * @publicApi\n */\nclass QueryList {\n static { Symbol.iterator; }\n /**\n * Returns `Observable` of `QueryList` notifying the subscriber of changes.\n */\n get changes() {\n return (this._changes ??= new EventEmitter());\n }\n /**\n * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change\n * has occurred. Or if it should fire when query is recomputed. (recomputing could resolve in\n * the same result)\n */\n constructor(_emitDistinctChangesOnly = false) {\n this._emitDistinctChangesOnly = _emitDistinctChangesOnly;\n this.dirty = true;\n this._onDirty = undefined;\n this._results = [];\n this._changesDetected = false;\n this._changes = undefined;\n this.length = 0;\n this.first = undefined;\n this.last = undefined;\n // This function should be declared on the prototype, but doing so there will cause the class\n // declaration to have side-effects and become not tree-shakable. For this reason we do it in\n // the constructor.\n // [Symbol.iterator](): Iterator<T> { ... }\n const proto = QueryList.prototype;\n if (!proto[Symbol.iterator])\n proto[Symbol.iterator] = symbolIterator;\n }\n /**\n * Returns the QueryList entry at `index`.\n */\n get(index) {\n return this._results[index];\n }\n /**\n * See\n * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n */\n map(fn) {\n return this._results.map(fn);\n }\n filter(fn) {\n return this._results.filter(fn);\n }\n /**\n * See\n * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n */\n find(fn) {\n return this._results.find(fn);\n }\n /**\n * See\n * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n */\n reduce(fn, init) {\n return this._results.reduce(fn, init);\n }\n /**\n * See\n * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n */\n forEach(fn) {\n this._results.forEach(fn);\n }\n /**\n * See\n * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n */\n some(fn) {\n return this._results.some(fn);\n }\n /**\n * Returns a copy of the internal results list as an Array.\n */\n toArray() {\n return this._results.slice();\n }\n toString() {\n return this._results.toString();\n }\n /**\n * Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that\n * on change detection, it will not notify of changes to the queries, unless a new change\n * occurs.\n *\n * @param resultsTree The query results to store\n * @param identityAccessor Optional function for extracting stable object identity from a value\n * in the array. This function is executed for each element of the query result list while\n * comparing current query list with the new one (provided as a first argument of the `reset`\n * function) to detect if the lists are different. If the function is not provided, elements\n * are compared as is (without any pre-processing).\n */\n reset(resultsTree, identityAccessor) {\n this.dirty = false;\n const newResultFlat = flatten(resultsTree);\n if ((this._changesDetected = !arrayEquals(this._results, newResultFlat, identityAccessor))) {\n this._results = newResultFlat;\n this.length = newResultFlat.length;\n this.last = newResultFlat[this.length - 1];\n this.first = newResultFlat[0];\n }\n }\n /**\n * Triggers a change event by emitting on the `changes` {@link EventEmitter}.\n */\n notifyOnChanges() {\n if (this._changes !== undefined && (this._changesDetected || !this._emitDistinctChangesOnly))\n this._changes.emit(this);\n }\n /** @internal */\n onDirty(cb) {\n this._onDirty = cb;\n }\n /** internal */\n setDirty() {\n this.dirty = true;\n this._onDirty?.();\n }\n /** internal */\n destroy() {\n if (this._changes !== undefined) {\n this._changes.complete();\n this._changes.unsubscribe();\n }\n }\n}\n\n/**\n * The name of an attribute that can be added to the hydration boundary node\n * (component host node) to disable hydration for the content within that boundary.\n */\nconst SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration';\n/** Lowercase name of the `ngSkipHydration` attribute used for case-insensitive comparisons. */\nconst SKIP_HYDRATION_ATTR_NAME_LOWER_CASE = 'ngskiphydration';\n/**\n * Helper function to check if a given TNode has the 'ngSkipHydration' attribute.\n */\nfunction hasSkipHydrationAttrOnTNode(tNode) {\n const attrs = tNode.mergedAttrs;\n if (attrs === null)\n return false;\n // only ever look at the attribute name and skip the values\n for (let i = 0; i < attrs.length; i += 2) {\n const value = attrs[i];\n // This is a marker, which means that the static attributes section is over,\n // so we can exit early.\n if (typeof value === 'number')\n return false;\n if (typeof value === 'string' && value.toLowerCase() === SKIP_HYDRATION_ATTR_NAME_LOWER_CASE) {\n return true;\n }\n }\n return false;\n}\n/**\n * Helper function to check if a given RElement has the 'ngSkipHydration' attribute.\n */\nfunction hasSkipHydrationAttrOnRElement(rNode) {\n return rNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME);\n}\n/**\n * Checks whether a TNode has a flag to indicate that it's a part of\n * a skip hydration block.\n */\nfunction hasInSkipHydrationBlockFlag(tNode) {\n return (tNode.flags & 128 /* TNodeFlags.inSkipHydrationBlock */) === 128 /* TNodeFlags.inSkipHydrationBlock */;\n}\n/**\n * Helper function that determines if a given node is within a skip hydration block\n * by navigating up the TNode tree to see if any parent nodes have skip hydration\n * attribute.\n */\nfunction isInSkipHydrationBlock(tNode) {\n if (hasInSkipHydrationBlockFlag(tNode)) {\n return true;\n }\n let currentTNode = tNode.parent;\n while (currentTNode) {\n if (hasInSkipHydrationBlockFlag(tNode) || hasSkipHydrationAttrOnTNode(currentTNode)) {\n return true;\n }\n currentTNode = currentTNode.parent;\n }\n return false;\n}\n/**\n * Check if an i18n block is in a skip hydration section by looking at a parent TNode\n * to determine if this TNode is in a skip hydration section or the TNode has\n * the `ngSkipHydration` attribute.\n */\nfunction isI18nInSkipHydrationBlock(parentTNode) {\n return (hasInSkipHydrationBlockFlag(parentTNode) ||\n hasSkipHydrationAttrOnTNode(parentTNode) ||\n isInSkipHydrationBlock(parentTNode));\n}\n\n// Keeps track of the currently-active LViews.\nconst TRACKED_LVIEWS = new Map();\n// Used for generating unique IDs for LViews.\nlet uniqueIdCounter = 0;\n/** Gets a unique ID that can be assigned to an LView. */\nfunction getUniqueLViewId() {\n return uniqueIdCounter++;\n}\n/** Starts tracking an LView. */\nfunction registerLView(lView) {\n ngDevMode && assertNumber(lView[ID], 'LView must have an ID in order to be registered');\n TRACKED_LVIEWS.set(lView[ID], lView);\n}\n/** Gets an LView by its unique ID. */\nfunction getLViewById(id) {\n ngDevMode && assertNumber(id, 'ID used for LView lookup must be a number');\n return TRACKED_LVIEWS.get(id) || null;\n}\n/** Stops tracking an LView. */\nfunction unregisterLView(lView) {\n ngDevMode && assertNumber(lView[ID], 'Cannot stop tracking an LView that does not have an ID');\n TRACKED_LVIEWS.delete(lView[ID]);\n}\n\n/**\n * The internal view context which is specific to a given DOM element, directive or\n * component instance. Each value in here (besides the LView and element node details)\n * can be present, null or undefined. If undefined then it implies the value has not been\n * looked up yet, otherwise, if null, then a lookup was executed and nothing was found.\n *\n * Each value will get filled when the respective value is examined within the getContext\n * function. The component, element and each directive instance will share the same instance\n * of the context.\n */\nclass LContext {\n /** Component's parent view data. */\n get lView() {\n return getLViewById(this.lViewId);\n }\n constructor(\n /**\n * ID of the component's parent view data.\n */\n lViewId, \n /**\n * The index instance of the node.\n */\n nodeIndex, \n /**\n * The instance of the DOM node that is attached to the lNode.\n */\n native) {\n this.lViewId = lViewId;\n this.nodeIndex = nodeIndex;\n this.native = native;\n }\n}\n\n/**\n * Returns the matching `LContext` data for a given DOM node, directive or component instance.\n *\n * This function will examine the provided DOM element, component, or directive instance\\'s\n * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched\n * value will be that of the newly created `LContext`.\n *\n * If the monkey-patched value is the `LView` instance then the context value for that\n * target will be created and the monkey-patch reference will be updated. Therefore when this\n * function is called it may mutate the provided element\\'s, component\\'s or any of the associated\n * directive\\'s monkey-patch values.\n *\n * If the monkey-patch value is not detected then the code will walk up the DOM until an element\n * is found which contains a monkey-patch reference. When that occurs then the provided element\n * will be updated with a new context (which is then returned). If the monkey-patch value is not\n * detected for a component/directive instance then it will throw an error (all components and\n * directives should be automatically monkey-patched by ivy).\n *\n * @param target Component, Directive or DOM Node.\n */\nfunction getLContext(target) {\n let mpValue = readPatchedData(target);\n if (mpValue) {\n // only when it's an array is it considered an LView instance\n // ... otherwise it's an already constructed LContext instance\n if (isLView(mpValue)) {\n const lView = mpValue;\n let nodeIndex;\n let component = undefined;\n let directives = undefined;\n if (isComponentInstance(target)) {\n nodeIndex = findViaComponent(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided component was not found in the application');\n }\n component = target;\n }\n else if (isDirectiveInstance(target)) {\n nodeIndex = findViaDirective(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided directive was not found in the application');\n }\n directives = getDirectivesAtNodeIndex(nodeIndex, lView);\n }\n else {\n nodeIndex = findViaNativeElement(lView, target);\n if (nodeIndex == -1) {\n return null;\n }\n }\n // the goal is not to fill the entire context full of data because the lookups\n // are expensive. Instead, only the target data (the element, component, container, ICU\n // expression or directive details) are filled into the context. If called multiple times\n // with different target values then the missing target data will be filled in.\n const native = unwrapRNode(lView[nodeIndex]);\n const existingCtx = readPatchedData(native);\n const context = existingCtx && !Array.isArray(existingCtx)\n ? existingCtx\n : createLContext(lView, nodeIndex, native);\n // only when the component has been discovered then update the monkey-patch\n if (component && context.component === undefined) {\n context.component = component;\n attachPatchData(context.component, context);\n }\n // only when the directives have been discovered then update the monkey-patch\n if (directives && context.directives === undefined) {\n context.directives = directives;\n for (let i = 0; i < directives.length; i++) {\n attachPatchData(directives[i], context);\n }\n }\n attachPatchData(context.native, context);\n mpValue = context;\n }\n }\n else {\n const rElement = target;\n ngDevMode && assertDomNode(rElement);\n // if the context is not found then we need to traverse upwards up the DOM\n // to find the nearest element that has already been monkey patched with data\n let parent = rElement;\n while ((parent = parent.parentNode)) {\n const parentContext = readPatchedData(parent);\n if (parentContext) {\n const lView = Array.isArray(parentContext) ? parentContext : parentContext.lView;\n // the edge of the app was also reached here through another means\n // (maybe because the DOM was changed manually).\n if (!lView) {\n return null;\n }\n const index = findViaNativeElement(lView, rElement);\n if (index >= 0) {\n const native = unwrapRNode(lView[index]);\n const context = createLContext(lView, index, native);\n attachPatchData(native, context);\n mpValue = context;\n break;\n }\n }\n }\n }\n return mpValue || null;\n}\n/**\n * Creates an empty instance of a `LContext` context\n */\nfunction createLContext(lView, nodeIndex, native) {\n return new LContext(lView[ID], nodeIndex, native);\n}\n/**\n * Takes a component instance and returns the view for that component.\n *\n * @param componentInstance\n * @returns The component's view\n */\nfunction getComponentViewByInstance(componentInstance) {\n let patchedData = readPatchedData(componentInstance);\n let lView;\n if (isLView(patchedData)) {\n const contextLView = patchedData;\n const nodeIndex = findViaComponent(contextLView, componentInstance);\n lView = getComponentLViewByIndex(nodeIndex, contextLView);\n const context = createLContext(contextLView, nodeIndex, lView[HOST]);\n context.component = componentInstance;\n attachPatchData(componentInstance, context);\n attachPatchData(context.native, context);\n }\n else {\n const context = patchedData;\n const contextLView = context.lView;\n ngDevMode && assertLView(contextLView);\n lView = getComponentLViewByIndex(context.nodeIndex, contextLView);\n }\n return lView;\n}\n/**\n * This property will be monkey-patched on elements, components and directives.\n */\nconst MONKEY_PATCH_KEY_NAME = '__ngContext__';\nfunction attachLViewId(target, data) {\n target[MONKEY_PATCH_KEY_NAME] = data[ID];\n}\n/**\n * Returns the monkey-patch value data present on the target (which could be\n * a component, directive or a DOM node).\n */\nfunction readLView(target) {\n const data = readPatchedData(target);\n if (isLView(data)) {\n return data;\n }\n return data ? data.lView : null;\n}\n/**\n * Assigns the given data to the given target (which could be a component,\n * directive or DOM node instance) using monkey-patching.\n */\nfunction attachPatchData(target, data) {\n ngDevMode && assertDefined(target, 'Target expected');\n // Only attach the ID of the view in order to avoid memory leaks (see #41047). We only do this\n // for `LView`, because we have control over when an `LView` is created and destroyed, whereas\n // we can't know when to remove an `LContext`.\n if (isLView(data)) {\n target[MONKEY_PATCH_KEY_NAME] = data[ID];\n registerLView(data);\n }\n else {\n target[MONKEY_PATCH_KEY_NAME] = data;\n }\n}\n/**\n * Returns the monkey-patch value data present on the target (which could be\n * a component, directive or a DOM node).\n */\nfunction readPatchedData(target) {\n ngDevMode && assertDefined(target, 'Target expected');\n const data = target[MONKEY_PATCH_KEY_NAME];\n return typeof data === 'number' ? getLViewById(data) : data || null;\n}\nfunction readPatchedLView(target) {\n const value = readPatchedData(target);\n if (value) {\n return (isLView(value) ? value : value.lView);\n }\n return null;\n}\nfunction isComponentInstance(instance) {\n return instance && instance.constructor && instance.constructor.ɵcmp;\n}\nfunction isDirectiveInstance(instance) {\n return instance && instance.constructor && instance.constructor.ɵdir;\n}\n/**\n * Locates the element within the given LView and returns the matching index\n */\nfunction findViaNativeElement(lView, target) {\n const tView = lView[TVIEW];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (unwrapRNode(lView[i]) === target) {\n return i;\n }\n }\n return -1;\n}\n/**\n * Locates the next tNode (child, sibling or parent).\n */\nfunction traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}\n/**\n * Locates the component within the given LView and returns the matching index\n */\nfunction findViaComponent(lView, componentInstance) {\n const componentIndices = lView[TVIEW].components;\n if (componentIndices) {\n for (let i = 0; i < componentIndices.length; i++) {\n const elementComponentIndex = componentIndices[i];\n const componentView = getComponentLViewByIndex(elementComponentIndex, lView);\n if (componentView[CONTEXT] === componentInstance) {\n return elementComponentIndex;\n }\n }\n }\n else {\n const rootComponentView = getComponentLViewByIndex(HEADER_OFFSET, lView);\n const rootComponent = rootComponentView[CONTEXT];\n if (rootComponent === componentInstance) {\n // we are dealing with the root element here therefore we know that the\n // element is the very first element after the HEADER data in the lView\n return HEADER_OFFSET;\n }\n }\n return -1;\n}\n/**\n * Locates the directive within the given LView and returns the matching index\n */\nfunction findViaDirective(lView, directiveInstance) {\n // if a directive is monkey patched then it will (by default)\n // have a reference to the LView of the current view. The\n // element bound to the directive being search lives somewhere\n // in the view data. We loop through the nodes and check their\n // list of directives for the instance.\n let tNode = lView[TVIEW].firstChild;\n while (tNode) {\n const directiveIndexStart = tNode.directiveStart;\n const directiveIndexEnd = tNode.directiveEnd;\n for (let i = directiveIndexStart; i < directiveIndexEnd; i++) {\n if (lView[i] === directiveInstance) {\n return tNode.index;\n }\n }\n tNode = traverseNextElement(tNode);\n }\n return -1;\n}\n/**\n * Returns a list of directives applied to a node at a specific index. The list includes\n * directives matched by selector and any host directives, but it excludes components.\n * Use `getComponentAtNodeIndex` to find the component applied to a node.\n *\n * @param nodeIndex The node index\n * @param lView The target view data\n */\nfunction getDirectivesAtNodeIndex(nodeIndex, lView) {\n const tNode = lView[TVIEW].data[nodeIndex];\n if (tNode.directiveStart === 0)\n return EMPTY_ARRAY;\n const results = [];\n for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {\n const directiveInstance = lView[i];\n if (!isComponentInstance(directiveInstance)) {\n results.push(directiveInstance);\n }\n }\n return results;\n}\nfunction getComponentAtNodeIndex(nodeIndex, lView) {\n const tNode = lView[TVIEW].data[nodeIndex];\n const { directiveStart, componentOffset } = tNode;\n return componentOffset > -1 ? lView[directiveStart + componentOffset] : null;\n}\n/**\n * Returns a map of local references (local reference name => element or directive instance) that\n * exist on a given element.\n */\nfunction discoverLocalRefs(lView, nodeIndex) {\n const tNode = lView[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n const result = {};\n let localIndex = tNode.index + 1;\n for (let i = 0; i < tNode.localNames.length; i += 2) {\n result[tNode.localNames[i]] = lView[localIndex];\n localIndex++;\n }\n return result;\n }\n return null;\n}\n\n/**\n * Retrieve the root view from any component or `LView` by walking the parent `LView` until\n * reaching the root `LView`.\n *\n * @param componentOrLView any component or `LView`\n */\nfunction getRootView(componentOrLView) {\n ngDevMode && assertDefined(componentOrLView, 'component');\n let lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView);\n while (lView && !(lView[FLAGS] & 512 /* LViewFlags.IsRoot */)) {\n lView = getLViewParent(lView);\n }\n ngDevMode && assertLView(lView);\n return lView;\n}\n/**\n * Returns the context information associated with the application where the target is situated. It\n * does this by walking the parent views until it gets to the root view, then getting the context\n * off of that.\n *\n * @param viewOrComponent the `LView` or component to get the root context for.\n */\nfunction getRootContext(viewOrComponent) {\n const rootView = getRootView(viewOrComponent);\n ngDevMode &&\n assertDefined(rootView[CONTEXT], 'Root view has no context. Perhaps it is disconnected?');\n return rootView[CONTEXT];\n}\n/**\n * Gets the first `LContainer` in the LView or `null` if none exists.\n */\nfunction getFirstLContainer(lView) {\n return getNearestLContainer(lView[CHILD_HEAD]);\n}\n/**\n * Gets the next `LContainer` that is a sibling of the given container.\n */\nfunction getNextLContainer(container) {\n return getNearestLContainer(container[NEXT]);\n}\nfunction getNearestLContainer(viewOrContainer) {\n while (viewOrContainer !== null && !isLContainer(viewOrContainer)) {\n viewOrContainer = viewOrContainer[NEXT];\n }\n return viewOrContainer;\n}\n\n/**\n * Retrieves the component instance associated with a given DOM element.\n *\n * @usageNotes\n * Given the following DOM structure:\n *\n * ```html\n * <app-root>\n * <div>\n * <child-comp></child-comp>\n * </div>\n * </app-root>\n * ```\n *\n * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`\n * associated with this DOM element.\n *\n * Calling the function on `<app-root>` will return the `MyApp` instance.\n *\n *\n * @param element DOM element from which the component should be retrieved.\n * @returns Component instance associated with the element or `null` if there\n * is no component associated with it.\n *\n * @publicApi\n */\nfunction getComponent$1(element) {\n ngDevMode && assertDomElement(element);\n const context = getLContext(element);\n if (context === null)\n return null;\n if (context.component === undefined) {\n const lView = context.lView;\n if (lView === null) {\n return null;\n }\n context.component = getComponentAtNodeIndex(context.nodeIndex, lView);\n }\n return context.component;\n}\n/**\n * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded\n * view that the element is part of. Otherwise retrieves the instance of the component whose view\n * owns the element (in this case, the result is the same as calling `getOwningComponent`).\n *\n * @param element Element for which to get the surrounding component instance.\n * @returns Instance of the component that is around the element or null if the element isn't\n * inside any component.\n *\n * @publicApi\n */\nfunction getContext(element) {\n assertDomElement(element);\n const context = getLContext(element);\n const lView = context ? context.lView : null;\n return lView === null ? null : lView[CONTEXT];\n}\n/**\n * Retrieves the component instance whose view contains the DOM element.\n *\n * For example, if `<child-comp>` is used in the template of `<app-comp>`\n * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`\n * would return `<app-comp>`.\n *\n * @param elementOrDir DOM element, component or directive instance\n * for which to retrieve the root components.\n * @returns Component instance whose view owns the DOM element or null if the element is not\n * part of a component view.\n *\n * @publicApi\n */\nfunction getOwningComponent(elementOrDir) {\n const context = getLContext(elementOrDir);\n let lView = context ? context.lView : null;\n if (lView === null)\n return null;\n let parent;\n while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {\n lView = parent;\n }\n return lView[FLAGS] & 512 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];\n}\n/**\n * Retrieves all root components associated with a DOM element, directive or component instance.\n * Root components are those which have been bootstrapped by Angular.\n *\n * @param elementOrDir DOM element, component or directive instance\n * for which to retrieve the root components.\n * @returns Root components associated with the target object.\n *\n * @publicApi\n */\nfunction getRootComponents(elementOrDir) {\n const lView = readPatchedLView(elementOrDir);\n return lView !== null ? [getRootContext(lView)] : [];\n}\n/**\n * Retrieves an `Injector` associated with an element, component or directive instance.\n *\n * @param elementOrDir DOM element, component or directive instance for which to\n * retrieve the injector.\n * @returns Injector associated with the element, component or directive instance.\n *\n * @publicApi\n */\nfunction getInjector(elementOrDir) {\n const context = getLContext(elementOrDir);\n const lView = context ? context.lView : null;\n if (lView === null)\n return Injector.NULL;\n const tNode = lView[TVIEW].data[context.nodeIndex];\n return new NodeInjector(tNode, lView);\n}\n/**\n * Retrieve a set of injection tokens at a given DOM node.\n *\n * @param element Element for which the injection tokens should be retrieved.\n */\nfunction getInjectionTokens(element) {\n const context = getLContext(element);\n const lView = context ? context.lView : null;\n if (lView === null)\n return [];\n const tView = lView[TVIEW];\n const tNode = tView.data[context.nodeIndex];\n const providerTokens = [];\n const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;\n const endIndex = tNode.directiveEnd;\n for (let i = startIndex; i < endIndex; i++) {\n let value = tView.data[i];\n if (isDirectiveDefHack(value)) {\n // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a\n // design flaw. We should always store same type so that we can be monomorphic. The issue\n // is that for Components/Directives we store the def instead the type. The correct behavior\n // is that we should always be storing injectable type in this location.\n value = value.type;\n }\n providerTokens.push(value);\n }\n return providerTokens;\n}\n/**\n * Retrieves directive instances associated with a given DOM node. Does not include\n * component instances.\n *\n * @usageNotes\n * Given the following DOM structure:\n *\n * ```html\n * <app-root>\n * <button my-button></button>\n * <my-comp></my-comp>\n * </app-root>\n * ```\n *\n * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`\n * directive that is associated with the DOM node.\n *\n * Calling `getDirectives` on `<my-comp>` will return an empty array.\n *\n * @param node DOM node for which to get the directives.\n * @returns Array of directives associated with the node.\n *\n * @publicApi\n */\nfunction getDirectives(node) {\n // Skip text nodes because we can't have directives associated with them.\n if (node instanceof Text) {\n return [];\n }\n const context = getLContext(node);\n const lView = context ? context.lView : null;\n if (lView === null) {\n return [];\n }\n const tView = lView[TVIEW];\n const nodeIndex = context.nodeIndex;\n if (!tView?.data[nodeIndex]) {\n return [];\n }\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(nodeIndex, lView);\n }\n // The `directives` in this case are a named array called `LComponentView`. Clone the\n // result so we don't expose an internal data structure in the user's console.\n return context.directives === null ? [] : [...context.directives];\n}\n/**\n * Returns the debug (partial) metadata for a particular directive or component instance.\n * The function accepts an instance of a directive or component and returns the corresponding\n * metadata.\n *\n * @param directiveOrComponentInstance Instance of a directive or component\n * @returns metadata of the passed directive or component\n *\n * @publicApi\n */\nfunction getDirectiveMetadata$1(directiveOrComponentInstance) {\n const { constructor } = directiveOrComponentInstance;\n if (!constructor) {\n throw new Error('Unable to find the instance constructor');\n }\n // In case a component inherits from a directive, we may have component and directive metadata\n // To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.\n const componentDef = getComponentDef(constructor);\n if (componentDef) {\n const inputs = extractInputDebugMetadata(componentDef.inputs);\n return {\n inputs,\n outputs: componentDef.outputs,\n encapsulation: componentDef.encapsulation,\n changeDetection: componentDef.onPush\n ? ChangeDetectionStrategy.OnPush\n : ChangeDetectionStrategy.Default,\n };\n }\n const directiveDef = getDirectiveDef(constructor);\n if (directiveDef) {\n const inputs = extractInputDebugMetadata(directiveDef.inputs);\n return { inputs, outputs: directiveDef.outputs };\n }\n return null;\n}\n/**\n * Retrieve map of local references.\n *\n * The references are retrieved as a map of local reference name to element or directive instance.\n *\n * @param target DOM element, component or directive instance for which to retrieve\n * the local references.\n */\nfunction getLocalRefs(target) {\n const context = getLContext(target);\n if (context === null)\n return {};\n if (context.localRefs === undefined) {\n const lView = context.lView;\n if (lView === null) {\n return {};\n }\n context.localRefs = discoverLocalRefs(lView, context.nodeIndex);\n }\n return context.localRefs || {};\n}\n/**\n * Retrieves the host element of a component or directive instance.\n * The host element is the DOM element that matched the selector of the directive.\n *\n * @param componentOrDirective Component or directive instance for which the host\n * element should be retrieved.\n * @returns Host element of the target.\n *\n * @publicApi\n */\nfunction getHostElement(componentOrDirective) {\n return getLContext(componentOrDirective).native;\n}\n/**\n * Retrieves the rendered text for a given component.\n *\n * This function retrieves the host element of a component and\n * and then returns the `textContent` for that element. This implies\n * that the text returned will include re-projected content of\n * the component as well.\n *\n * @param component The component to return the content text for.\n */\nfunction getRenderedText(component) {\n const hostElement = getHostElement(component);\n return hostElement.textContent || '';\n}\n/**\n * Retrieves a list of event listeners associated with a DOM element. The list does include host\n * listeners, but it does not include event listeners defined outside of the Angular context\n * (e.g. through `addEventListener`).\n *\n * @usageNotes\n * Given the following DOM structure:\n *\n * ```html\n * <app-root>\n * <div (click)=\"doSomething()\"></div>\n * </app-root>\n * ```\n *\n * Calling `getListeners` on `<div>` will return an object that looks as follows:\n *\n * ```ts\n * {\n * name: 'click',\n * element: <div>,\n * callback: () => doSomething(),\n * useCapture: false\n * }\n * ```\n *\n * @param element Element for which the DOM listeners should be retrieved.\n * @returns Array of event listeners on the DOM element.\n *\n * @publicApi\n */\nfunction getListeners(element) {\n ngDevMode && assertDomElement(element);\n const lContext = getLContext(element);\n const lView = lContext === null ? null : lContext.lView;\n if (lView === null)\n return [];\n const tView = lView[TVIEW];\n const lCleanup = lView[CLEANUP];\n const tCleanup = tView.cleanup;\n const listeners = [];\n if (tCleanup && lCleanup) {\n for (let i = 0; i < tCleanup.length;) {\n const firstParam = tCleanup[i++];\n const secondParam = tCleanup[i++];\n if (typeof firstParam === 'string') {\n const name = firstParam;\n const listenerElement = unwrapRNode(lView[secondParam]);\n const callback = lCleanup[tCleanup[i++]];\n const useCaptureOrIndx = tCleanup[i++];\n // if useCaptureOrIndx is boolean then report it as is.\n // if useCaptureOrIndx is positive number then it in unsubscribe method\n // if useCaptureOrIndx is negative number then it is a Subscription\n const type = typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0 ? 'dom' : 'output';\n const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;\n if (element == listenerElement) {\n listeners.push({ element, name, callback, useCapture, type });\n }\n }\n }\n }\n listeners.sort(sortListeners);\n return listeners;\n}\nfunction sortListeners(a, b) {\n if (a.name == b.name)\n return 0;\n return a.name < b.name ? -1 : 1;\n}\n/**\n * This function should not exist because it is megamorphic and only mostly correct.\n *\n * See call site for more info.\n */\nfunction isDirectiveDefHack(obj) {\n return (obj.type !== undefined &&\n obj.declaredInputs !== undefined &&\n obj.findHostDirectiveDefs !== undefined);\n}\n/**\n * Retrieve the component `LView` from component/element.\n *\n * NOTE: `LView` is a private and should not be leaked outside.\n * Don't export this method to `ng.*` on window.\n *\n * @param target DOM element or component instance for which to retrieve the LView.\n */\nfunction getComponentLView(target) {\n const lContext = getLContext(target);\n const nodeIndx = lContext.nodeIndex;\n const lView = lContext.lView;\n ngDevMode && assertLView(lView);\n const componentLView = lView[nodeIndx];\n ngDevMode && assertLView(componentLView);\n return componentLView;\n}\n/** Asserts that a value is a DOM Element. */\nfunction assertDomElement(value) {\n if (typeof Element !== 'undefined' && !(value instanceof Element)) {\n throw new Error('Expecting instance of DOM Element');\n }\n}\n/**\n * A directive definition holds additional metadata using bitwise flags to indicate\n * for example whether it is signal based.\n *\n * This information needs to be separate from the `publicName -> minifiedName`\n * mappings for backwards compatibility.\n */\nfunction extractInputDebugMetadata(inputs) {\n const res = {};\n for (const key in inputs) {\n if (!inputs.hasOwnProperty(key)) {\n continue;\n }\n const value = inputs[key];\n if (value === undefined) {\n continue;\n }\n let minifiedName;\n if (Array.isArray(value)) {\n minifiedName = value[0];\n // flags are not used for now.\n // TODO: Consider exposing flag information in discovery.\n }\n else {\n minifiedName = value;\n }\n res[key] = minifiedName;\n }\n return res;\n}\n\n/**\n * Most of the use of `document` in Angular is from within the DI system so it is possible to simply\n * inject the `DOCUMENT` token and are done.\n *\n * Ivy is special because it does not rely upon the DI and must get hold of the document some other\n * way.\n *\n * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.\n * Wherever ivy needs the global document, it calls `getDocument()` instead.\n *\n * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to\n * tell ivy what the global `document` is.\n *\n * Angular does this for us in each of the standard platforms (`Browser` and `Server`)\n * by calling `setDocument()` when providing the `DOCUMENT` token.\n */\nlet DOCUMENT = undefined;\n/**\n * Tell ivy what the `document` is for this platform.\n *\n * It is only necessary to call this if the current platform is not a browser.\n *\n * @param document The object representing the global `document` in this environment.\n */\nfunction setDocument(document) {\n DOCUMENT = document;\n}\n/**\n * Access the object that represents the `document` for this platform.\n *\n * Ivy calls this whenever it needs to access the `document` object.\n * For example to create the renderer or to do sanitization.\n */\nfunction getDocument() {\n if (DOCUMENT !== undefined) {\n return DOCUMENT;\n }\n else if (typeof document !== 'undefined') {\n return document;\n }\n throw new RuntimeError(210 /* RuntimeErrorCode.MISSING_DOCUMENT */, (typeof ngDevMode === 'undefined' || ngDevMode) &&\n `The document object is not available in this context. Make sure the DOCUMENT injection token is provided.`);\n // No \"document\" can be found. This should only happen if we are running ivy outside Angular and\n // the current platform is not a browser. Since this is not a supported scenario at the moment\n // this should not happen in Angular apps.\n // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a\n // public API.\n}\n\n/**\n * A DI token representing a string ID, used\n * primarily for prefixing application attributes and CSS styles when\n * {@link ViewEncapsulation#Emulated} is being used.\n *\n * The token is needed in cases when multiple applications are bootstrapped on a page\n * (for example, using `bootstrapApplication` calls). In this case, ensure that those applications\n * have different `APP_ID` value setup. For example:\n *\n * ```\n * bootstrapApplication(ComponentA, {\n * providers: [\n * { provide: APP_ID, useValue: 'app-a' },\n * // ... other providers ...\n * ]\n * });\n *\n * bootstrapApplication(ComponentB, {\n * providers: [\n * { provide: APP_ID, useValue: 'app-b' },\n * // ... other providers ...\n * ]\n * });\n * ```\n *\n * By default, when there is only one application bootstrapped, you don't need to provide the\n * `APP_ID` token (the `ng` will be used as an app ID).\n *\n * @publicApi\n */\nconst APP_ID = new InjectionToken(ngDevMode ? 'AppId' : '', {\n providedIn: 'root',\n factory: () => DEFAULT_APP_ID,\n});\n/** Default value of the `APP_ID` token. */\nconst DEFAULT_APP_ID = 'ng';\n/**\n * A function that is executed when a platform is initialized.\n * @publicApi\n */\nconst PLATFORM_INITIALIZER = new InjectionToken(ngDevMode ? 'Platform Initializer' : '');\n/**\n * A token that indicates an opaque platform ID.\n * @publicApi\n */\nconst PLATFORM_ID = new InjectionToken(ngDevMode ? 'Platform ID' : '', {\n providedIn: 'platform',\n factory: () => 'unknown', // set a default platform name, when none set explicitly\n});\n/**\n * A DI token that indicates the root directory of\n * the application\n * @publicApi\n * @deprecated\n */\nconst PACKAGE_ROOT_URL = new InjectionToken(ngDevMode ? 'Application Packages Root URL' : '');\n// We keep this token here, rather than the animations package, so that modules that only care\n// about which animations module is loaded (e.g. the CDK) can retrieve it without having to\n// include extra dependencies. See #44970 for more context.\n/**\n * A [DI token](api/core/InjectionToken) that indicates which animations\n * module has been loaded.\n * @publicApi\n */\nconst ANIMATION_MODULE_TYPE = new InjectionToken(ngDevMode ? 'AnimationModuleType' : '');\n// TODO(crisbeto): link to CSP guide here.\n/**\n * Token used to configure the [Content Security Policy](https://web.dev/strict-csp/) nonce that\n * Angular will apply when inserting inline styles. If not provided, Angular will look up its value\n * from the `ngCspNonce` attribute of the application root node.\n *\n * @publicApi\n */\nconst CSP_NONCE = new InjectionToken(ngDevMode ? 'CSP nonce' : '', {\n providedIn: 'root',\n factory: () => {\n // Ideally we wouldn't have to use `querySelector` here since we know that the nonce will be on\n // the root node, but because the token value is used in renderers, it has to be available\n // *very* early in the bootstrapping process. This should be a fairly shallow search, because\n // the app won't have been added to the DOM yet. Some approaches that were considered:\n // 1. Find the root node through `ApplicationRef.components[i].location` - normally this would\n // be enough for our purposes, but the token is injected very early so the `components` array\n // isn't populated yet.\n // 2. Find the root `LView` through the current `LView` - renderers are a prerequisite to\n // creating the `LView`. This means that no `LView` will have been entered when this factory is\n // invoked for the root component.\n // 3. Have the token factory return `() => string` which is invoked when a nonce is requested -\n // the slightly later execution does allow us to get an `LView` reference, but the fact that\n // it is a function means that it could be executed at *any* time (including immediately) which\n // may lead to weird bugs.\n // 4. Have the `ComponentFactory` read the attribute and provide it to the injector under the\n // hood - has the same problem as #1 and #2 in that the renderer is used to query for the root\n // node and the nonce value needs to be available when the renderer is created.\n return getDocument().body?.querySelector('[ngCspNonce]')?.getAttribute('ngCspNonce') || null;\n },\n});\nconst IMAGE_CONFIG_DEFAULTS = {\n breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],\n placeholderResolution: 30,\n disableImageSizeWarning: false,\n disableImageLazyLoadWarning: false,\n};\n/**\n * Injection token that configures the image optimized image functionality.\n * See {@link ImageConfig} for additional information about parameters that\n * can be used.\n *\n * @see {@link NgOptimizedImage}\n * @see {@link ImageConfig}\n * @publicApi\n */\nconst IMAGE_CONFIG = new InjectionToken(ngDevMode ? 'ImageConfig' : '', {\n providedIn: 'root',\n factory: () => IMAGE_CONFIG_DEFAULTS,\n});\n\n/**\n * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.\n *\n * Example:\n *\n * ```\n * const COUNTER_KEY = makeStateKey<number>('counter');\n * let value = 10;\n *\n * transferState.set(COUNTER_KEY, value);\n * ```\n *\n * @publicApi\n */\nfunction makeStateKey(key) {\n return key;\n}\nfunction initTransferState() {\n const transferState = new TransferState();\n if (inject(PLATFORM_ID) === 'browser') {\n transferState.store = retrieveTransferredState(getDocument(), inject(APP_ID));\n }\n return transferState;\n}\n/**\n * A key value store that is transferred from the application on the server side to the application\n * on the client side.\n *\n * The `TransferState` is available as an injectable token.\n * On the client, just inject this token using DI and use it, it will be lazily initialized.\n * On the server it's already included if `renderApplication` function is used. Otherwise, import\n * the `ServerTransferStateModule` module to make the `TransferState` available.\n *\n * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only\n * boolean, number, string, null and non-class objects will be serialized and deserialized in a\n * non-lossy manner.\n *\n * @publicApi\n */\nclass TransferState {\n constructor() {\n /** @internal */\n this.store = {};\n this.onSerializeCallbacks = {};\n }\n /** @nocollapse */\n static { this.ɵprov = ɵɵdefineInjectable({\n token: TransferState,\n providedIn: 'root',\n factory: initTransferState,\n }); }\n /**\n * Get the value corresponding to a key. Return `defaultValue` if key is not found.\n */\n get(key, defaultValue) {\n return this.store[key] !== undefined ? this.store[key] : defaultValue;\n }\n /**\n * Set the value corresponding to a key.\n */\n set(key, value) {\n this.store[key] = value;\n }\n /**\n * Remove a key from the store.\n */\n remove(key) {\n delete this.store[key];\n }\n /**\n * Test whether a key exists in the store.\n */\n hasKey(key) {\n return this.store.hasOwnProperty(key);\n }\n /**\n * Indicates whether the state is empty.\n */\n get isEmpty() {\n return Object.keys(this.store).length === 0;\n }\n /**\n * Register a callback to provide the value for a key when `toJson` is called.\n */\n onSerialize(key, callback) {\n this.onSerializeCallbacks[key] = callback;\n }\n /**\n * Serialize the current state of the store to JSON.\n */\n toJson() {\n // Call the onSerialize callbacks and put those values into the store.\n for (const key in this.onSerializeCallbacks) {\n if (this.onSerializeCallbacks.hasOwnProperty(key)) {\n try {\n this.store[key] = this.onSerializeCallbacks[key]();\n }\n catch (e) {\n console.warn('Exception in onSerialize callback: ', e);\n }\n }\n }\n // Escape script tag to avoid break out of <script> tag in serialized output.\n // Encoding of `<` is the same behaviour as G3 script_builders.\n return JSON.stringify(this.store).replace(/</g, '\\\\u003C');\n }\n}\nfunction retrieveTransferredState(doc, appId) {\n // Locate the script tag with the JSON data transferred from the server.\n // The id of the script tag is set to the Angular appId + 'state'.\n const script = doc.getElementById(appId + '-state');\n if (script?.textContent) {\n try {\n // Avoid using any here as it triggers lint errors in google3 (any is not allowed).\n // Decoding of `<` is done of the box by browsers and node.js, same behaviour as G3\n // script_builders.\n return JSON.parse(script.textContent);\n }\n catch (e) {\n console.warn('Exception while restoring TransferState for app ' + appId, e);\n }\n }\n return {};\n}\n\n/** Encodes that the node lookup should start from the host node of this component. */\nconst REFERENCE_NODE_HOST = 'h';\n/** Encodes that the node lookup should start from the document body node. */\nconst REFERENCE_NODE_BODY = 'b';\n/**\n * Describes navigation steps that the runtime logic need to perform,\n * starting from a given (known) element.\n */\nvar NodeNavigationStep;\n(function (NodeNavigationStep) {\n NodeNavigationStep[\"FirstChild\"] = \"f\";\n NodeNavigationStep[\"NextSibling\"] = \"n\";\n})(NodeNavigationStep || (NodeNavigationStep = {}));\n/**\n * Keys within serialized view data structure to represent various\n * parts. See the `SerializedView` interface below for additional information.\n */\nconst ELEMENT_CONTAINERS = 'e';\nconst TEMPLATES = 't';\nconst CONTAINERS = 'c';\nconst MULTIPLIER = 'x';\nconst NUM_ROOT_NODES = 'r';\nconst TEMPLATE_ID = 'i'; // as it's also an \"id\"\nconst NODES = 'n';\nconst DISCONNECTED_NODES = 'd';\nconst I18N_DATA = 'l';\n\n/**\n * The name of the key used in the TransferState collection,\n * where hydration information is located.\n */\nconst TRANSFER_STATE_TOKEN_ID = '__nghData__';\n/**\n * Lookup key used to reference DOM hydration data (ngh) in `TransferState`.\n */\nconst NGH_DATA_KEY = makeStateKey(TRANSFER_STATE_TOKEN_ID);\n/**\n * The name of the attribute that would be added to host component\n * nodes and contain a reference to a particular slot in transferred\n * state that contains the necessary hydration info for this component.\n */\nconst NGH_ATTR_NAME = 'ngh';\n/**\n * Marker used in a comment node to ensure hydration content integrity\n */\nconst SSR_CONTENT_INTEGRITY_MARKER = 'nghm';\n/**\n * Reference to a function that reads `ngh` attribute value from a given RNode\n * and retrieves hydration information from the TransferState using that value\n * as an index. Returns `null` by default, when hydration is not enabled.\n *\n * @param rNode Component's host element.\n * @param injector Injector that this component has access to.\n * @param isRootView Specifies whether we trying to read hydration info for the root view.\n */\nlet _retrieveHydrationInfoImpl = () => null;\nfunction retrieveHydrationInfoImpl(rNode, injector, isRootView = false) {\n let nghAttrValue = rNode.getAttribute(NGH_ATTR_NAME);\n if (nghAttrValue == null)\n return null;\n // For cases when a root component also acts as an anchor node for a ViewContainerRef\n // (for example, when ViewContainerRef is injected in a root component), there is a need\n // to serialize information about the component itself, as well as an LContainer that\n // represents this ViewContainerRef. Effectively, we need to serialize 2 pieces of info:\n // (1) hydration info for the root component itself and (2) hydration info for the\n // ViewContainerRef instance (an LContainer). Each piece of information is included into\n // the hydration data (in the TransferState object) separately, thus we end up with 2 ids.\n // Since we only have 1 root element, we encode both bits of info into a single string:\n // ids are separated by the `|` char (e.g. `10|25`, where `10` is the ngh for a component view\n // and 25 is the `ngh` for a root view which holds LContainer).\n const [componentViewNgh, rootViewNgh] = nghAttrValue.split('|');\n nghAttrValue = isRootView ? rootViewNgh : componentViewNgh;\n if (!nghAttrValue)\n return null;\n // We've read one of the ngh ids, keep the remaining one, so that\n // we can set it back on the DOM element.\n const rootNgh = rootViewNgh ? `|${rootViewNgh}` : '';\n const remainingNgh = isRootView ? componentViewNgh : rootNgh;\n let data = {};\n // An element might have an empty `ngh` attribute value (e.g. `<comp ngh=\"\" />`),\n // which means that no special annotations are required. Do not attempt to read\n // from the TransferState in this case.\n if (nghAttrValue !== '') {\n const transferState = injector.get(TransferState, null, { optional: true });\n if (transferState !== null) {\n const nghData = transferState.get(NGH_DATA_KEY, []);\n // The nghAttrValue is always a number referencing an index\n // in the hydration TransferState data.\n data = nghData[Number(nghAttrValue)];\n // If the `ngh` attribute exists and has a non-empty value,\n // the hydration info *must* be present in the TransferState.\n // If there is no data for some reasons, this is an error.\n ngDevMode && assertDefined(data, 'Unable to retrieve hydration info from the TransferState.');\n }\n }\n const dehydratedView = {\n data,\n firstChild: rNode.firstChild ?? null,\n };\n if (isRootView) {\n // If there is hydration info present for the root view, it means that there was\n // a ViewContainerRef injected in the root component. The root component host element\n // acted as an anchor node in this scenario. As a result, the DOM nodes that represent\n // embedded views in this ViewContainerRef are located as siblings to the host node,\n // i.e. `<app-root /><#VIEW1><#VIEW2>...<!--container-->`. In this case, the current\n // node becomes the first child of this root view and the next sibling is the first\n // element in the DOM segment.\n dehydratedView.firstChild = rNode;\n // We use `0` here, since this is the slot (right after the HEADER_OFFSET)\n // where a component LView or an LContainer is located in a root LView.\n setSegmentHead(dehydratedView, 0, rNode.nextSibling);\n }\n if (remainingNgh) {\n // If we have only used one of the ngh ids, store the remaining one\n // back on this RNode.\n rNode.setAttribute(NGH_ATTR_NAME, remainingNgh);\n }\n else {\n // The `ngh` attribute is cleared from the DOM node now\n // that the data has been retrieved for all indices.\n rNode.removeAttribute(NGH_ATTR_NAME);\n }\n // Note: don't check whether this node was claimed for hydration,\n // because this node might've been previously claimed while processing\n // template instructions.\n ngDevMode && markRNodeAsClaimedByHydration(rNode, /* checkIfAlreadyClaimed */ false);\n ngDevMode && ngDevMode.hydratedComponents++;\n return dehydratedView;\n}\n/**\n * Sets the implementation for the `retrieveHydrationInfo` function.\n */\nfunction enableRetrieveHydrationInfoImpl() {\n _retrieveHydrationInfoImpl = retrieveHydrationInfoImpl;\n}\n/**\n * Retrieves hydration info by reading the value from the `ngh` attribute\n * and accessing a corresponding slot in TransferState storage.\n */\nfunction retrieveHydrationInfo(rNode, injector, isRootView = false) {\n return _retrieveHydrationInfoImpl(rNode, injector, isRootView);\n}\n/**\n * Retrieves the necessary object from a given ViewRef to serialize:\n * - an LView for component views\n * - an LContainer for cases when component acts as a ViewContainerRef anchor\n * - `null` in case of an embedded view\n */\nfunction getLNodeForHydration(viewRef) {\n // Reading an internal field from `ViewRef` instance.\n let lView = viewRef._lView;\n const tView = lView[TVIEW];\n // A registered ViewRef might represent an instance of an\n // embedded view, in which case we do not need to annotate it.\n if (tView.type === 2 /* TViewType.Embedded */) {\n return null;\n }\n // Check if it's a root view and if so, retrieve component's\n // LView from the first slot after the header.\n if (isRootView(lView)) {\n lView = lView[HEADER_OFFSET];\n }\n return lView;\n}\nfunction getTextNodeContent(node) {\n return node.textContent?.replace(/\\s/gm, '');\n}\n/**\n * Restores text nodes and separators into the DOM that were lost during SSR\n * serialization. The hydration process replaces empty text nodes and text\n * nodes that are immediately adjacent to other text nodes with comment nodes\n * that this method filters on to restore those missing nodes that the\n * hydration process is expecting to be present.\n *\n * @param node The app's root HTML Element\n */\nfunction processTextNodeMarkersBeforeHydration(node) {\n const doc = getDocument();\n const commentNodesIterator = doc.createNodeIterator(node, NodeFilter.SHOW_COMMENT, {\n acceptNode(node) {\n const content = getTextNodeContent(node);\n const isTextNodeMarker = content === \"ngetn\" /* TextNodeMarker.EmptyNode */ || content === \"ngtns\" /* TextNodeMarker.Separator */;\n return isTextNodeMarker ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;\n },\n });\n let currentNode;\n // We cannot modify the DOM while using the commentIterator,\n // because it throws off the iterator state.\n // So we collect all marker nodes first and then follow up with\n // applying the changes to the DOM: either inserting an empty node\n // or just removing the marker if it was used as a separator.\n const nodes = [];\n while ((currentNode = commentNodesIterator.nextNode())) {\n nodes.push(currentNode);\n }\n for (const node of nodes) {\n if (node.textContent === \"ngetn\" /* TextNodeMarker.EmptyNode */) {\n node.replaceWith(doc.createTextNode(''));\n }\n else {\n node.remove();\n }\n }\n}\n/**\n * Internal type that represents a claimed node.\n * Only used in dev mode.\n */\nvar HydrationStatus;\n(function (HydrationStatus) {\n HydrationStatus[\"Hydrated\"] = \"hydrated\";\n HydrationStatus[\"Skipped\"] = \"skipped\";\n HydrationStatus[\"Mismatched\"] = \"mismatched\";\n})(HydrationStatus || (HydrationStatus = {}));\nconst HYDRATION_INFO_KEY = '__ngDebugHydrationInfo__';\nfunction patchHydrationInfo(node, info) {\n node[HYDRATION_INFO_KEY] = info;\n}\nfunction readHydrationInfo(node) {\n return node[HYDRATION_INFO_KEY] ?? null;\n}\n/**\n * Marks a node as \"claimed\" by hydration process.\n * This is needed to make assessments in tests whether\n * the hydration process handled all nodes.\n */\nfunction markRNodeAsClaimedByHydration(node, checkIfAlreadyClaimed = true) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsClaimedByHydration` in prod mode ' +\n 'is not supported and likely a mistake.');\n }\n if (checkIfAlreadyClaimed && isRNodeClaimedForHydration(node)) {\n throw new Error('Trying to claim a node, which was claimed already.');\n }\n patchHydrationInfo(node, { status: HydrationStatus.Hydrated });\n ngDevMode.hydratedNodes++;\n}\nfunction markRNodeAsSkippedByHydration(node) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsSkippedByHydration` in prod mode ' +\n 'is not supported and likely a mistake.');\n }\n patchHydrationInfo(node, { status: HydrationStatus.Skipped });\n ngDevMode.componentsSkippedHydration++;\n}\nfunction markRNodeAsHavingHydrationMismatch(node, expectedNodeDetails = null, actualNodeDetails = null) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsMismatchedByHydration` in prod mode ' +\n 'is not supported and likely a mistake.');\n }\n // The RNode can be a standard HTMLElement (not an Angular component or directive)\n // The devtools component tree only displays Angular components & directives\n // Therefore we attach the debug info to the closest component/directive\n while (node && !getComponent$1(node)) {\n node = node?.parentNode;\n }\n if (node) {\n patchHydrationInfo(node, {\n status: HydrationStatus.Mismatched,\n expectedNodeDetails,\n actualNodeDetails,\n });\n }\n}\nfunction isRNodeClaimedForHydration(node) {\n return readHydrationInfo(node)?.status === HydrationStatus.Hydrated;\n}\nfunction setSegmentHead(hydrationInfo, index, node) {\n hydrationInfo.segmentHeads ??= {};\n hydrationInfo.segmentHeads[index] = node;\n}\nfunction getSegmentHead(hydrationInfo, index) {\n return hydrationInfo.segmentHeads?.[index] ?? null;\n}\n/**\n * Returns the size of an <ng-container>, using either the information\n * serialized in `ELEMENT_CONTAINERS` (element container size) or by\n * computing the sum of root nodes in all dehydrated views in a given\n * container (in case this `<ng-container>` was also used as a view\n * container host node, e.g. <ng-container *ngIf>).\n */\nfunction getNgContainerSize(hydrationInfo, index) {\n const data = hydrationInfo.data;\n let size = data[ELEMENT_CONTAINERS]?.[index] ?? null;\n // If there is no serialized information available in the `ELEMENT_CONTAINERS` slot,\n // check if we have info about view containers at this location (e.g.\n // `<ng-container *ngIf>`) and use container size as a number of root nodes in this\n // element container.\n if (size === null && data[CONTAINERS]?.[index]) {\n size = calcSerializedContainerSize(hydrationInfo, index);\n }\n return size;\n}\nfunction isSerializedElementContainer(hydrationInfo, index) {\n return hydrationInfo.data[ELEMENT_CONTAINERS]?.[index] !== undefined;\n}\nfunction getSerializedContainerViews(hydrationInfo, index) {\n return hydrationInfo.data[CONTAINERS]?.[index] ?? null;\n}\n/**\n * Computes the size of a serialized container (the number of root nodes)\n * by calculating the sum of root nodes in all dehydrated views in this container.\n */\nfunction calcSerializedContainerSize(hydrationInfo, index) {\n const views = getSerializedContainerViews(hydrationInfo, index) ?? [];\n let numNodes = 0;\n for (let view of views) {\n numNodes += view[NUM_ROOT_NODES] * (view[MULTIPLIER] ?? 1);\n }\n return numNodes;\n}\n/**\n * Attempt to initialize the `disconnectedNodes` field of the given\n * `DehydratedView`. Returns the initialized value.\n */\nfunction initDisconnectedNodes(hydrationInfo) {\n // Check if we are processing disconnected info for the first time.\n if (typeof hydrationInfo.disconnectedNodes === 'undefined') {\n const nodeIds = hydrationInfo.data[DISCONNECTED_NODES];\n hydrationInfo.disconnectedNodes = nodeIds ? new Set(nodeIds) : null;\n }\n return hydrationInfo.disconnectedNodes;\n}\n/**\n * Checks whether a node is annotated as \"disconnected\", i.e. not present\n * in the DOM at serialization time. We should not attempt hydration for\n * such nodes and instead, use a regular \"creation mode\".\n */\nfunction isDisconnectedNode$1(hydrationInfo, index) {\n // Check if we are processing disconnected info for the first time.\n if (typeof hydrationInfo.disconnectedNodes === 'undefined') {\n const nodeIds = hydrationInfo.data[DISCONNECTED_NODES];\n hydrationInfo.disconnectedNodes = nodeIds ? new Set(nodeIds) : null;\n }\n return !!initDisconnectedNodes(hydrationInfo)?.has(index);\n}\n/**\n * Helper function to prepare text nodes for serialization by ensuring\n * that seperate logical text blocks in the DOM remain separate after\n * serialization.\n */\nfunction processTextNodeBeforeSerialization(context, node) {\n // Handle cases where text nodes can be lost after DOM serialization:\n // 1. When there is an *empty text node* in DOM: in this case, this\n // node would not make it into the serialized string and as a result,\n // this node wouldn't be created in a browser. This would result in\n // a mismatch during the hydration, where the runtime logic would expect\n // a text node to be present in live DOM, but no text node would exist.\n // Example: `<span>{{ name }}</span>` when the `name` is an empty string.\n // This would result in `<span></span>` string after serialization and\n // in a browser only the `span` element would be created. To resolve that,\n // an extra comment node is appended in place of an empty text node and\n // that special comment node is replaced with an empty text node *before*\n // hydration.\n // 2. When there are 2 consecutive text nodes present in the DOM.\n // Example: `<div>Hello <ng-container *ngIf=\"true\">world</ng-container></div>`.\n // In this scenario, the live DOM would look like this:\n // <div>#text('Hello ') #text('world') #comment('container')</div>\n // Serialized string would look like this: `<div>Hello world<!--container--></div>`.\n // The live DOM in a browser after that would be:\n // <div>#text('Hello world') #comment('container')</div>\n // Notice how 2 text nodes are now \"merged\" into one. This would cause hydration\n // logic to fail, since it'd expect 2 text nodes being present, not one.\n // To fix this, we insert a special comment node in between those text nodes, so\n // serialized representation is: `<div>Hello <!--ngtns-->world<!--container--></div>`.\n // This forces browser to create 2 text nodes separated by a comment node.\n // Before running a hydration process, this special comment node is removed, so the\n // live DOM has exactly the same state as it was before serialization.\n // Collect this node as required special annotation only when its\n // contents is empty. Otherwise, such text node would be present on\n // the client after server-side rendering and no special handling needed.\n const el = node;\n const corruptedTextNodes = context.corruptedTextNodes;\n if (el.textContent === '') {\n corruptedTextNodes.set(el, \"ngetn\" /* TextNodeMarker.EmptyNode */);\n }\n else if (el.nextSibling?.nodeType === Node.TEXT_NODE) {\n corruptedTextNodes.set(el, \"ngtns\" /* TextNodeMarker.Separator */);\n }\n}\n\n/**\n * Internal token that specifies whether DOM reuse logic\n * during hydration is enabled.\n */\nconst IS_HYDRATION_DOM_REUSE_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'IS_HYDRATION_DOM_REUSE_ENABLED' : '');\n// By default (in client rendering mode), we remove all the contents\n// of the host element and render an application after that.\nconst PRESERVE_HOST_CONTENT_DEFAULT = false;\n/**\n * Internal token that indicates whether host element content should be\n * retained during the bootstrap.\n */\nconst PRESERVE_HOST_CONTENT = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'PRESERVE_HOST_CONTENT' : '', {\n providedIn: 'root',\n factory: () => PRESERVE_HOST_CONTENT_DEFAULT,\n});\n/**\n * Internal token that indicates whether hydration support for i18n\n * is enabled.\n */\nconst IS_I18N_HYDRATION_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'IS_I18N_HYDRATION_ENABLED' : '');\n/**\n * Internal token that indicates whether event replay support for SSR\n * is enabled.\n */\nconst IS_EVENT_REPLAY_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'IS_EVENT_REPLAY_ENABLED' : '');\nconst EVENT_REPLAY_ENABLED_DEFAULT = false;\n\n/**\n * @fileoverview\n * A module to facilitate use of a Trusted Types policy internally within\n * Angular. It lazily constructs the Trusted Types policy, providing helper\n * utilities for promoting strings to Trusted Types. When Trusted Types are not\n * available, strings are used as a fallback.\n * @security All use of this module is security-sensitive and should go through\n * security review.\n */\n/**\n * The Trusted Types policy, or null if Trusted Types are not\n * enabled/supported, or undefined if the policy has not been created yet.\n */\nlet policy$1;\n/**\n * Returns the Trusted Types policy, or null if Trusted Types are not\n * enabled/supported. The first call to this function will create the policy.\n */\nfunction getPolicy$1() {\n if (policy$1 === undefined) {\n policy$1 = null;\n if (_global.trustedTypes) {\n try {\n policy$1 = _global.trustedTypes.createPolicy('angular', {\n createHTML: (s) => s,\n createScript: (s) => s,\n createScriptURL: (s) => s,\n });\n }\n catch {\n // trustedTypes.createPolicy throws if called with a name that is\n // already registered, even in report-only mode. Until the API changes,\n // catch the error not to break the applications functionally. In such\n // cases, the code will fall back to using strings.\n }\n }\n }\n return policy$1;\n}\n/**\n * Unsafely promote a string to a TrustedHTML, falling back to strings when\n * Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that the\n * provided string will never cause an XSS vulnerability if used in a context\n * that will be interpreted as HTML by a browser, e.g. when assigning to\n * element.innerHTML.\n */\nfunction trustedHTMLFromString(html) {\n return getPolicy$1()?.createHTML(html) || html;\n}\n/**\n * Unsafely promote a string to a TrustedScript, falling back to strings when\n * Trusted Types are not available.\n * @security In particular, it must be assured that the provided string will\n * never cause an XSS vulnerability if used in a context that will be\n * interpreted and executed as a script by a browser, e.g. when calling eval.\n */\nfunction trustedScriptFromString(script) {\n return getPolicy$1()?.createScript(script) || script;\n}\n/**\n * Unsafely promote a string to a TrustedScriptURL, falling back to strings\n * when Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that the\n * provided string will never cause an XSS vulnerability if used in a context\n * that will cause a browser to load and execute a resource, e.g. when\n * assigning to script.src.\n */\nfunction trustedScriptURLFromString(url) {\n return getPolicy$1()?.createScriptURL(url) || url;\n}\n/**\n * Unsafely call the Function constructor with the given string arguments. It\n * is only available in development mode, and should be stripped out of\n * production code.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that it\n * is only called from development code, as use in production code can lead to\n * XSS vulnerabilities.\n */\nfunction newTrustedFunctionForDev(...args) {\n if (typeof ngDevMode === 'undefined') {\n throw new Error('newTrustedFunctionForDev should never be called in production');\n }\n if (!_global.trustedTypes) {\n // In environments that don't support Trusted Types, fall back to the most\n // straightforward implementation:\n return new Function(...args);\n }\n // Chrome currently does not support passing TrustedScript to the Function\n // constructor. The following implements the workaround proposed on the page\n // below, where the Chromium bug is also referenced:\n // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor\n const fnArgs = args.slice(0, -1).join(',');\n const fnBody = args[args.length - 1];\n const body = `(function anonymous(${fnArgs}\n) { ${fnBody}\n})`;\n // Using eval directly confuses the compiler and prevents this module from\n // being stripped out of JS binaries even if not used. The global['eval']\n // indirection fixes that.\n const fn = _global['eval'](trustedScriptFromString(body));\n if (fn.bind === undefined) {\n // Workaround for a browser bug that only exists in Chrome 83, where passing\n // a TrustedScript to eval just returns the TrustedScript back without\n // evaluating it. In that case, fall back to the most straightforward\n // implementation:\n return new Function(...args);\n }\n // To completely mimic the behavior of calling \"new Function\", two more\n // things need to happen:\n // 1. Stringifying the resulting function should return its source code\n fn.toString = () => body;\n // 2. When calling the resulting function, `this` should refer to `global`\n return fn.bind(_global);\n // When Trusted Types support in Function constructors is widely available,\n // the implementation of this function can be simplified to:\n // return new Function(...args.map(a => trustedScriptFromString(a)));\n}\n\n/**\n * @fileoverview\n * A module to facilitate use of a Trusted Types policy internally within\n * Angular specifically for bypassSecurityTrust* and custom sanitizers. It\n * lazily constructs the Trusted Types policy, providing helper utilities for\n * promoting strings to Trusted Types. When Trusted Types are not available,\n * strings are used as a fallback.\n * @security All use of this module is security-sensitive and should go through\n * security review.\n */\n/**\n * The Trusted Types policy, or null if Trusted Types are not\n * enabled/supported, or undefined if the policy has not been created yet.\n */\nlet policy;\n/**\n * Returns the Trusted Types policy, or null if Trusted Types are not\n * enabled/supported. The first call to this function will create the policy.\n */\nfunction getPolicy() {\n if (policy === undefined) {\n policy = null;\n if (_global.trustedTypes) {\n try {\n policy = _global.trustedTypes.createPolicy('angular#unsafe-bypass', {\n createHTML: (s) => s,\n createScript: (s) => s,\n createScriptURL: (s) => s,\n });\n }\n catch {\n // trustedTypes.createPolicy throws if called with a name that is\n // already registered, even in report-only mode. Until the API changes,\n // catch the error not to break the applications functionally. In such\n // cases, the code will fall back to using strings.\n }\n }\n }\n return policy;\n}\n/**\n * Unsafely promote a string to a TrustedHTML, falling back to strings when\n * Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nfunction trustedHTMLFromStringBypass(html) {\n return getPolicy()?.createHTML(html) || html;\n}\n/**\n * Unsafely promote a string to a TrustedScript, falling back to strings when\n * Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nfunction trustedScriptFromStringBypass(script) {\n return getPolicy()?.createScript(script) || script;\n}\n/**\n * Unsafely promote a string to a TrustedScriptURL, falling back to strings\n * when Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nfunction trustedScriptURLFromStringBypass(url) {\n return getPolicy()?.createScriptURL(url) || url;\n}\n\nclass SafeValueImpl {\n constructor(changingThisBreaksApplicationSecurity) {\n this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;\n }\n toString() {\n return (`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` +\n ` (see ${XSS_SECURITY_URL})`);\n }\n}\nclass SafeHtmlImpl extends SafeValueImpl {\n getTypeName() {\n return \"HTML\" /* BypassType.Html */;\n }\n}\nclass SafeStyleImpl extends SafeValueImpl {\n getTypeName() {\n return \"Style\" /* BypassType.Style */;\n }\n}\nclass SafeScriptImpl extends SafeValueImpl {\n getTypeName() {\n return \"Script\" /* BypassType.Script */;\n }\n}\nclass SafeUrlImpl extends SafeValueImpl {\n getTypeName() {\n return \"URL\" /* BypassType.Url */;\n }\n}\nclass SafeResourceUrlImpl extends SafeValueImpl {\n getTypeName() {\n return \"ResourceURL\" /* BypassType.ResourceUrl */;\n }\n}\nfunction unwrapSafeValue(value) {\n return value instanceof SafeValueImpl\n ? value.changingThisBreaksApplicationSecurity\n : value;\n}\nfunction allowSanitizationBypassAndThrow(value, type) {\n const actualType = getSanitizationBypassType(value);\n if (actualType != null && actualType !== type) {\n // Allow ResourceURLs in URL contexts, they are strictly more trusted.\n if (actualType === \"ResourceURL\" /* BypassType.ResourceUrl */ && type === \"URL\" /* BypassType.Url */)\n return true;\n throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`);\n }\n return actualType === type;\n}\nfunction getSanitizationBypassType(value) {\n return (value instanceof SafeValueImpl && value.getTypeName()) || null;\n}\n/**\n * Mark `html` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link htmlSanitizer} to be trusted implicitly.\n *\n * @param trustedHtml `html` string which needs to be implicitly trusted.\n * @returns a `html` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustHtml(trustedHtml) {\n return new SafeHtmlImpl(trustedHtml);\n}\n/**\n * Mark `style` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link styleSanitizer} to be trusted implicitly.\n *\n * @param trustedStyle `style` string which needs to be implicitly trusted.\n * @returns a `style` hich has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustStyle(trustedStyle) {\n return new SafeStyleImpl(trustedStyle);\n}\n/**\n * Mark `script` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link scriptSanitizer} to be trusted implicitly.\n *\n * @param trustedScript `script` string which needs to be implicitly trusted.\n * @returns a `script` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustScript(trustedScript) {\n return new SafeScriptImpl(trustedScript);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link urlSanitizer} to be trusted implicitly.\n *\n * @param trustedUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustUrl(trustedUrl) {\n return new SafeUrlImpl(trustedUrl);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.\n *\n * @param trustedResourceUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustResourceUrl(trustedResourceUrl) {\n return new SafeResourceUrlImpl(trustedResourceUrl);\n}\n\n/**\n * This helper is used to get hold of an inert tree of DOM elements containing dirty HTML\n * that needs sanitizing.\n * Depending upon browser support we use one of two strategies for doing this.\n * Default: DOMParser strategy\n * Fallback: InertDocument strategy\n */\nfunction getInertBodyHelper(defaultDoc) {\n const inertDocumentHelper = new InertDocumentHelper(defaultDoc);\n return isDOMParserAvailable() ? new DOMParserHelper(inertDocumentHelper) : inertDocumentHelper;\n}\n/**\n * Uses DOMParser to create and fill an inert body element.\n * This is the default strategy used in browsers that support it.\n */\nclass DOMParserHelper {\n constructor(inertDocumentHelper) {\n this.inertDocumentHelper = inertDocumentHelper;\n }\n getInertBodyElement(html) {\n // We add these extra elements to ensure that the rest of the content is parsed as expected\n // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the\n // `<head>` tag. Note that the `<body>` tag is closed implicitly to prevent unclosed tags\n // in `html` from consuming the otherwise explicit `</body>` tag.\n html = '<body><remove></remove>' + html;\n try {\n const body = new window.DOMParser().parseFromString(trustedHTMLFromString(html), 'text/html').body;\n if (body === null) {\n // In some browsers (e.g. Mozilla/5.0 iPad AppleWebKit Mobile) the `body` property only\n // becomes available in the following tick of the JS engine. In that case we fall back to\n // the `inertDocumentHelper` instead.\n return this.inertDocumentHelper.getInertBodyElement(html);\n }\n body.firstChild?.remove();\n return body;\n }\n catch {\n return null;\n }\n }\n}\n/**\n * Use an HTML5 `template` element to create and fill an inert DOM element.\n * This is the fallback strategy if the browser does not support DOMParser.\n */\nclass InertDocumentHelper {\n constructor(defaultDoc) {\n this.defaultDoc = defaultDoc;\n this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');\n }\n getInertBodyElement(html) {\n const templateEl = this.inertDocument.createElement('template');\n templateEl.innerHTML = trustedHTMLFromString(html);\n return templateEl;\n }\n}\n/**\n * We need to determine whether the DOMParser exists in the global context and\n * supports parsing HTML; HTML parsing support is not as wide as other formats, see\n * https://developer.mozilla.org/en-US/docs/Web/API/DOMParser#Browser_compatibility.\n *\n * @suppress {uselessCode}\n */\nfunction isDOMParserAvailable() {\n try {\n return !!new window.DOMParser().parseFromString(trustedHTMLFromString(''), 'text/html');\n }\n catch {\n return false;\n }\n}\n\n/**\n * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation\n * contexts.\n *\n * This regular expression matches a subset of URLs that will not cause script\n * execution if used in URL context within a HTML document. Specifically, this\n * regular expression matches if:\n * (1) Either a protocol that is not javascript:, and that has valid characters\n * (alphanumeric or [+-.]).\n * (2) or no protocol. A protocol must be followed by a colon. The below\n * allows that by allowing colons only after one of the characters [/?#].\n * A colon after a hash (#) must be in the fragment.\n * Otherwise, a colon after a (?) must be in a query.\n * Otherwise, a colon after a single solidus (/) must be in a path.\n * Otherwise, a colon after a double solidus (//) must be in the authority\n * (before port).\n *\n * The pattern disallows &, used in HTML entity declarations before\n * one of the characters in [/?#]. This disallows HTML entities used in the\n * protocol name, which should never happen, e.g. \"h&#116;tp\" for \"http\".\n * It also disallows HTML entities in the first path part of a relative path,\n * e.g. \"foo&lt;bar/baz\". Our existing escaping functions should not produce\n * that. More importantly, it disallows masking of a colon,\n * e.g. \"javascript&#58;...\".\n *\n * This regular expression was taken from the Closure sanitization library.\n */\nconst SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\\/?#]*(?:[\\/?#]|$))/i;\nfunction _sanitizeUrl(url) {\n url = String(url);\n if (url.match(SAFE_URL_PATTERN))\n return url;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`);\n }\n return 'unsafe:' + url;\n}\n\nfunction tagSet(tags) {\n const res = {};\n for (const t of tags.split(','))\n res[t] = true;\n return res;\n}\nfunction merge(...sets) {\n const res = {};\n for (const s of sets) {\n for (const v in s) {\n if (s.hasOwnProperty(v))\n res[v] = true;\n }\n }\n return res;\n}\n// Good source of info about elements and attributes\n// https://html.spec.whatwg.org/#semantics\n// https://simon.html5.org/html-elements\n// Safe Void Elements - HTML5\n// https://html.spec.whatwg.org/#void-elements\nconst VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');\n// Elements that you can, intentionally, leave open (and which close themselves)\n// https://html.spec.whatwg.org/#optional-tags\nconst OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');\nconst OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');\nconst OPTIONAL_END_TAG_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);\n// Safe Block Elements - HTML5\nconst BLOCK_ELEMENTS = merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' +\n 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +\n 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));\n// Inline Elements - HTML5\nconst INLINE_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' +\n 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +\n 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));\nconst VALID_ELEMENTS = merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);\n// Attributes that have href and hence need to be sanitized\nconst URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');\nconst HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +\n 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +\n 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +\n 'scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,' +\n 'valign,value,vspace,width');\n// Accessibility attributes as per WAI-ARIA 1.1 (W3C Working Draft 14 December 2018)\nconst ARIA_ATTRS = tagSet('aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,' +\n 'aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,' +\n 'aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,' +\n 'aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,' +\n 'aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,' +\n 'aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,' +\n 'aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext');\n// NB: This currently consciously doesn't support SVG. SVG sanitization has had several security\n// issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via\n// innerHTML is required, SVG attributes should be added here.\n// NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those\n// can be sanitized, but they increase security surface area without a legitimate use case, so they\n// are left out here.\nconst VALID_ATTRS = merge(URI_ATTRS, HTML_ATTRS, ARIA_ATTRS);\n// Elements whose content should not be traversed/preserved, if the elements themselves are invalid.\n//\n// Typically, `<invalid>Some content</invalid>` would traverse (and in this case preserve)\n// `Some content`, but strip `invalid-element` opening/closing tags. For some elements, though, we\n// don't want to preserve the content, if the elements themselves are going to be removed.\nconst SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet('script,style,template');\n/**\n * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe\n * attributes.\n */\nclass SanitizingHtmlSerializer {\n constructor() {\n // Explicitly track if something was stripped, to avoid accidentally warning of sanitization just\n // because characters were re-encoded.\n this.sanitizedSomething = false;\n this.buf = [];\n }\n sanitizeChildren(el) {\n // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.\n // However this code never accesses properties off of `document` before deleting its contents\n // again, so it shouldn't be vulnerable to DOM clobbering.\n let current = el.firstChild;\n let traverseContent = true;\n let parentNodes = [];\n while (current) {\n if (current.nodeType === Node.ELEMENT_NODE) {\n traverseContent = this.startElement(current);\n }\n else if (current.nodeType === Node.TEXT_NODE) {\n this.chars(current.nodeValue);\n }\n else {\n // Strip non-element, non-text nodes.\n this.sanitizedSomething = true;\n }\n if (traverseContent && current.firstChild) {\n // Push current node to the parent stack before entering its content.\n parentNodes.push(current);\n current = getFirstChild(current);\n continue;\n }\n while (current) {\n // Leaving the element.\n // Walk up and to the right, closing tags as we go.\n if (current.nodeType === Node.ELEMENT_NODE) {\n this.endElement(current);\n }\n let next = getNextSibling(current);\n if (next) {\n current = next;\n break;\n }\n // There was no next sibling, walk up to the parent node (extract it from the stack).\n current = parentNodes.pop();\n }\n }\n return this.buf.join('');\n }\n /**\n * Sanitizes an opening element tag (if valid) and returns whether the element's contents should\n * be traversed. Element content must always be traversed (even if the element itself is not\n * valid/safe), unless the element is one of `SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS`.\n *\n * @param element The element to sanitize.\n * @return True if the element's contents should be traversed.\n */\n startElement(element) {\n const tagName = getNodeName(element).toLowerCase();\n if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {\n this.sanitizedSomething = true;\n return !SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName);\n }\n this.buf.push('<');\n this.buf.push(tagName);\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const elAttr = elAttrs.item(i);\n const attrName = elAttr.name;\n const lower = attrName.toLowerCase();\n if (!VALID_ATTRS.hasOwnProperty(lower)) {\n this.sanitizedSomething = true;\n continue;\n }\n let value = elAttr.value;\n // TODO(martinprobst): Special case image URIs for data:image/...\n if (URI_ATTRS[lower])\n value = _sanitizeUrl(value);\n this.buf.push(' ', attrName, '=\"', encodeEntities(value), '\"');\n }\n this.buf.push('>');\n return true;\n }\n endElement(current) {\n const tagName = getNodeName(current).toLowerCase();\n if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {\n this.buf.push('</');\n this.buf.push(tagName);\n this.buf.push('>');\n }\n }\n chars(chars) {\n this.buf.push(encodeEntities(chars));\n }\n}\n/**\n * Verifies whether a given child node is a descendant of a given parent node.\n * It may not be the case when properties like `.firstChild` are clobbered and\n * accessing `.firstChild` results in an unexpected node returned.\n */\nfunction isClobberedElement(parentNode, childNode) {\n return ((parentNode.compareDocumentPosition(childNode) & Node.DOCUMENT_POSITION_CONTAINED_BY) !==\n Node.DOCUMENT_POSITION_CONTAINED_BY);\n}\n/**\n * Retrieves next sibling node and makes sure that there is no\n * clobbering of the `nextSibling` property happening.\n */\nfunction getNextSibling(node) {\n const nextSibling = node.nextSibling;\n // Make sure there is no `nextSibling` clobbering: navigating to\n // the next sibling and going back to the previous one should result\n // in the original node.\n if (nextSibling && node !== nextSibling.previousSibling) {\n throw clobberedElementError(nextSibling);\n }\n return nextSibling;\n}\n/**\n * Retrieves first child node and makes sure that there is no\n * clobbering of the `firstChild` property happening.\n */\nfunction getFirstChild(node) {\n const firstChild = node.firstChild;\n if (firstChild && isClobberedElement(node, firstChild)) {\n throw clobberedElementError(firstChild);\n }\n return firstChild;\n}\n/** Gets a reasonable nodeName, even for clobbered nodes. */\nfunction getNodeName(node) {\n const nodeName = node.nodeName;\n // If the property is clobbered, assume it is an `HTMLFormElement`.\n return typeof nodeName === 'string' ? nodeName : 'FORM';\n}\nfunction clobberedElementError(node) {\n return new Error(`Failed to sanitize html because the element is clobbered: ${node.outerHTML}`);\n}\n// Regular Expressions for parsing tags and attributes\nconst SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n// ! to ~ is the ASCII range.\nconst NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param value\n */\nfunction encodeEntities(value) {\n return value\n .replace(/&/g, '&amp;')\n .replace(SURROGATE_PAIR_REGEXP, function (match) {\n const hi = match.charCodeAt(0);\n const low = match.charCodeAt(1);\n return '&#' + ((hi - 0xd800) * 0x400 + (low - 0xdc00) + 0x10000) + ';';\n })\n .replace(NON_ALPHANUMERIC_REGEXP, function (match) {\n return '&#' + match.charCodeAt(0) + ';';\n })\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n}\nlet inertBodyHelper;\n/**\n * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to\n * the DOM in a browser environment.\n */\nfunction _sanitizeHtml(defaultDoc, unsafeHtmlInput) {\n let inertBodyElement = null;\n try {\n inertBodyHelper = inertBodyHelper || getInertBodyHelper(defaultDoc);\n // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).\n let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser\n // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.\n let mXSSAttempts = 5;\n let parsedHtml = unsafeHtml;\n do {\n if (mXSSAttempts === 0) {\n throw new Error('Failed to sanitize html because the input is unstable');\n }\n mXSSAttempts--;\n unsafeHtml = parsedHtml;\n parsedHtml = inertBodyElement.innerHTML;\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n } while (unsafeHtml !== parsedHtml);\n const sanitizer = new SanitizingHtmlSerializer();\n const safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && sanitizer.sanitizedSomething) {\n console.warn(`WARNING: sanitizing HTML stripped some content, see ${XSS_SECURITY_URL}`);\n }\n return trustedHTMLFromString(safeHtml);\n }\n finally {\n // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.\n if (inertBodyElement) {\n const parent = getTemplateContent(inertBodyElement) || inertBodyElement;\n while (parent.firstChild) {\n parent.firstChild.remove();\n }\n }\n }\n}\nfunction getTemplateContent(el) {\n return 'content' in el /** Microsoft/TypeScript#21517 */ && isTemplateElement(el)\n ? el.content\n : null;\n}\nfunction isTemplateElement(el) {\n return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE';\n}\n\n/**\n * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property\n * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly\n * handled.\n *\n * See DomSanitizer for more details on security in Angular applications.\n *\n * @publicApi\n */\nvar SecurityContext;\n(function (SecurityContext) {\n SecurityContext[SecurityContext[\"NONE\"] = 0] = \"NONE\";\n SecurityContext[SecurityContext[\"HTML\"] = 1] = \"HTML\";\n SecurityContext[SecurityContext[\"STYLE\"] = 2] = \"STYLE\";\n SecurityContext[SecurityContext[\"SCRIPT\"] = 3] = \"SCRIPT\";\n SecurityContext[SecurityContext[\"URL\"] = 4] = \"URL\";\n SecurityContext[SecurityContext[\"RESOURCE_URL\"] = 5] = \"RESOURCE_URL\";\n})(SecurityContext || (SecurityContext = {}));\n\n/**\n * An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing\n * dangerous content.\n *\n * This method parses the `html` and locates potentially dangerous content (such as urls and\n * javascript) and removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.\n *\n * @param unsafeHtml untrusted `html`, typically from the user.\n * @returns `html` string which is safe to display to user, because all of the dangerous javascript\n * and urls have been removed.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeHtml(unsafeHtml) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedHTMLFromStringBypass(sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeHtml, \"HTML\" /* BypassType.Html */)) {\n return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml));\n }\n return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml));\n}\n/**\n * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing\n * dangerous content.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.\n *\n * @param unsafeStyle untrusted `style`, typically from the user.\n * @returns `style` string which is safe to bind to the `style` properties.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeStyle(unsafeStyle) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || '';\n }\n if (allowSanitizationBypassAndThrow(unsafeStyle, \"Style\" /* BypassType.Style */)) {\n return unwrapSafeValue(unsafeStyle);\n }\n return renderStringify(unsafeStyle);\n}\n/**\n * A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing\n * dangerous\n * content.\n *\n * This method parses the `url` and locates potentially dangerous content (such as javascript) and\n * removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.\n *\n * @param unsafeUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * all of the dangerous javascript has been removed.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeUrl(unsafeUrl) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || '';\n }\n if (allowSanitizationBypassAndThrow(unsafeUrl, \"URL\" /* BypassType.Url */)) {\n return unwrapSafeValue(unsafeUrl);\n }\n return _sanitizeUrl(renderStringify(unsafeUrl));\n}\n/**\n * A `url` sanitizer which only lets trusted `url`s through.\n *\n * This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.\n *\n * @param unsafeResourceUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * only trusted `url`s have been allowed to pass.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeResourceUrl(unsafeResourceUrl) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedScriptURLFromStringBypass(sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeResourceUrl, \"ResourceURL\" /* BypassType.ResourceUrl */)) {\n return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));\n }\n throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);\n}\n/**\n * A `script` sanitizer which only lets trusted javascript through.\n *\n * This passes only `script`s marked trusted by calling {@link\n * bypassSanitizationTrustScript}.\n *\n * @param unsafeScript untrusted `script`, typically from the user.\n * @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,\n * because only trusted `scripts` have been allowed to pass.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeScript(unsafeScript) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedScriptFromStringBypass(sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeScript, \"Script\" /* BypassType.Script */)) {\n return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));\n }\n throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, ngDevMode && 'unsafe value used in a script context');\n}\n/**\n * A template tag function for promoting the associated constant literal to a\n * TrustedHTML. Interpolation is explicitly not allowed.\n *\n * @param html constant template literal containing trusted HTML.\n * @returns TrustedHTML wrapping `html`.\n *\n * @security This is a security-sensitive function and should only be used to\n * convert constant values of attributes and properties found in\n * application-provided Angular templates to TrustedHTML.\n *\n * @codeGenApi\n */\nfunction ɵɵtrustConstantHtml(html) {\n // The following runtime check ensures that the function was called as a\n // template tag (e.g. ɵɵtrustConstantHtml`content`), without any interpolation\n // (e.g. not ɵɵtrustConstantHtml`content ${variable}`). A TemplateStringsArray\n // is an array with a `raw` property that is also an array. The associated\n // template literal has no interpolation if and only if the length of the\n // TemplateStringsArray is 1.\n if (ngDevMode && (!Array.isArray(html) || !Array.isArray(html.raw) || html.length !== 1)) {\n throw new Error(`Unexpected interpolation in trusted HTML constant: ${html.join('?')}`);\n }\n return trustedHTMLFromString(html[0]);\n}\n/**\n * A template tag function for promoting the associated constant literal to a\n * TrustedScriptURL. Interpolation is explicitly not allowed.\n *\n * @param url constant template literal containing a trusted script URL.\n * @returns TrustedScriptURL wrapping `url`.\n *\n * @security This is a security-sensitive function and should only be used to\n * convert constant values of attributes and properties found in\n * application-provided Angular templates to TrustedScriptURL.\n *\n * @codeGenApi\n */\nfunction ɵɵtrustConstantResourceUrl(url) {\n // The following runtime check ensures that the function was called as a\n // template tag (e.g. ɵɵtrustConstantResourceUrl`content`), without any\n // interpolation (e.g. not ɵɵtrustConstantResourceUrl`content ${variable}`). A\n // TemplateStringsArray is an array with a `raw` property that is also an\n // array. The associated template literal has no interpolation if and only if\n // the length of the TemplateStringsArray is 1.\n if (ngDevMode && (!Array.isArray(url) || !Array.isArray(url.raw) || url.length !== 1)) {\n throw new Error(`Unexpected interpolation in trusted URL constant: ${url.join('?')}`);\n }\n return trustedScriptURLFromString(url[0]);\n}\n/**\n * Detects which sanitizer to use for URL property, based on tag name and prop name.\n *\n * The rules are based on the RESOURCE_URL context config from\n * `packages/compiler/src/schema/dom_security_schema.ts`.\n * If tag and prop names don't match Resource URL schema, use URL sanitizer.\n */\nfunction getUrlSanitizer(tag, prop) {\n if ((prop === 'src' &&\n (tag === 'embed' ||\n tag === 'frame' ||\n tag === 'iframe' ||\n tag === 'media' ||\n tag === 'script')) ||\n (prop === 'href' && (tag === 'base' || tag === 'link'))) {\n return ɵɵsanitizeResourceUrl;\n }\n return ɵɵsanitizeUrl;\n}\n/**\n * Sanitizes URL, selecting sanitizer function based on tag and property names.\n *\n * This function is used in case we can't define security context at compile time, when only prop\n * name is available. This happens when we generate host bindings for Directives/Components. The\n * host element is unknown at compile time, so we defer calculation of specific sanitizer to\n * runtime.\n *\n * @param unsafeUrl untrusted `url`, typically from the user.\n * @param tag target element tag name.\n * @param prop name of the property that contains the value.\n * @returns `url` string which is safe to bind.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {\n return getUrlSanitizer(tag, prop)(unsafeUrl);\n}\nfunction validateAgainstEventProperties(name) {\n if (name.toLowerCase().startsWith('on')) {\n const errorMessage = `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 throw new RuntimeError(306 /* RuntimeErrorCode.INVALID_EVENT_BINDING */, errorMessage);\n }\n}\nfunction validateAgainstEventAttributes(name) {\n if (name.toLowerCase().startsWith('on')) {\n const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, ` +\n `please use (${name.slice(2)})=...`;\n throw new RuntimeError(306 /* RuntimeErrorCode.INVALID_EVENT_BINDING */, errorMessage);\n }\n}\nfunction getSanitizer() {\n const lView = getLView();\n return lView && lView[ENVIRONMENT].sanitizer;\n}\n\n/**\n * Disallowed strings in the comment.\n *\n * see: https://html.spec.whatwg.org/multipage/syntax.html#comments\n */\nconst COMMENT_DISALLOWED = /^>|^->|<!--|-->|--!>|<!-$/g;\n/**\n * Delimiter in the disallowed strings which needs to be wrapped with zero with character.\n */\nconst COMMENT_DELIMITER = /(<|>)/g;\nconst COMMENT_DELIMITER_ESCAPED = '\\u200B$1\\u200B';\n/**\n * Escape the content of comment strings so that it can be safely inserted into a comment node.\n *\n * The issue is that HTML does not specify any way to escape comment end text inside the comment.\n * Consider: `<!-- The way you close a comment is with \">\", and \"->\" at the beginning or by \"-->\" or\n * \"--!>\" at the end. -->`. Above the `\"-->\"` is meant to be text not an end to the comment. This\n * can be created programmatically through DOM APIs. (`<!--` are also disallowed.)\n *\n * see: https://html.spec.whatwg.org/multipage/syntax.html#comments\n *\n * ```\n * div.innerHTML = div.innerHTML\n * ```\n *\n * One would expect that the above code would be safe to do, but it turns out that because comment\n * text is not escaped, the comment may contain text which will prematurely close the comment\n * opening up the application for XSS attack. (In SSR we programmatically create comment nodes which\n * may contain such text and expect them to be safe.)\n *\n * This function escapes the comment text by looking for comment delimiters (`<` and `>`) and\n * surrounding them with `_>_` where the `_` is a zero width space `\\u200B`. The result is that if a\n * comment contains any of the comment start/end delimiters (such as `<!--`, `-->` or `--!>`) the\n * text it will render normally but it will not cause the HTML parser to close/open the comment.\n *\n * @param value text to make safe for comment node by escaping the comment open/close character\n * sequence.\n */\nfunction escapeCommentText(value) {\n return value.replace(COMMENT_DISALLOWED, (text) => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));\n}\n\nfunction normalizeDebugBindingName(name) {\n // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers\n name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));\n return `ng-reflect-${name}`;\n}\nconst CAMEL_CASE_REGEXP = /([A-Z])/g;\nfunction camelCaseToDashCase(input) {\n return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());\n}\nfunction normalizeDebugBindingValue(value) {\n try {\n // Limit the size of the value as otherwise the DOM just gets polluted.\n return value != null ? value.toString().slice(0, 30) : value;\n }\n catch (e) {\n return '[ERROR] Exception while trying to serialize the value';\n }\n}\n\n/**\n * Defines a schema that allows an NgModule to contain the following:\n * - Non-Angular elements named with dash case (`-`).\n * - Element properties named with dash case (`-`).\n * Dash case is the naming convention for custom elements.\n *\n * @publicApi\n */\nconst CUSTOM_ELEMENTS_SCHEMA = {\n name: 'custom-elements',\n};\n/**\n * Defines a schema that allows any property on any element.\n *\n * This schema allows you to ignore the errors related to any unknown elements or properties in a\n * template. The usage of this schema is generally discouraged because it prevents useful validation\n * and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead.\n *\n * @publicApi\n */\nconst NO_ERRORS_SCHEMA = {\n name: 'no-errors-schema',\n};\n\nlet shouldThrowErrorOnUnknownElement = false;\n/**\n * Sets a strict mode for JIT-compiled components to throw an error on unknown elements,\n * instead of just logging the error.\n * (for AOT-compiled ones this check happens at build time).\n */\nfunction ɵsetUnknownElementStrictMode(shouldThrow) {\n shouldThrowErrorOnUnknownElement = shouldThrow;\n}\n/**\n * Gets the current value of the strict mode.\n */\nfunction ɵgetUnknownElementStrictMode() {\n return shouldThrowErrorOnUnknownElement;\n}\nlet shouldThrowErrorOnUnknownProperty = false;\n/**\n * Sets a strict mode for JIT-compiled components to throw an error on unknown properties,\n * instead of just logging the error.\n * (for AOT-compiled ones this check happens at build time).\n */\nfunction ɵsetUnknownPropertyStrictMode(shouldThrow) {\n shouldThrowErrorOnUnknownProperty = shouldThrow;\n}\n/**\n * Gets the current value of the strict mode.\n */\nfunction ɵgetUnknownPropertyStrictMode() {\n return shouldThrowErrorOnUnknownProperty;\n}\n/**\n * Validates that the element is known at runtime and produces\n * an error if it's not the case.\n * This check is relevant for JIT-compiled components (for AOT-compiled\n * ones this check happens at build time).\n *\n * The element is considered known if either:\n * - it's a known HTML element\n * - it's a known custom element\n * - the element matches any directive\n * - the element is allowed by one of the schemas\n *\n * @param element Element to validate\n * @param lView An `LView` that represents a current component that is being rendered\n * @param tagName Name of the tag to check\n * @param schemas Array of schemas\n * @param hasDirectives Boolean indicating that the element matches any directive\n */\nfunction validateElementIsKnown(element, lView, tagName, schemas, hasDirectives) {\n // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT\n // mode where this check happens at compile time. In JIT mode, `schemas` is always present and\n // defined as an array (as an empty array in case `schemas` field is not defined) and we should\n // execute the check below.\n if (schemas === null)\n return;\n // If the element matches any directive, it's considered as valid.\n if (!hasDirectives && tagName !== null) {\n // The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered\n // as a custom element. Note that unknown elements with a dash in their name won't be instances\n // of HTMLUnknownElement in browsers that support web components.\n const isUnknown = \n // Note that we can't check for `typeof HTMLUnknownElement === 'function'` because\n // Domino doesn't expose HTMLUnknownElement globally.\n (typeof HTMLUnknownElement !== 'undefined' &&\n HTMLUnknownElement &&\n element instanceof HTMLUnknownElement) ||\n (typeof customElements !== 'undefined' &&\n tagName.indexOf('-') > -1 &&\n !customElements.get(tagName));\n if (isUnknown && !matchingSchemas(schemas, tagName)) {\n const isHostStandalone = isHostComponentStandalone(lView);\n const templateLocation = getTemplateLocationDetails(lView);\n const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;\n let message = `'${tagName}' is not a known element${templateLocation}:\\n`;\n message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone\n ? \"included in the '@Component.imports' of this component\"\n : 'a part of an @NgModule where this component is declared'}.\\n`;\n if (tagName && tagName.indexOf('-') > -1) {\n message += `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;\n }\n else {\n message += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;\n }\n if (shouldThrowErrorOnUnknownElement) {\n throw new RuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message);\n }\n else {\n console.error(formatRuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message));\n }\n }\n }\n}\n/**\n * Validates that the property of the element is known at runtime and returns\n * false if it's not the case.\n * This check is relevant for JIT-compiled components (for AOT-compiled\n * ones this check happens at build time).\n *\n * The property is considered known if either:\n * - it's a known property of the element\n * - the element is allowed by one of the schemas\n * - the property is used for animations\n *\n * @param element Element to validate\n * @param propName Name of the property to check\n * @param tagName Name of the tag hosting the property\n * @param schemas Array of schemas\n */\nfunction isPropertyValid(element, propName, tagName, schemas) {\n // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT\n // mode where this check happens at compile time. In JIT mode, `schemas` is always present and\n // defined as an array (as an empty array in case `schemas` field is not defined) and we should\n // execute the check below.\n if (schemas === null)\n return true;\n // The property is considered valid if the element matches the schema, it exists on the element,\n // or it is synthetic.\n if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {\n return true;\n }\n // Note: `typeof Node` returns 'function' in most browsers, but is undefined with domino.\n return typeof Node === 'undefined' || Node === null || !(element instanceof Node);\n}\n/**\n * Logs or throws an error that a property is not supported on an element.\n *\n * @param propName Name of the invalid property\n * @param tagName Name of the tag hosting the property\n * @param nodeType Type of the node hosting the property\n * @param lView An `LView` that represents a current component\n */\nfunction handleUnknownPropertyError(propName, tagName, nodeType, lView) {\n // Special-case a situation when a structural directive is applied to\n // an `<ng-template>` element, for example: `<ng-template *ngIf=\"true\">`.\n // In this case the compiler generates the `ɵɵtemplate` instruction with\n // the `null` as the tagName. The directive matching logic at runtime relies\n // on this effect (see `isInlineTemplate`), thus using the 'ng-template' as\n // a default value of the `tNode.value` is not feasible at this moment.\n if (!tagName && nodeType === 4 /* TNodeType.Container */) {\n tagName = 'ng-template';\n }\n const isHostStandalone = isHostComponentStandalone(lView);\n const templateLocation = getTemplateLocationDetails(lView);\n let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;\n const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;\n const importLocation = isHostStandalone\n ? \"included in the '@Component.imports' of this component\"\n : 'a part of an @NgModule where this component is declared';\n if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {\n // Most likely this is a control flow directive (such as `*ngIf`) used in\n // a template, but the directive or the `CommonModule` is not imported.\n const correspondingImport = KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName);\n message +=\n `\\nIf the '${propName}' is an Angular control flow directive, ` +\n `please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`;\n }\n else {\n // May be an Angular component, which is not imported/declared?\n message +=\n `\\n1. If '${tagName}' is an Angular component and it has the ` +\n `'${propName}' input, then verify that it is ${importLocation}.`;\n // May be a Web Component?\n if (tagName && tagName.indexOf('-') > -1) {\n message +=\n `\\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' ` +\n `to the ${schemas} of this component to suppress this message.`;\n message +=\n `\\n3. To allow any property add 'NO_ERRORS_SCHEMA' to ` +\n `the ${schemas} of this component.`;\n }\n else {\n // If it's expected, the error can be suppressed by the `NO_ERRORS_SCHEMA` schema.\n message +=\n `\\n2. To allow any property add 'NO_ERRORS_SCHEMA' to ` +\n `the ${schemas} of this component.`;\n }\n }\n reportUnknownPropertyError(message);\n}\nfunction reportUnknownPropertyError(message) {\n if (shouldThrowErrorOnUnknownProperty) {\n throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);\n }\n else {\n console.error(formatRuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message));\n }\n}\n/**\n * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)\n * and must **not** be used in production bundles. The function makes megamorphic reads, which might\n * be too slow for production mode and also it relies on the constructor function being available.\n *\n * Gets a reference to the host component def (where a current component is declared).\n *\n * @param lView An `LView` that represents a current component that is being rendered.\n */\nfunction getDeclarationComponentDef(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const declarationLView = lView[DECLARATION_COMPONENT_VIEW];\n const context = declarationLView[CONTEXT];\n // Unable to obtain a context.\n if (!context)\n return null;\n return context.constructor ? getComponentDef(context.constructor) : null;\n}\n/**\n * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)\n * and must **not** be used in production bundles. The function makes megamorphic reads, which might\n * be too slow for production mode.\n *\n * Checks if the current component is declared inside of a standalone component template.\n *\n * @param lView An `LView` that represents a current component that is being rendered.\n */\nfunction isHostComponentStandalone(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const componentDef = getDeclarationComponentDef(lView);\n // Treat host component as non-standalone if we can't obtain the def.\n return !!componentDef?.standalone;\n}\n/**\n * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)\n * and must **not** be used in production bundles. The function makes megamorphic reads, which might\n * be too slow for production mode.\n *\n * Constructs a string describing the location of the host component template. The function is used\n * in dev mode to produce error messages.\n *\n * @param lView An `LView` that represents a current component that is being rendered.\n */\nfunction getTemplateLocationDetails(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n return componentClassName ? ` (used in the '${componentClassName}' component template)` : '';\n}\n/**\n * The set of known control flow directives and their corresponding imports.\n * We use this set to produce a more precises error message with a note\n * that the `CommonModule` should also be included.\n */\nconst KNOWN_CONTROL_FLOW_DIRECTIVES = new Map([\n ['ngIf', 'NgIf'],\n ['ngFor', 'NgFor'],\n ['ngSwitchCase', 'NgSwitchCase'],\n ['ngSwitchDefault', 'NgSwitchDefault'],\n]);\n/**\n * Returns true if the tag name is allowed by specified schemas.\n * @param schemas Array of schemas\n * @param tagName Name of the tag\n */\nfunction matchingSchemas(schemas, tagName) {\n if (schemas !== null) {\n for (let i = 0; i < schemas.length; i++) {\n const schema = schemas[i];\n if (schema === NO_ERRORS_SCHEMA ||\n (schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1)) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveWindow(element) {\n return element.ownerDocument.defaultView;\n}\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveDocument(element) {\n return element.ownerDocument;\n}\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveBody(element) {\n return element.ownerDocument.body;\n}\n/**\n * The special delimiter we use to separate property names, prefixes, and suffixes\n * in property binding metadata. See storeBindingMetadata().\n *\n * We intentionally use the Unicode \"REPLACEMENT CHARACTER\" (U+FFFD) as a delimiter\n * because it is a very uncommon character that is unlikely to be part of a user's\n * property names or interpolation strings. If it is in fact used in a property\n * binding, DebugElement.properties will not return the correct value for that\n * binding. However, there should be no runtime effect for real applications.\n *\n * This character is typically rendered as a question mark inside of a diamond.\n * See https://en.wikipedia.org/wiki/Specials_(Unicode_block)\n *\n */\nconst INTERPOLATION_DELIMITER = `<60>`;\n/**\n * Unwrap a value which might be behind a closure (for forward declaration reasons).\n */\nfunction maybeUnwrapFn(value) {\n if (value instanceof Function) {\n return value();\n }\n else {\n return value;\n }\n}\n/**\n * Detects whether the code is invoked in a browser.\n * Later on, this check should be replaced with a tree-shakable\n * flag (e.g. `!isServer`).\n */\nfunction isPlatformBrowser(injector) {\n return (injector ?? inject(Injector)).get(PLATFORM_ID) === 'browser';\n}\n\n/**\n * The max length of the string representation of a value in an error message\n */\nconst VALUE_STRING_LENGTH_LIMIT = 200;\n/** Verifies that a given type is a Standalone Component. */\nfunction assertStandaloneComponentType(type) {\n assertComponentDef(type);\n const componentDef = getComponentDef(type);\n if (!componentDef.standalone) {\n throw new RuntimeError(907 /* RuntimeErrorCode.TYPE_IS_NOT_STANDALONE */, `The ${stringifyForError(type)} component is not marked as standalone, ` +\n `but Angular expects to have a standalone component here. ` +\n `Please make sure the ${stringifyForError(type)} component has ` +\n `the \\`standalone: true\\` flag in the decorator.`);\n }\n}\n/** Verifies whether a given type is a component */\nfunction assertComponentDef(type) {\n if (!getComponentDef(type)) {\n throw new RuntimeError(906 /* RuntimeErrorCode.MISSING_GENERATED_DEF */, `The ${stringifyForError(type)} is not an Angular component, ` +\n `make sure it has the \\`@Component\\` decorator.`);\n }\n}\n/** Called when there are multiple component selectors that match a given node */\nfunction throwMultipleComponentError(tNode, first, second) {\n throw new RuntimeError(-300 /* RuntimeErrorCode.MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}: ` +\n `${stringifyForError(first)} and ` +\n `${stringifyForError(second)}`);\n}\n/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */\nfunction throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName, lView) {\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n const field = propName ? ` for '${propName}'` : '';\n let msg = `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value${field}: '${formatValue(oldValue)}'. Current value: '${formatValue(currValue)}'.${componentClassName ? ` Expression location: ${componentClassName} component` : ''}`;\n if (creationMode) {\n msg +=\n ` It seems like the view has been created after its parent and its children have been dirty checked.` +\n ` Has it been created in a change detection hook?`;\n }\n throw new RuntimeError(-100 /* RuntimeErrorCode.EXPRESSION_CHANGED_AFTER_CHECKED */, msg);\n}\nfunction formatValue(value) {\n let strValue = String(value);\n // JSON.stringify will throw on circular references\n try {\n if (Array.isArray(value) || strValue === '[object Object]') {\n strValue = JSON.stringify(value);\n }\n }\n catch (error) { }\n return strValue.length > VALUE_STRING_LENGTH_LIMIT\n ? strValue.substring(0, VALUE_STRING_LENGTH_LIMIT) + '…'\n : strValue;\n}\nfunction constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {\n const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER);\n let oldValue = prefix, newValue = prefix;\n for (let i = 0; i < chunks.length; i++) {\n const slotIdx = rootIndex + i;\n oldValue += `${lView[slotIdx]}${chunks[i]}`;\n newValue += `${slotIdx === expressionIndex ? changedValue : lView[slotIdx]}${chunks[i]}`;\n }\n return { propName, oldValue, newValue };\n}\n/**\n * Constructs an object that contains details for the ExpressionChangedAfterItHasBeenCheckedError:\n * - property name (for property bindings or interpolations)\n * - old and new values, enriched using information from metadata\n *\n * More information on the metadata storage format can be found in `storePropertyBindingMetadata`\n * function description.\n */\nfunction getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValue) {\n const tData = lView[TVIEW].data;\n const metadata = tData[bindingIndex];\n if (typeof metadata === 'string') {\n // metadata for property interpolation\n if (metadata.indexOf(INTERPOLATION_DELIMITER) > -1) {\n return constructDetailsForInterpolation(lView, bindingIndex, bindingIndex, metadata, newValue);\n }\n // metadata for property binding\n return { propName: metadata, oldValue, newValue };\n }\n // metadata is not available for this expression, check if this expression is a part of the\n // property interpolation by going from the current binding index left and look for a string that\n // contains INTERPOLATION_DELIMITER, the layout in tView.data for this case will look like this:\n // [..., 'id<69>Prefix <20> and <20> suffix', null, null, null, ...]\n if (metadata === null) {\n let idx = bindingIndex - 1;\n while (typeof tData[idx] !== 'string' && tData[idx + 1] === null) {\n idx--;\n }\n const meta = tData[idx];\n if (typeof meta === 'string') {\n const matches = meta.match(new RegExp(INTERPOLATION_DELIMITER, 'g'));\n // first interpolation delimiter separates property name from interpolation parts (in case of\n // property interpolations), so we subtract one from total number of found delimiters\n if (matches && matches.length - 1 > bindingIndex - idx) {\n return constructDetailsForInterpolation(lView, idx, bindingIndex, meta, newValue);\n }\n }\n }\n return { propName: undefined, oldValue, newValue };\n}\n\n/**\n * Flags for renderer-specific style modifiers.\n * @publicApi\n */\nvar RendererStyleFlags2;\n(function (RendererStyleFlags2) {\n // TODO(misko): This needs to be refactored into a separate file so that it can be imported from\n // `node_manipulation.ts` Currently doing the import cause resolution order to change and fails\n // the tests. The work around is to have hard coded value in `node_manipulation.ts` for now.\n /**\n * Marks a style as important.\n */\n RendererStyleFlags2[RendererStyleFlags2[\"Important\"] = 1] = \"Important\";\n /**\n * Marks a style as using dash case naming (this-is-dash-case).\n */\n RendererStyleFlags2[RendererStyleFlags2[\"DashCase\"] = 2] = \"DashCase\";\n})(RendererStyleFlags2 || (RendererStyleFlags2 = {}));\n\nlet _icuContainerIterate;\n/**\n * Iterator which provides ability to visit all of the `TIcuContainerNode` root `RNode`s.\n */\nfunction icuContainerIterate(tIcuContainerNode, lView) {\n return _icuContainerIterate(tIcuContainerNode, lView);\n}\n/**\n * Ensures that `IcuContainerVisitor`'s implementation is present.\n *\n * This function is invoked when i18n instruction comes across an ICU. The purpose is to allow the\n * bundler to tree shake ICU logic and only load it if ICU instruction is executed.\n */\nfunction ensureIcuContainerVisitorLoaded(loader) {\n if (_icuContainerIterate === undefined) {\n // Do not inline this function. We want to keep `ensureIcuContainerVisitorLoaded` light, so it\n // can be inlined into call-site.\n _icuContainerIterate = loader();\n }\n}\n\n/**\n * NOTE: for performance reasons, the possible actions are inlined within the function instead of\n * being passed as an argument.\n */\nfunction applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {\n // If this slot was allocated for a text node dynamically created by i18n, the text node itself\n // won't be created until i18nApply() in the update block, so this node should be skipped.\n // For more info, see \"ICU expressions should work inside an ngTemplateOutlet inside an ngFor\"\n // in `i18n_spec.ts`.\n if (lNodeToHandle != null) {\n let lContainer;\n let isComponent = false;\n // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is\n // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if\n // it has LContainer so that we can process all of those cases appropriately.\n if (isLContainer(lNodeToHandle)) {\n lContainer = lNodeToHandle;\n }\n else if (isLView(lNodeToHandle)) {\n isComponent = true;\n ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n lNodeToHandle = lNodeToHandle[HOST];\n }\n const rNode = unwrapRNode(lNodeToHandle);\n if (action === 0 /* WalkTNodeTreeAction.Create */ && parent !== null) {\n if (beforeNode == null) {\n nativeAppendChild(renderer, parent, rNode);\n }\n else {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n }\n else if (action === 1 /* WalkTNodeTreeAction.Insert */ && parent !== null) {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n else if (action === 2 /* WalkTNodeTreeAction.Detach */) {\n nativeRemoveNode(renderer, rNode, isComponent);\n }\n else if (action === 3 /* WalkTNodeTreeAction.Destroy */) {\n ngDevMode && ngDevMode.rendererDestroyNode++;\n renderer.destroyNode(rNode);\n }\n if (lContainer != null) {\n applyContainer(renderer, action, lContainer, parent, beforeNode);\n }\n }\n}\nfunction createTextNode(renderer, value) {\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n ngDevMode && ngDevMode.rendererSetText++;\n return renderer.createText(value);\n}\nfunction updateTextNode(renderer, rNode, value) {\n ngDevMode && ngDevMode.rendererSetText++;\n renderer.setValue(rNode, value);\n}\nfunction createCommentNode(renderer, value) {\n ngDevMode && ngDevMode.rendererCreateComment++;\n return renderer.createComment(escapeCommentText(value));\n}\n/**\n * Creates a native element from a tag name, using a renderer.\n * @param renderer A renderer to use\n * @param name the tag name\n * @param namespace Optional namespace for element.\n * @returns the element created\n */\nfunction createElementNode(renderer, name, namespace) {\n ngDevMode && ngDevMode.rendererCreateElement++;\n return renderer.createElement(name, namespace);\n}\n/**\n * Removes all DOM elements associated with a view.\n *\n * Because some root nodes of the view may be containers, we sometimes need\n * to propagate deeply into the nested containers to remove all elements in the\n * views beneath it.\n *\n * @param tView The `TView' of the `LView` from which elements should be added or removed\n * @param lView The view from which elements should be added or removed\n */\nfunction removeViewFromDOM(tView, lView) {\n detachViewFromDOM(tView, lView);\n lView[HOST] = null;\n lView[T_HOST] = null;\n}\n/**\n * Adds all DOM elements associated with a view.\n *\n * Because some root nodes of the view may be containers, we sometimes need\n * to propagate deeply into the nested containers to add all elements in the\n * views beneath it.\n *\n * @param tView The `TView' of the `LView` from which elements should be added or removed\n * @param parentTNode The `TNode` where the `LView` should be attached to.\n * @param renderer Current renderer to use for DOM manipulations.\n * @param lView The view from which elements should be added or removed\n * @param parentNativeNode The parent `RElement` where it should be inserted into.\n * @param beforeNode The node before which elements should be added, if insert mode\n */\nfunction addViewToDOM(tView, parentTNode, renderer, lView, parentNativeNode, beforeNode) {\n lView[HOST] = parentNativeNode;\n lView[T_HOST] = parentTNode;\n applyView(tView, lView, renderer, 1 /* WalkTNodeTreeAction.Insert */, parentNativeNode, beforeNode);\n}\n/**\n * Detach a `LView` from the DOM by detaching its nodes.\n *\n * @param tView The `TView' of the `LView` to be detached\n * @param lView the `LView` to be detached.\n */\nfunction detachViewFromDOM(tView, lView) {\n // When we remove a view from the DOM, we need to rerun afterRender hooks\n // We don't necessarily needs to run change detection. DOM removal only requires\n // change detection if animations are enabled (this notification is handled by animations).\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(9 /* NotificationSource.ViewDetachedFromDOM */);\n applyView(tView, lView, lView[RENDERER], 2 /* WalkTNodeTreeAction.Detach */, null, null);\n}\n/**\n * Traverses down and up the tree of views and containers to remove listeners and\n * call onDestroy callbacks.\n *\n * Notes:\n * - Because it's used for onDestroy calls, it needs to be bottom-up.\n * - Must process containers instead of their views to avoid splicing\n * when views are destroyed and re-added.\n * - Using a while loop because it's faster than recursion\n * - Destroy only called on movement to sibling or movement to parent (laterally or up)\n *\n * @param rootView The view to destroy\n */\nfunction destroyViewTree(rootView) {\n // If the view has no children, we can clean it up and return early.\n let lViewOrLContainer = rootView[CHILD_HEAD];\n if (!lViewOrLContainer) {\n return cleanUpView(rootView[TVIEW], rootView);\n }\n while (lViewOrLContainer) {\n let next = null;\n if (isLView(lViewOrLContainer)) {\n // If LView, traverse down to child.\n next = lViewOrLContainer[CHILD_HEAD];\n }\n else {\n ngDevMode && assertLContainer(lViewOrLContainer);\n // If container, traverse down to its first LView.\n const firstView = lViewOrLContainer[CONTAINER_HEADER_OFFSET];\n if (firstView)\n next = firstView;\n }\n if (!next) {\n // Only clean up view when moving to the side or up, as destroy hooks\n // should be called in order from the bottom up.\n while (lViewOrLContainer && !lViewOrLContainer[NEXT] && lViewOrLContainer !== rootView) {\n if (isLView(lViewOrLContainer)) {\n cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);\n }\n lViewOrLContainer = lViewOrLContainer[PARENT];\n }\n if (lViewOrLContainer === null)\n lViewOrLContainer = rootView;\n if (isLView(lViewOrLContainer)) {\n cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);\n }\n next = lViewOrLContainer && lViewOrLContainer[NEXT];\n }\n lViewOrLContainer = next;\n }\n}\n/**\n * Inserts a view into a container.\n *\n * This adds the view to the container's array of active views in the correct\n * position. It also adds the view's elements to the DOM if the container isn't a\n * root node of another view (in that case, the view's elements will be added when\n * the container's parent view is added later).\n *\n * @param tView The `TView' of the `LView` to insert\n * @param lView The view to insert\n * @param lContainer The container into which the view should be inserted\n * @param index Which index in the container to insert the child view into\n */\nfunction insertView(tView, lView, lContainer, index) {\n ngDevMode && assertLView(lView);\n ngDevMode && assertLContainer(lContainer);\n const indexInContainer = CONTAINER_HEADER_OFFSET + index;\n const containerLength = lContainer.length;\n if (index > 0) {\n // This is a new view, we need to add it to the children.\n lContainer[indexInContainer - 1][NEXT] = lView;\n }\n if (index < containerLength - CONTAINER_HEADER_OFFSET) {\n lView[NEXT] = lContainer[indexInContainer];\n addToArray(lContainer, CONTAINER_HEADER_OFFSET + index, lView);\n }\n else {\n lContainer.push(lView);\n lView[NEXT] = null;\n }\n lView[PARENT] = lContainer;\n // track views where declaration and insertion points are different\n const declarationLContainer = lView[DECLARATION_LCONTAINER];\n if (declarationLContainer !== null && lContainer !== declarationLContainer) {\n trackMovedView(declarationLContainer, lView);\n }\n // notify query that a new view has been added\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.insertView(tView);\n }\n updateAncestorTraversalFlagsOnAttach(lView);\n // Sets the attached flag\n lView[FLAGS] |= 128 /* LViewFlags.Attached */;\n}\n/**\n * Track views created from the declaration container (TemplateRef) and inserted into a\n * different LContainer or attached directly to ApplicationRef.\n */\nfunction trackMovedView(declarationContainer, lView) {\n ngDevMode && assertDefined(lView, 'LView required');\n ngDevMode && assertLContainer(declarationContainer);\n const movedViews = declarationContainer[MOVED_VIEWS];\n const parent = lView[PARENT];\n ngDevMode && assertDefined(parent, 'missing parent');\n if (isLView(parent)) {\n declarationContainer[FLAGS] |= LContainerFlags.HasTransplantedViews;\n }\n else {\n const insertedComponentLView = parent[PARENT][DECLARATION_COMPONENT_VIEW];\n ngDevMode && assertDefined(insertedComponentLView, 'Missing insertedComponentLView');\n const declaredComponentLView = lView[DECLARATION_COMPONENT_VIEW];\n ngDevMode && assertDefined(declaredComponentLView, 'Missing declaredComponentLView');\n if (declaredComponentLView !== insertedComponentLView) {\n // At this point the declaration-component is not same as insertion-component; this means that\n // this is a transplanted view. Mark the declared lView as having transplanted views so that\n // those views can participate in CD.\n declarationContainer[FLAGS] |= LContainerFlags.HasTransplantedViews;\n }\n }\n if (movedViews === null) {\n declarationContainer[MOVED_VIEWS] = [lView];\n }\n else {\n movedViews.push(lView);\n }\n}\nfunction detachMovedView(declarationContainer, lView) {\n ngDevMode && assertLContainer(declarationContainer);\n ngDevMode &&\n assertDefined(declarationContainer[MOVED_VIEWS], 'A projected view should belong to a non-empty projected views collection');\n const movedViews = declarationContainer[MOVED_VIEWS];\n const declarationViewIndex = movedViews.indexOf(lView);\n movedViews.splice(declarationViewIndex, 1);\n}\n/**\n * Detaches a view from a container.\n *\n * This method removes the view from the container's array of active views. It also\n * removes the view's elements from the DOM.\n *\n * @param lContainer The container from which to detach a view\n * @param removeIndex The index of the view to detach\n * @returns Detached LView instance.\n */\nfunction detachView(lContainer, removeIndex) {\n if (lContainer.length <= CONTAINER_HEADER_OFFSET)\n return;\n const indexInContainer = CONTAINER_HEADER_OFFSET + removeIndex;\n const viewToDetach = lContainer[indexInContainer];\n if (viewToDetach) {\n const declarationLContainer = viewToDetach[DECLARATION_LCONTAINER];\n if (declarationLContainer !== null && declarationLContainer !== lContainer) {\n detachMovedView(declarationLContainer, viewToDetach);\n }\n if (removeIndex > 0) {\n lContainer[indexInContainer - 1][NEXT] = viewToDetach[NEXT];\n }\n const removedLView = removeFromArray(lContainer, CONTAINER_HEADER_OFFSET + removeIndex);\n removeViewFromDOM(viewToDetach[TVIEW], viewToDetach);\n // notify query that a view has been removed\n const lQueries = removedLView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(removedLView[TVIEW]);\n }\n viewToDetach[PARENT] = null;\n viewToDetach[NEXT] = null;\n // Unsets the attached flag\n viewToDetach[FLAGS] &= ~128 /* LViewFlags.Attached */;\n }\n return viewToDetach;\n}\n/**\n * A standalone function which destroys an LView,\n * conducting clean up (e.g. removing listeners, calling onDestroys).\n *\n * @param tView The `TView' of the `LView` to be destroyed\n * @param lView The view to be destroyed.\n */\nfunction destroyLView(tView, lView) {\n if (!(lView[FLAGS] & 256 /* LViewFlags.Destroyed */)) {\n const renderer = lView[RENDERER];\n if (renderer.destroyNode) {\n applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);\n }\n destroyViewTree(lView);\n }\n}\n/**\n * Calls onDestroys hooks for all directives and pipes in a given view and then removes all\n * listeners. Listeners are removed as the last step so events delivered in the onDestroys hooks\n * can be propagated to @Output listeners.\n *\n * @param tView `TView` for the `LView` to clean up.\n * @param lView The LView to clean up\n */\nfunction cleanUpView(tView, lView) {\n if (lView[FLAGS] & 256 /* LViewFlags.Destroyed */) {\n return;\n }\n const prevConsumer = setActiveConsumer$1(null);\n try {\n // Usually the Attached flag is removed when the view is detached from its parent, however\n // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n lView[FLAGS] &= ~128 /* LViewFlags.Attached */;\n // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n // really more of an \"afterDestroy\" hook if you think about it.\n lView[FLAGS] |= 256 /* LViewFlags.Destroyed */;\n lView[REACTIVE_TEMPLATE_CONSUMER] && consumerDestroy$1(lView[REACTIVE_TEMPLATE_CONSUMER]);\n executeOnDestroys(tView, lView);\n processCleanups(tView, lView);\n // For component views only, the local renderer is destroyed at clean up time.\n if (lView[TVIEW].type === 1 /* TViewType.Component */) {\n ngDevMode && ngDevMode.rendererDestroy++;\n lView[RENDERER].destroy();\n }\n const declarationContainer = lView[DECLARATION_LCONTAINER];\n // we are dealing with an embedded view that is still inserted into a container\n if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n // and this is a projected view\n if (declarationContainer !== lView[PARENT]) {\n detachMovedView(declarationContainer, lView);\n }\n // For embedded views still attached to a container: remove query result from this view.\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(tView);\n }\n }\n // Unregister the view once everything else has been cleaned up.\n unregisterLView(lView);\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n }\n}\n/** Removes listeners and unsubscribes from output subscriptions */\nfunction processCleanups(tView, lView) {\n ngDevMode && assertNotReactive(processCleanups.name);\n const tCleanup = tView.cleanup;\n const lCleanup = lView[CLEANUP];\n if (tCleanup !== null) {\n for (let i = 0; i < tCleanup.length - 1; i += 2) {\n if (typeof tCleanup[i] === 'string') {\n // This is a native DOM listener. It will occupy 4 entries in the TCleanup array (hence i +=\n // 2 at the end of this block).\n const targetIdx = tCleanup[i + 3];\n ngDevMode && assertNumber(targetIdx, 'cleanup target must be a number');\n if (targetIdx >= 0) {\n // Destroy anything whose teardown is a function call (e.g. QueryList, ModelSignal).\n lCleanup[targetIdx]();\n }\n else {\n // Subscription\n lCleanup[-targetIdx].unsubscribe();\n }\n i += 2;\n }\n else {\n // This is a cleanup function that is grouped with the index of its context\n const context = lCleanup[tCleanup[i + 1]];\n tCleanup[i].call(context);\n }\n }\n }\n if (lCleanup !== null) {\n lView[CLEANUP] = null;\n }\n const destroyHooks = lView[ON_DESTROY_HOOKS];\n if (destroyHooks !== null) {\n // Reset the ON_DESTROY_HOOKS array before iterating over it to prevent hooks that unregister\n // themselves from mutating the array during iteration.\n lView[ON_DESTROY_HOOKS] = null;\n for (let i = 0; i < destroyHooks.length; i++) {\n const destroyHooksFn = destroyHooks[i];\n ngDevMode && assertFunction(destroyHooksFn, 'Expecting destroy hook to be a function.');\n destroyHooksFn();\n }\n }\n}\n/** Calls onDestroy hooks for this view */\nfunction executeOnDestroys(tView, lView) {\n ngDevMode && assertNotReactive(executeOnDestroys.name);\n let destroyHooks;\n if (tView != null && (destroyHooks = tView.destroyHooks) != null) {\n for (let i = 0; i < destroyHooks.length; i += 2) {\n const context = lView[destroyHooks[i]];\n // Only call the destroy hook if the context has been requested.\n if (!(context instanceof NodeInjectorFactory)) {\n const toCall = destroyHooks[i + 1];\n if (Array.isArray(toCall)) {\n for (let j = 0; j < toCall.length; j += 2) {\n const callContext = context[toCall[j]];\n const hook = toCall[j + 1];\n profiler(4 /* ProfilerEvent.LifecycleHookStart */, callContext, hook);\n try {\n hook.call(callContext);\n }\n finally {\n profiler(5 /* ProfilerEvent.LifecycleHookEnd */, callContext, hook);\n }\n }\n }\n else {\n profiler(4 /* ProfilerEvent.LifecycleHookStart */, context, toCall);\n try {\n toCall.call(context);\n }\n finally {\n profiler(5 /* ProfilerEvent.LifecycleHookEnd */, context, toCall);\n }\n }\n }\n }\n }\n}\n/**\n * Returns a native element if a node can be inserted into the given parent.\n *\n * There are two reasons why we may not be able to insert a element immediately.\n * - Projection: When creating a child content element of a component, we have to skip the\n * insertion because the content of a component will be projected.\n * `<component><content>delayed due to projection</content></component>`\n * - Parent container is disconnected: This can happen when we are inserting a view into\n * parent container, which itself is disconnected. For example the parent container is part\n * of a View which has not be inserted or is made for projection but has not been inserted\n * into destination.\n *\n * @param tView: Current `TView`.\n * @param tNode: `TNode` for which we wish to retrieve render parent.\n * @param lView: Current `LView`.\n */\nfunction getParentRElement(tView, tNode, lView) {\n return getClosestRElement(tView, tNode.parent, lView);\n}\n/**\n * Get closest `RElement` or `null` if it can't be found.\n *\n * If `TNode` is `TNodeType.Element` => return `RElement` at `LView[tNode.index]` location.\n * If `TNode` is `TNodeType.ElementContainer|IcuContain` => return the parent (recursively).\n * If `TNode` is `null` then return host `RElement`:\n * - return `null` if projection\n * - return `null` if parent container is disconnected (we have no parent.)\n *\n * @param tView: Current `TView`.\n * @param tNode: `TNode` for which we wish to retrieve `RElement` (or `null` if host element is\n * needed).\n * @param lView: Current `LView`.\n * @returns `null` if the `RElement` can't be determined at this time (no parent / projection)\n */\nfunction getClosestRElement(tView, tNode, lView) {\n let parentTNode = tNode;\n // Skip over element and ICU containers as those are represented by a comment node and\n // can't be used as a render parent. Also skip let declarations since they don't have a\n // corresponding DOM node at all.\n while (parentTNode !== null &&\n parentTNode.type & (8 /* TNodeType.ElementContainer */ | 32 /* TNodeType.Icu */ | 128 /* TNodeType.LetDeclaration */)) {\n tNode = parentTNode;\n parentTNode = tNode.parent;\n }\n // If the parent tNode is null, then we are inserting across views: either into an embedded view\n // or a component view.\n if (parentTNode === null) {\n // We are inserting a root element of the component view into the component host element and\n // it should always be eager.\n return lView[HOST];\n }\n else {\n ngDevMode && assertTNodeType(parentTNode, 3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */);\n const { componentOffset } = parentTNode;\n if (componentOffset > -1) {\n ngDevMode && assertTNodeForLView(parentTNode, lView);\n const { encapsulation } = tView.data[parentTNode.directiveStart + componentOffset];\n // We've got a parent which is an element in the current view. We just need to verify if the\n // parent element is not a component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would then move it to its final destination. Note that we can't\n // make this assumption when using the Shadow DOM, because the native projection placeholders\n // (<content> or <slot>) have to be in place as elements are being inserted.\n if (encapsulation === ViewEncapsulation$1.None ||\n encapsulation === ViewEncapsulation$1.Emulated) {\n return null;\n }\n }\n return getNativeByTNode(parentTNode, lView);\n }\n}\n/**\n * Inserts a native node before another native node for a given parent.\n * This is a utility function that can be used when native nodes were determined.\n */\nfunction nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {\n ngDevMode && ngDevMode.rendererInsertBefore++;\n renderer.insertBefore(parent, child, beforeNode, isMove);\n}\nfunction nativeAppendChild(renderer, parent, child) {\n ngDevMode && ngDevMode.rendererAppendChild++;\n ngDevMode && assertDefined(parent, 'parent node must be defined');\n renderer.appendChild(parent, child);\n}\nfunction nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {\n if (beforeNode !== null) {\n nativeInsertBefore(renderer, parent, child, beforeNode, isMove);\n }\n else {\n nativeAppendChild(renderer, parent, child);\n }\n}\n/**\n * Returns a native parent of a given native node.\n */\nfunction nativeParentNode(renderer, node) {\n return renderer.parentNode(node);\n}\n/**\n * Returns a native sibling of a given native node.\n */\nfunction nativeNextSibling(renderer, node) {\n return renderer.nextSibling(node);\n}\n/**\n * Find a node in front of which `currentTNode` should be inserted.\n *\n * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n * takes `TNode.insertBeforeIndex` into account if i18n code has been invoked.\n *\n * @param parentTNode parent `TNode`\n * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n * @param lView current `LView`\n */\nfunction getInsertInFrontOfRNode(parentTNode, currentTNode, lView) {\n return _getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView);\n}\n/**\n * Find a node in front of which `currentTNode` should be inserted. (Does not take i18n into\n * account)\n *\n * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n * does not take `TNode.insertBeforeIndex` into account.\n *\n * @param parentTNode parent `TNode`\n * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n * @param lView current `LView`\n */\nfunction getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView) {\n if (parentTNode.type & (8 /* TNodeType.ElementContainer */ | 32 /* TNodeType.Icu */)) {\n return getNativeByTNode(parentTNode, lView);\n }\n return null;\n}\n/**\n * Tree shakable boundary for `getInsertInFrontOfRNodeWithI18n` function.\n *\n * This function will only be set if i18n code runs.\n */\nlet _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithNoI18n;\n/**\n * Tree shakable boundary for `processI18nInsertBefore` function.\n *\n * This function will only be set if i18n code runs.\n */\nlet _processI18nInsertBefore;\nfunction setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore) {\n _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithI18n;\n _processI18nInsertBefore = processI18nInsertBefore;\n}\n/**\n * Appends the `child` native node (or a collection of nodes) to the `parent`.\n *\n * @param tView The `TView' to be appended\n * @param lView The current LView\n * @param childRNode The native child (or children) that should be appended\n * @param childTNode The TNode of the child element\n */\nfunction appendChild(tView, lView, childRNode, childTNode) {\n const parentRNode = getParentRElement(tView, childTNode, lView);\n const renderer = lView[RENDERER];\n const parentTNode = childTNode.parent || lView[T_HOST];\n const anchorNode = getInsertInFrontOfRNode(parentTNode, childTNode, lView);\n if (parentRNode != null) {\n if (Array.isArray(childRNode)) {\n for (let i = 0; i < childRNode.length; i++) {\n nativeAppendOrInsertBefore(renderer, parentRNode, childRNode[i], anchorNode, false);\n }\n }\n else {\n nativeAppendOrInsertBefore(renderer, parentRNode, childRNode, anchorNode, false);\n }\n }\n _processI18nInsertBefore !== undefined &&\n _processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRNode);\n}\n/**\n * Returns the first native node for a given LView, starting from the provided TNode.\n *\n * Native nodes are returned in the order in which those appear in the native tree (DOM).\n */\nfunction getFirstNativeNode(lView, tNode) {\n if (tNode !== null) {\n ngDevMode &&\n assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ |\n 12 /* TNodeType.AnyContainer */ |\n 32 /* TNodeType.Icu */ |\n 16 /* TNodeType.Projection */ |\n 128 /* TNodeType.LetDeclaration */);\n const tNodeType = tNode.type;\n if (tNodeType & 3 /* TNodeType.AnyRNode */) {\n return getNativeByTNode(tNode, lView);\n }\n else if (tNodeType & 4 /* TNodeType.Container */) {\n return getBeforeNodeForView(-1, lView[tNode.index]);\n }\n else if (tNodeType & 8 /* TNodeType.ElementContainer */) {\n const elIcuContainerChild = tNode.child;\n if (elIcuContainerChild !== null) {\n return getFirstNativeNode(lView, elIcuContainerChild);\n }\n else {\n const rNodeOrLContainer = lView[tNode.index];\n if (isLContainer(rNodeOrLContainer)) {\n return getBeforeNodeForView(-1, rNodeOrLContainer);\n }\n else {\n return unwrapRNode(rNodeOrLContainer);\n }\n }\n }\n else if (tNodeType & 128 /* TNodeType.LetDeclaration */) {\n return getFirstNativeNode(lView, tNode.next);\n }\n else if (tNodeType & 32 /* TNodeType.Icu */) {\n let nextRNode = icuContainerIterate(tNode, lView);\n let rNode = nextRNode();\n // If the ICU container has no nodes, than we use the ICU anchor as the node.\n return rNode || unwrapRNode(lView[tNode.index]);\n }\n else {\n const projectionNodes = getProjectionNodes(lView, tNode);\n if (projectionNodes !== null) {\n if (Array.isArray(projectionNodes)) {\n return projectionNodes[0];\n }\n const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);\n ngDevMode && assertParentView(parentView);\n return getFirstNativeNode(parentView, projectionNodes);\n }\n else {\n return getFirstNativeNode(lView, tNode.next);\n }\n }\n }\n return null;\n}\nfunction getProjectionNodes(lView, tNode) {\n if (tNode !== null) {\n const componentView = lView[DECLARATION_COMPONENT_VIEW];\n const componentHost = componentView[T_HOST];\n const slotIdx = tNode.projection;\n ngDevMode && assertProjectionSlots(lView);\n return componentHost.projection[slotIdx];\n }\n return null;\n}\nfunction getBeforeNodeForView(viewIndexInContainer, lContainer) {\n const nextViewIndex = CONTAINER_HEADER_OFFSET + viewIndexInContainer + 1;\n if (nextViewIndex < lContainer.length) {\n const lView = lContainer[nextViewIndex];\n const firstTNodeOfView = lView[TVIEW].firstChild;\n if (firstTNodeOfView !== null) {\n return getFirstNativeNode(lView, firstTNodeOfView);\n }\n }\n return lContainer[NATIVE];\n}\n/**\n * Removes a native node itself using a given renderer. To remove the node we are looking up its\n * parent from the native tree as not all platforms / browsers support the equivalent of\n * node.remove().\n *\n * @param renderer A renderer to be used\n * @param rNode The native node that should be removed\n * @param isHostElement A flag indicating if a node to be removed is a host of a component.\n */\nfunction nativeRemoveNode(renderer, rNode, isHostElement) {\n ngDevMode && ngDevMode.rendererRemoveNode++;\n renderer.removeChild(null, rNode, isHostElement);\n}\n/**\n * Clears the contents of a given RElement.\n *\n * @param rElement the native RElement to be cleared\n */\nfunction clearElementContents(rElement) {\n rElement.textContent = '';\n}\n/**\n * Performs the operation of `action` on the node. Typically this involves inserting or removing\n * nodes on the LView or projection boundary.\n */\nfunction applyNodes(renderer, action, tNode, lView, parentRElement, beforeNode, isProjection) {\n while (tNode != null) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n // Let declarations don't have corresponding DOM nodes so we skip over them.\n if (tNode.type === 128 /* TNodeType.LetDeclaration */) {\n tNode = tNode.next;\n continue;\n }\n ngDevMode &&\n assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 16 /* TNodeType.Projection */ | 32 /* TNodeType.Icu */);\n const rawSlotValue = lView[tNode.index];\n const tNodeType = tNode.type;\n if (isProjection) {\n if (action === 0 /* WalkTNodeTreeAction.Create */) {\n rawSlotValue && attachPatchData(unwrapRNode(rawSlotValue), lView);\n tNode.flags |= 2 /* TNodeFlags.isProjected */;\n }\n }\n if ((tNode.flags & 32 /* TNodeFlags.isDetached */) !== 32 /* TNodeFlags.isDetached */) {\n if (tNodeType & 8 /* TNodeType.ElementContainer */) {\n applyNodes(renderer, action, tNode.child, lView, parentRElement, beforeNode, false);\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n }\n else if (tNodeType & 32 /* TNodeType.Icu */) {\n const nextRNode = icuContainerIterate(tNode, lView);\n let rNode;\n while ((rNode = nextRNode())) {\n applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);\n }\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n }\n else if (tNodeType & 16 /* TNodeType.Projection */) {\n applyProjectionRecursive(renderer, action, lView, tNode, parentRElement, beforeNode);\n }\n else {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */);\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n }\n }\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n }\n}\nfunction applyView(tView, lView, renderer, action, parentRElement, beforeNode) {\n applyNodes(renderer, action, tView.firstChild, lView, parentRElement, beforeNode, false);\n}\n/**\n * `applyProjection` performs operation on the projection.\n *\n * Inserting a projection requires us to locate the projected nodes from the parent component. The\n * complication is that those nodes themselves could be re-projected from their parent component.\n *\n * @param tView The `TView` of `LView` which needs to be inserted, detached, destroyed\n * @param lView The `LView` which needs to be inserted, detached, destroyed.\n * @param tProjectionNode node to project\n */\nfunction applyProjection(tView, lView, tProjectionNode) {\n const renderer = lView[RENDERER];\n const parentRNode = getParentRElement(tView, tProjectionNode, lView);\n const parentTNode = tProjectionNode.parent || lView[T_HOST];\n let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n applyProjectionRecursive(renderer, 0 /* WalkTNodeTreeAction.Create */, lView, tProjectionNode, parentRNode, beforeNode);\n}\n/**\n * `applyProjectionRecursive` performs operation on the projection specified by `action` (insert,\n * detach, destroy)\n *\n * Inserting a projection requires us to locate the projected nodes from the parent component. The\n * complication is that those nodes themselves could be re-projected from their parent component.\n *\n * @param renderer Render to use\n * @param action action to perform (insert, detach, destroy)\n * @param lView The LView which needs to be inserted, detached, destroyed.\n * @param tProjectionNode node to project\n * @param parentRElement parent DOM element for insertion/removal.\n * @param beforeNode Before which node the insertions should happen.\n */\nfunction applyProjectionRecursive(renderer, action, lView, tProjectionNode, parentRElement, beforeNode) {\n const componentLView = lView[DECLARATION_COMPONENT_VIEW];\n const componentNode = componentLView[T_HOST];\n ngDevMode &&\n assertEqual(typeof tProjectionNode.projection, 'number', 'expecting projection index');\n const nodeToProjectOrRNodes = componentNode.projection[tProjectionNode.projection];\n if (Array.isArray(nodeToProjectOrRNodes)) {\n // This should not exist, it is a bit of a hack. When we bootstrap a top level node and we\n // need to support passing projectable nodes, so we cheat and put them in the TNode\n // of the Host TView. (Yes we put instance info at the T Level). We can get away with it\n // because we know that TView is not shared and therefore it will not be a problem.\n // This should be refactored and cleaned up.\n for (let i = 0; i < nodeToProjectOrRNodes.length; i++) {\n const rNode = nodeToProjectOrRNodes[i];\n applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);\n }\n }\n else {\n let nodeToProject = nodeToProjectOrRNodes;\n const projectedComponentLView = componentLView[PARENT];\n // If a parent <ng-content> is located within a skip hydration block,\n // annotate an actual node that is being projected with the same flag too.\n if (hasInSkipHydrationBlockFlag(tProjectionNode)) {\n nodeToProject.flags |= 128 /* TNodeFlags.inSkipHydrationBlock */;\n }\n applyNodes(renderer, action, nodeToProject, projectedComponentLView, parentRElement, beforeNode, true);\n }\n}\n/**\n * `applyContainer` performs an operation on the container and its views as specified by\n * `action` (insert, detach, destroy)\n *\n * Inserting a Container is complicated by the fact that the container may have Views which\n * themselves have containers or projections.\n *\n * @param renderer Renderer to use\n * @param action action to perform (insert, detach, destroy)\n * @param lContainer The LContainer which needs to be inserted, detached, destroyed.\n * @param parentRElement parent DOM element for insertion/removal.\n * @param beforeNode Before which node the insertions should happen.\n */\nfunction applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {\n ngDevMode && assertLContainer(lContainer);\n const anchor = lContainer[NATIVE]; // LContainer has its own before node.\n const native = unwrapRNode(lContainer);\n // An LContainer can be created dynamically on any node by injecting ViewContainerRef.\n // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor\n // node (comment in the DOM) that will be different from the LContainer's host node. In this\n // particular case we need to execute action on 2 nodes:\n // - container's host node (this is done in the executeActionOnElementOrContainer)\n // - container's host node (this is done here)\n if (anchor !== native) {\n // This is very strange to me (Misko). I would expect that the native is same as anchor. I\n // don't see a reason why they should be different, but they are.\n //\n // If they are we need to process the second anchor as well.\n applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lView = lContainer[i];\n applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);\n }\n}\n/**\n * Writes class/style to element.\n *\n * @param renderer Renderer to use.\n * @param isClassBased `true` if it should be written to `class` (`false` to write to `style`)\n * @param rNode The Node to write to.\n * @param prop Property to write to. This would be the class/style name.\n * @param value Value to write. If `null`/`undefined`/`false` this is considered a remove (set/add\n * otherwise).\n */\nfunction applyStyling(renderer, isClassBased, rNode, prop, value) {\n if (isClassBased) {\n // We actually want JS true/false here because any truthy value should add the class\n if (!value) {\n ngDevMode && ngDevMode.rendererRemoveClass++;\n renderer.removeClass(rNode, prop);\n }\n else {\n ngDevMode && ngDevMode.rendererAddClass++;\n renderer.addClass(rNode, prop);\n }\n }\n else {\n let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;\n if (value == null /** || value === undefined */) {\n ngDevMode && ngDevMode.rendererRemoveStyle++;\n renderer.removeStyle(rNode, prop, flags);\n }\n else {\n // A value is important if it ends with `!important`. The style\n // parser strips any semicolons at the end of the value.\n const isImportant = typeof value === 'string' ? value.endsWith('!important') : false;\n if (isImportant) {\n // !important has to be stripped from the value for it to be valid.\n value = value.slice(0, -10);\n flags |= RendererStyleFlags2.Important;\n }\n ngDevMode && ngDevMode.rendererSetStyle++;\n renderer.setStyle(rNode, prop, value, flags);\n }\n }\n}\n/**\n * Write `cssText` to `RElement`.\n *\n * This function does direct write without any reconciliation. Used for writing initial values, so\n * that static styling values do not pull in the style parser.\n *\n * @param renderer Renderer to use\n * @param element The element which needs to be updated.\n * @param newValue The new class list to write.\n */\nfunction writeDirectStyle(renderer, element, newValue) {\n ngDevMode && assertString(newValue, \"'newValue' should be a string\");\n renderer.setAttribute(element, 'style', newValue);\n ngDevMode && ngDevMode.rendererSetStyle++;\n}\n/**\n * Write `className` to `RElement`.\n *\n * This function does direct write without any reconciliation. Used for writing initial values, so\n * that static styling values do not pull in the style parser.\n *\n * @param renderer Renderer to use\n * @param element The element which needs to be updated.\n * @param newValue The new class list to write.\n */\nfunction writeDirectClass(renderer, element, newValue) {\n ngDevMode && assertString(newValue, \"'newValue' should be a string\");\n if (newValue === '') {\n // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.\n renderer.removeAttribute(element, 'class');\n }\n else {\n renderer.setAttribute(element, 'class', newValue);\n }\n ngDevMode && ngDevMode.rendererSetClassName++;\n}\n/** Sets up the static DOM attributes on an `RNode`. */\nfunction setupStaticAttributes(renderer, element, tNode) {\n const { mergedAttrs, classes, styles } = tNode;\n if (mergedAttrs !== null) {\n setUpAttributes(renderer, element, mergedAttrs);\n }\n if (classes !== null) {\n writeDirectClass(renderer, element, classes);\n }\n if (styles !== null) {\n writeDirectStyle(renderer, element, styles);\n }\n}\n\n/** A special value which designates that a value has not changed. */\nconst NO_CHANGE = typeof ngDevMode === 'undefined' || ngDevMode ? { __brand__: 'NO_CHANGE' } : {};\n\n/**\n * Advances to an element for later binding instructions.\n *\n * Used in conjunction with instructions like {@link property} to act on elements with specified\n * indices, for example those created with {@link element} or {@link elementStart}.\n *\n * ```ts\n * (rf: RenderFlags, ctx: any) => {\n * if (rf & 1) {\n * text(0, 'Hello');\n * text(1, 'Goodbye')\n * element(2, 'div');\n * }\n * if (rf & 2) {\n * advance(2); // Advance twice to the <div>.\n * property('title', 'test');\n * }\n * }\n * ```\n * @param delta Number of elements to advance forwards by.\n *\n * @codeGenApi\n */\nfunction ɵɵadvance(delta = 1) {\n ngDevMode && assertGreaterThan(delta, 0, 'Can only advance forward');\n selectIndexInternal(getTView(), getLView(), getSelectedIndex() + delta, !!ngDevMode && isInCheckNoChangesMode());\n}\nfunction selectIndexInternal(tView, lView, index, checkNoChangesMode) {\n ngDevMode && assertIndexInDeclRange(lView[TVIEW], index);\n // Flush the initial hooks for elements in the view that have been added up to this point.\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!checkNoChangesMode) {\n const hooksInitPhaseCompleted = (lView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === 3 /* InitPhaseState.InitPhaseCompleted */;\n if (hooksInitPhaseCompleted) {\n const preOrderCheckHooks = tView.preOrderCheckHooks;\n if (preOrderCheckHooks !== null) {\n executeCheckHooks(lView, preOrderCheckHooks, index);\n }\n }\n else {\n const preOrderHooks = tView.preOrderHooks;\n if (preOrderHooks !== null) {\n executeInitAndCheckHooks(lView, preOrderHooks, 0 /* InitPhaseState.OnInitHooksToBeRun */, index);\n }\n }\n }\n // We must set the selected index *after* running the hooks, because hooks may have side-effects\n // that cause other template functions to run, thus updating the selected index, which is global\n // state. If we run `setSelectedIndex` *before* we run the hooks, in some cases the selected index\n // will be altered by the time we leave the `ɵɵadvance` instruction.\n setSelectedIndex(index);\n}\n\nfunction ɵɵdirectiveInject(token, flags = InjectFlags.Default) {\n const lView = getLView();\n // Fall back to inject() if view hasn't been created. This situation can happen in tests\n // if inject utilities are used before bootstrapping.\n if (lView === null) {\n // Verify that we will not get into infinite loop.\n ngDevMode && assertInjectImplementationNotEqual(ɵɵdirectiveInject);\n return ɵɵinject(token, flags);\n }\n const tNode = getCurrentTNode();\n const value = getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);\n ngDevMode && emitInjectEvent(token, value, flags);\n return value;\n}\n/**\n * Throws an error indicating that a factory function could not be generated by the compiler for a\n * particular class.\n *\n * This instruction allows the actual error message to be optimized away when ngDevMode is turned\n * off, saving bytes of generated code while still providing a good experience in dev mode.\n *\n * The name of the class is not mentioned here, but will be in the generated factory function name\n * and thus in the stack trace.\n *\n * @codeGenApi\n */\nfunction ɵɵinvalidFactory() {\n const msg = ngDevMode\n ? `This constructor was not compatible with Dependency Injection.`\n : 'invalid';\n throw new Error(msg);\n}\n\nfunction writeToDirectiveInput(def, instance, publicName, privateName, flags, value) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n // If we know we are dealing with a signal input, we cache its reference\n // in a tree-shakable way. The input signal node can then be used for\n // value transform execution or actual value updates without introducing\n // additional megamorphic accesses for accessing the instance field.\n let inputSignalNode = null;\n if ((flags & InputFlags.SignalBased) !== 0) {\n const field = instance[privateName];\n inputSignalNode = field[SIGNAL$1];\n }\n // If there is a signal node and a transform, run it before potentially\n // delegating to features like `NgOnChanges`.\n if (inputSignalNode !== null && inputSignalNode.transformFn !== undefined) {\n value = inputSignalNode.transformFn(value);\n }\n // If there is a decorator input transform, run it.\n if ((flags & InputFlags.HasDecoratorInputTransform) !== 0) {\n value = def.inputTransforms[privateName].call(instance, value);\n }\n if (def.setInput !== null) {\n def.setInput(instance, inputSignalNode, value, publicName, privateName);\n }\n else {\n applyValueToInputField(instance, inputSignalNode, privateName, value);\n }\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n }\n}\n\n/**\n * Invoke `HostBindingsFunction`s for view.\n *\n * This methods executes `TView.hostBindingOpCodes`. It is used to execute the\n * `HostBindingsFunction`s associated with the current `LView`.\n *\n * @param tView Current `TView`.\n * @param lView Current `LView`.\n */\nfunction processHostBindingOpCodes(tView, lView) {\n const hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null)\n return;\n try {\n for (let i = 0; i < hostBindingOpCodes.length; i++) {\n const opCode = hostBindingOpCodes[i];\n if (opCode < 0) {\n // Negative numbers are element indexes.\n setSelectedIndex(~opCode);\n }\n else {\n // Positive numbers are NumberTuple which store bindingRootIndex and directiveIndex.\n const directiveIdx = opCode;\n const bindingRootIndx = hostBindingOpCodes[++i];\n const hostBindingFn = hostBindingOpCodes[++i];\n setBindingRootForHostBindings(bindingRootIndx, directiveIdx);\n const context = lView[directiveIdx];\n hostBindingFn(2 /* RenderFlags.Update */, context);\n }\n }\n }\n finally {\n setSelectedIndex(-1);\n }\n}\nfunction createLView(parentLView, tView, context, flags, host, tHostNode, environment, renderer, injector, embeddedViewInjector, hydrationInfo) {\n const lView = tView.blueprint.slice();\n lView[HOST] = host;\n lView[FLAGS] =\n flags |\n 4 /* LViewFlags.CreationMode */ |\n 128 /* LViewFlags.Attached */ |\n 8 /* LViewFlags.FirstLViewPass */ |\n 64 /* LViewFlags.Dirty */;\n if (embeddedViewInjector !== null ||\n (parentLView && parentLView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */)) {\n lView[FLAGS] |= 2048 /* LViewFlags.HasEmbeddedViewInjector */;\n }\n resetPreOrderHookFlags(lView);\n ngDevMode && tView.declTNode && parentLView && assertTNodeForLView(tView.declTNode, parentLView);\n lView[PARENT] = lView[DECLARATION_VIEW] = parentLView;\n lView[CONTEXT] = context;\n lView[ENVIRONMENT] = (environment || (parentLView && parentLView[ENVIRONMENT]));\n ngDevMode && assertDefined(lView[ENVIRONMENT], 'LViewEnvironment is required');\n lView[RENDERER] = (renderer || (parentLView && parentLView[RENDERER]));\n ngDevMode && assertDefined(lView[RENDERER], 'Renderer is required');\n lView[INJECTOR] = injector || (parentLView && parentLView[INJECTOR]) || null;\n lView[T_HOST] = tHostNode;\n lView[ID] = getUniqueLViewId();\n lView[HYDRATION] = hydrationInfo;\n lView[EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector;\n ngDevMode &&\n assertEqual(tView.type == 2 /* TViewType.Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');\n lView[DECLARATION_COMPONENT_VIEW] =\n tView.type == 2 /* TViewType.Embedded */ ? parentLView[DECLARATION_COMPONENT_VIEW] : lView;\n return lView;\n}\nfunction getOrCreateTNode(tView, index, type, name, attrs) {\n ngDevMode &&\n index !== 0 && // 0 are bogus nodes and they are OK. See `createContainerRef` in\n // `view_engine_compatibility` for additional context.\n assertGreaterThanOrEqual(index, HEADER_OFFSET, \"TNodes can't be in the LView header.\");\n // Keep this function short, so that the VM will inline it.\n ngDevMode && assertPureTNodeType(type);\n let tNode = tView.data[index];\n if (tNode === null) {\n tNode = createTNodeAtIndex(tView, index, type, name, attrs);\n if (isInI18nBlock()) {\n // If we are in i18n block then all elements should be pre declared through `Placeholder`\n // See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n // If the `TNode` was not pre-declared than it means it was not mentioned which means it was\n // removed, so we mark it as detached.\n tNode.flags |= 32 /* TNodeFlags.isDetached */;\n }\n }\n else if (tNode.type & 64 /* TNodeType.Placeholder */) {\n tNode.type = type;\n tNode.value = name;\n tNode.attrs = attrs;\n const parent = getCurrentParentTNode();\n tNode.injectorIndex = parent === null ? -1 : parent.injectorIndex;\n ngDevMode && assertTNodeForTView(tNode, tView);\n ngDevMode && assertEqual(index, tNode.index, 'Expecting same index');\n }\n setCurrentTNode(tNode, true);\n return tNode;\n}\nfunction createTNodeAtIndex(tView, index, type, name, attrs) {\n const currentTNode = getCurrentTNodePlaceholderOk();\n const isParent = isCurrentTNodeParent();\n const parent = isParent ? currentTNode : currentTNode && currentTNode.parent;\n // Parents cannot cross component boundaries because components will be used in multiple places.\n const tNode = (tView.data[index] = createTNode(tView, parent, type, index, name, attrs));\n // Assign a pointer to the first child node of a given view. The first node is not always the one\n // at index 0, in case of i18n, index 0 can be the instruction `i18nStart` and the first node has\n // the index 1 or more, so we can't just check node index.\n if (tView.firstChild === null) {\n tView.firstChild = tNode;\n }\n if (currentTNode !== null) {\n if (isParent) {\n // FIXME(misko): This logic looks unnecessarily complicated. Could we simplify?\n if (currentTNode.child == null && tNode.parent !== null) {\n // We are in the same view, which means we are adding content node to the parent view.\n currentTNode.child = tNode;\n }\n }\n else {\n if (currentTNode.next === null) {\n // In the case of i18n the `currentTNode` may already be linked, in which case we don't want\n // to break the links which i18n created.\n currentTNode.next = tNode;\n tNode.prev = currentTNode;\n }\n }\n }\n return tNode;\n}\n/**\n * When elements are created dynamically after a view blueprint is created (e.g. through\n * i18nApply()), we need to adjust the blueprint for future\n * template passes.\n *\n * @param tView `TView` associated with `LView`\n * @param lView The `LView` containing the blueprint to adjust\n * @param numSlotsToAlloc The number of slots to alloc in the LView, should be >0\n * @param initialValue Initial value to store in blueprint\n */\nfunction allocExpando(tView, lView, numSlotsToAlloc, initialValue) {\n if (numSlotsToAlloc === 0)\n return -1;\n if (ngDevMode) {\n assertFirstCreatePass(tView);\n assertSame(tView, lView[TVIEW], '`LView` must be associated with `TView`!');\n assertEqual(tView.data.length, lView.length, 'Expecting LView to be same size as TView');\n assertEqual(tView.data.length, tView.blueprint.length, 'Expecting Blueprint to be same size as TView');\n assertFirstUpdatePass(tView);\n }\n const allocIdx = lView.length;\n for (let i = 0; i < numSlotsToAlloc; i++) {\n lView.push(initialValue);\n tView.blueprint.push(initialValue);\n tView.data.push(null);\n }\n return allocIdx;\n}\nfunction executeTemplate(tView, lView, templateFn, rf, context) {\n const prevSelectedIndex = getSelectedIndex();\n const isUpdatePhase = rf & 2 /* RenderFlags.Update */;\n try {\n setSelectedIndex(-1);\n if (isUpdatePhase && lView.length > HEADER_OFFSET) {\n // When we're updating, inherently select 0 so we don't\n // have to generate that instruction for most update blocks.\n selectIndexInternal(tView, lView, HEADER_OFFSET, !!ngDevMode && isInCheckNoChangesMode());\n }\n const preHookType = isUpdatePhase\n ? 2 /* ProfilerEvent.TemplateUpdateStart */\n : 0 /* ProfilerEvent.TemplateCreateStart */;\n profiler(preHookType, context);\n templateFn(rf, context);\n }\n finally {\n setSelectedIndex(prevSelectedIndex);\n const postHookType = isUpdatePhase\n ? 3 /* ProfilerEvent.TemplateUpdateEnd */\n : 1 /* ProfilerEvent.TemplateCreateEnd */;\n profiler(postHookType, context);\n }\n}\n//////////////////////////\n//// Element\n//////////////////////////\nfunction executeContentQueries(tView, tNode, lView) {\n if (isContentQueryHost(tNode)) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {\n const def = tView.data[directiveIndex];\n if (def.contentQueries) {\n const directiveInstance = lView[directiveIndex];\n ngDevMode &&\n assertDefined(directiveIndex, 'Incorrect reference to a directive defining a content query');\n def.contentQueries(1 /* RenderFlags.Create */, directiveInstance, directiveIndex);\n }\n }\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n}\n/**\n * Creates directive instances.\n */\nfunction createDirectivesInstances(tView, lView, tNode) {\n if (!getBindingsEnabled())\n return;\n instantiateAllDirectives(tView, lView, tNode, getNativeByTNode(tNode, lView));\n if ((tNode.flags & 64 /* TNodeFlags.hasHostBindings */) === 64 /* TNodeFlags.hasHostBindings */) {\n invokeDirectivesHostBindings(tView, lView, tNode);\n }\n}\n/**\n * Takes a list of local names and indices and pushes the resolved local variable values\n * to LView in the same order as they are loaded in the template with load().\n */\nfunction saveResolvedLocalsInData(viewData, tNode, localRefExtractor = getNativeByTNode) {\n const localNames = tNode.localNames;\n if (localNames !== null) {\n let localIndex = tNode.index + 1;\n for (let i = 0; i < localNames.length; i += 2) {\n const index = localNames[i + 1];\n const value = index === -1\n ? localRefExtractor(tNode, viewData)\n : viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}\n/**\n * Gets TView from a template function or creates a new TView\n * if it doesn't already exist.\n *\n * @param def ComponentDef\n * @returns TView\n */\nfunction getOrCreateComponentTView(def) {\n const tView = def.tView;\n // Create a TView if there isn't one, or recreate it if the first create pass didn't\n // complete successfully since we can't know for sure whether it's in a usable shape.\n if (tView === null || tView.incompleteFirstPass) {\n // Declaration node here is null since this function is called when we dynamically create a\n // component and hence there is no declaration.\n const declTNode = null;\n return (def.tView = createTView(1 /* TViewType.Component */, declTNode, def.template, def.decls, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery, def.schemas, def.consts, def.id));\n }\n return tView;\n}\n/**\n * Creates a TView instance\n *\n * @param type Type of `TView`.\n * @param declTNode Declaration location of this `TView`.\n * @param templateFn Template function\n * @param decls The number of nodes, local refs, and pipes in this template\n * @param directives Registry of directives for this view\n * @param pipes Registry of pipes for this view\n * @param viewQuery View queries for this view\n * @param schemas Schemas for this view\n * @param consts Constants for this view\n */\nfunction createTView(type, declTNode, templateFn, decls, vars, directives, pipes, viewQuery, schemas, constsOrFactory, ssrId) {\n ngDevMode && ngDevMode.tView++;\n const bindingStartIndex = HEADER_OFFSET + decls;\n // This length does not yet contain host bindings from child directives because at this point,\n // we don't know which directives are active on this template. As soon as a directive is matched\n // that has a host binding, we will update the blueprint with that def's hostVars count.\n const initialViewLength = bindingStartIndex + vars;\n const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);\n const consts = typeof constsOrFactory === 'function' ? constsOrFactory() : constsOrFactory;\n const tView = (blueprint[TVIEW] = {\n type: type,\n blueprint: blueprint,\n template: templateFn,\n queries: null,\n viewQuery: viewQuery,\n declTNode: declTNode,\n data: blueprint.slice().fill(null, bindingStartIndex),\n bindingStartIndex: bindingStartIndex,\n expandoStartIndex: initialViewLength,\n hostBindingOpCodes: null,\n firstCreatePass: true,\n firstUpdatePass: true,\n staticViewQueries: false,\n staticContentQueries: false,\n preOrderHooks: null,\n preOrderCheckHooks: null,\n contentHooks: null,\n contentCheckHooks: null,\n viewHooks: null,\n viewCheckHooks: null,\n destroyHooks: null,\n cleanup: null,\n contentQueries: null,\n components: null,\n directiveRegistry: typeof directives === 'function' ? directives() : directives,\n pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,\n firstChild: null,\n schemas: schemas,\n consts: consts,\n incompleteFirstPass: false,\n ssrId,\n });\n if (ngDevMode) {\n // For performance reasons it is important that the tView retains the same shape during runtime.\n // (To make sure that all of the code is monomorphic.) For this reason we seal the object to\n // prevent class transitions.\n Object.seal(tView);\n }\n return tView;\n}\nfunction createViewBlueprint(bindingStartIndex, initialViewLength) {\n const blueprint = [];\n for (let i = 0; i < initialViewLength; i++) {\n blueprint.push(i < bindingStartIndex ? null : NO_CHANGE);\n }\n return blueprint;\n}\n/**\n * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.\n *\n * @param renderer the renderer used to locate the element.\n * @param elementOrSelector Render element or CSS selector to locate the element.\n * @param encapsulation View Encapsulation defined for component that requests host element.\n * @param injector Root view injector instance.\n */\nfunction locateHostElement(renderer, elementOrSelector, encapsulation, injector) {\n // Note: we use default value for the `PRESERVE_HOST_CONTENT` here even though it's a\n // tree-shakable one (providedIn:'root'). This code path can be triggered during dynamic\n // component creation (after calling ViewContainerRef.createComponent) when an injector\n // instance can be provided. The injector instance might be disconnected from the main DI\n // tree, thus the `PRESERVE_HOST_CONTENT` would not be able to instantiate. In this case, the\n // default value will be used.\n const preserveHostContent = injector.get(PRESERVE_HOST_CONTENT, PRESERVE_HOST_CONTENT_DEFAULT);\n // When using native Shadow DOM, do not clear host element to allow native slot\n // projection.\n const preserveContent = preserveHostContent || encapsulation === ViewEncapsulation$1.ShadowDom;\n const rootElement = renderer.selectRootElement(elementOrSelector, preserveContent);\n applyRootElementTransform(rootElement);\n return rootElement;\n}\n/**\n * Applies any root element transformations that are needed. If hydration is enabled,\n * this will process corrupted text nodes.\n *\n * @param rootElement the app root HTML Element\n */\nfunction applyRootElementTransform(rootElement) {\n _applyRootElementTransformImpl(rootElement);\n}\n/**\n * Reference to a function that applies transformations to the root HTML element\n * of an app. When hydration is enabled, this processes any corrupt text nodes\n * so they are properly hydratable on the client.\n *\n * @param rootElement the app root HTML Element\n */\nlet _applyRootElementTransformImpl = () => null;\n/**\n * Processes text node markers before hydration begins. This replaces any special comment\n * nodes that were added prior to serialization are swapped out to restore proper text\n * nodes before hydration.\n *\n * @param rootElement the app root HTML Element\n */\nfunction applyRootElementTransformImpl(rootElement) {\n if (hasSkipHydrationAttrOnRElement(rootElement)) {\n // Handle a situation when the `ngSkipHydration` attribute is applied\n // to the root node of an application. In this case, we should clear\n // the contents and render everything from scratch.\n clearElementContents(rootElement);\n }\n else {\n processTextNodeMarkersBeforeHydration(rootElement);\n }\n}\n/**\n * Sets the implementation for the `applyRootElementTransform` function.\n */\nfunction enableApplyRootElementTransformImpl() {\n _applyRootElementTransformImpl = applyRootElementTransformImpl;\n}\n/**\n * Saves context for this cleanup function in LView.cleanupInstances.\n *\n * On the first template pass, saves in TView:\n * - Cleanup function\n * - Index of context we just saved in LView.cleanupInstances\n */\nfunction storeCleanupWithContext(tView, lView, context, cleanupFn) {\n const lCleanup = getOrCreateLViewCleanup(lView);\n // Historically the `storeCleanupWithContext` was used to register both framework-level and\n // user-defined cleanup callbacks, but over time those two types of cleanups were separated.\n // This dev mode checks assures that user-level cleanup callbacks are _not_ stored in data\n // structures reserved for framework-specific hooks.\n ngDevMode &&\n assertDefined(context, 'Cleanup context is mandatory when registering framework-level destroy hooks');\n lCleanup.push(context);\n if (tView.firstCreatePass) {\n getOrCreateTViewCleanup(tView).push(cleanupFn, lCleanup.length - 1);\n }\n else {\n // Make sure that no new framework-level cleanup functions are registered after the first\n // template pass is done (and TView data structures are meant to fully constructed).\n if (ngDevMode) {\n Object.freeze(getOrCreateTViewCleanup(tView));\n }\n }\n}\nfunction createTNode(tView, tParent, type, index, value, attrs) {\n ngDevMode &&\n index !== 0 && // 0 are bogus nodes and they are OK. See `createContainerRef` in\n // `view_engine_compatibility` for additional context.\n assertGreaterThanOrEqual(index, HEADER_OFFSET, \"TNodes can't be in the LView header.\");\n ngDevMode && assertNotSame(attrs, undefined, \"'undefined' is not valid value for 'attrs'\");\n ngDevMode && ngDevMode.tNode++;\n ngDevMode && tParent && assertTNodeForTView(tParent, tView);\n let injectorIndex = tParent ? tParent.injectorIndex : -1;\n let flags = 0;\n if (isInSkipHydrationBlock$1()) {\n flags |= 128 /* TNodeFlags.inSkipHydrationBlock */;\n }\n const tNode = {\n type,\n index,\n insertBeforeIndex: null,\n injectorIndex,\n directiveStart: -1,\n directiveEnd: -1,\n directiveStylingLast: -1,\n componentOffset: -1,\n propertyBindings: null,\n flags,\n providerIndexes: 0,\n value: value,\n attrs: attrs,\n mergedAttrs: null,\n localNames: null,\n initialInputs: undefined,\n inputs: null,\n outputs: null,\n tView: null,\n next: null,\n prev: null,\n projectionNext: null,\n child: null,\n parent: tParent,\n projection: null,\n styles: null,\n stylesWithoutHost: null,\n residualStyles: undefined,\n classes: null,\n classesWithoutHost: null,\n residualClasses: undefined,\n classBindings: 0,\n styleBindings: 0,\n };\n if (ngDevMode) {\n // For performance reasons it is important that the tNode retains the same shape during runtime.\n // (To make sure that all of the code is monomorphic.) For this reason we seal the object to\n // prevent class transitions.\n Object.seal(tNode);\n }\n return tNode;\n}\nfunction captureNodeBindings(mode, aliasMap, directiveIndex, bindingsResult, hostDirectiveAliasMap) {\n for (let publicName in aliasMap) {\n if (!aliasMap.hasOwnProperty(publicName)) {\n continue;\n }\n const value = aliasMap[publicName];\n if (value === undefined) {\n continue;\n }\n bindingsResult ??= {};\n let internalName;\n let inputFlags = InputFlags.None;\n // For inputs, the value might be an array capturing additional\n // input flags.\n if (Array.isArray(value)) {\n internalName = value[0];\n inputFlags = value[1];\n }\n else {\n internalName = value;\n }\n // If there are no host directive mappings, we want to remap using the alias map from the\n // definition itself. If there is an alias map, it has two functions:\n // 1. It serves as an allowlist of bindings that are exposed by the host directives. Only the\n // ones inside the host directive map will be exposed on the host.\n // 2. The public name of the property is aliased using the host directive alias map, rather\n // than the alias map from the definition.\n let finalPublicName = publicName;\n if (hostDirectiveAliasMap !== null) {\n // If there is no mapping, it's not part of the allowlist and this input/output\n // is not captured and should be ignored.\n if (!hostDirectiveAliasMap.hasOwnProperty(publicName)) {\n continue;\n }\n finalPublicName = hostDirectiveAliasMap[publicName];\n }\n if (mode === 0 /* CaptureNodeBindingMode.Inputs */) {\n addPropertyBinding(bindingsResult, directiveIndex, finalPublicName, internalName, inputFlags);\n }\n else {\n addPropertyBinding(bindingsResult, directiveIndex, finalPublicName, internalName);\n }\n }\n return bindingsResult;\n}\nfunction addPropertyBinding(bindings, directiveIndex, publicName, internalName, inputFlags) {\n let values;\n if (bindings.hasOwnProperty(publicName)) {\n (values = bindings[publicName]).push(directiveIndex, internalName);\n }\n else {\n values = bindings[publicName] = [directiveIndex, internalName];\n }\n if (inputFlags !== undefined) {\n values.push(inputFlags);\n }\n}\n/**\n * Initializes data structures required to work with directive inputs and outputs.\n * Initialization is done for all directives matched on a given TNode.\n */\nfunction initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefinitionMap) {\n ngDevMode && assertFirstCreatePass(tView);\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n const tViewData = tView.data;\n const tNodeAttrs = tNode.attrs;\n const inputsFromAttrs = [];\n let inputsStore = null;\n let outputsStore = null;\n for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {\n const directiveDef = tViewData[directiveIndex];\n const aliasData = hostDirectiveDefinitionMap\n ? hostDirectiveDefinitionMap.get(directiveDef)\n : null;\n const aliasedInputs = aliasData ? aliasData.inputs : null;\n const aliasedOutputs = aliasData ? aliasData.outputs : null;\n inputsStore = captureNodeBindings(0 /* CaptureNodeBindingMode.Inputs */, directiveDef.inputs, directiveIndex, inputsStore, aliasedInputs);\n outputsStore = captureNodeBindings(1 /* CaptureNodeBindingMode.Outputs */, directiveDef.outputs, directiveIndex, outputsStore, aliasedOutputs);\n // Do not use unbound attributes as inputs to structural directives, since structural\n // directive inputs can only be set using microsyntax (e.g. `<div *dir=\"exp\">`).\n // TODO(FW-1930): microsyntax expressions may also contain unbound/static attributes, which\n // should be set for inline templates.\n const initialInputs = inputsStore !== null && tNodeAttrs !== null && !isInlineTemplate(tNode)\n ? generateInitialInputs(inputsStore, directiveIndex, tNodeAttrs)\n : null;\n inputsFromAttrs.push(initialInputs);\n }\n if (inputsStore !== null) {\n if (inputsStore.hasOwnProperty('class')) {\n tNode.flags |= 8 /* TNodeFlags.hasClassInput */;\n }\n if (inputsStore.hasOwnProperty('style')) {\n tNode.flags |= 16 /* TNodeFlags.hasStyleInput */;\n }\n }\n tNode.initialInputs = inputsFromAttrs;\n tNode.inputs = inputsStore;\n tNode.outputs = outputsStore;\n}\n/**\n * Mapping between attributes names that don't correspond to their element property names.\n *\n * Performance note: this function is written as a series of if checks (instead of, say, a property\n * object lookup) for performance reasons - the series of `if` checks seems to be the fastest way of\n * mapping property names. Do NOT change without benchmarking.\n *\n * Note: this mapping has to be kept in sync with the equally named mapping in the template\n * type-checking machinery of ngtsc.\n */\nfunction mapPropName(name) {\n if (name === 'class')\n return 'className';\n if (name === 'for')\n return 'htmlFor';\n if (name === 'formaction')\n return 'formAction';\n if (name === 'innerHtml')\n return 'innerHTML';\n if (name === 'readonly')\n return 'readOnly';\n if (name === 'tabindex')\n return 'tabIndex';\n return name;\n}\nfunction elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, nativeOnly) {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n const element = getNativeByTNode(tNode, lView);\n let inputData = tNode.inputs;\n let dataValue;\n if (!nativeOnly && inputData != null && (dataValue = inputData[propName])) {\n setInputsForProperty(tView, lView, dataValue, propName, value);\n if (isComponentHost(tNode))\n markDirtyIfOnPush(lView, tNode.index);\n if (ngDevMode) {\n setNgReflectProperties(lView, element, tNode.type, dataValue, value);\n }\n }\n else if (tNode.type & 3 /* TNodeType.AnyRNode */) {\n propName = mapPropName(propName);\n if (ngDevMode) {\n validateAgainstEventProperties(propName);\n if (!isPropertyValid(element, propName, tNode.value, tView.schemas)) {\n handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);\n }\n ngDevMode.rendererSetProperty++;\n }\n // It is assumed that the sanitizer is only added when the compiler determines that the\n // property is risky, so sanitization can be done without further checks.\n value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value;\n renderer.setProperty(element, propName, value);\n }\n else if (tNode.type & 12 /* TNodeType.AnyContainer */) {\n // If the node is a container and the property didn't\n // match any of the inputs or schemas we should throw.\n if (ngDevMode && !matchingSchemas(tView.schemas, tNode.value)) {\n handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);\n }\n }\n}\n/** If node is an OnPush component, marks its LView dirty. */\nfunction markDirtyIfOnPush(lView, viewIndex) {\n ngDevMode && assertLView(lView);\n const childComponentLView = getComponentLViewByIndex(viewIndex, lView);\n if (!(childComponentLView[FLAGS] & 16 /* LViewFlags.CheckAlways */)) {\n childComponentLView[FLAGS] |= 64 /* LViewFlags.Dirty */;\n }\n}\nfunction setNgReflectProperty(lView, element, type, attrName, value) {\n const renderer = lView[RENDERER];\n attrName = normalizeDebugBindingName(attrName);\n const debugValue = normalizeDebugBindingValue(value);\n if (type & 3 /* TNodeType.AnyRNode */) {\n if (value == null) {\n renderer.removeAttribute(element, attrName);\n }\n else {\n renderer.setAttribute(element, attrName, debugValue);\n }\n }\n else {\n const textContent = escapeCommentText(`bindings=${JSON.stringify({ [attrName]: debugValue }, null, 2)}`);\n renderer.setValue(element, textContent);\n }\n}\nfunction setNgReflectProperties(lView, element, type, dataValue, value) {\n if (type & (3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */)) {\n /**\n * dataValue is an array containing runtime input or output names for the directives:\n * i+0: directive instance index\n * i+1: privateName\n *\n * e.g. [0, 'change', 'change-minified']\n * we want to set the reflected property with the privateName: dataValue[i+1]\n */\n for (let i = 0; i < dataValue.length; i += 3) {\n setNgReflectProperty(lView, element, type, dataValue[i + 1], value);\n }\n }\n}\n/**\n * Resolve the matched directives on a node.\n */\nfunction resolveDirectives(tView, lView, tNode, localRefs) {\n // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in\n // tsickle.\n ngDevMode && assertFirstCreatePass(tView);\n if (getBindingsEnabled()) {\n const exportsMap = localRefs === null ? null : { '': -1 };\n const matchResult = findDirectiveDefMatches(tView, tNode);\n let directiveDefs;\n let hostDirectiveDefs;\n if (matchResult === null) {\n directiveDefs = hostDirectiveDefs = null;\n }\n else {\n [directiveDefs, hostDirectiveDefs] = matchResult;\n }\n if (directiveDefs !== null) {\n initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs);\n }\n if (exportsMap)\n cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n }\n // Merge the template attrs last so that they have the highest priority.\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);\n}\n/** Initializes the data structures necessary for a list of directives to be instantiated. */\nfunction initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs) {\n ngDevMode && assertFirstCreatePass(tView);\n // Publishes the directive types to DI so they can be injected. Needs to\n // happen in a separate pass before the TNode flags have been initialized.\n for (let i = 0; i < directives.length; i++) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, directives[i].type);\n }\n initTNodeFlags(tNode, tView.data.length, directives.length);\n // When the same token is provided by several directives on the same node, some rules apply in\n // the viewEngine:\n // - viewProviders have priority over providers\n // - the last directive in NgModule.declarations has priority over the previous one\n // So to match these rules, the order in which providers are added in the arrays is very\n // important.\n for (let i = 0; i < directives.length; i++) {\n const def = directives[i];\n if (def.providersResolver)\n def.providersResolver(def);\n }\n let preOrderHooksFound = false;\n let preOrderCheckHooksFound = false;\n let directiveIdx = allocExpando(tView, lView, directives.length, null);\n ngDevMode &&\n assertSame(directiveIdx, tNode.directiveStart, 'TNode.directiveStart should point to just allocated space');\n for (let i = 0; i < directives.length; i++) {\n const def = directives[i];\n // Merge the attrs in the order of matches. This assumes that the first directive is the\n // component itself, so that the component has the least priority.\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);\n configureViewWithDirective(tView, tNode, lView, directiveIdx, def);\n saveNameToExportMap(directiveIdx, def, exportsMap);\n if (def.contentQueries !== null)\n tNode.flags |= 4 /* TNodeFlags.hasContentQuery */;\n if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0)\n tNode.flags |= 64 /* TNodeFlags.hasHostBindings */;\n const lifeCycleHooks = def.type.prototype;\n // Only push a node index into the preOrderHooks array if this is the first\n // pre-order hook found on this node.\n if (!preOrderHooksFound &&\n (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) {\n // We will push the actual hook function into this array later during dir instantiation.\n // We cannot do it now because we must ensure hooks are registered in the same\n // order that directives are created (i.e. injection order).\n (tView.preOrderHooks ??= []).push(tNode.index);\n preOrderHooksFound = true;\n }\n if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {\n (tView.preOrderCheckHooks ??= []).push(tNode.index);\n preOrderCheckHooksFound = true;\n }\n directiveIdx++;\n }\n initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs);\n}\n/**\n * Add `hostBindings` to the `TView.hostBindingOpCodes`.\n *\n * @param tView `TView` to which the `hostBindings` should be added.\n * @param tNode `TNode` the element which contains the directive\n * @param directiveIdx Directive index in view.\n * @param directiveVarsIdx Where will the directive's vars be stored\n * @param def `ComponentDef`/`DirectiveDef`, which contains the `hostVars`/`hostBindings` to add.\n */\nfunction registerHostBindingOpCodes(tView, tNode, directiveIdx, directiveVarsIdx, def) {\n ngDevMode && assertFirstCreatePass(tView);\n const hostBindings = def.hostBindings;\n if (hostBindings) {\n let hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null) {\n hostBindingOpCodes = tView.hostBindingOpCodes = [];\n }\n const elementIndx = ~tNode.index;\n if (lastSelectedElementIdx(hostBindingOpCodes) != elementIndx) {\n // Conditionally add select element so that we are more efficient in execution.\n // NOTE: this is strictly not necessary and it trades code size for runtime perf.\n // (We could just always add it.)\n hostBindingOpCodes.push(elementIndx);\n }\n hostBindingOpCodes.push(directiveIdx, directiveVarsIdx, hostBindings);\n }\n}\n/**\n * Returns the last selected element index in the `HostBindingOpCodes`\n *\n * For perf reasons we don't need to update the selected element index in `HostBindingOpCodes` only\n * if it changes. This method returns the last index (or '0' if not found.)\n *\n * Selected element index are only the ones which are negative.\n */\nfunction lastSelectedElementIdx(hostBindingOpCodes) {\n let i = hostBindingOpCodes.length;\n while (i > 0) {\n const value = hostBindingOpCodes[--i];\n if (typeof value === 'number' && value < 0) {\n return value;\n }\n }\n return 0;\n}\n/**\n * Instantiate all the directives that were previously resolved on the current node.\n */\nfunction instantiateAllDirectives(tView, lView, tNode, native) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n // The component view needs to be created before creating the node injector\n // since it is used to inject some special symbols like `ChangeDetectorRef`.\n if (isComponentHost(tNode)) {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);\n addComponentLogic(lView, tNode, tView.data[start + tNode.componentOffset]);\n }\n if (!tView.firstCreatePass) {\n getOrCreateNodeInjectorForNode(tNode, lView);\n }\n attachPatchData(native, lView);\n const initialInputs = tNode.initialInputs;\n for (let i = start; i < end; i++) {\n const def = tView.data[i];\n const directive = getNodeInjectable(lView, tView, i, tNode);\n attachPatchData(directive, lView);\n if (initialInputs !== null) {\n setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs);\n }\n if (isComponentDef(def)) {\n const componentView = getComponentLViewByIndex(tNode.index, lView);\n componentView[CONTEXT] = getNodeInjectable(lView, tView, i, tNode);\n }\n }\n}\nfunction invokeDirectivesHostBindings(tView, lView, tNode) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n const elementIndex = tNode.index;\n const currentDirectiveIndex = getCurrentDirectiveIndex();\n try {\n setSelectedIndex(elementIndex);\n for (let dirIndex = start; dirIndex < end; dirIndex++) {\n const def = tView.data[dirIndex];\n const directive = lView[dirIndex];\n setCurrentDirectiveIndex(dirIndex);\n if (def.hostBindings !== null || def.hostVars !== 0 || def.hostAttrs !== null) {\n invokeHostBindingsInCreationMode(def, directive);\n }\n }\n }\n finally {\n setSelectedIndex(-1);\n setCurrentDirectiveIndex(currentDirectiveIndex);\n }\n}\n/**\n * Invoke the host bindings in creation mode.\n *\n * @param def `DirectiveDef` which may contain the `hostBindings` function.\n * @param directive Instance of directive.\n */\nfunction invokeHostBindingsInCreationMode(def, directive) {\n if (def.hostBindings !== null) {\n def.hostBindings(1 /* RenderFlags.Create */, directive);\n }\n}\n/**\n * Matches the current node against all available selectors.\n * If a component is matched (at most one), it is returned in first position in the array.\n */\nfunction findDirectiveDefMatches(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);\n const registry = tView.directiveRegistry;\n let matches = null;\n let hostDirectiveDefs = null;\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {\n matches || (matches = []);\n if (isComponentDef(def)) {\n if (ngDevMode) {\n assertTNodeType(tNode, 2 /* TNodeType.Element */, `\"${tNode.value}\" tags cannot be used as component hosts. ` +\n `Please use a different tag to activate the ${stringify(def.type)} component.`);\n if (isComponentHost(tNode)) {\n throwMultipleComponentError(tNode, matches.find(isComponentDef).type, def.type);\n }\n }\n // Components are inserted at the front of the matches array so that their lifecycle\n // hooks run before any directive lifecycle hooks. This appears to be for ViewEngine\n // compatibility. This logic doesn't make sense with host directives, because it\n // would allow the host directives to undo any overrides the host may have made.\n // To handle this case, the host directives of components are inserted at the beginning\n // of the array, followed by the component. As such, the insertion order is as follows:\n // 1. Host directives belonging to the selector-matched component.\n // 2. Selector-matched component.\n // 3. Host directives belonging to selector-matched directives.\n // 4. Selector-matched directives.\n if (def.findHostDirectiveDefs !== null) {\n const hostDirectiveMatches = [];\n hostDirectiveDefs = hostDirectiveDefs || new Map();\n def.findHostDirectiveDefs(def, hostDirectiveMatches, hostDirectiveDefs);\n // Add all host directives declared on this component, followed by the component itself.\n // Host directives should execute first so the host has a chance to override changes\n // to the DOM made by them.\n matches.unshift(...hostDirectiveMatches, def);\n // Component is offset starting from the beginning of the host directives array.\n const componentOffset = hostDirectiveMatches.length;\n markAsComponentHost(tView, tNode, componentOffset);\n }\n else {\n // No host directives on this component, just add the\n // component def to the beginning of the matches.\n matches.unshift(def);\n markAsComponentHost(tView, tNode, 0);\n }\n }\n else {\n // Append any host directives to the matches first.\n hostDirectiveDefs = hostDirectiveDefs || new Map();\n def.findHostDirectiveDefs?.(def, matches, hostDirectiveDefs);\n matches.push(def);\n }\n }\n }\n }\n ngDevMode && matches !== null && assertNoDuplicateDirectives(matches);\n return matches === null ? null : [matches, hostDirectiveDefs];\n}\n/**\n * Marks a given TNode as a component's host. This consists of:\n * - setting the component offset on the TNode.\n * - storing index of component's host element so it will be queued for view refresh during CD.\n */\nfunction markAsComponentHost(tView, hostTNode, componentOffset) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertGreaterThan(componentOffset, -1, 'componentOffset must be great than -1');\n hostTNode.componentOffset = componentOffset;\n (tView.components ??= []).push(hostTNode.index);\n}\n/** Caches local names and their matching directive indices for query and template lookups. */\nfunction cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n const localNames = (tNode.localNames = []);\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (let i = 0; i < localRefs.length; i += 2) {\n const index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new RuntimeError(-301 /* RuntimeErrorCode.EXPORT_NOT_FOUND */, ngDevMode && `Export of name '${localRefs[i + 1]}' not found!`);\n localNames.push(localRefs[i], index);\n }\n }\n}\n/**\n * Builds up an export map as directives are created, so local refs can be quickly mapped\n * to their directive instances.\n */\nfunction saveNameToExportMap(directiveIdx, def, exportsMap) {\n if (exportsMap) {\n if (def.exportAs) {\n for (let i = 0; i < def.exportAs.length; i++) {\n exportsMap[def.exportAs[i]] = directiveIdx;\n }\n }\n if (isComponentDef(def))\n exportsMap[''] = directiveIdx;\n }\n}\n/**\n * Initializes the flags on the current node, setting all indices to the initial index,\n * the directive count to 0, and adding the isComponent flag.\n * @param index the initial index\n */\nfunction initTNodeFlags(tNode, index, numberOfDirectives) {\n ngDevMode &&\n assertNotEqual(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, 'Reached the max number of directives');\n tNode.flags |= 1 /* TNodeFlags.isDirectiveHost */;\n // When the first directive is created on a node, save the index\n tNode.directiveStart = index;\n tNode.directiveEnd = index + numberOfDirectives;\n tNode.providerIndexes = index;\n}\n/**\n * Setup directive for instantiation.\n *\n * We need to create a `NodeInjectorFactory` which is then inserted in both the `Blueprint` as well\n * as `LView`. `TView` gets the `DirectiveDef`.\n *\n * @param tView `TView`\n * @param tNode `TNode`\n * @param lView `LView`\n * @param directiveIndex Index where the directive will be stored in the Expando.\n * @param def `DirectiveDef`\n */\nfunction configureViewWithDirective(tView, tNode, lView, directiveIndex, def) {\n ngDevMode &&\n assertGreaterThanOrEqual(directiveIndex, HEADER_OFFSET, 'Must be in Expando section');\n tView.data[directiveIndex] = def;\n const directiveFactory = def.factory || (def.factory = getFactoryDef(def.type, true));\n // Even though `directiveFactory` will already be using `ɵɵdirectiveInject` in its generated code,\n // we also want to support `inject()` directly from the directive constructor context so we set\n // `ɵɵdirectiveInject` as the inject implementation here too.\n const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), ɵɵdirectiveInject);\n tView.blueprint[directiveIndex] = nodeInjectorFactory;\n lView[directiveIndex] = nodeInjectorFactory;\n registerHostBindingOpCodes(tView, tNode, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def);\n}\nfunction addComponentLogic(lView, hostTNode, def) {\n const native = getNativeByTNode(hostTNode, lView);\n const tView = getOrCreateComponentTView(def);\n // Only component views should be added to the view tree directly. Embedded views are\n // accessed through their containers because they may be removed / re-added later.\n const rendererFactory = lView[ENVIRONMENT].rendererFactory;\n let lViewFlags = 16 /* LViewFlags.CheckAlways */;\n if (def.signals) {\n lViewFlags = 4096 /* LViewFlags.SignalView */;\n }\n else if (def.onPush) {\n lViewFlags = 64 /* LViewFlags.Dirty */;\n }\n const componentView = addToViewTree(lView, createLView(lView, tView, null, lViewFlags, native, hostTNode, null, rendererFactory.createRenderer(native, def), null, null, null));\n // Component view will always be created before any injected LContainers,\n // so this is a regular element, wrap it with the component view\n lView[hostTNode.index] = componentView;\n}\nfunction elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace) {\n if (ngDevMode) {\n assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n validateAgainstEventAttributes(name);\n assertTNodeType(tNode, 2 /* TNodeType.Element */, `Attempted to set attribute \\`${name}\\` on a container node. ` +\n `Host bindings are not valid on ng-container or ng-template.`);\n }\n const element = getNativeByTNode(tNode, lView);\n setElementAttribute(lView[RENDERER], element, namespace, tNode.value, name, value, sanitizer);\n}\nfunction setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {\n if (value == null) {\n ngDevMode && ngDevMode.rendererRemoveAttribute++;\n renderer.removeAttribute(element, name, namespace);\n }\n else {\n ngDevMode && ngDevMode.rendererSetAttribute++;\n const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);\n renderer.setAttribute(element, name, strValue, namespace);\n }\n}\n/**\n * Sets initial input properties on directive instances from attribute data\n *\n * @param lView Current LView that is being processed.\n * @param directiveIndex Index of the directive in directives array\n * @param instance Instance of the directive on which to set the initial inputs\n * @param def The directive def that contains the list of inputs\n * @param tNode The static data for this node\n */\nfunction setInputsFromAttrs(lView, directiveIndex, instance, def, tNode, initialInputData) {\n const initialInputs = initialInputData[directiveIndex];\n if (initialInputs !== null) {\n for (let i = 0; i < initialInputs.length;) {\n const publicName = initialInputs[i++];\n const privateName = initialInputs[i++];\n const flags = initialInputs[i++];\n const value = initialInputs[i++];\n writeToDirectiveInput(def, instance, publicName, privateName, flags, value);\n if (ngDevMode) {\n const nativeElement = getNativeByTNode(tNode, lView);\n setNgReflectProperty(lView, nativeElement, tNode.type, privateName, value);\n }\n }\n }\n}\n/**\n * Generates initialInputData for a node and stores it in the template's static storage\n * so subsequent template invocations don't have to recalculate it.\n *\n * initialInputData is an array containing values that need to be set as input properties\n * for directives on this node, but only once on creation. We need this array to support\n * the case where you set an @Input property of a directive using attribute-like syntax.\n * e.g. if you have a `name` @Input, you can set it once like this:\n *\n * <my-component name=\"Bess\"></my-component>\n *\n * @param inputs Input alias map that was generated from the directive def inputs.\n * @param directiveIndex Index of the directive that is currently being processed.\n * @param attrs Static attrs on this node.\n */\nfunction generateInitialInputs(inputs, directiveIndex, attrs) {\n let inputsToStore = null;\n let i = 0;\n while (i < attrs.length) {\n const attrName = attrs[i];\n if (attrName === 0 /* AttributeMarker.NamespaceURI */) {\n // We do not allow inputs on namespaced attributes.\n i += 4;\n continue;\n }\n else if (attrName === 5 /* AttributeMarker.ProjectAs */) {\n // Skip over the `ngProjectAs` value.\n i += 2;\n continue;\n }\n // If we hit any other attribute markers, we're done anyway. None of those are valid inputs.\n if (typeof attrName === 'number')\n break;\n if (inputs.hasOwnProperty(attrName)) {\n if (inputsToStore === null)\n inputsToStore = [];\n // Find the input's public name from the input store. Note that we can be found easier\n // through the directive def, but we want to do it using the inputs store so that it can\n // account for host directive aliases.\n const inputConfig = inputs[attrName];\n for (let j = 0; j < inputConfig.length; j += 3) {\n if (inputConfig[j] === directiveIndex) {\n inputsToStore.push(attrName, inputConfig[j + 1], inputConfig[j + 2], attrs[i + 1]);\n // A directive can't have multiple inputs with the same name so we can break here.\n break;\n }\n }\n }\n i += 2;\n }\n return inputsToStore;\n}\n//////////////////////////\n//// ViewContainer & View\n//////////////////////////\n/**\n * Creates a LContainer, either from a container instruction, or for a ViewContainerRef.\n *\n * @param hostNative The host element for the LContainer\n * @param hostTNode The host TNode for the LContainer\n * @param currentView The parent view of the LContainer\n * @param native The native comment element\n * @param isForViewContainerRef Optional a flag indicating the ViewContainerRef case\n * @returns LContainer\n */\nfunction createLContainer(hostNative, currentView, native, tNode) {\n ngDevMode && assertLView(currentView);\n const lContainer = [\n hostNative, // host native\n true, // Boolean `true` in this position signifies that this is an `LContainer`\n 0, // flags\n currentView, // parent\n null, // next\n tNode, // t_host\n null, // dehydrated views\n native, // native,\n null, // view refs\n null, // moved views\n ];\n ngDevMode &&\n assertEqual(lContainer.length, CONTAINER_HEADER_OFFSET, 'Should allocate correct number of slots for LContainer header.');\n return lContainer;\n}\n/** Refreshes all content queries declared by directives in a given view */\nfunction refreshContentQueries(tView, lView) {\n const contentQueries = tView.contentQueries;\n if (contentQueries !== null) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n for (let i = 0; i < contentQueries.length; i += 2) {\n const queryStartIdx = contentQueries[i];\n const directiveDefIdx = contentQueries[i + 1];\n if (directiveDefIdx !== -1) {\n const directiveDef = tView.data[directiveDefIdx];\n ngDevMode && assertDefined(directiveDef, 'DirectiveDef not found.');\n ngDevMode &&\n assertDefined(directiveDef.contentQueries, 'contentQueries function should be defined');\n setCurrentQueryIndex(queryStartIdx);\n directiveDef.contentQueries(2 /* RenderFlags.Update */, lView[directiveDefIdx], directiveDefIdx);\n }\n }\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n}\n/**\n * Adds LView or LContainer to the end of the current view tree.\n *\n * This structure will be used to traverse through nested views to remove listeners\n * and call onDestroy callbacks.\n *\n * @param lView The view where LView or LContainer should be added\n * @param adjustedHostIndex Index of the view's host node in LView[], adjusted for header\n * @param lViewOrLContainer The LView or LContainer to add to the view tree\n * @returns The state passed in\n */\nfunction addToViewTree(lView, lViewOrLContainer) {\n // TODO(benlesh/misko): This implementation is incorrect, because it always adds the LContainer\n // to the end of the queue, which means if the developer retrieves the LContainers from RNodes out\n // of order, the change detection will run out of order, as the act of retrieving the the\n // LContainer from the RNode is what adds it to the queue.\n if (lView[CHILD_HEAD]) {\n lView[CHILD_TAIL][NEXT] = lViewOrLContainer;\n }\n else {\n lView[CHILD_HEAD] = lViewOrLContainer;\n }\n lView[CHILD_TAIL] = lViewOrLContainer;\n return lViewOrLContainer;\n}\n///////////////////////////////\n//// Change detection\n///////////////////////////////\nfunction executeViewQueryFn(flags, viewQueryFn, component) {\n ngDevMode && assertDefined(viewQueryFn, 'View queries function to execute must be defined.');\n setCurrentQueryIndex(0);\n const prevConsumer = setActiveConsumer$1(null);\n try {\n viewQueryFn(flags, component);\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n }\n}\n///////////////////////////////\n//// Bindings & interpolations\n///////////////////////////////\n/**\n * Stores meta-data for a property binding to be used by TestBed's `DebugElement.properties`.\n *\n * In order to support TestBed's `DebugElement.properties` we need to save, for each binding:\n * - a bound property name;\n * - a static parts of interpolated strings;\n *\n * A given property metadata is saved at the binding's index in the `TView.data` (in other words, a\n * property binding metadata will be stored in `TView.data` at the same index as a bound value in\n * `LView`). Metadata are represented as `INTERPOLATION_DELIMITER`-delimited string with the\n * following format:\n * - `propertyName` for bound properties;\n * - `propertyName<6D>prefix<69>interpolation_static_part1<74>..interpolation_static_partN<74>suffix` for\n * interpolated properties.\n *\n * @param tData `TData` where meta-data will be saved;\n * @param tNode `TNode` that is a target of the binding;\n * @param propertyName bound property name;\n * @param bindingIndex binding index in `LView`\n * @param interpolationParts static interpolation parts (for property interpolations)\n */\nfunction storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex, ...interpolationParts) {\n // Binding meta-data are stored only the first time a given property instruction is processed.\n // Since we don't have a concept of the \"first update pass\" we need to check for presence of the\n // binding meta-data to decide if one should be stored (or if was stored already).\n if (tData[bindingIndex] === null) {\n if (tNode.inputs == null || !tNode.inputs[propertyName]) {\n const propBindingIdxs = tNode.propertyBindings || (tNode.propertyBindings = []);\n propBindingIdxs.push(bindingIndex);\n let bindingMetadata = propertyName;\n if (interpolationParts.length > 0) {\n bindingMetadata +=\n INTERPOLATION_DELIMITER + interpolationParts.join(INTERPOLATION_DELIMITER);\n }\n tData[bindingIndex] = bindingMetadata;\n }\n }\n}\nfunction getOrCreateLViewCleanup(view) {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return (view[CLEANUP] ??= []);\n}\nfunction getOrCreateTViewCleanup(tView) {\n return (tView.cleanup ??= []);\n}\n/**\n * There are cases where the sub component's renderer needs to be included\n * instead of the current renderer (see the componentSyntheticHost* instructions).\n */\nfunction loadComponentRenderer(currentDef, tNode, lView) {\n // TODO(FW-2043): the `currentDef` is null when host bindings are invoked while creating root\n // component (see packages/core/src/render3/component.ts). This is not consistent with the process\n // of creating inner components, when current directive index is available in the state. In order\n // to avoid relying on current def being `null` (thus special-casing root component creation), the\n // process of creating root component should be unified with the process of creating inner\n // components.\n if (currentDef === null || isComponentDef(currentDef)) {\n lView = unwrapLView(lView[tNode.index]);\n }\n return lView[RENDERER];\n}\n/** Handles an error thrown in an LView. */\nfunction handleError(lView, error) {\n const injector = lView[INJECTOR];\n const errorHandler = injector ? injector.get(ErrorHandler, null) : null;\n errorHandler && errorHandler.handleError(error);\n}\n/**\n * Set the inputs of directives at the current node to corresponding value.\n *\n * @param tView The current TView\n * @param lView the `LView` which contains the directives.\n * @param inputs mapping between the public \"input\" name and privately-known,\n * possibly minified, property names to write to.\n * @param value Value to set.\n */\nfunction setInputsForProperty(tView, lView, inputs, publicName, value) {\n for (let i = 0; i < inputs.length;) {\n const index = inputs[i++];\n const privateName = inputs[i++];\n const flags = inputs[i++];\n const instance = lView[index];\n ngDevMode && assertIndexInRange(lView, index);\n const def = tView.data[index];\n writeToDirectiveInput(def, instance, publicName, privateName, flags, value);\n }\n}\n/**\n * Updates a text binding at a given index in a given LView.\n */\nfunction textBindingInternal(lView, index, value) {\n ngDevMode && assertString(value, 'Value should be a string');\n ngDevMode && assertNotSame(value, NO_CHANGE, 'value should not be NO_CHANGE');\n ngDevMode && assertIndexInRange(lView, index);\n const element = getNativeByIndex(index, lView);\n ngDevMode && assertDefined(element, 'native element should exist');\n updateTextNode(lView[RENDERER], element, value);\n}\n\nfunction renderComponent(hostLView, componentHostIdx) {\n ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');\n const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);\n const componentTView = componentView[TVIEW];\n syncViewWithBlueprint(componentTView, componentView);\n const hostRNode = componentView[HOST];\n // Populate an LView with hydration info retrieved from the DOM via TransferState.\n if (hostRNode !== null && componentView[HYDRATION] === null) {\n componentView[HYDRATION] = retrieveHydrationInfo(hostRNode, componentView[INJECTOR]);\n }\n renderView(componentTView, componentView, componentView[CONTEXT]);\n}\n/**\n * Syncs an LView instance with its blueprint if they have gotten out of sync.\n *\n * Typically, blueprints and their view instances should always be in sync, so the loop here\n * will be skipped. However, consider this case of two components side-by-side:\n *\n * App template:\n * ```\n * <comp></comp>\n * <comp></comp>\n * ```\n *\n * The following will happen:\n * 1. App template begins processing.\n * 2. First <comp> is matched as a component and its LView is created.\n * 3. Second <comp> is matched as a component and its LView is created.\n * 4. App template completes processing, so it's time to check child templates.\n * 5. First <comp> template is checked. It has a directive, so its def is pushed to blueprint.\n * 6. Second <comp> template is checked. Its blueprint has been updated by the first\n * <comp> template, but its LView was created before this update, so it is out of sync.\n *\n * Note that embedded views inside ngFor loops will never be out of sync because these views\n * are processed as soon as they are created.\n *\n * @param tView The `TView` that contains the blueprint for syncing\n * @param lView The view to sync\n */\nfunction syncViewWithBlueprint(tView, lView) {\n for (let i = lView.length; i < tView.blueprint.length; i++) {\n lView.push(tView.blueprint[i]);\n }\n}\n/**\n * Processes a view in the creation mode. This includes a number of steps in a specific order:\n * - creating view query functions (if any);\n * - executing a template function in the creation mode;\n * - updating static queries (if any);\n * - creating child components defined in a given view.\n */\nfunction renderView(tView, lView, context) {\n ngDevMode && assertEqual(isCreationMode(lView), true, 'Should be run in creation mode');\n ngDevMode && assertNotReactive(renderView.name);\n enterView(lView);\n try {\n const viewQuery = tView.viewQuery;\n if (viewQuery !== null) {\n executeViewQueryFn(1 /* RenderFlags.Create */, viewQuery, context);\n }\n // Execute a template associated with this view, if it exists. A template function might not be\n // defined for the root component views.\n const templateFn = tView.template;\n if (templateFn !== null) {\n executeTemplate(tView, lView, templateFn, 1 /* RenderFlags.Create */, context);\n }\n // This needs to be set before children are processed to support recursive components.\n // This must be set to false immediately after the first creation run because in an\n // ngFor loop, all the views will be created together before update mode runs and turns\n // off firstCreatePass. If we don't set it here, instances will perform directive\n // matching, etc again and again.\n if (tView.firstCreatePass) {\n tView.firstCreatePass = false;\n }\n // Mark all queries active in this view as dirty. This is necessary for signal-based queries to\n // have a clear marking point where we can read query results atomically (for a given view).\n lView[QUERIES]?.finishViewCreation(tView);\n // We resolve content queries specifically marked as `static` in creation mode. Dynamic\n // content queries are resolved during change detection (i.e. update mode), after embedded\n // views are refreshed (see block above).\n if (tView.staticContentQueries) {\n refreshContentQueries(tView, lView);\n }\n // We must materialize query results before child components are processed\n // in case a child component has projected a container. The LContainer needs\n // to exist so the embedded views are properly attached by the container.\n if (tView.staticViewQueries) {\n executeViewQueryFn(2 /* RenderFlags.Update */, tView.viewQuery, context);\n }\n // Render child component views.\n const components = tView.components;\n if (components !== null) {\n renderChildComponents(lView, components);\n }\n }\n catch (error) {\n // If we didn't manage to get past the first template pass due to\n // an error, mark the view as corrupted so we can try to recover.\n if (tView.firstCreatePass) {\n tView.incompleteFirstPass = true;\n tView.firstCreatePass = false;\n }\n throw error;\n }\n finally {\n lView[FLAGS] &= ~4 /* LViewFlags.CreationMode */;\n leaveView();\n }\n}\n/** Renders child components in the current view (creation mode). */\nfunction renderChildComponents(hostLView, components) {\n for (let i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n}\n\nfunction createAndRenderEmbeddedLView(declarationLView, templateTNode, context, options) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n const embeddedTView = templateTNode.tView;\n ngDevMode && assertDefined(embeddedTView, 'TView must be defined for a template node.');\n ngDevMode && assertTNodeForLView(templateTNode, declarationLView);\n // Embedded views follow the change detection strategy of the view they're declared in.\n const isSignalView = declarationLView[FLAGS] & 4096 /* LViewFlags.SignalView */;\n const viewFlags = isSignalView ? 4096 /* LViewFlags.SignalView */ : 16 /* LViewFlags.CheckAlways */;\n const embeddedLView = createLView(declarationLView, embeddedTView, context, viewFlags, null, templateTNode, null, null, options?.injector ?? null, options?.embeddedViewInjector ?? null, options?.dehydratedView ?? null);\n const declarationLContainer = declarationLView[templateTNode.index];\n ngDevMode && assertLContainer(declarationLContainer);\n embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;\n const declarationViewLQueries = declarationLView[QUERIES];\n if (declarationViewLQueries !== null) {\n embeddedLView[QUERIES] = declarationViewLQueries.createEmbeddedView(embeddedTView);\n }\n // execute creation mode of a view\n renderView(embeddedTView, embeddedLView, context);\n return embeddedLView;\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n }\n}\nfunction getLViewFromLContainer(lContainer, index) {\n const adjustedIndex = CONTAINER_HEADER_OFFSET + index;\n // avoid reading past the array boundaries\n if (adjustedIndex < lContainer.length) {\n const lView = lContainer[adjustedIndex];\n ngDevMode && assertLView(lView);\n return lView;\n }\n return undefined;\n}\n/**\n * Returns whether an elements that belong to a view should be\n * inserted into the DOM. For client-only cases, DOM elements are\n * always inserted. For hydration cases, we check whether serialized\n * info is available for a view and the view is not in a \"skip hydration\"\n * block (in which case view contents was re-created, thus needing insertion).\n */\nfunction shouldAddViewToDom(tNode, dehydratedView) {\n return (!dehydratedView || dehydratedView.firstChild === null || hasInSkipHydrationBlockFlag(tNode));\n}\nfunction addLViewToLContainer(lContainer, lView, index, addToDOM = true) {\n const tView = lView[TVIEW];\n // Insert into the view tree so the new view can be change-detected\n insertView(tView, lView, lContainer, index);\n // Insert elements that belong to this view into the DOM tree\n if (addToDOM) {\n const beforeNode = getBeforeNodeForView(index, lContainer);\n const renderer = lView[RENDERER];\n const parentRNode = nativeParentNode(renderer, lContainer[NATIVE]);\n if (parentRNode !== null) {\n addViewToDOM(tView, lContainer[T_HOST], renderer, lView, parentRNode, beforeNode);\n }\n }\n // When in hydration mode, reset the pointer to the first child in\n // the dehydrated view. This indicates that the view was hydrated and\n // further attaching/detaching should work with this view as normal.\n const hydrationInfo = lView[HYDRATION];\n if (hydrationInfo !== null && hydrationInfo.firstChild !== null) {\n hydrationInfo.firstChild = null;\n }\n}\nfunction removeLViewFromLContainer(lContainer, index) {\n const lView = detachView(lContainer, index);\n if (lView !== undefined) {\n destroyLView(lView[TVIEW], lView);\n }\n return lView;\n}\n\nfunction collectNativeNodes(tView, lView, tNode, result, isProjection = false) {\n while (tNode !== null) {\n // Let declarations don't have corresponding DOM nodes so we skip over them.\n if (tNode.type === 128 /* TNodeType.LetDeclaration */) {\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n continue;\n }\n ngDevMode &&\n assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 16 /* TNodeType.Projection */ | 32 /* TNodeType.Icu */);\n const lNode = lView[tNode.index];\n if (lNode !== null) {\n result.push(unwrapRNode(lNode));\n }\n // A given lNode can represent either a native node or a LContainer (when it is a host of a\n // ViewContainerRef). When we find a LContainer we need to descend into it to collect root nodes\n // from the views in this container.\n if (isLContainer(lNode)) {\n collectNativeNodesInLContainer(lNode, result);\n }\n const tNodeType = tNode.type;\n if (tNodeType & 8 /* TNodeType.ElementContainer */) {\n collectNativeNodes(tView, lView, tNode.child, result);\n }\n else if (tNodeType & 32 /* TNodeType.Icu */) {\n const nextRNode = icuContainerIterate(tNode, lView);\n let rNode;\n while ((rNode = nextRNode())) {\n result.push(rNode);\n }\n }\n else if (tNodeType & 16 /* TNodeType.Projection */) {\n const nodesInSlot = getProjectionNodes(lView, tNode);\n if (Array.isArray(nodesInSlot)) {\n result.push(...nodesInSlot);\n }\n else {\n const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);\n ngDevMode && assertParentView(parentView);\n collectNativeNodes(parentView[TVIEW], parentView, nodesInSlot, result, true);\n }\n }\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n }\n return result;\n}\n/**\n * Collects all root nodes in all views in a given LContainer.\n */\nfunction collectNativeNodesInLContainer(lContainer, result) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lViewInAContainer = lContainer[i];\n const lViewFirstChildTNode = lViewInAContainer[TVIEW].firstChild;\n if (lViewFirstChildTNode !== null) {\n collectNativeNodes(lViewInAContainer[TVIEW], lViewInAContainer, lViewFirstChildTNode, result);\n }\n }\n // When an LContainer is created, the anchor (comment) node is:\n // - (1) either reused in case of an ElementContainer (<ng-container>)\n // - (2) or a new comment node is created\n // In the first case, the anchor comment node would be added to the final\n // list by the code in the `collectNativeNodes` function\n // (see the `result.push(unwrapRNode(lNode))` line), but the second\n // case requires extra handling: the anchor node needs to be added to the\n // final list manually. See additional information in the `createAnchorNode`\n // function in the `view_container_ref.ts`.\n //\n // In the first case, the same reference would be stored in the `NATIVE`\n // and `HOST` slots in an LContainer. Otherwise, this is the second case and\n // we should add an element to the final list.\n if (lContainer[NATIVE] !== lContainer[HOST]) {\n result.push(lContainer[NATIVE]);\n }\n}\n\nlet freeConsumers = [];\n/**\n * Create a new template consumer pointing at the specified LView.\n * Sometimes, a previously created consumer may be reused, in order to save on allocations. In that\n * case, the LView will be updated.\n */\nfunction getOrBorrowReactiveLViewConsumer(lView) {\n return lView[REACTIVE_TEMPLATE_CONSUMER] ?? borrowReactiveLViewConsumer(lView);\n}\nfunction borrowReactiveLViewConsumer(lView) {\n const consumer = freeConsumers.pop() ?? Object.create(REACTIVE_LVIEW_CONSUMER_NODE);\n consumer.lView = lView;\n return consumer;\n}\nfunction maybeReturnReactiveLViewConsumer(consumer) {\n if (consumer.lView[REACTIVE_TEMPLATE_CONSUMER] === consumer) {\n // The consumer got committed.\n return;\n }\n consumer.lView = null;\n freeConsumers.push(consumer);\n}\nconst REACTIVE_LVIEW_CONSUMER_NODE = {\n ...REACTIVE_NODE$1,\n consumerIsAlwaysLive: true,\n consumerMarkedDirty: (node) => {\n markAncestorsForTraversal(node.lView);\n },\n consumerOnSignalRead() {\n this.lView[REACTIVE_TEMPLATE_CONSUMER] = this;\n },\n};\n/**\n * Creates a temporary consumer for use with `LView`s that should not have consumers.\n * If the LView already has a consumer, returns the existing one instead.\n *\n * This is necessary because some APIs may cause change detection directly on an LView\n * that we do not want to have a consumer (Embedded views today). As a result, there\n * would be no active consumer from running change detection on its host component\n * and any signals in the LView template would be untracked. Instead, we create\n * this temporary consumer that marks the first parent that _should_ have a consumer\n * for refresh. Once change detection runs as part of that refresh, we throw away\n * this consumer because its signals will then be tracked by the parent's consumer.\n */\nfunction getOrCreateTemporaryConsumer(lView) {\n const consumer = lView[REACTIVE_TEMPLATE_CONSUMER] ?? Object.create(TEMPORARY_CONSUMER_NODE);\n consumer.lView = lView;\n return consumer;\n}\nconst TEMPORARY_CONSUMER_NODE = {\n ...REACTIVE_NODE$1,\n consumerIsAlwaysLive: true,\n consumerMarkedDirty: (node) => {\n let parent = getLViewParent(node.lView);\n while (parent && !viewShouldHaveReactiveConsumer(parent[TVIEW])) {\n parent = getLViewParent(parent);\n }\n if (!parent) {\n // If we can't find an appropriate parent that should have a consumer, we\n // don't have a way of appropriately refreshing this LView as part of application synchronization.\n return;\n }\n markViewForRefresh(parent);\n },\n consumerOnSignalRead() {\n this.lView[REACTIVE_TEMPLATE_CONSUMER] = this;\n },\n};\n/**\n * Indicates if the view should get its own reactive consumer node.\n *\n * In the current design, all embedded views share a consumer with the component view. This allows\n * us to refresh at the component level rather than at a per-view level. In addition, root views get\n * their own reactive node because root component will have a host view that executes the\n * component's host bindings. This needs to be tracked in a consumer as well.\n *\n * To get a more granular change detection than per-component, all we would just need to update the\n * condition here so that a given view gets a reactive consumer which can become dirty independently\n * from its parent component. For example embedded views for signal components could be created with\n * a new type \"SignalEmbeddedView\" and the condition here wouldn't even need updating in order to\n * get granular per-view change detection for signal components.\n */\nfunction viewShouldHaveReactiveConsumer(tView) {\n return tView.type !== 2 /* TViewType.Embedded */;\n}\n\n/**\n * The maximum number of times the change detection traversal will rerun before throwing an error.\n */\nconst MAXIMUM_REFRESH_RERUNS$1 = 100;\nfunction detectChangesInternal(lView, notifyErrorHandler = true, mode = 0 /* ChangeDetectionMode.Global */) {\n const environment = lView[ENVIRONMENT];\n const rendererFactory = environment.rendererFactory;\n // Check no changes mode is a dev only mode used to verify that bindings have not changed\n // since they were assigned. We do not want to invoke renderer factory functions in that mode\n // to avoid any possible side-effects.\n const checkNoChangesMode = !!ngDevMode && isInCheckNoChangesMode();\n if (!checkNoChangesMode) {\n rendererFactory.begin?.();\n }\n try {\n detectChangesInViewWhileDirty(lView, mode);\n }\n catch (error) {\n if (notifyErrorHandler) {\n handleError(lView, error);\n }\n throw error;\n }\n finally {\n if (!checkNoChangesMode) {\n rendererFactory.end?.();\n // One final flush of the effects queue to catch any effects created in `ngAfterViewInit` or\n // other post-order hooks.\n environment.inlineEffectRunner?.flush();\n }\n }\n}\nfunction detectChangesInViewWhileDirty(lView, mode) {\n const lastIsRefreshingViewsValue = isRefreshingViews();\n try {\n setIsRefreshingViews(true);\n detectChangesInView(lView, mode);\n // We don't need or want to do any looping when in exhaustive checkNoChanges because we\n // already traverse all the views and nothing should change so we shouldn't have to do\n // another pass to pick up new changes.\n if (ngDevMode && isExhaustiveCheckNoChanges()) {\n return;\n }\n let retries = 0;\n // If after running change detection, this view still needs to be refreshed or there are\n // descendants views that need to be refreshed due to re-dirtying during the change detection\n // run, detect changes on the view again. We run change detection in `Targeted` mode to only\n // refresh views with the `RefreshView` flag.\n while (requiresRefreshOrTraversal(lView)) {\n if (retries === MAXIMUM_REFRESH_RERUNS$1) {\n throw new RuntimeError(103 /* RuntimeErrorCode.INFINITE_CHANGE_DETECTION */, ngDevMode &&\n 'Infinite change detection while trying to refresh views. ' +\n 'There may be components which each cause the other to require a refresh, ' +\n 'causing an infinite loop.');\n }\n retries++;\n // Even if this view is detached, we still detect changes in targeted mode because this was\n // the root of the change detection run.\n detectChangesInView(lView, 1 /* ChangeDetectionMode.Targeted */);\n }\n }\n finally {\n // restore state to what it was before entering this change detection loop\n setIsRefreshingViews(lastIsRefreshingViewsValue);\n }\n}\nfunction checkNoChangesInternal(lView, mode, notifyErrorHandler = true) {\n setIsInCheckNoChangesMode(mode);\n try {\n detectChangesInternal(lView, notifyErrorHandler);\n }\n finally {\n setIsInCheckNoChangesMode(CheckNoChangesMode.Off);\n }\n}\n/**\n * Processes a view in update mode. This includes a number of steps in a specific order:\n * - executing a template function in update mode;\n * - executing hooks;\n * - refreshing queries;\n * - setting host bindings;\n * - refreshing child (embedded and component) views.\n */\nfunction refreshView(tView, lView, templateFn, context) {\n ngDevMode && assertEqual(isCreationMode(lView), false, 'Should be run in update mode');\n const flags = lView[FLAGS];\n if ((flags & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */)\n return;\n // Check no changes mode is a dev only mode used to verify that bindings have not changed\n // since they were assigned. We do not want to execute lifecycle hooks in that mode.\n const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();\n const isInExhaustiveCheckNoChangesPass = ngDevMode && isExhaustiveCheckNoChanges();\n !isInCheckNoChangesPass && lView[ENVIRONMENT].inlineEffectRunner?.flush();\n // Start component reactive context\n // - We might already be in a reactive context if this is an embedded view of the host.\n // - We might be descending into a view that needs a consumer.\n enterView(lView);\n let returnConsumerToPool = true;\n let prevConsumer = null;\n let currentConsumer = null;\n if (!isInCheckNoChangesPass) {\n if (viewShouldHaveReactiveConsumer(tView)) {\n currentConsumer = getOrBorrowReactiveLViewConsumer(lView);\n prevConsumer = consumerBeforeComputation$1(currentConsumer);\n }\n else if (getActiveConsumer$1() === null) {\n // If the current view should not have a reactive consumer but we don't have an active consumer,\n // we still need to create a temporary consumer to track any signal reads in this template.\n // This is a rare case that can happen with `viewContainerRef.createEmbeddedView(...).detectChanges()`.\n // This temporary consumer marks the first parent that _should_ have a consumer for refresh.\n // Once that refresh happens, the signals will be tracked in the parent consumer and we can destroy\n // the temporary one.\n returnConsumerToPool = false;\n currentConsumer = getOrCreateTemporaryConsumer(lView);\n prevConsumer = consumerBeforeComputation$1(currentConsumer);\n }\n else if (lView[REACTIVE_TEMPLATE_CONSUMER]) {\n consumerDestroy$1(lView[REACTIVE_TEMPLATE_CONSUMER]);\n lView[REACTIVE_TEMPLATE_CONSUMER] = null;\n }\n }\n try {\n resetPreOrderHookFlags(lView);\n setBindingIndex(tView.bindingStartIndex);\n if (templateFn !== null) {\n executeTemplate(tView, lView, templateFn, 2 /* RenderFlags.Update */, context);\n }\n const hooksInitPhaseCompleted = (flags & 3 /* LViewFlags.InitPhaseStateMask */) === 3 /* InitPhaseState.InitPhaseCompleted */;\n // execute pre-order hooks (OnInit, OnChanges, DoCheck)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const preOrderCheckHooks = tView.preOrderCheckHooks;\n if (preOrderCheckHooks !== null) {\n executeCheckHooks(lView, preOrderCheckHooks, null);\n }\n }\n else {\n const preOrderHooks = tView.preOrderHooks;\n if (preOrderHooks !== null) {\n executeInitAndCheckHooks(lView, preOrderHooks, 0 /* InitPhaseState.OnInitHooksToBeRun */, null);\n }\n incrementInitPhaseFlags(lView, 0 /* InitPhaseState.OnInitHooksToBeRun */);\n }\n }\n // We do not need to mark transplanted views for refresh when doing exhaustive checks\n // because all views will be reached anyways during the traversal.\n if (!isInExhaustiveCheckNoChangesPass) {\n // First mark transplanted views that are declared in this lView as needing a refresh at their\n // insertion points. This is needed to avoid the situation where the template is defined in this\n // `LView` but its declaration appears after the insertion component.\n markTransplantedViewsForRefresh(lView);\n }\n detectChangesInEmbeddedViews(lView, 0 /* ChangeDetectionMode.Global */);\n // Content query results must be refreshed before content hooks are called.\n if (tView.contentQueries !== null) {\n refreshContentQueries(tView, lView);\n }\n // execute content hooks (AfterContentInit, AfterContentChecked)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const contentCheckHooks = tView.contentCheckHooks;\n if (contentCheckHooks !== null) {\n executeCheckHooks(lView, contentCheckHooks);\n }\n }\n else {\n const contentHooks = tView.contentHooks;\n if (contentHooks !== null) {\n executeInitAndCheckHooks(lView, contentHooks, 1 /* InitPhaseState.AfterContentInitHooksToBeRun */);\n }\n incrementInitPhaseFlags(lView, 1 /* InitPhaseState.AfterContentInitHooksToBeRun */);\n }\n }\n processHostBindingOpCodes(tView, lView);\n // Refresh child component views.\n const components = tView.components;\n if (components !== null) {\n detectChangesInChildComponents(lView, components, 0 /* ChangeDetectionMode.Global */);\n }\n // View queries must execute after refreshing child components because a template in this view\n // could be inserted in a child component. If the view query executes before child component\n // refresh, the template might not yet be inserted.\n const viewQuery = tView.viewQuery;\n if (viewQuery !== null) {\n executeViewQueryFn(2 /* RenderFlags.Update */, viewQuery, context);\n }\n // execute view hooks (AfterViewInit, AfterViewChecked)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const viewCheckHooks = tView.viewCheckHooks;\n if (viewCheckHooks !== null) {\n executeCheckHooks(lView, viewCheckHooks);\n }\n }\n else {\n const viewHooks = tView.viewHooks;\n if (viewHooks !== null) {\n executeInitAndCheckHooks(lView, viewHooks, 2 /* InitPhaseState.AfterViewInitHooksToBeRun */);\n }\n incrementInitPhaseFlags(lView, 2 /* InitPhaseState.AfterViewInitHooksToBeRun */);\n }\n }\n if (tView.firstUpdatePass === true) {\n // We need to make sure that we only flip the flag on successful `refreshView` only\n // Don't do this in `finally` block.\n // If we did this in `finally` block then an exception could block the execution of styling\n // instructions which in turn would be unable to insert themselves into the styling linked\n // list. The result of this would be that if the exception would not be throw on subsequent CD\n // the styling would be unable to process it data and reflect to the DOM.\n tView.firstUpdatePass = false;\n }\n // Schedule any effects that are waiting on the update pass of this view.\n if (lView[EFFECTS_TO_SCHEDULE]) {\n for (const notifyEffect of lView[EFFECTS_TO_SCHEDULE]) {\n notifyEffect();\n }\n // Once they've been run, we can drop the array.\n lView[EFFECTS_TO_SCHEDULE] = null;\n }\n // Do not reset the dirty state when running in check no changes mode. We don't want components\n // to behave differently depending on whether check no changes is enabled or not. For example:\n // Marking an OnPush component as dirty from within the `ngAfterViewInit` hook in order to\n // refresh a `NgClass` binding should work. If we would reset the dirty state in the check\n // no changes cycle, the component would be not be dirty for the next update pass. This would\n // be different in production mode where the component dirty state is not reset.\n if (!isInCheckNoChangesPass) {\n lView[FLAGS] &= ~(64 /* LViewFlags.Dirty */ | 8 /* LViewFlags.FirstLViewPass */);\n }\n }\n catch (e) {\n if (!isInCheckNoChangesPass) {\n // If refreshing a view causes an error, we need to remark the ancestors as needing traversal\n // because the error might have caused a situation where views below the current location are\n // dirty but will be unreachable because the \"has dirty children\" flag in the ancestors has been\n // cleared during change detection and we failed to run to completion.\n markAncestorsForTraversal(lView);\n }\n throw e;\n }\n finally {\n if (currentConsumer !== null) {\n consumerAfterComputation$1(currentConsumer, prevConsumer);\n if (returnConsumerToPool) {\n maybeReturnReactiveLViewConsumer(currentConsumer);\n }\n }\n leaveView();\n }\n}\n/**\n * Goes over embedded views (ones created through ViewContainerRef APIs) and refreshes\n * them by executing an associated template function.\n */\nfunction detectChangesInEmbeddedViews(lView, mode) {\n for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const embeddedLView = lContainer[i];\n detectChangesInViewIfAttached(embeddedLView, mode);\n }\n }\n}\n/**\n * Mark transplanted views as needing to be refreshed at their attachment points.\n *\n * @param lView The `LView` that may have transplanted views.\n */\nfunction markTransplantedViewsForRefresh(lView) {\n for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {\n if (!(lContainer[FLAGS] & LContainerFlags.HasTransplantedViews))\n continue;\n const movedViews = lContainer[MOVED_VIEWS];\n ngDevMode && assertDefined(movedViews, 'Transplanted View flags set but missing MOVED_VIEWS');\n for (let i = 0; i < movedViews.length; i++) {\n const movedLView = movedViews[i];\n markViewForRefresh(movedLView);\n }\n }\n}\n/**\n * Detects changes in a component by entering the component view and processing its bindings,\n * queries, etc. if it is CheckAlways, OnPush and Dirty, etc.\n *\n * @param componentHostIdx Element index in LView[] (adjusted for HEADER_OFFSET)\n */\nfunction detectChangesInComponent(hostLView, componentHostIdx, mode) {\n ngDevMode && assertEqual(isCreationMode(hostLView), false, 'Should be run in update mode');\n const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);\n detectChangesInViewIfAttached(componentView, mode);\n}\n/**\n * Visits a view as part of change detection traversal.\n *\n * If the view is detached, no additional traversal happens.\n */\nfunction detectChangesInViewIfAttached(lView, mode) {\n if (!viewAttachedToChangeDetector(lView)) {\n return;\n }\n detectChangesInView(lView, mode);\n}\n/**\n * Visits a view as part of change detection traversal.\n *\n * The view is refreshed if:\n * - If the view is CheckAlways or Dirty and ChangeDetectionMode is `Global`\n * - If the view has the `RefreshView` flag\n *\n * The view is not refreshed, but descendants are traversed in `ChangeDetectionMode.Targeted` if the\n * view HasChildViewsToRefresh flag is set.\n */\nfunction detectChangesInView(lView, mode) {\n const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();\n const tView = lView[TVIEW];\n const flags = lView[FLAGS];\n const consumer = lView[REACTIVE_TEMPLATE_CONSUMER];\n // Refresh CheckAlways views in Global mode.\n let shouldRefreshView = !!(mode === 0 /* ChangeDetectionMode.Global */ && flags & 16 /* LViewFlags.CheckAlways */);\n // Refresh Dirty views in Global mode, as long as we're not in checkNoChanges.\n // CheckNoChanges never worked with `OnPush` components because the `Dirty` flag was\n // cleared before checkNoChanges ran. Because there is now a loop for to check for\n // backwards views, it gives an opportunity for `OnPush` components to be marked `Dirty`\n // before the CheckNoChanges pass. We don't want existing errors that are hidden by the\n // current CheckNoChanges bug to surface when making unrelated changes.\n shouldRefreshView ||= !!(flags & 64 /* LViewFlags.Dirty */ &&\n mode === 0 /* ChangeDetectionMode.Global */ &&\n !isInCheckNoChangesPass);\n // Always refresh views marked for refresh, regardless of mode.\n shouldRefreshView ||= !!(flags & 1024 /* LViewFlags.RefreshView */);\n // Refresh views when they have a dirty reactive consumer, regardless of mode.\n shouldRefreshView ||= !!(consumer?.dirty && consumerPollProducersForChange$1(consumer));\n shouldRefreshView ||= !!(ngDevMode && isExhaustiveCheckNoChanges());\n // Mark the Flags and `ReactiveNode` as not dirty before refreshing the component, so that they\n // can be re-dirtied during the refresh process.\n if (consumer) {\n consumer.dirty = false;\n }\n lView[FLAGS] &= ~(8192 /* LViewFlags.HasChildViewsToRefresh */ | 1024 /* LViewFlags.RefreshView */);\n if (shouldRefreshView) {\n refreshView(tView, lView, tView.template, lView[CONTEXT]);\n }\n else if (flags & 8192 /* LViewFlags.HasChildViewsToRefresh */) {\n detectChangesInEmbeddedViews(lView, 1 /* ChangeDetectionMode.Targeted */);\n const components = tView.components;\n if (components !== null) {\n detectChangesInChildComponents(lView, components, 1 /* ChangeDetectionMode.Targeted */);\n }\n }\n}\n/** Refreshes child components in the current view (update mode). */\nfunction detectChangesInChildComponents(hostLView, components, mode) {\n for (let i = 0; i < components.length; i++) {\n detectChangesInComponent(hostLView, components[i], mode);\n }\n}\n\n/**\n * Marks current view and all ancestors dirty.\n *\n * Returns the root view because it is found as a byproduct of marking the view tree\n * dirty, and can be used by methods that consume markViewDirty() to easily schedule\n * change detection. Otherwise, such methods would need to traverse up the view tree\n * an additional time to get the root view and schedule a tick on it.\n *\n * @param lView The starting LView to mark dirty\n * @returns the root LView\n */\nfunction markViewDirty(lView, source) {\n const dirtyBitsToUse = isRefreshingViews()\n ? // When we are actively refreshing views, we only use the `Dirty` bit to mark a view\n 64 /* LViewFlags.Dirty */\n : // When we are not actively refreshing a view tree, it is absolutely\n // valid to update state and mark views dirty. We use the `RefreshView` flag in this\n // case to allow synchronously rerunning change detection. This applies today to\n // afterRender hooks as well as animation listeners which execute after detecting\n // changes in a view when the render factory flushes.\n 1024 /* LViewFlags.RefreshView */ | 64 /* LViewFlags.Dirty */;\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(source);\n while (lView) {\n lView[FLAGS] |= dirtyBitsToUse;\n const parent = getLViewParent(lView);\n // Stop traversing up as soon as you find a root view that wasn't attached to any container\n if (isRootView(lView) && !parent) {\n return lView;\n }\n // continue otherwise\n lView = parent;\n }\n return null;\n}\n\nclass ViewRef$1 {\n get rootNodes() {\n const lView = this._lView;\n const tView = lView[TVIEW];\n return collectNativeNodes(tView, lView, tView.firstChild, []);\n }\n constructor(\n /**\n * This represents `LView` associated with the component when ViewRef is a ChangeDetectorRef.\n *\n * When ViewRef is created for a dynamic component, this also represents the `LView` for the\n * component.\n *\n * For a \"regular\" ViewRef created for an embedded view, this is the `LView` for the embedded\n * view.\n *\n * @internal\n */\n _lView, \n /**\n * This represents the `LView` associated with the point where `ChangeDetectorRef` was\n * requested.\n *\n * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.\n */\n _cdRefInjectingView, notifyErrorHandler = true) {\n this._lView = _lView;\n this._cdRefInjectingView = _cdRefInjectingView;\n this.notifyErrorHandler = notifyErrorHandler;\n this._appRef = null;\n this._attachedToViewContainer = false;\n }\n get context() {\n return this._lView[CONTEXT];\n }\n /**\n * @deprecated Replacing the full context object is not supported. Modify the context\n * directly, or consider using a `Proxy` if you need to replace the full object.\n * // TODO(devversion): Remove this.\n */\n set context(value) {\n if (ngDevMode) {\n // Note: We have a warning message here because the `@deprecated` JSDoc will not be picked\n // up for assignments on the setter. We want to let users know about the deprecated usage.\n console.warn('Angular: Replacing the `context` object of an `EmbeddedViewRef` is deprecated.');\n }\n this._lView[CONTEXT] = value;\n }\n get destroyed() {\n return (this._lView[FLAGS] & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */;\n }\n destroy() {\n if (this._appRef) {\n this._appRef.detachView(this);\n }\n else if (this._attachedToViewContainer) {\n const parent = this._lView[PARENT];\n if (isLContainer(parent)) {\n const viewRefs = parent[VIEW_REFS];\n const index = viewRefs ? viewRefs.indexOf(this) : -1;\n if (index > -1) {\n ngDevMode &&\n assertEqual(index, parent.indexOf(this._lView) - CONTAINER_HEADER_OFFSET, 'An attached view should be in the same position within its container as its ViewRef in the VIEW_REFS array.');\n detachView(parent, index);\n removeFromArray(viewRefs, index);\n }\n }\n this._attachedToViewContainer = false;\n }\n destroyLView(this._lView[TVIEW], this._lView);\n }\n onDestroy(callback) {\n storeLViewOnDestroy(this._lView, callback);\n }\n /**\n * Marks a view and all of its ancestors dirty.\n *\n * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush} component is\n * checked when it needs to be re-rendered but the two normal triggers haven't marked it\n * dirty (i.e. inputs haven't changed and events haven't fired in the view).\n *\n * <!-- TODO: Add a link to a chapter on OnPush components -->\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Component({\n * selector: 'app-root',\n * template: `Number of ticks: {{numberOfTicks}}`\n * changeDetection: ChangeDetectionStrategy.OnPush,\n * })\n * class AppComponent {\n * numberOfTicks = 0;\n *\n * constructor(private ref: ChangeDetectorRef) {\n * setInterval(() => {\n * this.numberOfTicks++;\n * // the following is required, otherwise the view will not be updated\n * this.ref.markForCheck();\n * }, 1000);\n * }\n * }\n * ```\n */\n markForCheck() {\n markViewDirty(this._cdRefInjectingView || this._lView, 4 /* NotificationSource.MarkForCheck */);\n }\n /**\n * Detaches the view from the change detection tree.\n *\n * Detached views will not be checked during change detection runs until they are\n * re-attached, even if they are dirty. `detach` can be used in combination with\n * {@link ChangeDetectorRef#detectChanges} to implement local change\n * detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds. We can do that by detaching\n * the component's change detector and doing a local check every five seconds.\n *\n * ```typescript\n * class DataProvider {\n * // in a real application the returned data will be different every time\n * get data() {\n * return [1,2,3,4,5];\n * }\n * }\n *\n * @Component({\n * selector: 'giant-list',\n * template: `\n * <li *ngFor=\"let d of dataProvider.data\">Data {{d}}</li>\n * `,\n * })\n * class GiantList {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {\n * ref.detach();\n * setInterval(() => {\n * this.ref.detectChanges();\n * }, 5000);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * providers: [DataProvider],\n * template: `\n * <giant-list><giant-list>\n * `,\n * })\n * class App {\n * }\n * ```\n */\n detach() {\n this._lView[FLAGS] &= ~128 /* LViewFlags.Attached */;\n }\n /**\n * Re-attaches a view to the change detection tree.\n *\n * This can be used to re-attach views that were previously detached from the tree\n * using {@link ChangeDetectorRef#detach}. Views are attached to the tree by default.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example creates a component displaying `live` data. The component will detach\n * its change detector from the main change detector tree when the component's live property\n * is set to false.\n *\n * ```typescript\n * class DataProvider {\n * data = 1;\n *\n * constructor() {\n * setInterval(() => {\n * this.data = this.data * 2;\n * }, 500);\n * }\n * }\n *\n * @Component({\n * selector: 'live-data',\n * inputs: ['live'],\n * template: 'Data: {{dataProvider.data}}'\n * })\n * class LiveData {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}\n *\n * set live(value) {\n * if (value) {\n * this.ref.reattach();\n * } else {\n * this.ref.detach();\n * }\n * }\n * }\n *\n * @Component({\n * selector: 'app-root',\n * providers: [DataProvider],\n * template: `\n * Live Update: <input type=\"checkbox\" [(ngModel)]=\"live\">\n * <live-data [live]=\"live\"><live-data>\n * `,\n * })\n * class AppComponent {\n * live = true;\n * }\n * ```\n */\n reattach() {\n updateAncestorTraversalFlagsOnAttach(this._lView);\n this._lView[FLAGS] |= 128 /* LViewFlags.Attached */;\n }\n /**\n * Checks the view and its children.\n *\n * This can also be used in combination with {@link ChangeDetectorRef#detach} to implement\n * local change detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine, the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds.\n *\n * We can do that by detaching the component's change detector and doing a local change detection\n * check every five seconds.\n *\n * See {@link ChangeDetectorRef#detach} for more information.\n */\n detectChanges() {\n // Add `RefreshView` flag to ensure this view is refreshed if not already dirty.\n // `RefreshView` flag is used intentionally over `Dirty` because it gets cleared before\n // executing any of the actual refresh code while the `Dirty` flag doesn't get cleared\n // until the end of the refresh. Using `RefreshView` prevents creating a potential difference\n // in the state of the LViewFlags during template execution.\n this._lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;\n detectChangesInternal(this._lView, this.notifyErrorHandler);\n }\n /**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * This is used in development mode to verify that running change detection doesn't\n * introduce other changes.\n */\n checkNoChanges() {\n if (ngDevMode) {\n checkNoChangesInternal(this._lView, CheckNoChangesMode.OnlyDirtyViews, this.notifyErrorHandler);\n }\n }\n attachToViewContainerRef() {\n if (this._appRef) {\n throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached directly to the ApplicationRef!');\n }\n this._attachedToViewContainer = true;\n }\n detachFromAppRef() {\n this._appRef = null;\n const isRoot = isRootView(this._lView);\n const declarationContainer = this._lView[DECLARATION_LCONTAINER];\n if (declarationContainer !== null && !isRoot) {\n detachMovedView(declarationContainer, this._lView);\n }\n detachViewFromDOM(this._lView[TVIEW], this._lView);\n }\n attachToAppRef(appRef) {\n if (this._attachedToViewContainer) {\n throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached to a ViewContainer!');\n }\n this._appRef = appRef;\n const isRoot = isRootView(this._lView);\n const declarationContainer = this._lView[DECLARATION_LCONTAINER];\n if (declarationContainer !== null && !isRoot) {\n trackMovedView(declarationContainer, this._lView);\n }\n updateAncestorTraversalFlagsOnAttach(this._lView);\n }\n}\n\n/**\n * Represents an embedded template that can be used to instantiate embedded views.\n * To instantiate embedded views based on a template, use the `ViewContainerRef`\n * method `createEmbeddedView()`.\n *\n * Access a `TemplateRef` instance by placing a directive on an `<ng-template>`\n * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view\n * is injected into the constructor of the directive,\n * using the `TemplateRef` token.\n *\n * You can also use a `Query` to find a `TemplateRef` associated with\n * a component or a directive.\n *\n * @see {@link ViewContainerRef}\n *\n * @publicApi\n */\nclass TemplateRef {\n /**\n * @internal\n * @nocollapse\n */\n static { this.__NG_ELEMENT_ID__ = injectTemplateRef; }\n}\nconst ViewEngineTemplateRef = TemplateRef;\n// TODO(alxhub): combine interface and implementation. Currently this is challenging since something\n// in g3 depends on them being separate.\nconst R3TemplateRef = class TemplateRef extends ViewEngineTemplateRef {\n constructor(_declarationLView, _declarationTContainer, elementRef) {\n super();\n this._declarationLView = _declarationLView;\n this._declarationTContainer = _declarationTContainer;\n this.elementRef = elementRef;\n }\n /**\n * Returns an `ssrId` associated with a TView, which was used to\n * create this instance of the `TemplateRef`.\n *\n * @internal\n */\n get ssrId() {\n return this._declarationTContainer.tView?.ssrId || null;\n }\n createEmbeddedView(context, injector) {\n return this.createEmbeddedViewImpl(context, injector);\n }\n /**\n * @internal\n */\n createEmbeddedViewImpl(context, injector, dehydratedView) {\n const embeddedLView = createAndRenderEmbeddedLView(this._declarationLView, this._declarationTContainer, context, { embeddedViewInjector: injector, dehydratedView });\n return new ViewRef$1(embeddedLView);\n }\n};\n/**\n * Creates a TemplateRef given a node.\n *\n * @returns The TemplateRef instance to use\n */\nfunction injectTemplateRef() {\n return createTemplateRef(getCurrentTNode(), getLView());\n}\n/**\n * Creates a TemplateRef and stores it on the injector.\n *\n * @param hostTNode The node on which a TemplateRef is requested\n * @param hostLView The `LView` to which the node belongs\n * @returns The TemplateRef instance or null if we can't create a TemplateRef on a given node type\n */\nfunction createTemplateRef(hostTNode, hostLView) {\n if (hostTNode.type & 4 /* TNodeType.Container */) {\n ngDevMode && assertDefined(hostTNode.tView, 'TView must be allocated');\n return new R3TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView));\n }\n return null;\n}\n\nconst AT_THIS_LOCATION = '<-- AT THIS LOCATION';\n/**\n * Retrieves a user friendly string for a given TNodeType for use in\n * friendly error messages\n *\n * @param tNodeType\n * @returns\n */\nfunction getFriendlyStringFromTNodeType(tNodeType) {\n switch (tNodeType) {\n case 4 /* TNodeType.Container */:\n return 'view container';\n case 2 /* TNodeType.Element */:\n return 'element';\n case 8 /* TNodeType.ElementContainer */:\n return 'ng-container';\n case 32 /* TNodeType.Icu */:\n return 'icu';\n case 64 /* TNodeType.Placeholder */:\n return 'i18n';\n case 16 /* TNodeType.Projection */:\n return 'projection';\n case 1 /* TNodeType.Text */:\n return 'text';\n case 128 /* TNodeType.LetDeclaration */:\n return '@let';\n default:\n // This should not happen as we cover all possible TNode types above.\n return '<unknown>';\n }\n}\n/**\n * Validates that provided nodes match during the hydration process.\n */\nfunction validateMatchingNode(node, nodeType, tagName, lView, tNode, isViewContainerAnchor = false) {\n if (!node ||\n node.nodeType !== nodeType ||\n (node.nodeType === Node.ELEMENT_NODE &&\n node.tagName.toLowerCase() !== tagName?.toLowerCase())) {\n const expectedNode = shortRNodeDescription(nodeType, tagName, null);\n let header = `During hydration Angular expected ${expectedNode} but `;\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n const expectedDom = describeExpectedDom(lView, tNode, isViewContainerAnchor);\n const expected = `Angular expected this DOM:\\n\\n${expectedDom}\\n\\n`;\n let actual = '';\n const componentHostElement = unwrapRNode(lView[HOST]);\n if (!node) {\n // No node found during hydration.\n header += `the node was not found.\\n\\n`;\n // Since the node is missing, we use the closest node to attach the error to\n markRNodeAsHavingHydrationMismatch(componentHostElement, expectedDom);\n }\n else {\n const actualNode = shortRNodeDescription(node.nodeType, node.tagName ?? null, node.textContent ?? null);\n header += `found ${actualNode}.\\n\\n`;\n const actualDom = describeDomFromNode(node);\n actual = `Actual DOM is:\\n\\n${actualDom}\\n\\n`;\n // DevTools only report hydration issues on the component level, so we attach extra debug\n // info to a component host element to make it available to DevTools.\n markRNodeAsHavingHydrationMismatch(componentHostElement, expectedDom, actualDom);\n }\n const footer = getHydrationErrorFooter(componentClassName);\n const message = header + expected + actual + getHydrationAttributeNote() + footer;\n throw new RuntimeError(-500 /* RuntimeErrorCode.HYDRATION_NODE_MISMATCH */, message);\n }\n}\n/**\n * Validates that a given node has sibling nodes\n */\nfunction validateSiblingNodeExists(node) {\n validateNodeExists(node);\n if (!node.nextSibling) {\n const header = 'During hydration Angular expected more sibling nodes to be present.\\n\\n';\n const actual = `Actual DOM is:\\n\\n${describeDomFromNode(node)}\\n\\n`;\n const footer = getHydrationErrorFooter();\n const message = header + actual + footer;\n markRNodeAsHavingHydrationMismatch(node, '', actual);\n throw new RuntimeError(-501 /* RuntimeErrorCode.HYDRATION_MISSING_SIBLINGS */, message);\n }\n}\n/**\n * Validates that a node exists or throws\n */\nfunction validateNodeExists(node, lView = null, tNode = null) {\n if (!node) {\n const header = 'During hydration, Angular expected an element to be present at this location.\\n\\n';\n let expected = '';\n let footer = '';\n if (lView !== null && tNode !== null) {\n expected = describeExpectedDom(lView, tNode, false);\n footer = getHydrationErrorFooter();\n // Since the node is missing, we use the closest node to attach the error to\n markRNodeAsHavingHydrationMismatch(unwrapRNode(lView[HOST]), expected, '');\n }\n throw new RuntimeError(-502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, `${header}${expected}\\n\\n${footer}`);\n }\n}\n/**\n * Builds the hydration error message when a node is not found\n *\n * @param lView the LView where the node exists\n * @param tNode the TNode\n */\nfunction nodeNotFoundError(lView, tNode) {\n const header = 'During serialization, Angular was unable to find an element in the DOM:\\n\\n';\n const expected = `${describeExpectedDom(lView, tNode, false)}\\n\\n`;\n const footer = getHydrationErrorFooter();\n throw new RuntimeError(-502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, header + expected + footer);\n}\n/**\n * Builds a hydration error message when a node is not found at a path location\n *\n * @param host the Host Node\n * @param path the path to the node\n */\nfunction nodeNotFoundAtPathError(host, path) {\n const header = `During hydration Angular was unable to locate a node ` +\n `using the \"${path}\" path, starting from the ${describeRNode(host)} node.\\n\\n`;\n const footer = getHydrationErrorFooter();\n markRNodeAsHavingHydrationMismatch(host);\n throw new RuntimeError(-502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, header + footer);\n}\n/**\n * Builds the hydration error message in the case that dom nodes are created outside of\n * the Angular context and are being used as projected nodes\n *\n * @param lView the LView\n * @param tNode the TNode\n * @returns an error\n */\nfunction unsupportedProjectionOfDomNodes(rNode) {\n const header = 'During serialization, Angular detected DOM nodes ' +\n 'that were created outside of Angular context and provided as projectable nodes ' +\n '(likely via `ViewContainerRef.createComponent` or `createComponent` APIs). ' +\n 'Hydration is not supported for such cases, consider refactoring the code to avoid ' +\n 'this pattern or using `ngSkipHydration` on the host element of the component.\\n\\n';\n const actual = `${describeDomFromNode(rNode)}\\n\\n`;\n const message = header + actual + getHydrationAttributeNote();\n return new RuntimeError(-503 /* RuntimeErrorCode.UNSUPPORTED_PROJECTION_DOM_NODES */, message);\n}\n/**\n * Builds the hydration error message in the case that ngSkipHydration was used on a\n * node that is not a component host element or host binding\n *\n * @param rNode the HTML Element\n * @returns an error\n */\nfunction invalidSkipHydrationHost(rNode) {\n const header = 'The `ngSkipHydration` flag is applied on a node ' +\n \"that doesn't act as a component host. Hydration can be \" +\n 'skipped only on per-component basis.\\n\\n';\n const actual = `${describeDomFromNode(rNode)}\\n\\n`;\n const footer = 'Please move the `ngSkipHydration` attribute to the component host element.\\n\\n';\n const message = header + actual + footer;\n return new RuntimeError(-504 /* RuntimeErrorCode.INVALID_SKIP_HYDRATION_HOST */, message);\n}\n// Stringification methods\n/**\n * Stringifies a given TNode's attributes\n *\n * @param tNode a provided TNode\n * @returns string\n */\nfunction stringifyTNodeAttrs(tNode) {\n const results = [];\n if (tNode.attrs) {\n for (let i = 0; i < tNode.attrs.length;) {\n const attrName = tNode.attrs[i++];\n // Once we reach the first flag, we know that the list of\n // attributes is over.\n if (typeof attrName == 'number') {\n break;\n }\n const attrValue = tNode.attrs[i++];\n results.push(`${attrName}=\"${shorten(attrValue)}\"`);\n }\n }\n return results.join(' ');\n}\n/**\n * The list of internal attributes that should be filtered out while\n * producing an error message.\n */\nconst internalAttrs = new Set(['ngh', 'ng-version', 'ng-server-context']);\n/**\n * Stringifies an HTML Element's attributes\n *\n * @param rNode an HTML Element\n * @returns string\n */\nfunction stringifyRNodeAttrs(rNode) {\n const results = [];\n for (let i = 0; i < rNode.attributes.length; i++) {\n const attr = rNode.attributes[i];\n if (internalAttrs.has(attr.name))\n continue;\n results.push(`${attr.name}=\"${shorten(attr.value)}\"`);\n }\n return results.join(' ');\n}\n// Methods for Describing the DOM\n/**\n * Converts a tNode to a helpful readable string value for use in error messages\n *\n * @param tNode a given TNode\n * @param innerContent the content of the node\n * @returns string\n */\nfunction describeTNode(tNode, innerContent = '…') {\n switch (tNode.type) {\n case 1 /* TNodeType.Text */:\n const content = tNode.value ? `(${tNode.value})` : '';\n return `#text${content}`;\n case 2 /* TNodeType.Element */:\n const attrs = stringifyTNodeAttrs(tNode);\n const tag = tNode.value.toLowerCase();\n return `<${tag}${attrs ? ' ' + attrs : ''}>${innerContent}</${tag}>`;\n case 8 /* TNodeType.ElementContainer */:\n return '<!-- ng-container -->';\n case 4 /* TNodeType.Container */:\n return '<!-- container -->';\n default:\n const typeAsString = getFriendlyStringFromTNodeType(tNode.type);\n return `#node(${typeAsString})`;\n }\n}\n/**\n * Converts an RNode to a helpful readable string value for use in error messages\n *\n * @param rNode a given RNode\n * @param innerContent the content of the node\n * @returns string\n */\nfunction describeRNode(rNode, innerContent = '…') {\n const node = rNode;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n const tag = node.tagName.toLowerCase();\n const attrs = stringifyRNodeAttrs(node);\n return `<${tag}${attrs ? ' ' + attrs : ''}>${innerContent}</${tag}>`;\n case Node.TEXT_NODE:\n const content = node.textContent ? shorten(node.textContent) : '';\n return `#text${content ? `(${content})` : ''}`;\n case Node.COMMENT_NODE:\n return `<!-- ${shorten(node.textContent ?? '')} -->`;\n default:\n return `#node(${node.nodeType})`;\n }\n}\n/**\n * Builds the string containing the expected DOM present given the LView and TNode\n * values for a readable error message\n *\n * @param lView the lView containing the DOM\n * @param tNode the tNode\n * @param isViewContainerAnchor boolean\n * @returns string\n */\nfunction describeExpectedDom(lView, tNode, isViewContainerAnchor) {\n const spacer = ' ';\n let content = '';\n if (tNode.prev) {\n content += spacer + '…\\n';\n content += spacer + describeTNode(tNode.prev) + '\\n';\n }\n else if (tNode.type && tNode.type & 12 /* TNodeType.AnyContainer */) {\n content += spacer + '…\\n';\n }\n if (isViewContainerAnchor) {\n content += spacer + describeTNode(tNode) + '\\n';\n content += spacer + `<!-- container --> ${AT_THIS_LOCATION}\\n`;\n }\n else {\n content += spacer + describeTNode(tNode) + ` ${AT_THIS_LOCATION}\\n`;\n }\n content += spacer + '…\\n';\n const parentRNode = tNode.type ? getParentRElement(lView[TVIEW], tNode, lView) : null;\n if (parentRNode) {\n content = describeRNode(parentRNode, '\\n' + content);\n }\n return content;\n}\n/**\n * Builds the string containing the DOM present around a given RNode for a\n * readable error message\n *\n * @param node the RNode\n * @returns string\n */\nfunction describeDomFromNode(node) {\n const spacer = ' ';\n let content = '';\n const currentNode = node;\n if (currentNode.previousSibling) {\n content += spacer + '…\\n';\n content += spacer + describeRNode(currentNode.previousSibling) + '\\n';\n }\n content += spacer + describeRNode(currentNode) + ` ${AT_THIS_LOCATION}\\n`;\n if (node.nextSibling) {\n content += spacer + '…\\n';\n }\n if (node.parentNode) {\n content = describeRNode(currentNode.parentNode, '\\n' + content);\n }\n return content;\n}\n/**\n * Shortens the description of a given RNode by its type for readability\n *\n * @param nodeType the type of node\n * @param tagName the node tag name\n * @param textContent the text content in the node\n * @returns string\n */\nfunction shortRNodeDescription(nodeType, tagName, textContent) {\n switch (nodeType) {\n case Node.ELEMENT_NODE:\n return `<${tagName.toLowerCase()}>`;\n case Node.TEXT_NODE:\n const content = textContent ? ` (with the \"${shorten(textContent)}\" content)` : '';\n return `a text node${content}`;\n case Node.COMMENT_NODE:\n return 'a comment node';\n default:\n return `#node(nodeType=${nodeType})`;\n }\n}\n/**\n * Builds the footer hydration error message\n *\n * @param componentClassName the name of the component class\n * @returns string\n */\nfunction getHydrationErrorFooter(componentClassName) {\n const componentInfo = componentClassName ? `the \"${componentClassName}\"` : 'corresponding';\n return (`To fix this problem:\\n` +\n ` * check ${componentInfo} component for hydration-related issues\\n` +\n ` * check to see if your template has valid HTML structure\\n` +\n ` * or skip hydration by adding the \\`ngSkipHydration\\` attribute ` +\n `to its host node in a template\\n\\n`);\n}\n/**\n * An attribute related note for hydration errors\n */\nfunction getHydrationAttributeNote() {\n return ('Note: attributes are only displayed to better represent the DOM' +\n ' but have no effect on hydration mismatches.\\n\\n');\n}\n// Node string utility functions\n/**\n * Strips all newlines out of a given string\n *\n * @param input a string to be cleared of new line characters\n * @returns\n */\nfunction stripNewlines(input) {\n return input.replace(/\\s+/gm, '');\n}\n/**\n * Reduces a string down to a maximum length of characters with ellipsis for readability\n *\n * @param input a string input\n * @param maxLength a maximum length in characters\n * @returns string\n */\nfunction shorten(input, maxLength = 50) {\n if (!input) {\n return '';\n }\n input = stripNewlines(input);\n return input.length > maxLength ? `${input.substring(0, maxLength - 1)}…` : input;\n}\n\n/**\n * Find a node in front of which `currentTNode` should be inserted (takes i18n into account).\n *\n * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n * takes `TNode.insertBeforeIndex` into account.\n *\n * @param parentTNode parent `TNode`\n * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n * @param lView current `LView`\n */\nfunction getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView) {\n const tNodeInsertBeforeIndex = currentTNode.insertBeforeIndex;\n const insertBeforeIndex = Array.isArray(tNodeInsertBeforeIndex)\n ? tNodeInsertBeforeIndex[0]\n : tNodeInsertBeforeIndex;\n if (insertBeforeIndex === null) {\n return getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView);\n }\n else {\n ngDevMode && assertIndexInRange(lView, insertBeforeIndex);\n return unwrapRNode(lView[insertBeforeIndex]);\n }\n}\n/**\n * Process `TNode.insertBeforeIndex` by adding i18n text nodes.\n *\n * See `TNode.insertBeforeIndex`\n */\nfunction processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRElement) {\n const tNodeInsertBeforeIndex = childTNode.insertBeforeIndex;\n if (Array.isArray(tNodeInsertBeforeIndex)) {\n // An array indicates that there are i18n nodes that need to be added as children of this\n // `childRNode`. These i18n nodes were created before this `childRNode` was available and so\n // only now can be added. The first element of the array is the normal index where we should\n // insert the `childRNode`. Additional elements are the extra nodes to be added as children of\n // `childRNode`.\n ngDevMode && assertDomNode(childRNode);\n let i18nParent = childRNode;\n let anchorRNode = null;\n if (!(childTNode.type & 3 /* TNodeType.AnyRNode */)) {\n anchorRNode = i18nParent;\n i18nParent = parentRElement;\n }\n if (i18nParent !== null && childTNode.componentOffset === -1) {\n for (let i = 1; i < tNodeInsertBeforeIndex.length; i++) {\n // No need to `unwrapRNode` because all of the indexes point to i18n text nodes.\n // see `assertDomNode` below.\n const i18nChild = lView[tNodeInsertBeforeIndex[i]];\n nativeInsertBefore(renderer, i18nParent, i18nChild, anchorRNode, false);\n }\n }\n }\n}\n\n/**\n * Add `tNode` to `previousTNodes` list and update relevant `TNode`s in `previousTNodes` list\n * `tNode.insertBeforeIndex`.\n *\n * Things to keep in mind:\n * 1. All i18n text nodes are encoded as `TNodeType.Element` and are created eagerly by the\n * `ɵɵi18nStart` instruction.\n * 2. All `TNodeType.Placeholder` `TNodes` are elements which will be created later by\n * `ɵɵelementStart` instruction.\n * 3. `ɵɵelementStart` instruction will create `TNode`s in the ascending `TNode.index` order. (So a\n * smaller index `TNode` is guaranteed to be created before a larger one)\n *\n * We use the above three invariants to determine `TNode.insertBeforeIndex`.\n *\n * In an ideal world `TNode.insertBeforeIndex` would always be `TNode.next.index`. However,\n * this will not work because `TNode.next.index` may be larger than `TNode.index` which means that\n * the next node is not yet created and therefore we can't insert in front of it.\n *\n * Rule1: `TNode.insertBeforeIndex = null` if `TNode.next === null` (Initial condition, as we don't\n * know if there will be further `TNode`s inserted after.)\n * Rule2: If `previousTNode` is created after the `tNode` being inserted, then\n * `previousTNode.insertBeforeNode = tNode.index` (So when a new `tNode` is added we check\n * previous to see if we can update its `insertBeforeTNode`)\n *\n * See `TNode.insertBeforeIndex` for more context.\n *\n * @param previousTNodes A list of previous TNodes so that we can easily traverse `TNode`s in\n * reverse order. (If `TNode` would have `previous` this would not be necessary.)\n * @param newTNode A TNode to add to the `previousTNodes` list.\n */\nfunction addTNodeAndUpdateInsertBeforeIndex(previousTNodes, newTNode) {\n // Start with Rule1\n ngDevMode &&\n assertEqual(newTNode.insertBeforeIndex, null, 'We expect that insertBeforeIndex is not set');\n previousTNodes.push(newTNode);\n if (previousTNodes.length > 1) {\n for (let i = previousTNodes.length - 2; i >= 0; i--) {\n const existingTNode = previousTNodes[i];\n // Text nodes are created eagerly and so they don't need their `indexBeforeIndex` updated.\n // It is safe to ignore them.\n if (!isI18nText(existingTNode)) {\n if (isNewTNodeCreatedBefore(existingTNode, newTNode) &&\n getInsertBeforeIndex(existingTNode) === null) {\n // If it was created before us in time, (and it does not yet have `insertBeforeIndex`)\n // then add the `insertBeforeIndex`.\n setInsertBeforeIndex(existingTNode, newTNode.index);\n }\n }\n }\n }\n}\nfunction isI18nText(tNode) {\n return !(tNode.type & 64 /* TNodeType.Placeholder */);\n}\nfunction isNewTNodeCreatedBefore(existingTNode, newTNode) {\n return isI18nText(newTNode) || existingTNode.index > newTNode.index;\n}\nfunction getInsertBeforeIndex(tNode) {\n const index = tNode.insertBeforeIndex;\n return Array.isArray(index) ? index[0] : index;\n}\nfunction setInsertBeforeIndex(tNode, value) {\n const index = tNode.insertBeforeIndex;\n if (Array.isArray(index)) {\n // Array is stored if we have to insert child nodes. See `TNode.insertBeforeIndex`\n index[0] = value;\n }\n else {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n tNode.insertBeforeIndex = value;\n }\n}\n\n/**\n * Retrieve `TIcu` at a given `index`.\n *\n * The `TIcu` can be stored either directly (if it is nested ICU) OR\n * it is stored inside tho `TIcuContainer` if it is top level ICU.\n *\n * The reason for this is that the top level ICU need a `TNode` so that they are part of the render\n * tree, but nested ICU's have no TNode, because we don't know ahead of time if the nested ICU is\n * expressed (parent ICU may have selected a case which does not contain it.)\n *\n * @param tView Current `TView`.\n * @param index Index where the value should be read from.\n */\nfunction getTIcu(tView, index) {\n const value = tView.data[index];\n if (value === null || typeof value === 'string')\n return null;\n if (ngDevMode &&\n !(value.hasOwnProperty('tView') || value.hasOwnProperty('currentCaseLViewIndex'))) {\n throwError(\"We expect to get 'null'|'TIcu'|'TIcuContainer', but got: \" + value);\n }\n // Here the `value.hasOwnProperty('currentCaseLViewIndex')` is a polymorphic read as it can be\n // either TIcu or TIcuContainerNode. This is not ideal, but we still think it is OK because it\n // will be just two cases which fits into the browser inline cache (inline cache can take up to\n // 4)\n const tIcu = value.hasOwnProperty('currentCaseLViewIndex')\n ? value\n : value.value;\n ngDevMode && assertTIcu(tIcu);\n return tIcu;\n}\n/**\n * Store `TIcu` at a give `index`.\n *\n * The `TIcu` can be stored either directly (if it is nested ICU) OR\n * it is stored inside tho `TIcuContainer` if it is top level ICU.\n *\n * The reason for this is that the top level ICU need a `TNode` so that they are part of the render\n * tree, but nested ICU's have no TNode, because we don't know ahead of time if the nested ICU is\n * expressed (parent ICU may have selected a case which does not contain it.)\n *\n * @param tView Current `TView`.\n * @param index Index where the value should be stored at in `Tview.data`\n * @param tIcu The TIcu to store.\n */\nfunction setTIcu(tView, index, tIcu) {\n const tNode = tView.data[index];\n ngDevMode &&\n assertEqual(tNode === null || tNode.hasOwnProperty('tView'), true, \"We expect to get 'null'|'TIcuContainer'\");\n if (tNode === null) {\n tView.data[index] = tIcu;\n }\n else {\n ngDevMode && assertTNodeType(tNode, 32 /* TNodeType.Icu */);\n tNode.value = tIcu;\n }\n}\n/**\n * Set `TNode.insertBeforeIndex` taking the `Array` into account.\n *\n * See `TNode.insertBeforeIndex`\n */\nfunction setTNodeInsertBeforeIndex(tNode, index) {\n ngDevMode && assertTNode(tNode);\n let insertBeforeIndex = tNode.insertBeforeIndex;\n if (insertBeforeIndex === null) {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n insertBeforeIndex = tNode.insertBeforeIndex = [\n null /* may be updated to number later */,\n index,\n ];\n }\n else {\n assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');\n insertBeforeIndex.push(index);\n }\n}\n/**\n * Create `TNode.type=TNodeType.Placeholder` node.\n *\n * See `TNodeType.Placeholder` for more information.\n */\nfunction createTNodePlaceholder(tView, previousTNodes, index) {\n const tNode = createTNodeAtIndex(tView, index, 64 /* TNodeType.Placeholder */, null, null);\n addTNodeAndUpdateInsertBeforeIndex(previousTNodes, tNode);\n return tNode;\n}\n/**\n * Returns current ICU case.\n *\n * ICU cases are stored as index into the `TIcu.cases`.\n * At times it is necessary to communicate that the ICU case just switched and that next ICU update\n * should update all bindings regardless of the mask. In such a case the we store negative numbers\n * for cases which have just been switched. This function removes the negative flag.\n */\nfunction getCurrentICUCaseIndex(tIcu, lView) {\n const currentCase = lView[tIcu.currentCaseLViewIndex];\n return currentCase === null ? currentCase : currentCase < 0 ? ~currentCase : currentCase;\n}\nfunction getParentFromIcuCreateOpCode(mergedCode) {\n return mergedCode >>> 17 /* IcuCreateOpCode.SHIFT_PARENT */;\n}\nfunction getRefFromIcuCreateOpCode(mergedCode) {\n return (mergedCode & 131070 /* IcuCreateOpCode.MASK_REF */) >>> 1 /* IcuCreateOpCode.SHIFT_REF */;\n}\nfunction getInstructionFromIcuCreateOpCode(mergedCode) {\n return mergedCode & 1 /* IcuCreateOpCode.MASK_INSTRUCTION */;\n}\nfunction icuCreateOpCode(opCode, parentIdx, refIdx) {\n ngDevMode && assertGreaterThanOrEqual(parentIdx, 0, 'Missing parent index');\n ngDevMode && assertGreaterThan(refIdx, 0, 'Missing ref index');\n return (opCode | (parentIdx << 17 /* IcuCreateOpCode.SHIFT_PARENT */) | (refIdx << 1 /* IcuCreateOpCode.SHIFT_REF */));\n}\n// Returns whether the given value corresponds to a root template message,\n// or a sub-template.\nfunction isRootTemplateMessage(subTemplateIndex) {\n return subTemplateIndex === -1;\n}\n\nfunction enterIcu(state, tIcu, lView) {\n state.index = 0;\n const currentCase = getCurrentICUCaseIndex(tIcu, lView);\n if (currentCase !== null) {\n ngDevMode && assertNumberInRange(currentCase, 0, tIcu.cases.length - 1);\n state.removes = tIcu.remove[currentCase];\n }\n else {\n state.removes = EMPTY_ARRAY;\n }\n}\nfunction icuContainerIteratorNext(state) {\n if (state.index < state.removes.length) {\n const removeOpCode = state.removes[state.index++];\n ngDevMode && assertNumber(removeOpCode, 'Expecting OpCode number');\n if (removeOpCode > 0) {\n const rNode = state.lView[removeOpCode];\n ngDevMode && assertDomNode(rNode);\n return rNode;\n }\n else {\n state.stack.push(state.index, state.removes);\n // ICUs are represented by negative indices\n const tIcuIndex = ~removeOpCode;\n const tIcu = state.lView[TVIEW].data[tIcuIndex];\n ngDevMode && assertTIcu(tIcu);\n enterIcu(state, tIcu, state.lView);\n return icuContainerIteratorNext(state);\n }\n }\n else {\n if (state.stack.length === 0) {\n return null;\n }\n else {\n state.removes = state.stack.pop();\n state.index = state.stack.pop();\n return icuContainerIteratorNext(state);\n }\n }\n}\nfunction loadIcuContainerVisitor() {\n const _state = {\n stack: [],\n index: -1,\n };\n /**\n * Retrieves a set of root nodes from `TIcu.remove`. Used by `TNodeType.ICUContainer`\n * to determine which root belong to the ICU.\n *\n * Example of usage.\n * ```\n * const nextRNode = icuContainerIteratorStart(tIcuContainerNode, lView);\n * let rNode: RNode|null;\n * while(rNode = nextRNode()) {\n * console.log(rNode);\n * }\n * ```\n *\n * @param tIcuContainerNode Current `TIcuContainerNode`\n * @param lView `LView` where the `RNode`s should be looked up.\n */\n function icuContainerIteratorStart(tIcuContainerNode, lView) {\n _state.lView = lView;\n while (_state.stack.length)\n _state.stack.pop();\n ngDevMode && assertTNodeForLView(tIcuContainerNode, lView);\n enterIcu(_state, tIcuContainerNode.value, lView);\n return icuContainerIteratorNext.bind(null, _state);\n }\n return icuContainerIteratorStart;\n}\nfunction createIcuIterator(tIcu, lView) {\n const state = {\n stack: [],\n index: -1,\n lView,\n };\n ngDevMode && assertTIcu(tIcu);\n enterIcu(state, tIcu, lView);\n return icuContainerIteratorNext.bind(null, state);\n}\n\n/**\n * Regexp that extracts a reference node information from the compressed node location.\n * The reference node is represented as either:\n * - a number which points to an LView slot\n * - the `b` char which indicates that the lookup should start from the `document.body`\n * - the `h` char to start lookup from the component host node (`lView[HOST]`)\n */\nconst REF_EXTRACTOR_REGEXP = new RegExp(`^(\\\\d+)*(${REFERENCE_NODE_BODY}|${REFERENCE_NODE_HOST})*(.*)`);\n/**\n * Helper function that takes a reference node location and a set of navigation steps\n * (from the reference node) to a target node and outputs a string that represents\n * a location.\n *\n * For example, given: referenceNode = 'b' (body) and path = ['firstChild', 'firstChild',\n * 'nextSibling'], the function returns: `bf2n`.\n */\nfunction compressNodeLocation(referenceNode, path) {\n const result = [referenceNode];\n for (const segment of path) {\n const lastIdx = result.length - 1;\n if (lastIdx > 0 && result[lastIdx - 1] === segment) {\n // An empty string in a count slot represents 1 occurrence of an instruction.\n const value = (result[lastIdx] || 1);\n result[lastIdx] = value + 1;\n }\n else {\n // Adding a new segment to the path.\n // Using an empty string in a counter field to avoid encoding `1`s\n // into the path, since they are implicit (e.g. `f1n1` vs `fn`), so\n // it's enough to have a single char in this case.\n result.push(segment, '');\n }\n }\n return result.join('');\n}\n/**\n * Helper function that reverts the `compressNodeLocation` and transforms a given\n * string into an array where at 0th position there is a reference node info and\n * after that it contains information (in pairs) about a navigation step and the\n * number of repetitions.\n *\n * For example, the path like 'bf2n' will be transformed to:\n * ['b', 'firstChild', 2, 'nextSibling', 1].\n *\n * This information is later consumed by the code that navigates the DOM to find\n * a given node by its location.\n */\nfunction decompressNodeLocation(path) {\n const matches = path.match(REF_EXTRACTOR_REGEXP);\n const [_, refNodeId, refNodeName, rest] = matches;\n // If a reference node is represented by an index, transform it to a number.\n const ref = refNodeId ? parseInt(refNodeId, 10) : refNodeName;\n const steps = [];\n // Match all segments in a path.\n for (const [_, step, count] of rest.matchAll(/(f|n)(\\d*)/g)) {\n const repeat = parseInt(count, 10) || 1;\n steps.push(step, repeat);\n }\n return [ref, ...steps];\n}\n\n/** Whether current TNode is a first node in an <ng-container>. */\nfunction isFirstElementInNgContainer(tNode) {\n return !tNode.prev && tNode.parent?.type === 8 /* TNodeType.ElementContainer */;\n}\n/** Returns an instruction index (subtracting HEADER_OFFSET). */\nfunction getNoOffsetIndex(tNode) {\n return tNode.index - HEADER_OFFSET;\n}\n/**\n * Check whether a given node exists, but is disconnected from the DOM.\n */\nfunction isDisconnectedNode(tNode, lView) {\n return (!(tNode.type & (16 /* TNodeType.Projection */ | 128 /* TNodeType.LetDeclaration */)) &&\n !!lView[tNode.index] &&\n isDisconnectedRNode(unwrapRNode(lView[tNode.index])));\n}\n/**\n * Check whether the given node exists, but is disconnected from the DOM.\n *\n * Note: we leverage the fact that we have this information available in the DOM emulation\n * layer (in Domino) for now. Longer-term solution should not rely on the DOM emulation and\n * only use internal data structures and state to compute this information.\n */\nfunction isDisconnectedRNode(rNode) {\n return !!rNode && !rNode.isConnected;\n}\n/**\n * Locate a node in an i18n tree that corresponds to a given instruction index.\n *\n * @param hydrationInfo The hydration annotation data\n * @param noOffsetIndex the instruction index\n * @returns an RNode that corresponds to the instruction index\n */\nfunction locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex) {\n const i18nNodes = hydrationInfo.i18nNodes;\n if (i18nNodes) {\n return i18nNodes.get(noOffsetIndex);\n }\n return undefined;\n}\n/**\n * Attempt to locate an RNode by a path, if it exists.\n *\n * @param hydrationInfo The hydration annotation data\n * @param lView the current lView\n * @param noOffsetIndex the instruction index\n * @returns an RNode that corresponds to the instruction index or null if no path exists\n */\nfunction tryLocateRNodeByPath(hydrationInfo, lView, noOffsetIndex) {\n const nodes = hydrationInfo.data[NODES];\n const path = nodes?.[noOffsetIndex];\n return path ? locateRNodeByPath(path, lView) : null;\n}\n/**\n * Locate a node in DOM tree that corresponds to a given TNode.\n *\n * @param hydrationInfo The hydration annotation data\n * @param tView the current tView\n * @param lView the current lView\n * @param tNode the current tNode\n * @returns an RNode that represents a given tNode\n */\nfunction locateNextRNode(hydrationInfo, tView, lView, tNode) {\n const noOffsetIndex = getNoOffsetIndex(tNode);\n let native = locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex);\n if (native === undefined) {\n const nodes = hydrationInfo.data[NODES];\n if (nodes?.[noOffsetIndex]) {\n // We know the exact location of the node.\n native = locateRNodeByPath(nodes[noOffsetIndex], lView);\n }\n else if (tView.firstChild === tNode) {\n // We create a first node in this view, so we use a reference\n // to the first child in this DOM segment.\n native = hydrationInfo.firstChild;\n }\n else {\n // Locate a node based on a previous sibling or a parent node.\n const previousTNodeParent = tNode.prev === null;\n const previousTNode = (tNode.prev ?? tNode.parent);\n ngDevMode &&\n assertDefined(previousTNode, 'Unexpected state: current TNode does not have a connection ' +\n 'to the previous node or a parent node.');\n if (isFirstElementInNgContainer(tNode)) {\n const noOffsetParentIndex = getNoOffsetIndex(tNode.parent);\n native = getSegmentHead(hydrationInfo, noOffsetParentIndex);\n }\n else {\n let previousRElement = getNativeByTNode(previousTNode, lView);\n if (previousTNodeParent) {\n native = previousRElement.firstChild;\n }\n else {\n // If the previous node is an element, but it also has container info,\n // this means that we are processing a node like `<div #vcrTarget>`, which is\n // represented in the DOM as `<div></div>...<!--container-->`.\n // In this case, there are nodes *after* this element and we need to skip\n // all of them to reach an element that we are looking for.\n const noOffsetPrevSiblingIndex = getNoOffsetIndex(previousTNode);\n const segmentHead = getSegmentHead(hydrationInfo, noOffsetPrevSiblingIndex);\n if (previousTNode.type === 2 /* TNodeType.Element */ && segmentHead) {\n const numRootNodesToSkip = calcSerializedContainerSize(hydrationInfo, noOffsetPrevSiblingIndex);\n // `+1` stands for an anchor comment node after all the views in this container.\n const nodesToSkip = numRootNodesToSkip + 1;\n // First node after this segment.\n native = siblingAfter(nodesToSkip, segmentHead);\n }\n else {\n native = previousRElement.nextSibling;\n }\n }\n }\n }\n }\n return native;\n}\n/**\n * Skips over a specified number of nodes and returns the next sibling node after that.\n */\nfunction siblingAfter(skip, from) {\n let currentNode = from;\n for (let i = 0; i < skip; i++) {\n ngDevMode && validateSiblingNodeExists(currentNode);\n currentNode = currentNode.nextSibling;\n }\n return currentNode;\n}\n/**\n * Helper function to produce a string representation of the navigation steps\n * (in terms of `nextSibling` and `firstChild` navigations). Used in error\n * messages in dev mode.\n */\nfunction stringifyNavigationInstructions(instructions) {\n const container = [];\n for (let i = 0; i < instructions.length; i += 2) {\n const step = instructions[i];\n const repeat = instructions[i + 1];\n for (let r = 0; r < repeat; r++) {\n container.push(step === NodeNavigationStep.FirstChild ? 'firstChild' : 'nextSibling');\n }\n }\n return container.join('.');\n}\n/**\n * Helper function that navigates from a starting point node (the `from` node)\n * using provided set of navigation instructions (within `path` argument).\n */\nfunction navigateToNode(from, instructions) {\n let node = from;\n for (let i = 0; i < instructions.length; i += 2) {\n const step = instructions[i];\n const repeat = instructions[i + 1];\n for (let r = 0; r < repeat; r++) {\n if (ngDevMode && !node) {\n throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));\n }\n switch (step) {\n case NodeNavigationStep.FirstChild:\n node = node.firstChild;\n break;\n case NodeNavigationStep.NextSibling:\n node = node.nextSibling;\n break;\n }\n }\n }\n if (ngDevMode && !node) {\n throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));\n }\n return node;\n}\n/**\n * Locates an RNode given a set of navigation instructions (which also contains\n * a starting point node info).\n */\nfunction locateRNodeByPath(path, lView) {\n const [referenceNode, ...navigationInstructions] = decompressNodeLocation(path);\n let ref;\n if (referenceNode === REFERENCE_NODE_HOST) {\n ref = lView[DECLARATION_COMPONENT_VIEW][HOST];\n }\n else if (referenceNode === REFERENCE_NODE_BODY) {\n ref = ɵɵresolveBody(lView[DECLARATION_COMPONENT_VIEW][HOST]);\n }\n else {\n const parentElementId = Number(referenceNode);\n ref = unwrapRNode(lView[parentElementId + HEADER_OFFSET]);\n }\n return navigateToNode(ref, navigationInstructions);\n}\n/**\n * Generate a list of DOM navigation operations to get from node `start` to node `finish`.\n *\n * Note: assumes that node `start` occurs before node `finish` in an in-order traversal of the DOM\n * tree. That is, we should be able to get from `start` to `finish` purely by using `.firstChild`\n * and `.nextSibling` operations.\n */\nfunction navigateBetween(start, finish) {\n if (start === finish) {\n return [];\n }\n else if (start.parentElement == null || finish.parentElement == null) {\n return null;\n }\n else if (start.parentElement === finish.parentElement) {\n return navigateBetweenSiblings(start, finish);\n }\n else {\n // `finish` is a child of its parent, so the parent will always have a child.\n const parent = finish.parentElement;\n const parentPath = navigateBetween(start, parent);\n const childPath = navigateBetween(parent.firstChild, finish);\n if (!parentPath || !childPath)\n return null;\n return [\n // First navigate to `finish`'s parent\n ...parentPath,\n // Then to its first child.\n NodeNavigationStep.FirstChild,\n // And finally from that node to `finish` (maybe a no-op if we're already there).\n ...childPath,\n ];\n }\n}\n/**\n * Calculates a path between 2 sibling nodes (generates a number of `NextSibling` navigations).\n * Returns `null` if no such path exists between the given nodes.\n */\nfunction navigateBetweenSiblings(start, finish) {\n const nav = [];\n let node = null;\n for (node = start; node != null && node !== finish; node = node.nextSibling) {\n nav.push(NodeNavigationStep.NextSibling);\n }\n // If the `node` becomes `null` or `undefined` at the end, that means that we\n // didn't find the `end` node, thus return `null` (which would trigger serialization\n // error to be produced).\n return node == null ? null : nav;\n}\n/**\n * Calculates a path between 2 nodes in terms of `nextSibling` and `firstChild`\n * navigations:\n * - the `from` node is a known node, used as an starting point for the lookup\n * (the `fromNodeName` argument is a string representation of the node).\n * - the `to` node is a node that the runtime logic would be looking up,\n * using the path generated by this function.\n */\nfunction calcPathBetween(from, to, fromNodeName) {\n const path = navigateBetween(from, to);\n return path === null ? null : compressNodeLocation(fromNodeName, path);\n}\n/**\n * Invoked at serialization time (on the server) when a set of navigation\n * instructions needs to be generated for a TNode.\n */\nfunction calcPathForNode(tNode, lView, excludedParentNodes) {\n let parentTNode = tNode.parent;\n let parentIndex;\n let parentRNode;\n let referenceNodeName;\n // Skip over all parent nodes that are disconnected from the DOM, such nodes\n // can not be used as anchors.\n //\n // This might happen in certain content projection-based use-cases, where\n // a content of an element is projected and used, when a parent element\n // itself remains detached from DOM. In this scenario we try to find a parent\n // element that is attached to DOM and can act as an anchor instead.\n //\n // It can also happen that the parent node should be excluded, for example,\n // because it belongs to an i18n block, which requires paths which aren't\n // relative to other views in an i18n block.\n while (parentTNode !== null &&\n (isDisconnectedNode(parentTNode, lView) || excludedParentNodes?.has(parentTNode.index))) {\n parentTNode = parentTNode.parent;\n }\n if (parentTNode === null || !(parentTNode.type & 3 /* TNodeType.AnyRNode */)) {\n // If there is no parent TNode or a parent TNode does not represent an RNode\n // (i.e. not a DOM node), use component host element as a reference node.\n parentIndex = referenceNodeName = REFERENCE_NODE_HOST;\n parentRNode = lView[DECLARATION_COMPONENT_VIEW][HOST];\n }\n else {\n // Use parent TNode as a reference node.\n parentIndex = parentTNode.index;\n parentRNode = unwrapRNode(lView[parentIndex]);\n referenceNodeName = renderStringify(parentIndex - HEADER_OFFSET);\n }\n let rNode = unwrapRNode(lView[tNode.index]);\n if (tNode.type & (12 /* TNodeType.AnyContainer */ | 32 /* TNodeType.Icu */)) {\n // For <ng-container> nodes, instead of serializing a reference\n // to the anchor comment node, serialize a location of the first\n // DOM element. Paired with the container size (serialized as a part\n // of `ngh.containers`), it should give enough information for runtime\n // to hydrate nodes in this container.\n const firstRNode = getFirstNativeNode(lView, tNode);\n // If container is not empty, use a reference to the first element,\n // otherwise, rNode would point to an anchor comment node.\n if (firstRNode) {\n rNode = firstRNode;\n }\n }\n let path = calcPathBetween(parentRNode, rNode, referenceNodeName);\n if (path === null && parentRNode !== rNode) {\n // Searching for a path between elements within a host node failed.\n // Trying to find a path to an element starting from the `document.body` instead.\n //\n // Important note: this type of reference is relatively unstable, since Angular\n // may not be able to control parts of the page that the runtime logic navigates\n // through. This is mostly needed to cover \"portals\" use-case (like menus, dialog boxes,\n // etc), where nodes are content-projected (including direct DOM manipulations) outside\n // of the host node. The better solution is to provide APIs to work with \"portals\",\n // at which point this code path would not be needed.\n const body = parentRNode.ownerDocument.body;\n path = calcPathBetween(body, rNode, REFERENCE_NODE_BODY);\n if (path === null) {\n // If the path is still empty, it's likely that this node is detached and\n // won't be found during hydration.\n throw nodeNotFoundError(lView, tNode);\n }\n }\n return path;\n}\n\nlet _isI18nHydrationSupportEnabled = false;\nlet _prepareI18nBlockForHydrationImpl = () => {\n // noop unless `enablePrepareI18nBlockForHydrationImpl` is invoked.\n};\nfunction setIsI18nHydrationSupportEnabled(enabled) {\n _isI18nHydrationSupportEnabled = enabled;\n}\nfunction isI18nHydrationSupportEnabled() {\n return _isI18nHydrationSupportEnabled;\n}\n/**\n * Prepares an i18n block and its children, located at the given\n * view and instruction index, for hydration.\n *\n * @param lView lView with the i18n block\n * @param index index of the i18n block in the lView\n * @param parentTNode TNode of the parent of the i18n block\n * @param subTemplateIndex sub-template index, or -1 for the main template\n */\nfunction prepareI18nBlockForHydration(lView, index, parentTNode, subTemplateIndex) {\n _prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex);\n}\nfunction enablePrepareI18nBlockForHydrationImpl() {\n _prepareI18nBlockForHydrationImpl = prepareI18nBlockForHydrationImpl;\n}\nfunction isI18nHydrationEnabled(injector) {\n injector = injector ?? inject(Injector);\n return injector.get(IS_I18N_HYDRATION_ENABLED, false);\n}\n/**\n * Collects, if not already cached, all of the indices in the\n * given TView which are children of an i18n block.\n *\n * Since i18n blocks don't introduce a parent TNode, this is necessary\n * in order to determine which indices in a LView are translated.\n */\nfunction getOrComputeI18nChildren(tView, context) {\n let i18nChildren = context.i18nChildren.get(tView);\n if (i18nChildren === undefined) {\n i18nChildren = collectI18nChildren(tView);\n context.i18nChildren.set(tView, i18nChildren);\n }\n return i18nChildren;\n}\nfunction collectI18nChildren(tView) {\n const children = new Set();\n function collectI18nViews(node) {\n children.add(node.index);\n switch (node.kind) {\n case 1 /* I18nNodeKind.ELEMENT */:\n case 2 /* I18nNodeKind.PLACEHOLDER */: {\n for (const childNode of node.children) {\n collectI18nViews(childNode);\n }\n break;\n }\n case 3 /* I18nNodeKind.ICU */: {\n for (const caseNodes of node.cases) {\n for (const caseNode of caseNodes) {\n collectI18nViews(caseNode);\n }\n }\n break;\n }\n }\n }\n // Traverse through the AST of each i18n block in the LView,\n // and collect every instruction index.\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n const tI18n = tView.data[i];\n if (!tI18n || !tI18n.ast) {\n continue;\n }\n for (const node of tI18n.ast) {\n collectI18nViews(node);\n }\n }\n return children.size === 0 ? null : children;\n}\n/**\n * Attempts to serialize i18n data for an i18n block, located at\n * the given view and instruction index.\n *\n * @param lView lView with the i18n block\n * @param index index of the i18n block in the lView\n * @param context the hydration context\n * @returns the i18n data, or null if there is no relevant data\n */\nfunction trySerializeI18nBlock(lView, index, context) {\n if (!context.isI18nHydrationEnabled) {\n return null;\n }\n const tView = lView[TVIEW];\n const tI18n = tView.data[index];\n if (!tI18n || !tI18n.ast) {\n return null;\n }\n const parentTNode = tView.data[tI18n.parentTNodeIndex];\n if (parentTNode && isI18nInSkipHydrationBlock(parentTNode)) {\n return null;\n }\n const serializedI18nBlock = {\n caseQueue: [],\n disconnectedNodes: new Set(),\n disjointNodes: new Set(),\n };\n serializeI18nBlock(lView, serializedI18nBlock, context, tI18n.ast);\n return serializedI18nBlock.caseQueue.length === 0 &&\n serializedI18nBlock.disconnectedNodes.size === 0 &&\n serializedI18nBlock.disjointNodes.size === 0\n ? null\n : serializedI18nBlock;\n}\nfunction serializeI18nBlock(lView, serializedI18nBlock, context, nodes) {\n let prevRNode = null;\n for (const node of nodes) {\n const nextRNode = serializeI18nNode(lView, serializedI18nBlock, context, node);\n if (nextRNode) {\n if (isDisjointNode(prevRNode, nextRNode)) {\n serializedI18nBlock.disjointNodes.add(node.index - HEADER_OFFSET);\n }\n prevRNode = nextRNode;\n }\n }\n return prevRNode;\n}\n/**\n * Helper to determine whether the given nodes are \"disjoint\".\n *\n * The i18n hydration process walks through the DOM and i18n nodes\n * at the same time. It expects the sibling DOM node of the previous\n * i18n node to be the first node of the next i18n node.\n *\n * In cases of content projection, this won't always be the case. So\n * when we detect that, we mark the node as \"disjoint\", ensuring that\n * we will serialize the path to the node. This way, when we hydrate the\n * i18n node, we will be able to find the correct place to start.\n */\nfunction isDisjointNode(prevNode, nextNode) {\n return prevNode && prevNode.nextSibling !== nextNode;\n}\n/**\n * Process the given i18n node for serialization.\n * Returns the first RNode for the i18n node to begin hydration.\n */\nfunction serializeI18nNode(lView, serializedI18nBlock, context, node) {\n const maybeRNode = unwrapRNode(lView[node.index]);\n if (!maybeRNode || isDisconnectedRNode(maybeRNode)) {\n serializedI18nBlock.disconnectedNodes.add(node.index - HEADER_OFFSET);\n return null;\n }\n const rNode = maybeRNode;\n switch (node.kind) {\n case 0 /* I18nNodeKind.TEXT */: {\n processTextNodeBeforeSerialization(context, rNode);\n break;\n }\n case 1 /* I18nNodeKind.ELEMENT */:\n case 2 /* I18nNodeKind.PLACEHOLDER */: {\n serializeI18nBlock(lView, serializedI18nBlock, context, node.children);\n break;\n }\n case 3 /* I18nNodeKind.ICU */: {\n const currentCase = lView[node.currentCaseLViewIndex];\n if (currentCase != null) {\n // i18n uses a negative value to signal a change to a new case, so we\n // need to invert it to get the proper value.\n const caseIdx = currentCase < 0 ? ~currentCase : currentCase;\n serializedI18nBlock.caseQueue.push(caseIdx);\n serializeI18nBlock(lView, serializedI18nBlock, context, node.cases[caseIdx]);\n }\n break;\n }\n }\n return getFirstNativeNodeForI18nNode(lView, node);\n}\n/**\n * Helper function to get the first native node to begin hydrating\n * the given i18n node.\n */\nfunction getFirstNativeNodeForI18nNode(lView, node) {\n const tView = lView[TVIEW];\n const maybeTNode = tView.data[node.index];\n if (isTNodeShape(maybeTNode)) {\n // If the node is backed by an actual TNode, we can simply delegate.\n return getFirstNativeNode(lView, maybeTNode);\n }\n else if (node.kind === 3 /* I18nNodeKind.ICU */) {\n // A nested ICU container won't have an actual TNode. In that case, we can use\n // an iterator to find the first child.\n const icuIterator = createIcuIterator(maybeTNode, lView);\n let rNode = icuIterator();\n // If the ICU container has no nodes, then we use the ICU anchor as the node.\n return rNode ?? unwrapRNode(lView[node.index]);\n }\n else {\n // Otherwise, the node is a text or trivial element in an ICU container,\n // and we can just use the RNode directly.\n return unwrapRNode(lView[node.index]) ?? null;\n }\n}\nfunction setCurrentNode(state, node) {\n state.currentNode = node;\n}\n/**\n * Marks the current RNode as the hydration root for the given\n * AST node.\n */\nfunction appendI18nNodeToCollection(context, state, astNode) {\n const noOffsetIndex = astNode.index - HEADER_OFFSET;\n const { disconnectedNodes } = context;\n const currentNode = state.currentNode;\n if (state.isConnected) {\n context.i18nNodes.set(noOffsetIndex, currentNode);\n // We expect the node to be connected, so ensure that it\n // is not in the set, regardless of whether we found it,\n // so that the downstream error handling can provide the\n // proper context.\n disconnectedNodes.delete(noOffsetIndex);\n }\n else {\n disconnectedNodes.add(noOffsetIndex);\n }\n return currentNode;\n}\n/**\n * Skip over some sibling nodes during hydration.\n *\n * Note: we use this instead of `siblingAfter` as it's expected that\n * sometimes we might encounter null nodes. In those cases, we want to\n * defer to downstream error handling to provide proper context.\n */\nfunction skipSiblingNodes(state, skip) {\n let currentNode = state.currentNode;\n for (let i = 0; i < skip; i++) {\n if (!currentNode) {\n break;\n }\n currentNode = currentNode?.nextSibling ?? null;\n }\n return currentNode;\n}\n/**\n * Fork the given state into a new state for hydrating children.\n */\nfunction forkHydrationState(state, nextNode) {\n return { currentNode: nextNode, isConnected: state.isConnected };\n}\nfunction prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex) {\n const hydrationInfo = lView[HYDRATION];\n if (!hydrationInfo) {\n return;\n }\n if (!isI18nHydrationSupportEnabled() ||\n (parentTNode &&\n (isI18nInSkipHydrationBlock(parentTNode) ||\n isDisconnectedNode$1(hydrationInfo, parentTNode.index - HEADER_OFFSET)))) {\n return;\n }\n const tView = lView[TVIEW];\n const tI18n = tView.data[index];\n ngDevMode &&\n assertDefined(tI18n, 'Expected i18n data to be present in a given TView slot during hydration');\n function findHydrationRoot() {\n if (isRootTemplateMessage(subTemplateIndex)) {\n // This is the root of an i18n block. In this case, our hydration root will\n // depend on where our parent TNode (i.e. the block with i18n applied) is\n // in the DOM.\n ngDevMode && assertDefined(parentTNode, 'Expected parent TNode while hydrating i18n root');\n const rootNode = locateNextRNode(hydrationInfo, tView, lView, parentTNode);\n // If this i18n block is attached to an <ng-container>, then we want to begin\n // hydrating directly with the RNode. Otherwise, for a TNode with a physical DOM\n // element, we want to recurse into the first child and begin there.\n return parentTNode.type & 8 /* TNodeType.ElementContainer */ ? rootNode : rootNode.firstChild;\n }\n // This is a nested template in an i18n block. In this case, the entire view\n // is translated, and part of a dehydrated view in a container. This means that\n // we can simply begin hydration with the first dehydrated child.\n return hydrationInfo?.firstChild;\n }\n const currentNode = findHydrationRoot();\n ngDevMode && assertDefined(currentNode, 'Expected root i18n node during hydration');\n const disconnectedNodes = initDisconnectedNodes(hydrationInfo) ?? new Set();\n const i18nNodes = (hydrationInfo.i18nNodes ??= new Map());\n const caseQueue = hydrationInfo.data[I18N_DATA]?.[index - HEADER_OFFSET] ?? [];\n const dehydratedIcuData = (hydrationInfo.dehydratedIcuData ??= new Map());\n collectI18nNodesFromDom({ hydrationInfo, lView, i18nNodes, disconnectedNodes, caseQueue, dehydratedIcuData }, { currentNode, isConnected: true }, tI18n.ast);\n // Nodes from inactive ICU cases should be considered disconnected. We track them above\n // because they aren't (and shouldn't be) serialized. Since we may mutate or create a\n // new set, we need to be sure to write the expected value back to the DehydratedView.\n hydrationInfo.disconnectedNodes = disconnectedNodes.size === 0 ? null : disconnectedNodes;\n}\nfunction collectI18nNodesFromDom(context, state, nodeOrNodes) {\n if (Array.isArray(nodeOrNodes)) {\n let nextState = state;\n for (const node of nodeOrNodes) {\n // Whenever a node doesn't directly follow the previous RNode, it\n // is given a path. We need to resume collecting nodes from that location\n // until and unless we find another disjoint node.\n const targetNode = tryLocateRNodeByPath(context.hydrationInfo, context.lView, node.index - HEADER_OFFSET);\n if (targetNode) {\n nextState = forkHydrationState(state, targetNode);\n }\n collectI18nNodesFromDom(context, nextState, node);\n }\n }\n else {\n if (context.disconnectedNodes.has(nodeOrNodes.index - HEADER_OFFSET)) {\n // i18n nodes can be considered disconnected if e.g. they were projected.\n // In that case, we have to make sure to skip over them.\n return;\n }\n switch (nodeOrNodes.kind) {\n case 0 /* I18nNodeKind.TEXT */: {\n // Claim a text node for hydration\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n case 1 /* I18nNodeKind.ELEMENT */: {\n // Recurse into the current element's children...\n collectI18nNodesFromDom(context, forkHydrationState(state, state.currentNode?.firstChild ?? null), nodeOrNodes.children);\n // And claim the parent element itself.\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n case 2 /* I18nNodeKind.PLACEHOLDER */: {\n const noOffsetIndex = nodeOrNodes.index - HEADER_OFFSET;\n const { hydrationInfo } = context;\n const containerSize = getNgContainerSize(hydrationInfo, noOffsetIndex);\n switch (nodeOrNodes.type) {\n case 0 /* I18nPlaceholderType.ELEMENT */: {\n // Hydration expects to find the head of the element.\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n // A TNode for the node may not yet if we're hydrating during the first pass,\n // so use the serialized data to determine if this is an <ng-container>.\n if (isSerializedElementContainer(hydrationInfo, noOffsetIndex)) {\n // An <ng-container> doesn't have a physical DOM node, so we need to\n // continue hydrating from siblings.\n collectI18nNodesFromDom(context, state, nodeOrNodes.children);\n // Skip over the anchor element. It will be claimed by the\n // downstream container hydration.\n const nextNode = skipSiblingNodes(state, 1);\n setCurrentNode(state, nextNode);\n }\n else {\n // Non-container elements represent an actual node in the DOM, so we\n // need to continue hydration with the children, and claim the node.\n collectI18nNodesFromDom(context, forkHydrationState(state, state.currentNode?.firstChild ?? null), nodeOrNodes.children);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n // Elements can also be the anchor of a view container, so there may\n // be elements after this node that we need to skip.\n if (containerSize !== null) {\n // `+1` stands for an anchor node after all of the views in the container.\n const nextNode = skipSiblingNodes(state, containerSize + 1);\n setCurrentNode(state, nextNode);\n }\n }\n break;\n }\n case 1 /* I18nPlaceholderType.SUBTEMPLATE */: {\n ngDevMode &&\n assertNotEqual(containerSize, null, 'Expected a container size while hydrating i18n subtemplate');\n // Hydration expects to find the head of the template.\n appendI18nNodeToCollection(context, state, nodeOrNodes);\n // Skip over all of the template children, as well as the anchor\n // node, since the template itself will handle them instead.\n const nextNode = skipSiblingNodes(state, containerSize + 1);\n setCurrentNode(state, nextNode);\n break;\n }\n }\n break;\n }\n case 3 /* I18nNodeKind.ICU */: {\n // If the current node is connected, we need to pop the next case from the\n // queue, so that the active case is also considered connected.\n const selectedCase = state.isConnected ? context.caseQueue.shift() : null;\n const childState = { currentNode: null, isConnected: false };\n // We traverse through each case, even if it's not active,\n // so that we correctly populate disconnected nodes.\n for (let i = 0; i < nodeOrNodes.cases.length; i++) {\n collectI18nNodesFromDom(context, i === selectedCase ? state : childState, nodeOrNodes.cases[i]);\n }\n if (selectedCase !== null) {\n // ICUs represent a branching state, and the selected case could be different\n // than what it was on the server. In that case, we need to be able to clean\n // up the nodes from the original case. To do that, we store the selected case.\n context.dehydratedIcuData.set(nodeOrNodes.index, { case: selectedCase, node: nodeOrNodes });\n }\n // Hydration expects to find the ICU anchor element.\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n }\n }\n}\nlet _claimDehydratedIcuCaseImpl = () => {\n // noop unless `enableClaimDehydratedIcuCaseImpl` is invoked\n};\n/**\n * Mark the case for the ICU node at the given index in the view as claimed,\n * allowing its nodes to be hydrated and not cleaned up.\n */\nfunction claimDehydratedIcuCase(lView, icuIndex, caseIndex) {\n _claimDehydratedIcuCaseImpl(lView, icuIndex, caseIndex);\n}\nfunction enableClaimDehydratedIcuCaseImpl() {\n _claimDehydratedIcuCaseImpl = claimDehydratedIcuCaseImpl;\n}\nfunction claimDehydratedIcuCaseImpl(lView, icuIndex, caseIndex) {\n const dehydratedIcuDataMap = lView[HYDRATION]?.dehydratedIcuData;\n if (dehydratedIcuDataMap) {\n const dehydratedIcuData = dehydratedIcuDataMap.get(icuIndex);\n if (dehydratedIcuData?.case === caseIndex) {\n // If the case we're attempting to claim matches the dehydrated one,\n // we remove it from the map to mark it as \"claimed.\"\n dehydratedIcuDataMap.delete(icuIndex);\n }\n }\n}\n/**\n * Clean up all i18n hydration data associated with the given view.\n */\nfunction cleanupI18nHydrationData(lView) {\n const hydrationInfo = lView[HYDRATION];\n if (hydrationInfo) {\n const { i18nNodes, dehydratedIcuData: dehydratedIcuDataMap } = hydrationInfo;\n if (i18nNodes && dehydratedIcuDataMap) {\n const renderer = lView[RENDERER];\n for (const dehydratedIcuData of dehydratedIcuDataMap.values()) {\n cleanupDehydratedIcuData(renderer, i18nNodes, dehydratedIcuData);\n }\n }\n hydrationInfo.i18nNodes = undefined;\n hydrationInfo.dehydratedIcuData = undefined;\n }\n}\nfunction cleanupDehydratedIcuData(renderer, i18nNodes, dehydratedIcuData) {\n for (const node of dehydratedIcuData.node.cases[dehydratedIcuData.case]) {\n const rNode = i18nNodes.get(node.index - HEADER_OFFSET);\n if (rNode) {\n nativeRemoveNode(renderer, rNode, false);\n }\n }\n}\n\n/**\n * Removes all dehydrated views from a given LContainer:\n * both in internal data structure, as well as removing\n * corresponding DOM nodes that belong to that dehydrated view.\n */\nfunction removeDehydratedViews(lContainer) {\n const views = lContainer[DEHYDRATED_VIEWS] ?? [];\n const parentLView = lContainer[PARENT];\n const renderer = parentLView[RENDERER];\n for (const view of views) {\n removeDehydratedView(view, renderer);\n ngDevMode && ngDevMode.dehydratedViewsRemoved++;\n }\n // Reset the value to an empty array to indicate that no\n // further processing of dehydrated views is needed for\n // this view container (i.e. do not trigger the lookup process\n // once again in case a `ViewContainerRef` is created later).\n lContainer[DEHYDRATED_VIEWS] = EMPTY_ARRAY;\n}\n/**\n * Helper function to remove all nodes from a dehydrated view.\n */\nfunction removeDehydratedView(dehydratedView, renderer) {\n let nodesRemoved = 0;\n let currentRNode = dehydratedView.firstChild;\n if (currentRNode) {\n const numNodes = dehydratedView.data[NUM_ROOT_NODES];\n while (nodesRemoved < numNodes) {\n ngDevMode && validateSiblingNodeExists(currentRNode);\n const nextSibling = currentRNode.nextSibling;\n nativeRemoveNode(renderer, currentRNode, false);\n currentRNode = nextSibling;\n nodesRemoved++;\n }\n }\n}\n/**\n * Walks over all views within this LContainer invokes dehydrated views\n * cleanup function for each one.\n */\nfunction cleanupLContainer(lContainer) {\n removeDehydratedViews(lContainer);\n // The host could be an LView if this container is on a component node.\n // In this case, descend into host LView for further cleanup. See also\n // LContainer[HOST] docs for additional information.\n const hostLView = lContainer[HOST];\n if (isLView(hostLView)) {\n cleanupLView(hostLView);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n cleanupLView(lContainer[i]);\n }\n}\n/**\n * Walks over `LContainer`s and components registered within\n * this LView and invokes dehydrated views cleanup function for each one.\n */\nfunction cleanupLView(lView) {\n cleanupI18nHydrationData(lView);\n const tView = lView[TVIEW];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (isLContainer(lView[i])) {\n const lContainer = lView[i];\n cleanupLContainer(lContainer);\n }\n else if (isLView(lView[i])) {\n // This is a component, enter the `cleanupLView` recursively.\n cleanupLView(lView[i]);\n }\n }\n}\n/**\n * Walks over all views registered within the ApplicationRef and removes\n * all dehydrated views from all `LContainer`s along the way.\n */\nfunction cleanupDehydratedViews(appRef) {\n const viewRefs = appRef._views;\n for (const viewRef of viewRefs) {\n const lNode = getLNodeForHydration(viewRef);\n // An `lView` might be `null` if a `ViewRef` represents\n // an embedded view (not a component view).\n if (lNode !== null && lNode[HOST] !== null) {\n if (isLView(lNode)) {\n cleanupLView(lNode);\n }\n else {\n // Cleanup in all views within this view container\n cleanupLContainer(lNode);\n }\n ngDevMode && ngDevMode.dehydratedViewsCleanupRuns++;\n }\n }\n}\n\n/**\n * Given a current DOM node and a serialized information about the views\n * in a container, walks over the DOM structure, collecting the list of\n * dehydrated views.\n */\nfunction locateDehydratedViewsInContainer(currentRNode, serializedViews) {\n const dehydratedViews = [];\n for (const serializedView of serializedViews) {\n // Repeats a view multiple times as needed, based on the serialized information\n // (for example, for *ngFor-produced views).\n for (let i = 0; i < (serializedView[MULTIPLIER] ?? 1); i++) {\n const view = {\n data: serializedView,\n firstChild: null,\n };\n if (serializedView[NUM_ROOT_NODES] > 0) {\n // Keep reference to the first node in this view,\n // so it can be accessed while invoking template instructions.\n view.firstChild = currentRNode;\n // Move over to the next node after this view, which can\n // either be a first node of the next view or an anchor comment\n // node after the last view in a container.\n currentRNode = siblingAfter(serializedView[NUM_ROOT_NODES], currentRNode);\n }\n dehydratedViews.push(view);\n }\n }\n return [currentRNode, dehydratedViews];\n}\n/**\n * Reference to a function that searches for a matching dehydrated views\n * stored on a given lContainer.\n * Returns `null` by default, when hydration is not enabled.\n */\nlet _findMatchingDehydratedViewImpl = () => null;\n/**\n * Retrieves the next dehydrated view from the LContainer and verifies that\n * it matches a given template id (from the TView that was used to create this\n * instance of a view). If the id doesn't match, that means that we are in an\n * unexpected state and can not complete the reconciliation process. Thus,\n * all dehydrated views from this LContainer are removed (including corresponding\n * DOM nodes) and the rendering is performed as if there were no dehydrated views\n * in this container.\n */\nfunction findMatchingDehydratedViewImpl(lContainer, template) {\n const views = lContainer[DEHYDRATED_VIEWS];\n if (!template || views === null || views.length === 0) {\n return null;\n }\n const view = views[0];\n // Verify whether the first dehydrated view in the container matches\n // the template id passed to this function (that originated from a TView\n // that was used to create an instance of an embedded or component views.\n if (view.data[TEMPLATE_ID] === template) {\n // If the template id matches - extract the first view and return it.\n return views.shift();\n }\n else {\n // Otherwise, we are at the state when reconciliation can not be completed,\n // thus we remove all dehydrated views within this container (remove them\n // from internal data structures as well as delete associated elements from\n // the DOM tree).\n removeDehydratedViews(lContainer);\n return null;\n }\n}\nfunction enableFindMatchingDehydratedViewImpl() {\n _findMatchingDehydratedViewImpl = findMatchingDehydratedViewImpl;\n}\nfunction findMatchingDehydratedView(lContainer, template) {\n return _findMatchingDehydratedViewImpl(lContainer, template);\n}\n\n/**\n * Injectable that is notified when an `LView` is made aware of changes to application state.\n */\nclass ChangeDetectionScheduler {\n}\n/** Token used to indicate if zoneless was enabled via provideZonelessChangeDetection(). */\nconst ZONELESS_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'Zoneless enabled' : '', { providedIn: 'root', factory: () => false });\n/** Token used to indicate `provideExperimentalZonelessChangeDetection` was used. */\nconst PROVIDED_ZONELESS = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'Zoneless provided' : '', { providedIn: 'root', factory: () => false });\nconst ZONELESS_SCHEDULER_DISABLED = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'scheduler disabled' : '');\n// TODO(atscott): Remove in v19. Scheduler should be done with runOutsideAngular.\nconst SCHEDULE_IN_ROOT_ZONE = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'run changes outside zone in root' : '');\n\n/**\n * Represents a component created by a `ComponentFactory`.\n * Provides access to the component instance and related objects,\n * and provides the means of destroying the instance.\n *\n * @publicApi\n */\nclass ComponentRef$1 {\n}\n/**\n * Base class for a factory that can create a component dynamically.\n * Instantiate a factory for a given type of component with `resolveComponentFactory()`.\n * Use the resulting `ComponentFactory.create()` method to create a component of that type.\n *\n * @publicApi\n *\n * @deprecated Angular no longer requires Component factories. Please use other APIs where\n * Component class can be used directly.\n */\nclass ComponentFactory$1 {\n}\n\nfunction noComponentFactoryError(component) {\n const error = Error(`No component factory found for ${stringify(component)}.`);\n error[ERROR_COMPONENT] = component;\n return error;\n}\nconst ERROR_COMPONENT = 'ngComponent';\nfunction getComponent(error) {\n return error[ERROR_COMPONENT];\n}\nclass _NullComponentFactoryResolver {\n resolveComponentFactory(component) {\n throw noComponentFactoryError(component);\n }\n}\n/**\n * A simple registry that maps `Components` to generated `ComponentFactory` classes\n * that can be used to create instances of components.\n * Use to obtain the factory for a given component type,\n * then use the factory's `create()` method to create a component of that type.\n *\n * Note: since v13, dynamic component creation via\n * [`ViewContainerRef.createComponent`](api/core/ViewContainerRef#createComponent)\n * does **not** require resolving component factory: component class can be used directly.\n *\n * @publicApi\n *\n * @deprecated Angular no longer requires Component factories. Please use other APIs where\n * Component class can be used directly.\n */\nclass ComponentFactoryResolver$1 {\n static { this.NULL = new _NullComponentFactoryResolver(); }\n}\n\n/**\n * Creates and initializes a custom renderer that implements the `Renderer2` base class.\n *\n * @publicApi\n */\nclass RendererFactory2 {\n}\n/**\n * Extend this base class to implement custom rendering. By default, Angular\n * renders a template into DOM. You can use custom rendering to intercept\n * rendering calls, or to render to something other than DOM.\n *\n * Create your custom renderer using `RendererFactory2`.\n *\n * Use a custom renderer to bypass Angular's templating and\n * make custom UI changes that can't be expressed declaratively.\n * For example if you need to set a property or an attribute whose name is\n * not statically known, use the `setProperty()` or\n * `setAttribute()` method.\n *\n * @publicApi\n */\nclass Renderer2 {\n constructor() {\n /**\n * If null or undefined, the view engine won't call it.\n * This is used as a performance optimization for production mode.\n */\n this.destroyNode = null;\n }\n /**\n * @internal\n * @nocollapse\n */\n static { this.__NG_ELEMENT_ID__ = () => injectRenderer2(); }\n}\n/** Injects a Renderer2 for the current component. */\nfunction injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];\n}\n\n/**\n * Sanitizer is used by the views to sanitize potentially dangerous values.\n *\n * @publicApi\n */\nclass Sanitizer {\n /** @nocollapse */\n static { this.ɵprov = ɵɵdefineInjectable({\n token: Sanitizer,\n providedIn: 'root',\n factory: () => null,\n }); }\n}\n\nfunction isModuleWithProviders(value) {\n return value.ngModule !== undefined;\n}\nfunction isNgModule(value) {\n return !!getNgModuleDef(value);\n}\nfunction isPipe(value) {\n return !!getPipeDef$1(value);\n}\nfunction isDirective(value) {\n return !!getDirectiveDef(value);\n}\nfunction isComponent(value) {\n return !!getComponentDef(value);\n}\nfunction getDependencyTypeForError(type) {\n if (getComponentDef(type))\n return 'component';\n if (getDirectiveDef(type))\n return 'directive';\n if (getPipeDef$1(type))\n return 'pipe';\n return 'type';\n}\nfunction verifyStandaloneImport(depType, importingType) {\n if (isForwardRef(depType)) {\n depType = resolveForwardRef(depType);\n if (!depType) {\n throw new Error(`Expected forwardRef function, imported from \"${stringifyForError(importingType)}\", to return a standalone entity or NgModule but got \"${stringifyForError(depType) || depType}\".`);\n }\n }\n if (getNgModuleDef(depType) == null) {\n const def = getComponentDef(depType) || getDirectiveDef(depType) || getPipeDef$1(depType);\n if (def != null) {\n // if a component, directive or pipe is imported make sure that it is standalone\n if (!def.standalone) {\n throw new Error(`The \"${stringifyForError(depType)}\" ${getDependencyTypeForError(depType)}, imported from \"${stringifyForError(importingType)}\", is not standalone. Did you forget to add the standalone: true flag?`);\n }\n }\n else {\n // it can be either a module with provider or an unknown (not annotated) type\n if (isModuleWithProviders(depType)) {\n throw new Error(`A module with providers was imported from \"${stringifyForError(importingType)}\". Modules with providers are not supported in standalone components imports.`);\n }\n else {\n throw new Error(`The \"${stringifyForError(depType)}\" type, imported from \"${stringifyForError(importingType)}\", must be a standalone component / directive / pipe or an NgModule. Did you forget to add the required @Component / @Directive / @Pipe or @NgModule annotation?`);\n }\n }\n }\n}\n\n/**\n * Indicates whether to use the runtime dependency tracker for scope calculation in JIT compilation.\n * The value \"false\" means the old code path based on patching scope info into the types will be\n * used.\n *\n * @deprecated For migration purposes only, to be removed soon.\n */\nconst USE_RUNTIME_DEPS_TRACKER_FOR_JIT = true;\n/**\n * An implementation of DepsTrackerApi which will be used for JIT and local compilation.\n */\nclass DepsTracker {\n constructor() {\n this.ownerNgModule = new Map();\n this.ngModulesWithSomeUnresolvedDecls = new Set();\n this.ngModulesScopeCache = new Map();\n this.standaloneComponentsScopeCache = new Map();\n }\n /**\n * Attempts to resolve ng module's forward ref declarations as much as possible and add them to\n * the `ownerNgModule` map. This method normally should be called after the initial parsing when\n * all the forward refs are resolved (e.g., when trying to render a component)\n */\n resolveNgModulesDecls() {\n if (this.ngModulesWithSomeUnresolvedDecls.size === 0) {\n return;\n }\n for (const moduleType of this.ngModulesWithSomeUnresolvedDecls) {\n const def = getNgModuleDef(moduleType);\n if (def?.declarations) {\n for (const decl of maybeUnwrapFn(def.declarations)) {\n if (isComponent(decl)) {\n this.ownerNgModule.set(decl, moduleType);\n }\n }\n }\n }\n this.ngModulesWithSomeUnresolvedDecls.clear();\n }\n /** @override */\n getComponentDependencies(type, rawImports) {\n this.resolveNgModulesDecls();\n const def = getComponentDef(type);\n if (def === null) {\n throw new Error(`Attempting to get component dependencies for a type that is not a component: ${type}`);\n }\n if (def.standalone) {\n const scope = this.getStandaloneComponentScope(type, rawImports);\n if (scope.compilation.isPoisoned) {\n return { dependencies: [] };\n }\n return {\n dependencies: [\n ...scope.compilation.directives,\n ...scope.compilation.pipes,\n ...scope.compilation.ngModules,\n ],\n };\n }\n else {\n if (!this.ownerNgModule.has(type)) {\n // This component is orphan! No need to handle the error since the component rendering\n // pipeline (e.g., view_container_ref) will check for this error based on configs.\n return { dependencies: [] };\n }\n const scope = this.getNgModuleScope(this.ownerNgModule.get(type));\n if (scope.compilation.isPoisoned) {\n return { dependencies: [] };\n }\n return {\n dependencies: [...scope.compilation.directives, ...scope.compilation.pipes],\n };\n }\n }\n /**\n * @override\n * This implementation does not make use of param scopeInfo since it assumes the scope info is\n * already added to the type itself through methods like {@link ɵɵsetNgModuleScope}\n */\n registerNgModule(type, scopeInfo) {\n if (!isNgModule(type)) {\n throw new Error(`Attempting to register a Type which is not NgModule as NgModule: ${type}`);\n }\n // Lazily process the NgModules later when needed.\n this.ngModulesWithSomeUnresolvedDecls.add(type);\n }\n /** @override */\n clearScopeCacheFor(type) {\n this.ngModulesScopeCache.delete(type);\n this.standaloneComponentsScopeCache.delete(type);\n }\n /** @override */\n getNgModuleScope(type) {\n if (this.ngModulesScopeCache.has(type)) {\n return this.ngModulesScopeCache.get(type);\n }\n const scope = this.computeNgModuleScope(type);\n this.ngModulesScopeCache.set(type, scope);\n return scope;\n }\n /** Compute NgModule scope afresh. */\n computeNgModuleScope(type) {\n const def = getNgModuleDef(type, true);\n const scope = {\n exported: { directives: new Set(), pipes: new Set() },\n compilation: { directives: new Set(), pipes: new Set() },\n };\n // Analyzing imports\n for (const imported of maybeUnwrapFn(def.imports)) {\n if (isNgModule(imported)) {\n const importedScope = this.getNgModuleScope(imported);\n // When this module imports another, the imported module's exported directives and pipes\n // are added to the compilation scope of this module.\n addSet(importedScope.exported.directives, scope.compilation.directives);\n addSet(importedScope.exported.pipes, scope.compilation.pipes);\n }\n else if (isStandalone(imported)) {\n if (isDirective(imported) || isComponent(imported)) {\n scope.compilation.directives.add(imported);\n }\n else if (isPipe(imported)) {\n scope.compilation.pipes.add(imported);\n }\n else {\n // The standalone thing is neither a component nor a directive nor a pipe ... (what?)\n throw new RuntimeError(1000 /* RuntimeErrorCode.RUNTIME_DEPS_INVALID_IMPORTED_TYPE */, 'The standalone imported type is neither a component nor a directive nor a pipe');\n }\n }\n else {\n // The import is neither a module nor a module-with-providers nor a standalone thing. This\n // is going to be an error. So we short circuit.\n scope.compilation.isPoisoned = true;\n break;\n }\n }\n // Analyzing declarations\n if (!scope.compilation.isPoisoned) {\n for (const decl of maybeUnwrapFn(def.declarations)) {\n // Cannot declare another NgModule or a standalone thing\n if (isNgModule(decl) || isStandalone(decl)) {\n scope.compilation.isPoisoned = true;\n break;\n }\n if (isPipe(decl)) {\n scope.compilation.pipes.add(decl);\n }\n else {\n // decl is either a directive or a component. The component may not yet have the ɵcmp due\n // to async compilation.\n scope.compilation.directives.add(decl);\n }\n }\n }\n // Analyzing exports\n for (const exported of maybeUnwrapFn(def.exports)) {\n if (isNgModule(exported)) {\n // When this module exports another, the exported module's exported directives and pipes\n // are added to both the compilation and exported scopes of this module.\n const exportedScope = this.getNgModuleScope(exported);\n // Based on the current logic there is no way to have poisoned exported scope. So no need to\n // check for it.\n addSet(exportedScope.exported.directives, scope.exported.directives);\n addSet(exportedScope.exported.pipes, scope.exported.pipes);\n // Some test toolings which run in JIT mode depend on this behavior that the exported scope\n // should also be present in the compilation scope, even though AoT does not support this\n // and it is also in odds with NgModule metadata definitions. Without this some tests in\n // Google will fail.\n addSet(exportedScope.exported.directives, scope.compilation.directives);\n addSet(exportedScope.exported.pipes, scope.compilation.pipes);\n }\n else if (isPipe(exported)) {\n scope.exported.pipes.add(exported);\n }\n else {\n scope.exported.directives.add(exported);\n }\n }\n return scope;\n }\n /** @override */\n getStandaloneComponentScope(type, rawImports) {\n if (this.standaloneComponentsScopeCache.has(type)) {\n return this.standaloneComponentsScopeCache.get(type);\n }\n const ans = this.computeStandaloneComponentScope(type, rawImports);\n this.standaloneComponentsScopeCache.set(type, ans);\n return ans;\n }\n computeStandaloneComponentScope(type, rawImports) {\n const ans = {\n compilation: {\n // Standalone components are always able to self-reference.\n directives: new Set([type]),\n pipes: new Set(),\n ngModules: new Set(),\n },\n };\n for (const rawImport of flatten(rawImports ?? [])) {\n const imported = resolveForwardRef(rawImport);\n try {\n verifyStandaloneImport(imported, type);\n }\n catch (e) {\n // Short-circuit if an import is not valid\n ans.compilation.isPoisoned = true;\n return ans;\n }\n if (isNgModule(imported)) {\n ans.compilation.ngModules.add(imported);\n const importedScope = this.getNgModuleScope(imported);\n // Short-circuit if an imported NgModule has corrupted exported scope.\n if (importedScope.exported.isPoisoned) {\n ans.compilation.isPoisoned = true;\n return ans;\n }\n addSet(importedScope.exported.directives, ans.compilation.directives);\n addSet(importedScope.exported.pipes, ans.compilation.pipes);\n }\n else if (isPipe(imported)) {\n ans.compilation.pipes.add(imported);\n }\n else if (isDirective(imported) || isComponent(imported)) {\n ans.compilation.directives.add(imported);\n }\n else {\n // The imported thing is not module/pipe/directive/component, so we error and short-circuit\n // here\n ans.compilation.isPoisoned = true;\n return ans;\n }\n }\n return ans;\n }\n /** @override */\n isOrphanComponent(cmp) {\n const def = getComponentDef(cmp);\n if (!def || def.standalone) {\n return false;\n }\n this.resolveNgModulesDecls();\n return !this.ownerNgModule.has(cmp);\n }\n}\nfunction addSet(sourceSet, targetSet) {\n for (const m of sourceSet) {\n targetSet.add(m);\n }\n}\n/** The deps tracker to be used in the current Angular app in dev mode. */\nconst depsTracker = new DepsTracker();\nconst TEST_ONLY = { DepsTracker };\n\n/**\n * Compute the static styling (class/style) from `TAttributes`.\n *\n * This function should be called during `firstCreatePass` only.\n *\n * @param tNode The `TNode` into which the styling information should be loaded.\n * @param attrs `TAttributes` containing the styling information.\n * @param writeToHost Where should the resulting static styles be written?\n * - `false` Write to `TNode.stylesWithoutHost` / `TNode.classesWithoutHost`\n * - `true` Write to `TNode.styles` / `TNode.classes`\n */\nfunction computeStaticStyling(tNode, attrs, writeToHost) {\n ngDevMode &&\n assertFirstCreatePass(getTView(), 'Expecting to be called in first template pass only');\n let styles = writeToHost ? tNode.styles : null;\n let classes = writeToHost ? tNode.classes : null;\n let mode = 0;\n if (attrs !== null) {\n for (let i = 0; i < attrs.length; i++) {\n const value = attrs[i];\n if (typeof value === 'number') {\n mode = value;\n }\n else if (mode == 1 /* AttributeMarker.Classes */) {\n classes = concatStringsWithSpace(classes, value);\n }\n else if (mode == 2 /* AttributeMarker.Styles */) {\n const style = value;\n const styleValue = attrs[++i];\n styles = concatStringsWithSpace(styles, style + ': ' + styleValue + ';');\n }\n }\n }\n writeToHost ? (tNode.styles = styles) : (tNode.stylesWithoutHost = styles);\n writeToHost ? (tNode.classes = classes) : (tNode.classesWithoutHost = classes);\n}\n\nclass ComponentFactoryResolver extends ComponentFactoryResolver$1 {\n /**\n * @param ngModule The NgModuleRef to which all resolved factories are bound.\n */\n constructor(ngModule) {\n super();\n this.ngModule = ngModule;\n }\n resolveComponentFactory(component) {\n ngDevMode && assertComponentType(component);\n const componentDef = getComponentDef(component);\n return new ComponentFactory(componentDef, this.ngModule);\n }\n}\nfunction toRefArray(map, isInputMap) {\n const array = [];\n for (const publicName in map) {\n if (!map.hasOwnProperty(publicName)) {\n continue;\n }\n const value = map[publicName];\n if (value === undefined) {\n continue;\n }\n const isArray = Array.isArray(value);\n const propName = isArray ? value[0] : value;\n const flags = isArray ? value[1] : InputFlags.None;\n if (isInputMap) {\n array.push({\n propName: propName,\n templateName: publicName,\n isSignal: (flags & InputFlags.SignalBased) !== 0,\n });\n }\n else {\n array.push({\n propName: propName,\n templateName: publicName,\n });\n }\n }\n return array;\n}\nfunction getNamespace(elementName) {\n const name = elementName.toLowerCase();\n return name === 'svg' ? SVG_NAMESPACE : name === 'math' ? MATH_ML_NAMESPACE : null;\n}\n/**\n * ComponentFactory interface implementation.\n */\nclass ComponentFactory extends ComponentFactory$1 {\n get inputs() {\n const componentDef = this.componentDef;\n const inputTransforms = componentDef.inputTransforms;\n const refArray = toRefArray(componentDef.inputs, true);\n if (inputTransforms !== null) {\n for (const input of refArray) {\n if (inputTransforms.hasOwnProperty(input.propName)) {\n input.transform = inputTransforms[input.propName];\n }\n }\n }\n return refArray;\n }\n get outputs() {\n return toRefArray(this.componentDef.outputs, false);\n }\n /**\n * @param componentDef The component definition.\n * @param ngModule The NgModuleRef to which the factory is bound.\n */\n constructor(componentDef, ngModule) {\n super();\n this.componentDef = componentDef;\n this.ngModule = ngModule;\n this.componentType = componentDef.type;\n this.selector = stringifyCSSSelectorList(componentDef.selectors);\n this.ngContentSelectors = componentDef.ngContentSelectors\n ? componentDef.ngContentSelectors\n : [];\n this.isBoundToModule = !!ngModule;\n }\n create(injector, projectableNodes, rootSelectorOrNode, environmentInjector) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n // Check if the component is orphan\n if (ngDevMode &&\n (typeof ngJitMode === 'undefined' || ngJitMode) &&\n this.componentDef.debugInfo?.forbidOrphanRendering) {\n if (depsTracker.isOrphanComponent(this.componentType)) {\n throw new RuntimeError(1001 /* RuntimeErrorCode.RUNTIME_DEPS_ORPHAN_COMPONENT */, `Orphan component found! Trying to render the component ${debugStringifyTypeForError(this.componentType)} without first loading the NgModule that declares it. It is recommended to make this component standalone in order to avoid this error. If this is not possible now, import the component's NgModule in the appropriate NgModule, or the standalone component in which you are trying to render this component. If this is a lazy import, load the NgModule lazily as well and use its module injector.`);\n }\n }\n environmentInjector = environmentInjector || this.ngModule;\n let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector\n ? environmentInjector\n : environmentInjector?.injector;\n if (realEnvironmentInjector && this.componentDef.getStandaloneInjector !== null) {\n realEnvironmentInjector =\n this.componentDef.getStandaloneInjector(realEnvironmentInjector) ||\n realEnvironmentInjector;\n }\n const rootViewInjector = realEnvironmentInjector\n ? new ChainedInjector(injector, realEnvironmentInjector)\n : injector;\n const rendererFactory = rootViewInjector.get(RendererFactory2, null);\n if (rendererFactory === null) {\n throw new RuntimeError(407 /* RuntimeErrorCode.RENDERER_NOT_FOUND */, ngDevMode &&\n 'Angular was not able to inject a renderer (RendererFactory2). ' +\n 'Likely this is due to a broken DI hierarchy. ' +\n 'Make sure that any injector used to create this component has a correct parent.');\n }\n const sanitizer = rootViewInjector.get(Sanitizer, null);\n const changeDetectionScheduler = rootViewInjector.get(ChangeDetectionScheduler, null);\n const environment = {\n rendererFactory,\n sanitizer,\n // We don't use inline effects (yet).\n inlineEffectRunner: null,\n changeDetectionScheduler,\n };\n const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);\n // Determine a tag name used for creating host elements when this component is created\n // dynamically. Default to 'div' if this component did not specify any tag name in its\n // selector.\n const elementName = this.componentDef.selectors[0][0] || 'div';\n const hostRNode = rootSelectorOrNode\n ? locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation, rootViewInjector)\n : createElementNode(hostRenderer, elementName, getNamespace(elementName));\n let rootFlags = 512 /* LViewFlags.IsRoot */;\n if (this.componentDef.signals) {\n rootFlags |= 4096 /* LViewFlags.SignalView */;\n }\n else if (!this.componentDef.onPush) {\n rootFlags |= 16 /* LViewFlags.CheckAlways */;\n }\n let hydrationInfo = null;\n if (hostRNode !== null) {\n hydrationInfo = retrieveHydrationInfo(hostRNode, rootViewInjector, true /* isRootView */);\n }\n // Create the root view. Uses empty TView and ContentTemplate.\n const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null, null);\n const rootLView = createLView(null, rootTView, null, rootFlags, null, null, environment, hostRenderer, rootViewInjector, null, hydrationInfo);\n // rootView is the parent when bootstrapping\n // TODO(misko): it looks like we are entering view here but we don't really need to as\n // `renderView` does that. However as the code is written it is needed because\n // `createRootComponentView` and `createRootComponent` both read global state. Fixing those\n // issues would allow us to drop this.\n enterView(rootLView);\n let component;\n let tElementNode;\n let componentView = null;\n try {\n const rootComponentDef = this.componentDef;\n let rootDirectives;\n let hostDirectiveDefs = null;\n if (rootComponentDef.findHostDirectiveDefs) {\n rootDirectives = [];\n hostDirectiveDefs = new Map();\n rootComponentDef.findHostDirectiveDefs(rootComponentDef, rootDirectives, hostDirectiveDefs);\n rootDirectives.push(rootComponentDef);\n ngDevMode && assertNoDuplicateDirectives(rootDirectives);\n }\n else {\n rootDirectives = [rootComponentDef];\n }\n const hostTNode = createRootComponentTNode(rootLView, hostRNode);\n componentView = createRootComponentView(hostTNode, hostRNode, rootComponentDef, rootDirectives, rootLView, environment, hostRenderer);\n tElementNode = getTNode(rootTView, HEADER_OFFSET);\n // TODO(crisbeto): in practice `hostRNode` should always be defined, but there are some\n // tests where the renderer is mocked out and `undefined` is returned. We should update the\n // tests so that this check can be removed.\n if (hostRNode) {\n setRootNodeAttributes(hostRenderer, rootComponentDef, hostRNode, rootSelectorOrNode);\n }\n if (projectableNodes !== undefined) {\n projectNodes(tElementNode, this.ngContentSelectors, projectableNodes);\n }\n // TODO: should LifecycleHooksFeature and other host features be generated by the compiler\n // and executed here? Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref\n component = createRootComponent(componentView, rootComponentDef, rootDirectives, hostDirectiveDefs, rootLView, [LifecycleHooksFeature]);\n renderView(rootTView, rootLView, null);\n }\n catch (e) {\n // Stop tracking the views if creation failed since\n // the consumer won't have a way to dereference them.\n if (componentView !== null) {\n unregisterLView(componentView);\n }\n unregisterLView(rootLView);\n throw e;\n }\n finally {\n leaveView();\n }\n return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n}\n/**\n * Represents an instance of a Component created via a {@link ComponentFactory}.\n *\n * `ComponentRef` provides access to the Component Instance as well other objects related to this\n * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}\n * method.\n *\n */\nclass ComponentRef extends ComponentRef$1 {\n constructor(componentType, instance, location, _rootLView, _tNode) {\n super();\n this.location = location;\n this._rootLView = _rootLView;\n this._tNode = _tNode;\n this.previousInputValues = null;\n this.instance = instance;\n this.hostView = this.changeDetectorRef = new ViewRef$1(_rootLView, undefined /* _cdRefInjectingView */, false /* notifyErrorHandler */);\n this.componentType = componentType;\n }\n setInput(name, value) {\n const inputData = this._tNode.inputs;\n let dataValue;\n if (inputData !== null && (dataValue = inputData[name])) {\n this.previousInputValues ??= new Map();\n // Do not set the input if it is the same as the last value\n // This behavior matches `bindingUpdated` when binding inputs in templates.\n if (this.previousInputValues.has(name) &&\n Object.is(this.previousInputValues.get(name), value)) {\n return;\n }\n const lView = this._rootLView;\n setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);\n this.previousInputValues.set(name, value);\n const childComponentLView = getComponentLViewByIndex(this._tNode.index, lView);\n markViewDirty(childComponentLView, 1 /* NotificationSource.SetInput */);\n }\n else {\n if (ngDevMode) {\n const cmpNameForError = stringifyForError(this.componentType);\n let message = `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;\n message += `Make sure that the '${name}' property is annotated with @Input() or a mapped @Input('${name}') exists.`;\n reportUnknownPropertyError(message);\n }\n }\n }\n get injector() {\n return new NodeInjector(this._tNode, this._rootLView);\n }\n destroy() {\n this.hostView.destroy();\n }\n onDestroy(callback) {\n this.hostView.onDestroy(callback);\n }\n}\n/** Creates a TNode that can be used to instantiate a root component. */\nfunction createRootComponentTNode(lView, rNode) {\n const tView = lView[TVIEW];\n const index = HEADER_OFFSET;\n ngDevMode && assertIndexInRange(lView, index);\n lView[index] = rNode;\n // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at\n // the same time we want to communicate the debug `TNode` that this is a special `TNode`\n // representing a host element.\n return getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);\n}\n/**\n * Creates the root component view and the root component node.\n *\n * @param hostRNode Render host element.\n * @param rootComponentDef ComponentDef\n * @param rootView The parent view where the host node is stored\n * @param rendererFactory Factory to be used for creating child renderers.\n * @param hostRenderer The current renderer\n * @param sanitizer The sanitizer, if provided\n *\n * @returns Component view created\n */\nfunction createRootComponentView(tNode, hostRNode, rootComponentDef, rootDirectives, rootView, environment, hostRenderer) {\n const tView = rootView[TVIEW];\n applyRootComponentStyling(rootDirectives, tNode, hostRNode, hostRenderer);\n // Hydration info is on the host element and needs to be retrieved\n // and passed to the component LView.\n let hydrationInfo = null;\n if (hostRNode !== null) {\n hydrationInfo = retrieveHydrationInfo(hostRNode, rootView[INJECTOR]);\n }\n const viewRenderer = environment.rendererFactory.createRenderer(hostRNode, rootComponentDef);\n let lViewFlags = 16 /* LViewFlags.CheckAlways */;\n if (rootComponentDef.signals) {\n lViewFlags = 4096 /* LViewFlags.SignalView */;\n }\n else if (rootComponentDef.onPush) {\n lViewFlags = 64 /* LViewFlags.Dirty */;\n }\n const componentView = createLView(rootView, getOrCreateComponentTView(rootComponentDef), null, lViewFlags, rootView[tNode.index], tNode, environment, viewRenderer, null, null, hydrationInfo);\n if (tView.firstCreatePass) {\n markAsComponentHost(tView, tNode, rootDirectives.length - 1);\n }\n addToViewTree(rootView, componentView);\n // Store component view at node index, with node as the HOST\n return (rootView[tNode.index] = componentView);\n}\n/** Sets up the styling information on a root component. */\nfunction applyRootComponentStyling(rootDirectives, tNode, rNode, hostRenderer) {\n for (const def of rootDirectives) {\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);\n }\n if (tNode.mergedAttrs !== null) {\n computeStaticStyling(tNode, tNode.mergedAttrs, true);\n if (rNode !== null) {\n setupStaticAttributes(hostRenderer, rNode, tNode);\n }\n }\n}\n/**\n * Creates a root component and sets it up with features and host bindings.Shared by\n * renderComponent() and ViewContainerRef.createComponent().\n */\nfunction createRootComponent(componentView, rootComponentDef, rootDirectives, hostDirectiveDefs, rootLView, hostFeatures) {\n const rootTNode = getCurrentTNode();\n ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');\n const tView = rootLView[TVIEW];\n const native = getNativeByTNode(rootTNode, rootLView);\n initializeDirectives(tView, rootLView, rootTNode, rootDirectives, null, hostDirectiveDefs);\n for (let i = 0; i < rootDirectives.length; i++) {\n const directiveIndex = rootTNode.directiveStart + i;\n const directiveInstance = getNodeInjectable(rootLView, tView, directiveIndex, rootTNode);\n attachPatchData(directiveInstance, rootLView);\n }\n invokeDirectivesHostBindings(tView, rootLView, rootTNode);\n if (native) {\n attachPatchData(native, rootLView);\n }\n // We're guaranteed for the `componentOffset` to be positive here\n // since a root component always matches a component def.\n ngDevMode &&\n assertGreaterThan(rootTNode.componentOffset, -1, 'componentOffset must be great than -1');\n const component = getNodeInjectable(rootLView, tView, rootTNode.directiveStart + rootTNode.componentOffset, rootTNode);\n componentView[CONTEXT] = rootLView[CONTEXT] = component;\n if (hostFeatures !== null) {\n for (const feature of hostFeatures) {\n feature(component, rootComponentDef);\n }\n }\n // We want to generate an empty QueryList for root content queries for backwards\n // compatibility with ViewEngine.\n executeContentQueries(tView, rootTNode, rootLView);\n return component;\n}\n/** Sets the static attributes on a root component. */\nfunction setRootNodeAttributes(hostRenderer, componentDef, hostRNode, rootSelectorOrNode) {\n if (rootSelectorOrNode) {\n // The placeholder will be replaced with the actual version at build time.\n setUpAttributes(hostRenderer, hostRNode, ['ng-version', '18.2.10']);\n }\n else {\n // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`\n // is not defined), also apply attributes and classes extracted from component selector.\n // Extract attributes and classes from the first selector only to match VE behavior.\n const { attrs, classes } = extractAttrsAndClassesFromSelector(componentDef.selectors[0]);\n if (attrs) {\n setUpAttributes(hostRenderer, hostRNode, attrs);\n }\n if (classes && classes.length > 0) {\n writeDirectClass(hostRenderer, hostRNode, classes.join(' '));\n }\n }\n}\n/** Projects the `projectableNodes` that were specified when creating a root component. */\nfunction projectNodes(tNode, ngContentSelectors, projectableNodes) {\n const projection = (tNode.projection = []);\n for (let i = 0; i < ngContentSelectors.length; i++) {\n const nodesforSlot = projectableNodes[i];\n // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade\n // case). Here we do normalize passed data structure to be an array of arrays to avoid\n // complex checks down the line.\n // We also normalize the length of the passed in projectable nodes (to match the number of\n // <ng-container> slots defined by a component).\n projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);\n }\n}\n/**\n * Used to enable lifecycle hooks on the root component.\n *\n * Include this feature when calling `renderComponent` if the root component\n * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't\n * be called properly.\n *\n * Example:\n *\n * ```\n * renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});\n * ```\n */\nfunction LifecycleHooksFeature() {\n const tNode = getCurrentTNode();\n ngDevMode && assertDefined(tNode, 'TNode is required');\n registerPostOrderHooks(getLView()[TVIEW], tNode);\n}\n\n/**\n * Represents a container where one or more views can be attached to a component.\n *\n * Can contain *host views* (created by instantiating a\n * component with the `createComponent()` method), and *embedded views*\n * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).\n *\n * A view container instance can contain other view containers,\n * creating a view hierarchy.\n *\n * @usageNotes\n *\n * The example below demonstrates how the `createComponent` function can be used\n * to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef,\n * so that it gets included into change detection cycles.\n *\n * Note: the example uses standalone components, but the function can also be used for\n * non-standalone components (declared in an NgModule) as well.\n *\n * ```typescript\n * @Component({\n * standalone: true,\n * selector: 'dynamic',\n * template: `<span>This is a content of a dynamic component.</span>`,\n * })\n * class DynamicComponent {\n * vcr = inject(ViewContainerRef);\n * }\n *\n * @Component({\n * standalone: true,\n * selector: 'app',\n * template: `<main>Hi! This is the main content.</main>`,\n * })\n * class AppComponent {\n * vcr = inject(ViewContainerRef);\n *\n * ngAfterViewInit() {\n * const compRef = this.vcr.createComponent(DynamicComponent);\n * compRef.changeDetectorRef.detectChanges();\n * }\n * }\n * ```\n *\n * @see {@link ComponentRef}\n * @see {@link EmbeddedViewRef}\n *\n * @publicApi\n */\nclass ViewContainerRef {\n /**\n * @internal\n * @nocollapse\n */\n static { this.__NG_ELEMENT_ID__ = injectViewContainerRef; }\n}\n/**\n * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef\n * already exists, retrieves the existing ViewContainerRef.\n *\n * @returns The ViewContainerRef instance to use\n */\nfunction injectViewContainerRef() {\n const previousTNode = getCurrentTNode();\n return createContainerRef(previousTNode, getLView());\n}\nconst VE_ViewContainerRef = ViewContainerRef;\n// TODO(alxhub): cleaning up this indirection triggers a subtle bug in Closure in g3. Once the fix\n// for that lands, this can be cleaned up.\nconst R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {\n constructor(_lContainer, _hostTNode, _hostLView) {\n super();\n this._lContainer = _lContainer;\n this._hostTNode = _hostTNode;\n this._hostLView = _hostLView;\n }\n get element() {\n return createElementRef(this._hostTNode, this._hostLView);\n }\n get injector() {\n return new NodeInjector(this._hostTNode, this._hostLView);\n }\n /** @deprecated No replacement */\n get parentInjector() {\n const parentLocation = getParentInjectorLocation(this._hostTNode, this._hostLView);\n if (hasParentInjector(parentLocation)) {\n const parentView = getParentInjectorView(parentLocation, this._hostLView);\n const injectorIndex = getParentInjectorIndex(parentLocation);\n ngDevMode && assertNodeInjector(parentView, injectorIndex);\n const parentTNode = parentView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];\n return new NodeInjector(parentTNode, parentView);\n }\n else {\n return new NodeInjector(null, this._hostLView);\n }\n }\n clear() {\n while (this.length > 0) {\n this.remove(this.length - 1);\n }\n }\n get(index) {\n const viewRefs = getViewRefs(this._lContainer);\n return (viewRefs !== null && viewRefs[index]) || null;\n }\n get length() {\n return this._lContainer.length - CONTAINER_HEADER_OFFSET;\n }\n createEmbeddedView(templateRef, context, indexOrOptions) {\n let index;\n let injector;\n if (typeof indexOrOptions === 'number') {\n index = indexOrOptions;\n }\n else if (indexOrOptions != null) {\n index = indexOrOptions.index;\n injector = indexOrOptions.injector;\n }\n const dehydratedView = findMatchingDehydratedView(this._lContainer, templateRef.ssrId);\n const viewRef = templateRef.createEmbeddedViewImpl(context || {}, injector, dehydratedView);\n this.insertImpl(viewRef, index, shouldAddViewToDom(this._hostTNode, dehydratedView));\n return viewRef;\n }\n createComponent(componentFactoryOrType, indexOrOptions, injector, projectableNodes, environmentInjector) {\n const isComponentFactory = componentFactoryOrType && !isType(componentFactoryOrType);\n let index;\n // This function supports 2 signatures and we need to handle options correctly for both:\n // 1. When first argument is a Component type. This signature also requires extra\n // options to be provided as object (more ergonomic option).\n // 2. First argument is a Component factory. In this case extra options are represented as\n // positional arguments. This signature is less ergonomic and will be deprecated.\n if (isComponentFactory) {\n if (ngDevMode) {\n assertEqual(typeof indexOrOptions !== 'object', true, 'It looks like Component factory was provided as the first argument ' +\n 'and an options object as the second argument. This combination of arguments ' +\n 'is incompatible. You can either change the first argument to provide Component ' +\n 'type or change the second argument to be a number (representing an index at ' +\n \"which to insert the new component's host view into this container)\");\n }\n index = indexOrOptions;\n }\n else {\n if (ngDevMode) {\n assertDefined(getComponentDef(componentFactoryOrType), `Provided Component class doesn't contain Component definition. ` +\n `Please check whether provided class has @Component decorator.`);\n assertEqual(typeof indexOrOptions !== 'number', true, 'It looks like Component type was provided as the first argument ' +\n \"and a number (representing an index at which to insert the new component's \" +\n 'host view into this container as the second argument. This combination of arguments ' +\n 'is incompatible. Please use an object as the second argument instead.');\n }\n const options = (indexOrOptions || {});\n if (ngDevMode && options.environmentInjector && options.ngModuleRef) {\n throwError(`Cannot pass both environmentInjector and ngModuleRef options to createComponent().`);\n }\n index = options.index;\n injector = options.injector;\n projectableNodes = options.projectableNodes;\n environmentInjector = options.environmentInjector || options.ngModuleRef;\n }\n const componentFactory = isComponentFactory\n ? componentFactoryOrType\n : new ComponentFactory(getComponentDef(componentFactoryOrType));\n const contextInjector = injector || this.parentInjector;\n // If an `NgModuleRef` is not provided explicitly, try retrieving it from the DI tree.\n if (!environmentInjector && componentFactory.ngModule == null) {\n // For the `ComponentFactory` case, entering this logic is very unlikely, since we expect that\n // an instance of a `ComponentFactory`, resolved via `ComponentFactoryResolver` would have an\n // `ngModule` field. This is possible in some test scenarios and potentially in some JIT-based\n // use-cases. For the `ComponentFactory` case we preserve backwards-compatibility and try\n // using a provided injector first, then fall back to the parent injector of this\n // `ViewContainerRef` instance.\n //\n // For the factory-less case, it's critical to establish a connection with the module\n // injector tree (by retrieving an instance of an `NgModuleRef` and accessing its injector),\n // so that a component can use DI tokens provided in MgModules. For this reason, we can not\n // rely on the provided injector, since it might be detached from the DI tree (for example, if\n // it was created via `Injector.create` without specifying a parent injector, or if an\n // injector is retrieved from an `NgModuleRef` created via `createNgModule` using an\n // NgModule outside of a module tree). Instead, we always use `ViewContainerRef`'s parent\n // injector, which is normally connected to the DI tree, which includes module injector\n // subtree.\n const _injector = isComponentFactory ? contextInjector : this.parentInjector;\n // DO NOT REFACTOR. The code here used to have a `injector.get(NgModuleRef, null) ||\n // undefined` expression which seems to cause internal google apps to fail. This is documented\n // in the following internal bug issue: go/b/142967802\n const result = _injector.get(EnvironmentInjector, null);\n if (result) {\n environmentInjector = result;\n }\n }\n const componentDef = getComponentDef(componentFactory.componentType ?? {});\n const dehydratedView = findMatchingDehydratedView(this._lContainer, componentDef?.id ?? null);\n const rNode = dehydratedView?.firstChild ?? null;\n const componentRef = componentFactory.create(contextInjector, projectableNodes, rNode, environmentInjector);\n this.insertImpl(componentRef.hostView, index, shouldAddViewToDom(this._hostTNode, dehydratedView));\n return componentRef;\n }\n insert(viewRef, index) {\n return this.insertImpl(viewRef, index, true);\n }\n insertImpl(viewRef, index, addToDOM) {\n const lView = viewRef._lView;\n if (ngDevMode && viewRef.destroyed) {\n throw new Error('Cannot insert a destroyed View in a ViewContainer!');\n }\n if (viewAttachedToContainer(lView)) {\n // If view is already attached, detach it first so we clean up references appropriately.\n const prevIdx = this.indexOf(viewRef);\n // A view might be attached either to this or a different container. The `prevIdx` for\n // those cases will be:\n // equal to -1 for views attached to this ViewContainerRef\n // >= 0 for views attached to a different ViewContainerRef\n if (prevIdx !== -1) {\n this.detach(prevIdx);\n }\n else {\n const prevLContainer = lView[PARENT];\n ngDevMode &&\n assertEqual(isLContainer(prevLContainer), true, 'An attached view should have its PARENT point to a container.');\n // We need to re-create a R3ViewContainerRef instance since those are not stored on\n // LView (nor anywhere else).\n const prevVCRef = new R3ViewContainerRef(prevLContainer, prevLContainer[T_HOST], prevLContainer[PARENT]);\n prevVCRef.detach(prevVCRef.indexOf(viewRef));\n }\n }\n // Logical operation of adding `LView` to `LContainer`\n const adjustedIdx = this._adjustIndex(index);\n const lContainer = this._lContainer;\n addLViewToLContainer(lContainer, lView, adjustedIdx, addToDOM);\n viewRef.attachToViewContainerRef();\n addToArray(getOrCreateViewRefs(lContainer), adjustedIdx, viewRef);\n return viewRef;\n }\n move(viewRef, newIndex) {\n if (ngDevMode && viewRef.destroyed) {\n throw new Error('Cannot move a destroyed View in a ViewContainer!');\n }\n return this.insert(viewRef, newIndex);\n }\n indexOf(viewRef) {\n const viewRefsArr = getViewRefs(this._lContainer);\n return viewRefsArr !== null ? viewRefsArr.indexOf(viewRef) : -1;\n }\n remove(index) {\n const adjustedIdx = this._adjustIndex(index, -1);\n const detachedView = detachView(this._lContainer, adjustedIdx);\n if (detachedView) {\n // Before destroying the view, remove it from the container's array of `ViewRef`s.\n // This ensures the view container length is updated before calling\n // `destroyLView`, which could recursively call view container methods that\n // rely on an accurate container length.\n // (e.g. a method on this view container being called by a child directive's OnDestroy\n // lifecycle hook)\n removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx);\n destroyLView(detachedView[TVIEW], detachedView);\n }\n }\n detach(index) {\n const adjustedIdx = this._adjustIndex(index, -1);\n const view = detachView(this._lContainer, adjustedIdx);\n const wasDetached = view && removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx) != null;\n return wasDetached ? new ViewRef$1(view) : null;\n }\n _adjustIndex(index, shift = 0) {\n if (index == null) {\n return this.length + shift;\n }\n if (ngDevMode) {\n assertGreaterThan(index, -1, `ViewRef index must be positive, got ${index}`);\n // +1 because it's legal to insert at the end.\n assertLessThan(index, this.length + 1 + shift, 'index');\n }\n return index;\n }\n};\nfunction getViewRefs(lContainer) {\n return lContainer[VIEW_REFS];\n}\nfunction getOrCreateViewRefs(lContainer) {\n return (lContainer[VIEW_REFS] || (lContainer[VIEW_REFS] = []));\n}\n/**\n * Creates a ViewContainerRef and stores it on the injector.\n *\n * @param hostTNode The node that is requesting a ViewContainerRef\n * @param hostLView The view to which the node belongs\n * @returns The ViewContainerRef instance to use\n */\nfunction createContainerRef(hostTNode, hostLView) {\n ngDevMode && assertTNodeType(hostTNode, 12 /* TNodeType.AnyContainer */ | 3 /* TNodeType.AnyRNode */);\n let lContainer;\n const slotValue = hostLView[hostTNode.index];\n if (isLContainer(slotValue)) {\n // If the host is a container, we don't need to create a new LContainer\n lContainer = slotValue;\n }\n else {\n // An LContainer anchor can not be `null`, but we set it here temporarily\n // and update to the actual value later in this function (see\n // `_locateOrCreateAnchorNode`).\n lContainer = createLContainer(slotValue, hostLView, null, hostTNode);\n hostLView[hostTNode.index] = lContainer;\n addToViewTree(hostLView, lContainer);\n }\n _locateOrCreateAnchorNode(lContainer, hostLView, hostTNode, slotValue);\n return new R3ViewContainerRef(lContainer, hostTNode, hostLView);\n}\n/**\n * Creates and inserts a comment node that acts as an anchor for a view container.\n *\n * If the host is a regular element, we have to insert a comment node manually which will\n * be used as an anchor when inserting elements. In this specific case we use low-level DOM\n * manipulation to insert it.\n */\nfunction insertAnchorNode(hostLView, hostTNode) {\n const renderer = hostLView[RENDERER];\n ngDevMode && ngDevMode.rendererCreateComment++;\n const commentNode = renderer.createComment(ngDevMode ? 'container' : '');\n const hostNative = getNativeByTNode(hostTNode, hostLView);\n const parentOfHostNative = nativeParentNode(renderer, hostNative);\n nativeInsertBefore(renderer, parentOfHostNative, commentNode, nativeNextSibling(renderer, hostNative), false);\n return commentNode;\n}\nlet _locateOrCreateAnchorNode = createAnchorNode;\nlet _populateDehydratedViewsInLContainer = () => false; // noop by default\n/**\n * Looks up dehydrated views that belong to a given LContainer and populates\n * this information into the `LContainer[DEHYDRATED_VIEWS]` slot. When running\n * in client-only mode, this function is a noop.\n *\n * @param lContainer LContainer that should be populated.\n * @param tNode Corresponding TNode.\n * @param hostLView LView that hosts LContainer.\n * @returns a boolean flag that indicates whether a populating operation\n * was successful. The operation might be unsuccessful in case is has completed\n * previously, we are rendering in client-only mode or this content is located\n * in a skip hydration section.\n */\nfunction populateDehydratedViewsInLContainer(lContainer, tNode, hostLView) {\n return _populateDehydratedViewsInLContainer(lContainer, tNode, hostLView);\n}\n/**\n * Regular creation mode: an anchor is created and\n * assigned to the `lContainer[NATIVE]` slot.\n */\nfunction createAnchorNode(lContainer, hostLView, hostTNode, slotValue) {\n // We already have a native element (anchor) set, return.\n if (lContainer[NATIVE])\n return;\n let commentNode;\n // If the host is an element container, the native host element is guaranteed to be a\n // comment and we can reuse that comment as anchor element for the new LContainer.\n // The comment node in question is already part of the DOM structure so we don't need to append\n // it again.\n if (hostTNode.type & 8 /* TNodeType.ElementContainer */) {\n commentNode = unwrapRNode(slotValue);\n }\n else {\n commentNode = insertAnchorNode(hostLView, hostTNode);\n }\n lContainer[NATIVE] = commentNode;\n}\n/**\n * Hydration logic that looks up all dehydrated views in this container\n * and puts them into `lContainer[DEHYDRATED_VIEWS]` slot.\n *\n * @returns a boolean flag that indicates whether a populating operation\n * was successful. The operation might be unsuccessful in case is has completed\n * previously, we are rendering in client-only mode or this content is located\n * in a skip hydration section.\n */\nfunction populateDehydratedViewsInLContainerImpl(lContainer, tNode, hostLView) {\n // We already have a native element (anchor) set and the process\n // of finding dehydrated views happened (so the `lContainer[DEHYDRATED_VIEWS]`\n // is not null), exit early.\n if (lContainer[NATIVE] && lContainer[DEHYDRATED_VIEWS]) {\n return true;\n }\n const hydrationInfo = hostLView[HYDRATION];\n const noOffsetIndex = tNode.index - HEADER_OFFSET;\n const isNodeCreationMode = !hydrationInfo ||\n isInSkipHydrationBlock(tNode) ||\n isDisconnectedNode$1(hydrationInfo, noOffsetIndex);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return false;\n }\n // Hydration mode, looking up an anchor node and dehydrated views in DOM.\n const currentRNode = getSegmentHead(hydrationInfo, noOffsetIndex);\n const serializedViews = hydrationInfo.data[CONTAINERS]?.[noOffsetIndex];\n ngDevMode &&\n assertDefined(serializedViews, 'Unexpected state: no hydration info available for a given TNode, ' +\n 'which represents a view container.');\n const [commentNode, dehydratedViews] = locateDehydratedViewsInContainer(currentRNode, serializedViews);\n if (ngDevMode) {\n validateMatchingNode(commentNode, Node.COMMENT_NODE, null, hostLView, tNode, true);\n // Do not throw in case this node is already claimed (thus `false` as a second\n // argument). If this container is created based on an `<ng-template>`, the comment\n // node would be already claimed from the `template` instruction. If an element acts\n // as an anchor (e.g. <div #vcRef>), a separate comment node would be created/located,\n // so we need to claim it here.\n markRNodeAsClaimedByHydration(commentNode, false);\n }\n lContainer[NATIVE] = commentNode;\n lContainer[DEHYDRATED_VIEWS] = dehydratedViews;\n return true;\n}\nfunction locateOrCreateAnchorNode(lContainer, hostLView, hostTNode, slotValue) {\n if (!_populateDehydratedViewsInLContainer(lContainer, hostTNode, hostLView)) {\n // Populating dehydrated views operation returned `false`, which indicates\n // that the logic was running in client-only mode, this an anchor comment\n // node should be created for this container.\n createAnchorNode(lContainer, hostLView, hostTNode, slotValue);\n }\n}\nfunction enableLocateOrCreateContainerRefImpl() {\n _locateOrCreateAnchorNode = locateOrCreateAnchorNode;\n _populateDehydratedViewsInLContainer = populateDehydratedViewsInLContainerImpl;\n}\n\nclass LQuery_ {\n constructor(queryList) {\n this.queryList = queryList;\n this.matches = null;\n }\n clone() {\n return new LQuery_(this.queryList);\n }\n setDirty() {\n this.queryList.setDirty();\n }\n}\nclass LQueries_ {\n constructor(queries = []) {\n this.queries = queries;\n }\n createEmbeddedView(tView) {\n const tQueries = tView.queries;\n if (tQueries !== null) {\n const noOfInheritedQueries = tView.contentQueries !== null ? tView.contentQueries[0] : tQueries.length;\n const viewLQueries = [];\n // An embedded view has queries propagated from a declaration view at the beginning of the\n // TQueries collection and up until a first content query declared in the embedded view. Only\n // propagated LQueries are created at this point (LQuery corresponding to declared content\n // queries will be instantiated from the content query instructions for each directive).\n for (let i = 0; i < noOfInheritedQueries; i++) {\n const tQuery = tQueries.getByIndex(i);\n const parentLQuery = this.queries[tQuery.indexInDeclarationView];\n viewLQueries.push(parentLQuery.clone());\n }\n return new LQueries_(viewLQueries);\n }\n return null;\n }\n insertView(tView) {\n this.dirtyQueriesWithMatches(tView);\n }\n detachView(tView) {\n this.dirtyQueriesWithMatches(tView);\n }\n finishViewCreation(tView) {\n this.dirtyQueriesWithMatches(tView);\n }\n dirtyQueriesWithMatches(tView) {\n for (let i = 0; i < this.queries.length; i++) {\n if (getTQuery(tView, i).matches !== null) {\n this.queries[i].setDirty();\n }\n }\n }\n}\nclass TQueryMetadata_ {\n constructor(predicate, flags, read = null) {\n this.flags = flags;\n this.read = read;\n // Compiler might not be able to pre-optimize and split multiple selectors.\n if (typeof predicate === 'string') {\n this.predicate = splitQueryMultiSelectors(predicate);\n }\n else {\n this.predicate = predicate;\n }\n }\n}\nclass TQueries_ {\n constructor(queries = []) {\n this.queries = queries;\n }\n elementStart(tView, tNode) {\n ngDevMode &&\n assertFirstCreatePass(tView, 'Queries should collect results on the first template pass only');\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].elementStart(tView, tNode);\n }\n }\n elementEnd(tNode) {\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].elementEnd(tNode);\n }\n }\n embeddedTView(tNode) {\n let queriesForTemplateRef = null;\n for (let i = 0; i < this.length; i++) {\n const childQueryIndex = queriesForTemplateRef !== null ? queriesForTemplateRef.length : 0;\n const tqueryClone = this.getByIndex(i).embeddedTView(tNode, childQueryIndex);\n if (tqueryClone) {\n tqueryClone.indexInDeclarationView = i;\n if (queriesForTemplateRef !== null) {\n queriesForTemplateRef.push(tqueryClone);\n }\n else {\n queriesForTemplateRef = [tqueryClone];\n }\n }\n }\n return queriesForTemplateRef !== null ? new TQueries_(queriesForTemplateRef) : null;\n }\n template(tView, tNode) {\n ngDevMode &&\n assertFirstCreatePass(tView, 'Queries should collect results on the first template pass only');\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].template(tView, tNode);\n }\n }\n getByIndex(index) {\n ngDevMode && assertIndexInRange(this.queries, index);\n return this.queries[index];\n }\n get length() {\n return this.queries.length;\n }\n track(tquery) {\n this.queries.push(tquery);\n }\n}\nclass TQuery_ {\n constructor(metadata, nodeIndex = -1) {\n this.metadata = metadata;\n this.matches = null;\n this.indexInDeclarationView = -1;\n this.crossesNgTemplate = false;\n /**\n * A flag indicating if a given query still applies to nodes it is crossing. We use this flag\n * (alongside with _declarationNodeIndex) to know when to stop applying content queries to\n * elements in a template.\n */\n this._appliesToNextNode = true;\n this._declarationNodeIndex = nodeIndex;\n }\n elementStart(tView, tNode) {\n if (this.isApplyingToNode(tNode)) {\n this.matchTNode(tView, tNode);\n }\n }\n elementEnd(tNode) {\n if (this._declarationNodeIndex === tNode.index) {\n this._appliesToNextNode = false;\n }\n }\n template(tView, tNode) {\n this.elementStart(tView, tNode);\n }\n embeddedTView(tNode, childQueryIndex) {\n if (this.isApplyingToNode(tNode)) {\n this.crossesNgTemplate = true;\n // A marker indicating a `<ng-template>` element (a placeholder for query results from\n // embedded views created based on this `<ng-template>`).\n this.addMatch(-tNode.index, childQueryIndex);\n return new TQuery_(this.metadata);\n }\n return null;\n }\n isApplyingToNode(tNode) {\n if (this._appliesToNextNode &&\n (this.metadata.flags & 1 /* QueryFlags.descendants */) !== 1 /* QueryFlags.descendants */) {\n const declarationNodeIdx = this._declarationNodeIndex;\n let parent = tNode.parent;\n // Determine if a given TNode is a \"direct\" child of a node on which a content query was\n // declared (only direct children of query's host node can match with the descendants: false\n // option). There are 3 main use-case / conditions to consider here:\n // - <needs-target><i #target></i></needs-target>: here <i #target> parent node is a query\n // host node;\n // - <needs-target><ng-template [ngIf]=\"true\"><i #target></i></ng-template></needs-target>:\n // here <i #target> parent node is null;\n // - <needs-target><ng-container><i #target></i></ng-container></needs-target>: here we need\n // to go past `<ng-container>` to determine <i #target> parent node (but we shouldn't traverse\n // up past the query's host node!).\n while (parent !== null &&\n parent.type & 8 /* TNodeType.ElementContainer */ &&\n parent.index !== declarationNodeIdx) {\n parent = parent.parent;\n }\n return declarationNodeIdx === (parent !== null ? parent.index : -1);\n }\n return this._appliesToNextNode;\n }\n matchTNode(tView, tNode) {\n const predicate = this.metadata.predicate;\n if (Array.isArray(predicate)) {\n for (let i = 0; i < predicate.length; i++) {\n const name = predicate[i];\n this.matchTNodeWithReadOption(tView, tNode, getIdxOfMatchingSelector(tNode, name));\n // Also try matching the name to a provider since strings can be used as DI tokens too.\n this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, name, false, false));\n }\n }\n else {\n if (predicate === TemplateRef) {\n if (tNode.type & 4 /* TNodeType.Container */) {\n this.matchTNodeWithReadOption(tView, tNode, -1);\n }\n }\n else {\n this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, predicate, false, false));\n }\n }\n }\n matchTNodeWithReadOption(tView, tNode, nodeMatchIdx) {\n if (nodeMatchIdx !== null) {\n const read = this.metadata.read;\n if (read !== null) {\n if (read === ElementRef ||\n read === ViewContainerRef ||\n (read === TemplateRef && tNode.type & 4 /* TNodeType.Container */)) {\n this.addMatch(tNode.index, -2);\n }\n else {\n const directiveOrProviderIdx = locateDirectiveOrProvider(tNode, tView, read, false, false);\n if (directiveOrProviderIdx !== null) {\n this.addMatch(tNode.index, directiveOrProviderIdx);\n }\n }\n }\n else {\n this.addMatch(tNode.index, nodeMatchIdx);\n }\n }\n }\n addMatch(tNodeIdx, matchIdx) {\n if (this.matches === null) {\n this.matches = [tNodeIdx, matchIdx];\n }\n else {\n this.matches.push(tNodeIdx, matchIdx);\n }\n }\n}\n/**\n * Iterates over local names for a given node and returns directive index\n * (or -1 if a local name points to an element).\n *\n * @param tNode static data of a node to check\n * @param selector selector to match\n * @returns directive index, -1 or null if a selector didn't match any of the local names\n */\nfunction getIdxOfMatchingSelector(tNode, selector) {\n const localNames = tNode.localNames;\n if (localNames !== null) {\n for (let i = 0; i < localNames.length; i += 2) {\n if (localNames[i] === selector) {\n return localNames[i + 1];\n }\n }\n }\n return null;\n}\nfunction createResultByTNodeType(tNode, currentView) {\n if (tNode.type & (3 /* TNodeType.AnyRNode */ | 8 /* TNodeType.ElementContainer */)) {\n return createElementRef(tNode, currentView);\n }\n else if (tNode.type & 4 /* TNodeType.Container */) {\n return createTemplateRef(tNode, currentView);\n }\n return null;\n}\nfunction createResultForNode(lView, tNode, matchingIdx, read) {\n if (matchingIdx === -1) {\n // if read token and / or strategy is not specified, detect it using appropriate tNode type\n return createResultByTNodeType(tNode, lView);\n }\n else if (matchingIdx === -2) {\n // read a special token from a node injector\n return createSpecialToken(lView, tNode, read);\n }\n else {\n // read a token\n return getNodeInjectable(lView, lView[TVIEW], matchingIdx, tNode);\n }\n}\nfunction createSpecialToken(lView, tNode, read) {\n if (read === ElementRef) {\n return createElementRef(tNode, lView);\n }\n else if (read === TemplateRef) {\n return createTemplateRef(tNode, lView);\n }\n else if (read === ViewContainerRef) {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);\n return createContainerRef(tNode, lView);\n }\n else {\n ngDevMode &&\n throwError(`Special token to read should be one of ElementRef, TemplateRef or ViewContainerRef but got ${stringify(read)}.`);\n }\n}\n/**\n * A helper function that creates query results for a given view. This function is meant to do the\n * processing once and only once for a given view instance (a set of results for a given view\n * doesn't change).\n */\nfunction materializeViewResults(tView, lView, tQuery, queryIndex) {\n const lQuery = lView[QUERIES].queries[queryIndex];\n if (lQuery.matches === null) {\n const tViewData = tView.data;\n const tQueryMatches = tQuery.matches;\n const result = [];\n for (let i = 0; tQueryMatches !== null && i < tQueryMatches.length; i += 2) {\n const matchedNodeIdx = tQueryMatches[i];\n if (matchedNodeIdx < 0) {\n // we at the <ng-template> marker which might have results in views created based on this\n // <ng-template> - those results will be in separate views though, so here we just leave\n // null as a placeholder\n result.push(null);\n }\n else {\n ngDevMode && assertIndexInRange(tViewData, matchedNodeIdx);\n const tNode = tViewData[matchedNodeIdx];\n result.push(createResultForNode(lView, tNode, tQueryMatches[i + 1], tQuery.metadata.read));\n }\n }\n lQuery.matches = result;\n }\n return lQuery.matches;\n}\n/**\n * A helper function that collects (already materialized) query results from a tree of views,\n * starting with a provided LView.\n */\nfunction collectQueryResults(tView, lView, queryIndex, result) {\n const tQuery = tView.queries.getByIndex(queryIndex);\n const tQueryMatches = tQuery.matches;\n if (tQueryMatches !== null) {\n const lViewResults = materializeViewResults(tView, lView, tQuery, queryIndex);\n for (let i = 0; i < tQueryMatches.length; i += 2) {\n const tNodeIdx = tQueryMatches[i];\n if (tNodeIdx > 0) {\n result.push(lViewResults[i / 2]);\n }\n else {\n const childQueryIndex = tQueryMatches[i + 1];\n const declarationLContainer = lView[-tNodeIdx];\n ngDevMode && assertLContainer(declarationLContainer);\n // collect matches for views inserted in this container\n for (let i = CONTAINER_HEADER_OFFSET; i < declarationLContainer.length; i++) {\n const embeddedLView = declarationLContainer[i];\n if (embeddedLView[DECLARATION_LCONTAINER] === embeddedLView[PARENT]) {\n collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);\n }\n }\n // collect matches for views created from this declaration container and inserted into\n // different containers\n if (declarationLContainer[MOVED_VIEWS] !== null) {\n const embeddedLViews = declarationLContainer[MOVED_VIEWS];\n for (let i = 0; i < embeddedLViews.length; i++) {\n const embeddedLView = embeddedLViews[i];\n collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);\n }\n }\n }\n }\n }\n return result;\n}\nfunction loadQueryInternal(lView, queryIndex) {\n ngDevMode &&\n assertDefined(lView[QUERIES], 'LQueries should be defined when trying to load a query');\n ngDevMode && assertIndexInRange(lView[QUERIES].queries, queryIndex);\n return lView[QUERIES].queries[queryIndex].queryList;\n}\n/**\n * Creates a new instance of LQuery and returns its index in the collection of LQuery objects.\n *\n * @returns index in the collection of LQuery objects\n */\nfunction createLQuery(tView, lView, flags) {\n const queryList = new QueryList((flags & 4 /* QueryFlags.emitDistinctChangesOnly */) === 4 /* QueryFlags.emitDistinctChangesOnly */);\n storeCleanupWithContext(tView, lView, queryList, queryList.destroy);\n const lQueries = (lView[QUERIES] ??= new LQueries_()).queries;\n return lQueries.push(new LQuery_(queryList)) - 1;\n}\nfunction createViewQuery(predicate, flags, read) {\n ngDevMode && assertNumber(flags, 'Expecting flags');\n const tView = getTView();\n if (tView.firstCreatePass) {\n createTQuery(tView, new TQueryMetadata_(predicate, flags, read), -1);\n if ((flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */) {\n tView.staticViewQueries = true;\n }\n }\n return createLQuery(tView, getLView(), flags);\n}\nfunction createContentQuery(directiveIndex, predicate, flags, read) {\n ngDevMode && assertNumber(flags, 'Expecting flags');\n const tView = getTView();\n if (tView.firstCreatePass) {\n const tNode = getCurrentTNode();\n createTQuery(tView, new TQueryMetadata_(predicate, flags, read), tNode.index);\n saveContentQueryAndDirectiveIndex(tView, directiveIndex);\n if ((flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */) {\n tView.staticContentQueries = true;\n }\n }\n return createLQuery(tView, getLView(), flags);\n}\n/** Splits multiple selectors in the locator. */\nfunction splitQueryMultiSelectors(locator) {\n return locator.split(',').map((s) => s.trim());\n}\nfunction createTQuery(tView, metadata, nodeIndex) {\n if (tView.queries === null)\n tView.queries = new TQueries_();\n tView.queries.track(new TQuery_(metadata, nodeIndex));\n}\nfunction saveContentQueryAndDirectiveIndex(tView, directiveIndex) {\n const tViewContentQueries = tView.contentQueries || (tView.contentQueries = []);\n const lastSavedDirectiveIndex = tViewContentQueries.length\n ? tViewContentQueries[tViewContentQueries.length - 1]\n : -1;\n if (directiveIndex !== lastSavedDirectiveIndex) {\n tViewContentQueries.push(tView.queries.length - 1, directiveIndex);\n }\n}\nfunction getTQuery(tView, index) {\n ngDevMode && assertDefined(tView.queries, 'TQueries must be defined to retrieve a TQuery');\n return tView.queries.getByIndex(index);\n}\n/**\n * A helper function collecting results from all the views where a given query was active.\n * @param lView\n * @param queryIndex\n */\nfunction getQueryResults(lView, queryIndex) {\n const tView = lView[TVIEW];\n const tQuery = getTQuery(tView, queryIndex);\n return tQuery.crossesNgTemplate\n ? collectQueryResults(tView, lView, queryIndex, [])\n : materializeViewResults(tView, lView, tQuery, queryIndex);\n}\n\nconst markedFeatures = new Set();\n// tslint:disable:ban\n/**\n * A guarded `performance.mark` for feature marking.\n *\n * This method exists because while all supported browser and node.js version supported by Angular\n * support performance.mark API. This is not the case for other environments such as JSDOM and\n * Cloudflare workers.\n */\nfunction performanceMarkFeature(feature) {\n if (markedFeatures.has(feature)) {\n return;\n }\n markedFeatures.add(feature);\n performance?.mark?.('mark_feature_usage', { detail: { feature } });\n}\n\n/**\n * Checks if the given `value` is a reactive `Signal`.\n */\nfunction isSignal(value) {\n return typeof value === 'function' && value[SIGNAL$1] !== undefined;\n}\n\n/** Symbol used distinguish `WritableSignal` from other non-writable signals and functions. */\nconst ɵWRITABLE_SIGNAL = /* @__PURE__ */ Symbol('WRITABLE_SIGNAL');\n/**\n * Utility function used during template type checking to extract the value from a `WritableSignal`.\n * @codeGenApi\n */\nfunction ɵunwrapWritableSignal(value) {\n // Note: the function uses `WRITABLE_SIGNAL` as a brand instead of `WritableSignal<T>`,\n // because the latter incorrectly unwraps non-signal getter functions.\n return null;\n}\n/**\n * Create a `Signal` that can be set or updated directly.\n */\nfunction signal(initialValue, options) {\n performanceMarkFeature('NgSignals');\n const signalFn = createSignal$1(initialValue);\n const node = signalFn[SIGNAL$1];\n if (options?.equal) {\n node.equal = options.equal;\n }\n signalFn.set = (newValue) => signalSetFn$1(node, newValue);\n signalFn.update = (updateFn) => signalUpdateFn$1(node, updateFn);\n signalFn.asReadonly = signalAsReadonlyFn.bind(signalFn);\n if (ngDevMode) {\n signalFn.toString = () => `[Signal: ${signalFn()}]`;\n }\n return signalFn;\n}\nfunction signalAsReadonlyFn() {\n const node = this[SIGNAL$1];\n if (node.readonlyFn === undefined) {\n const readonlyFn = () => this();\n readonlyFn[SIGNAL$1] = node;\n node.readonlyFn = readonlyFn;\n }\n return node.readonlyFn;\n}\n/**\n * Checks if the given `value` is a writeable signal.\n */\nfunction isWritableSignal(value) {\n return isSignal(value) && typeof value.set === 'function';\n}\n\n/**\n * A signal factory function in charge of creating a new computed signal capturing query\n * results. This centralized creation function is used by all types of queries (child / children,\n * required / optional).\n *\n * @param firstOnly indicates if all or only the first result should be returned\n * @param required indicates if at least one result is required\n * @returns a read-only signal with query results\n */\nfunction createQuerySignalFn(firstOnly, required) {\n let node;\n const signalFn = createComputed$1(() => {\n // A dedicated signal that increments its value every time a query changes its dirty status. By\n // using this signal we can implement a query as computed and avoid creation of a specialized\n // reactive node type. Please note that a query gets marked dirty under the following\n // circumstances:\n // - a view (where a query is active) finished its first creation pass;\n // - a new view is inserted / deleted and it impacts query results.\n node._dirtyCounter();\n const value = refreshSignalQuery(node, firstOnly);\n if (required && value === undefined) {\n throw new RuntimeError(-951 /* RuntimeErrorCode.REQUIRED_QUERY_NO_VALUE */, ngDevMode && 'Child query result is required but no value is available.');\n }\n return value;\n });\n node = signalFn[SIGNAL$1];\n node._dirtyCounter = signal(0);\n node._flatValue = undefined;\n if (ngDevMode) {\n signalFn.toString = () => `[Query Signal]`;\n }\n return signalFn;\n}\nfunction createSingleResultOptionalQuerySignalFn() {\n return createQuerySignalFn(/* firstOnly */ true, /* required */ false);\n}\nfunction createSingleResultRequiredQuerySignalFn() {\n return createQuerySignalFn(/* firstOnly */ true, /* required */ true);\n}\nfunction createMultiResultQuerySignalFn() {\n return createQuerySignalFn(/* firstOnly */ false, /* required */ false);\n}\nfunction bindQueryToSignal(target, queryIndex) {\n const node = target[SIGNAL$1];\n node._lView = getLView();\n node._queryIndex = queryIndex;\n node._queryList = loadQueryInternal(node._lView, queryIndex);\n node._queryList.onDirty(() => node._dirtyCounter.update((v) => v + 1));\n}\nfunction refreshSignalQuery(node, firstOnly) {\n const lView = node._lView;\n const queryIndex = node._queryIndex;\n // There are 2 conditions under which we want to return \"empty\" results instead of the ones\n // collected by a query:\n //\n // 1) a given query wasn't created yet (this is a period of time between the directive creation\n // and execution of the query creation function) - in this case a query doesn't exist yet and we\n // don't have any results to return.\n //\n // 2) we are in the process of constructing a view (the first\n // creation pass didn't finish) and a query might have partial results, but we don't want to\n // return those - instead we do delay results collection until all nodes had a chance of matching\n // and we can present consistent, \"atomic\" (on a view level) results.\n if (lView === undefined || queryIndex === undefined || lView[FLAGS] & 4 /* LViewFlags.CreationMode */) {\n return (firstOnly ? undefined : EMPTY_ARRAY);\n }\n const queryList = loadQueryInternal(lView, queryIndex);\n const results = getQueryResults(lView, queryIndex);\n queryList.reset(results, unwrapElementRef);\n if (firstOnly) {\n return queryList.first;\n }\n else {\n // TODO: remove access to the private _changesDetected field by abstracting / removing usage of\n // QueryList in the signal-based queries (perf follow-up)\n const resultChanged = queryList._changesDetected;\n if (resultChanged || node._flatValue === undefined) {\n return (node._flatValue = queryList.toArray());\n }\n return node._flatValue;\n }\n}\n\nfunction viewChildFn(locator, opts) {\n ngDevMode && assertInInjectionContext(viewChild);\n return createSingleResultOptionalQuerySignalFn();\n}\nfunction viewChildRequiredFn(locator, opts) {\n ngDevMode && assertInInjectionContext(viewChild);\n return createSingleResultRequiredQuerySignalFn();\n}\n/**\n * Initializes a view child query.\n *\n * Consider using `viewChild.required` for queries that should always match.\n *\n * @usageNotes\n * Create a child query in your component by declaring a\n * class field and initializing it with the `viewChild()` function.\n *\n * ```ts\n * @Component({template: '<div #el></div><my-component #cmp />'})\n * export class TestComponent {\n * divEl = viewChild<ElementRef>('el'); // Signal<ElementRef|undefined>\n * divElRequired = viewChild.required<ElementRef>('el'); // Signal<ElementRef>\n * cmp = viewChild(MyComponent); // Signal<MyComponent|undefined>\n * cmpRequired = viewChild.required(MyComponent); // Signal<MyComponent>\n * }\n * ```\n *\n * @developerPreview\n * @initializerApiFunction\n */\nconst viewChild = (() => {\n // Note: This may be considered a side-effect, but nothing will depend on\n // this assignment, unless this `viewChild` constant export is accessed. It's a\n // self-contained side effect that is local to the user facing `viewChild` export.\n viewChildFn.required = viewChildRequiredFn;\n return viewChildFn;\n})();\n/**\n * Initializes a view children query.\n *\n * Query results are represented as a signal of a read-only collection containing all matched\n * elements.\n *\n * @usageNotes\n * Create a children query in your component by declaring a\n * class field and initializing it with the `viewChildren()` function.\n *\n * ```ts\n * @Component({...})\n * export class TestComponent {\n * divEls = viewChildren<ElementRef>('el'); // Signal<ReadonlyArray<ElementRef>>\n * }\n * ```\n *\n * @initializerApiFunction\n * @developerPreview\n */\nfunction viewChildren(locator, opts) {\n ngDevMode && assertInInjectionContext(viewChildren);\n return createMultiResultQuerySignalFn();\n}\nfunction contentChildFn(locator, opts) {\n ngDevMode && assertInInjectionContext(contentChild);\n return createSingleResultOptionalQuerySignalFn();\n}\nfunction contentChildRequiredFn(locator, opts) {\n ngDevMode && assertInInjectionContext(contentChildren);\n return createSingleResultRequiredQuerySignalFn();\n}\n/**\n * Initializes a content child query. Consider using `contentChild.required` for queries that should\n * always match.\n *\n * @usageNotes\n * Create a child query in your component by declaring a\n * class field and initializing it with the `contentChild()` function.\n *\n * ```ts\n * @Component({...})\n * export class TestComponent {\n * headerEl = contentChild<ElementRef>('h'); // Signal<ElementRef|undefined>\n * headerElElRequired = contentChild.required<ElementRef>('h'); // Signal<ElementRef>\n * header = contentChild(MyHeader); // Signal<MyHeader|undefined>\n * headerRequired = contentChild.required(MyHeader); // Signal<MyHeader>\n * }\n * ```\n *\n * @initializerApiFunction\n * @developerPreview\n */\nconst contentChild = (() => {\n // Note: This may be considered a side-effect, but nothing will depend on\n // this assignment, unless this `viewChild` constant export is accessed. It's a\n // self-contained side effect that is local to the user facing `viewChild` export.\n contentChildFn.required = contentChildRequiredFn;\n return contentChildFn;\n})();\n/**\n * Initializes a content children query.\n *\n * Query results are represented as a signal of a read-only collection containing all matched\n * elements.\n *\n * @usageNotes\n * Create a children query in your component by declaring a\n * class field and initializing it with the `contentChildren()` function.\n *\n * ```ts\n * @Component({...})\n * export class TestComponent {\n * headerEl = contentChildren<ElementRef>('h'); // Signal<ReadonlyArray<ElementRef>>\n * }\n * ```\n *\n * @initializerApiFunction\n * @developerPreview\n */\nfunction contentChildren(locator, opts) {\n return createMultiResultQuerySignalFn();\n}\n\n/**\n * Creates a model signal.\n *\n * @param initialValue The initial value.\n * Can be set to {@link REQUIRED_UNSET_VALUE} for required model signals.\n * @param options Additional options for the model.\n */\nfunction createModelSignal(initialValue) {\n const node = Object.create(INPUT_SIGNAL_NODE);\n const emitterRef = new OutputEmitterRef();\n node.value = initialValue;\n function getter() {\n producerAccessed$1(node);\n assertModelSet(node.value);\n return node.value;\n }\n getter[SIGNAL$1] = node;\n getter.asReadonly = signalAsReadonlyFn.bind(getter);\n // TODO: Should we throw an error when updating a destroyed model?\n getter.set = (newValue) => {\n if (!node.equal(node.value, newValue)) {\n signalSetFn$1(node, newValue);\n emitterRef.emit(newValue);\n }\n };\n getter.update = (updateFn) => {\n assertModelSet(node.value);\n getter.set(updateFn(node.value));\n };\n getter.subscribe = emitterRef.subscribe.bind(emitterRef);\n getter.destroyRef = emitterRef.destroyRef;\n if (ngDevMode) {\n getter.toString = () => `[Model Signal: ${getter()}]`;\n }\n return getter;\n}\n/** Asserts that a model's value is set. */\nfunction assertModelSet(value) {\n if (value === REQUIRED_UNSET_VALUE) {\n throw new RuntimeError(952 /* RuntimeErrorCode.REQUIRED_MODEL_NO_VALUE */, ngDevMode && 'Model is required but no value is available yet.');\n }\n}\n\nfunction modelFunction(initialValue) {\n ngDevMode && assertInInjectionContext(model);\n return createModelSignal(initialValue);\n}\nfunction modelRequiredFunction() {\n ngDevMode && assertInInjectionContext(model);\n return createModelSignal(REQUIRED_UNSET_VALUE);\n}\n/**\n * `model` declares a writeable signal that is exposed as an input/output\n * pair on the containing directive.\n *\n * The input name is taken either from the class member or from the `alias` option.\n * The output name is generated by taking the input name and appending `Change`.\n *\n * @usageNotes\n *\n * To use `model()`, import the function from `@angular/core`.\n *\n * ```\n * import {model} from '@angular/core`;\n * ```\n *\n * Inside your component, introduce a new class member and initialize\n * it with a call to `model` or `model.required`.\n *\n * ```ts\n * @Directive({\n * ...\n * })\n * export class MyDir {\n * firstName = model<string>(); // ModelSignal<string|undefined>\n * lastName = model.required<string>(); // ModelSignal<string>\n * age = model(0); // ModelSignal<number>\n * }\n * ```\n *\n * Inside your component template, you can display the value of a `model`\n * by calling the signal.\n *\n * ```html\n * <span>{{firstName()}}</span>\n * ```\n *\n * Updating the `model` is equivalent to updating a writable signal.\n *\n * ```ts\n * updateName(newFirstName: string): void {\n * this.firstName.set(newFirstName);\n * }\n * ```\n *\n * @developerPreview\n * @initializerApiFunction\n */\nconst model = (() => {\n // Note: This may be considered a side-effect, but nothing will depend on\n // this assignment, unless this `model` constant export is accessed. It's a\n // self-contained side effect that is local to the user facing `model` export.\n modelFunction.required = modelRequiredFunction;\n return modelFunction;\n})();\n\n// Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not\n// explicitly set.\nconst emitDistinctChangesOnlyDefaultValue = true;\n/**\n * Base class for query metadata.\n *\n * @see {@link ContentChildren}\n * @see {@link ContentChild}\n * @see {@link ViewChildren}\n * @see {@link ViewChild}\n *\n * @publicApi\n */\nclass Query {\n}\n/**\n * ContentChildren decorator and metadata.\n *\n *\n * @Annotation\n * @publicApi\n */\nconst ContentChildren = makePropDecorator('ContentChildren', (selector, opts = {}) => ({\n selector,\n first: false,\n isViewQuery: false,\n descendants: false,\n emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue,\n ...opts,\n}), Query);\n/**\n * ContentChild decorator and metadata.\n *\n *\n * @Annotation\n *\n * @publicApi\n */\nconst ContentChild = makePropDecorator('ContentChild', (selector, opts = {}) => ({\n selector,\n first: true,\n isViewQuery: false,\n descendants: true,\n ...opts,\n}), Query);\n/**\n * ViewChildren decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst ViewChildren = makePropDecorator('ViewChildren', (selector, opts = {}) => ({\n selector,\n first: false,\n isViewQuery: true,\n descendants: true,\n emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue,\n ...opts,\n}), Query);\n/**\n * ViewChild decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst ViewChild = makePropDecorator('ViewChild', (selector, opts) => ({\n selector,\n first: true,\n isViewQuery: true,\n descendants: true,\n ...opts,\n}), Query);\n\n/**\n * Used to resolve resource URLs on `@Component` when used with JIT compilation.\n *\n * Example:\n * ```\n * @Component({\n * selector: 'my-comp',\n * templateUrl: 'my-comp.html', // This requires asynchronous resolution\n * })\n * class MyComponent{\n * }\n *\n * // Calling `renderComponent` will fail because `renderComponent` is a synchronous process\n * // and `MyComponent`'s `@Component.templateUrl` needs to be resolved asynchronously.\n *\n * // Calling `resolveComponentResources()` will resolve `@Component.templateUrl` into\n * // `@Component.template`, which allows `renderComponent` to proceed in a synchronous manner.\n *\n * // Use browser's `fetch()` function as the default resource resolution strategy.\n * resolveComponentResources(fetch).then(() => {\n * // After resolution all URLs have been converted into `template` strings.\n * renderComponent(MyComponent);\n * });\n *\n * ```\n *\n * NOTE: In AOT the resolution happens during compilation, and so there should be no need\n * to call this method outside JIT mode.\n *\n * @param resourceResolver a function which is responsible for returning a `Promise` to the\n * contents of the resolved URL. Browser's `fetch()` method is a good default implementation.\n */\nfunction resolveComponentResources(resourceResolver) {\n // Store all promises which are fetching the resources.\n const componentResolved = [];\n // Cache so that we don't fetch the same resource more than once.\n const urlMap = new Map();\n function cachedResourceResolve(url) {\n let promise = urlMap.get(url);\n if (!promise) {\n const resp = resourceResolver(url);\n urlMap.set(url, (promise = resp.then(unwrapResponse)));\n }\n return promise;\n }\n componentResourceResolutionQueue.forEach((component, type) => {\n const promises = [];\n if (component.templateUrl) {\n promises.push(cachedResourceResolve(component.templateUrl).then((template) => {\n component.template = template;\n }));\n }\n const styles = typeof component.styles === 'string' ? [component.styles] : component.styles || [];\n component.styles = styles;\n if (component.styleUrl && component.styleUrls?.length) {\n throw new Error('@Component cannot define both `styleUrl` and `styleUrls`. ' +\n 'Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple');\n }\n else if (component.styleUrls?.length) {\n const styleOffset = component.styles.length;\n const styleUrls = component.styleUrls;\n component.styleUrls.forEach((styleUrl, index) => {\n styles.push(''); // pre-allocate array.\n promises.push(cachedResourceResolve(styleUrl).then((style) => {\n styles[styleOffset + index] = style;\n styleUrls.splice(styleUrls.indexOf(styleUrl), 1);\n if (styleUrls.length == 0) {\n component.styleUrls = undefined;\n }\n }));\n });\n }\n else if (component.styleUrl) {\n promises.push(cachedResourceResolve(component.styleUrl).then((style) => {\n styles.push(style);\n component.styleUrl = undefined;\n }));\n }\n const fullyResolved = Promise.all(promises).then(() => componentDefResolved(type));\n componentResolved.push(fullyResolved);\n });\n clearResolutionOfComponentResourcesQueue();\n return Promise.all(componentResolved).then(() => undefined);\n}\nlet componentResourceResolutionQueue = new Map();\n// Track when existing ɵcmp for a Type is waiting on resources.\nconst componentDefPendingResolution = new Set();\nfunction maybeQueueResolutionOfComponentResources(type, metadata) {\n if (componentNeedsResolution(metadata)) {\n componentResourceResolutionQueue.set(type, metadata);\n componentDefPendingResolution.add(type);\n }\n}\nfunction isComponentDefPendingResolution(type) {\n return componentDefPendingResolution.has(type);\n}\nfunction componentNeedsResolution(component) {\n return !!((component.templateUrl && !component.hasOwnProperty('template')) ||\n (component.styleUrls && component.styleUrls.length) ||\n component.styleUrl);\n}\nfunction clearResolutionOfComponentResourcesQueue() {\n const old = componentResourceResolutionQueue;\n componentResourceResolutionQueue = new Map();\n return old;\n}\nfunction restoreComponentResolutionQueue(queue) {\n componentDefPendingResolution.clear();\n queue.forEach((_, type) => componentDefPendingResolution.add(type));\n componentResourceResolutionQueue = queue;\n}\nfunction isComponentResourceResolutionQueueEmpty() {\n return componentResourceResolutionQueue.size === 0;\n}\nfunction unwrapResponse(response) {\n return typeof response == 'string' ? response : response.text();\n}\nfunction componentDefResolved(type) {\n componentDefPendingResolution.delete(type);\n}\n\n/**\n * Map of module-id to the corresponding NgModule.\n */\nconst modules = new Map();\n/**\n * Whether to check for duplicate NgModule registrations.\n *\n * This can be disabled for testing.\n */\nlet checkForDuplicateNgModules = true;\nfunction assertSameOrNotExisting(id, type, incoming) {\n if (type && type !== incoming && checkForDuplicateNgModules) {\n throw new Error(`Duplicate module registered for ${id} - ${stringify(type)} vs ${stringify(type.name)}`);\n }\n}\n/**\n * Adds the given NgModule type to Angular's NgModule registry.\n *\n * This is generated as a side-effect of NgModule compilation. Note that the `id` is passed in\n * explicitly and not read from the NgModule definition. This is for two reasons: it avoids a\n * megamorphic read, and in JIT there's a chicken-and-egg problem where the NgModule may not be\n * fully resolved when it's registered.\n *\n * @codeGenApi\n */\nfunction registerNgModuleType(ngModuleType, id) {\n const existing = modules.get(id) || null;\n assertSameOrNotExisting(id, existing, ngModuleType);\n modules.set(id, ngModuleType);\n}\nfunction clearModulesForTest() {\n modules.clear();\n}\nfunction getRegisteredNgModuleType(id) {\n return modules.get(id);\n}\n/**\n * Control whether the NgModule registration system enforces that each NgModule type registered has\n * a unique id.\n *\n * This is useful for testing as the NgModule registry cannot be properly reset between tests with\n * Angular's current API.\n */\nfunction setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {\n checkForDuplicateNgModules = !allowDuplicates;\n}\n\n/**\n * Validation function invoked at runtime for each binding that might potentially\n * represent a security-sensitive attribute of an <iframe>.\n * See `IFRAME_SECURITY_SENSITIVE_ATTRS` in the\n * `packages/compiler/src/schema/dom_security_schema.ts` script for the full list\n * of such attributes.\n *\n * @codeGenApi\n */\nfunction ɵɵvalidateIframeAttribute(attrValue, tagName, attrName) {\n const lView = getLView();\n const tNode = getSelectedTNode();\n const element = getNativeByTNode(tNode, lView);\n // Restrict any dynamic bindings of security-sensitive attributes/properties\n // on an <iframe> for security reasons.\n if (tNode.type === 2 /* TNodeType.Element */ && tagName.toLowerCase() === 'iframe') {\n const iframe = element;\n // Unset previously applied `src` and `srcdoc` if we come across a situation when\n // a security-sensitive attribute is set later via an attribute/property binding.\n iframe.src = '';\n iframe.srcdoc = trustedHTMLFromString('');\n // Also remove the <iframe> from the document.\n nativeRemoveNode(lView[RENDERER], iframe);\n const errorMessage = ngDevMode &&\n `Angular has detected that the \\`${attrName}\\` was applied ` +\n `as a binding to an <iframe>${getTemplateLocationDetails(lView)}. ` +\n `For security reasons, the \\`${attrName}\\` can be set on an <iframe> ` +\n `as a static attribute only. \\n` +\n `To fix this, switch the \\`${attrName}\\` binding to a static attribute ` +\n `in a template or in host bindings section.`;\n throw new RuntimeError(-910 /* RuntimeErrorCode.UNSAFE_IFRAME_ATTRS */, errorMessage);\n }\n return attrValue;\n}\n\nfunction getSuperType(type) {\n return Object.getPrototypeOf(type.prototype).constructor;\n}\n/**\n * Merges the definition from a super class to a sub class.\n * @param definition The definition that is a SubClass of another directive of component\n *\n * @codeGenApi\n */\nfunction ɵɵInheritDefinitionFeature(definition) {\n let superType = getSuperType(definition.type);\n let shouldInheritFields = true;\n const inheritanceChain = [definition];\n while (superType) {\n let superDef = undefined;\n if (isComponentDef(definition)) {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵcmp || superType.ɵdir;\n }\n else {\n if (superType.ɵcmp) {\n throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&\n `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);\n }\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵdir;\n }\n if (superDef) {\n if (shouldInheritFields) {\n inheritanceChain.push(superDef);\n // Some fields in the definition may be empty, if there were no values to put in them that\n // would've justified object creation. Unwrap them if necessary.\n const writeableDef = definition;\n writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);\n writeableDef.inputTransforms = maybeUnwrapEmpty(definition.inputTransforms);\n writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);\n writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);\n // Merge hostBindings\n const superHostBindings = superDef.hostBindings;\n superHostBindings && inheritHostBindings(definition, superHostBindings);\n // Merge queries\n const superViewQuery = superDef.viewQuery;\n const superContentQueries = superDef.contentQueries;\n superViewQuery && inheritViewQuery(definition, superViewQuery);\n superContentQueries && inheritContentQueries(definition, superContentQueries);\n // Merge inputs and outputs\n mergeInputsWithTransforms(definition, superDef);\n fillProperties(definition.outputs, superDef.outputs);\n // Merge animations metadata.\n // If `superDef` is a Component, the `data` field is present (defaults to an empty object).\n if (isComponentDef(superDef) && superDef.data.animation) {\n // If super def is a Component, the `definition` is also a Component, since Directives can\n // not inherit Components (we throw an error above and cannot reach this code).\n const defData = definition.data;\n defData.animation = (defData.animation || []).concat(superDef.data.animation);\n }\n }\n // Run parent features\n const features = superDef.features;\n if (features) {\n for (let i = 0; i < features.length; i++) {\n const feature = features[i];\n if (feature && feature.ngInherit) {\n feature(definition);\n }\n // If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this\n // def already has all the necessary information inherited from its super class(es), so we\n // can stop merging fields from super classes. However we need to iterate through the\n // prototype chain to look for classes that might contain other \"features\" (like\n // NgOnChanges), which we should invoke for the original `definition`. We set the\n // `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance\n // logic and only invoking functions from the \"features\" list.\n if (feature === ɵɵInheritDefinitionFeature) {\n shouldInheritFields = false;\n }\n }\n }\n }\n superType = Object.getPrototypeOf(superType);\n }\n mergeHostAttrsAcrossInheritance(inheritanceChain);\n}\nfunction mergeInputsWithTransforms(target, source) {\n for (const key in source.inputs) {\n if (!source.inputs.hasOwnProperty(key)) {\n continue;\n }\n if (target.inputs.hasOwnProperty(key)) {\n continue;\n }\n const value = source.inputs[key];\n if (value === undefined) {\n continue;\n }\n target.inputs[key] = value;\n target.declaredInputs[key] = source.declaredInputs[key];\n // If the input is inherited, and we have a transform for it, we also inherit it.\n // Note that transforms should not be inherited if the input has its own metadata\n // in the `source` directive itself already (i.e. the input is re-declared/overridden).\n if (source.inputTransforms !== null) {\n // Note: transforms are stored with their minified names.\n // Perf: only access the minified name when there are source transforms.\n const minifiedName = Array.isArray(value) ? value[0] : value;\n if (!source.inputTransforms.hasOwnProperty(minifiedName)) {\n continue;\n }\n target.inputTransforms ??= {};\n target.inputTransforms[minifiedName] = source.inputTransforms[minifiedName];\n }\n }\n}\n/**\n * Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.\n *\n * @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing\n * sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child\n * type.\n */\nfunction mergeHostAttrsAcrossInheritance(inheritanceChain) {\n let hostVars = 0;\n let hostAttrs = null;\n // We process the inheritance order from the base to the leaves here.\n for (let i = inheritanceChain.length - 1; i >= 0; i--) {\n const def = inheritanceChain[i];\n // For each `hostVars`, we need to add the superclass amount.\n def.hostVars = hostVars += def.hostVars;\n // for each `hostAttrs` we need to merge it with superclass.\n def.hostAttrs = mergeHostAttrs(def.hostAttrs, (hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs)));\n }\n}\nfunction maybeUnwrapEmpty(value) {\n if (value === EMPTY_OBJ) {\n return {};\n }\n else if (value === EMPTY_ARRAY) {\n return [];\n }\n else {\n return value;\n }\n}\nfunction inheritViewQuery(definition, superViewQuery) {\n const prevViewQuery = definition.viewQuery;\n if (prevViewQuery) {\n definition.viewQuery = (rf, ctx) => {\n superViewQuery(rf, ctx);\n prevViewQuery(rf, ctx);\n };\n }\n else {\n definition.viewQuery = superViewQuery;\n }\n}\nfunction inheritContentQueries(definition, superContentQueries) {\n const prevContentQueries = definition.contentQueries;\n if (prevContentQueries) {\n definition.contentQueries = (rf, ctx, directiveIndex) => {\n superContentQueries(rf, ctx, directiveIndex);\n prevContentQueries(rf, ctx, directiveIndex);\n };\n }\n else {\n definition.contentQueries = superContentQueries;\n }\n}\nfunction inheritHostBindings(definition, superHostBindings) {\n const prevHostBindings = definition.hostBindings;\n if (prevHostBindings) {\n definition.hostBindings = (rf, ctx) => {\n superHostBindings(rf, ctx);\n prevHostBindings(rf, ctx);\n };\n }\n else {\n definition.hostBindings = superHostBindings;\n }\n}\n\n/**\n * Fields which exist on either directive or component definitions, and need to be copied from\n * parent to child classes by the `ɵɵCopyDefinitionFeature`.\n */\nconst COPY_DIRECTIVE_FIELDS = [\n // The child class should use the providers of its parent.\n 'providersResolver',\n // Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such\n // as inputs, outputs, and host binding functions.\n];\n/**\n * Fields which exist only on component definitions, and need to be copied from parent to child\n * classes by the `ɵɵCopyDefinitionFeature`.\n *\n * The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,\n * since those should go in `COPY_DIRECTIVE_FIELDS` above.\n */\nconst COPY_COMPONENT_FIELDS = [\n // The child class should use the template function of its parent, including all template\n // semantics.\n 'template',\n 'decls',\n 'consts',\n 'vars',\n 'onPush',\n 'ngContentSelectors',\n // The child class should use the CSS styles of its parent, including all styling semantics.\n 'styles',\n 'encapsulation',\n // The child class should be checked by the runtime in the same way as its parent.\n 'schemas',\n];\n/**\n * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a\n * definition.\n *\n * This exists primarily to support ngcc migration of an existing View Engine pattern, where an\n * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it\n * generates a skeleton definition on the child class, and applies this feature.\n *\n * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,\n * including things like the component template function.\n *\n * @param definition The definition of a child class which inherits from a parent class with its\n * own definition.\n *\n * @codeGenApi\n */\nfunction ɵɵCopyDefinitionFeature(definition) {\n let superType = getSuperType(definition.type);\n let superDef = undefined;\n if (isComponentDef(definition)) {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵcmp;\n }\n else {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵdir;\n }\n // Needed because `definition` fields are readonly.\n const defAny = definition;\n // Copy over any fields that apply to either directives or components.\n for (const field of COPY_DIRECTIVE_FIELDS) {\n defAny[field] = superDef[field];\n }\n if (isComponentDef(superDef)) {\n // Copy over any component-specific fields.\n for (const field of COPY_COMPONENT_FIELDS) {\n defAny[field] = superDef[field];\n }\n }\n}\n\n/**\n * This feature adds the host directives behavior to a directive definition by patching a\n * function onto it. The expectation is that the runtime will invoke the function during\n * directive matching.\n *\n * For example:\n * ```ts\n * class ComponentWithHostDirective {\n * static ɵcmp = defineComponent({\n * type: ComponentWithHostDirective,\n * features: [ɵɵHostDirectivesFeature([\n * SimpleHostDirective,\n * {directive: AdvancedHostDirective, inputs: ['foo: alias'], outputs: ['bar']},\n * ])]\n * });\n * }\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵHostDirectivesFeature(rawHostDirectives) {\n const feature = (definition) => {\n const resolved = (Array.isArray(rawHostDirectives) ? rawHostDirectives : rawHostDirectives()).map((dir) => {\n return typeof dir === 'function'\n ? { directive: resolveForwardRef(dir), inputs: EMPTY_OBJ, outputs: EMPTY_OBJ }\n : {\n directive: resolveForwardRef(dir.directive),\n inputs: bindingArrayToMap(dir.inputs),\n outputs: bindingArrayToMap(dir.outputs),\n };\n });\n if (definition.hostDirectives === null) {\n definition.findHostDirectiveDefs = findHostDirectiveDefs;\n definition.hostDirectives = resolved;\n }\n else {\n definition.hostDirectives.unshift(...resolved);\n }\n };\n feature.ngInherit = true;\n return feature;\n}\nfunction findHostDirectiveDefs(currentDef, matchedDefs, hostDirectiveDefs) {\n if (currentDef.hostDirectives !== null) {\n for (const hostDirectiveConfig of currentDef.hostDirectives) {\n const hostDirectiveDef = getDirectiveDef(hostDirectiveConfig.directive);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n validateHostDirective(hostDirectiveConfig, hostDirectiveDef);\n }\n // We need to patch the `declaredInputs` so that\n // `ngOnChanges` can map the properties correctly.\n patchDeclaredInputs(hostDirectiveDef.declaredInputs, hostDirectiveConfig.inputs);\n // Host directives execute before the host so that its host bindings can be overwritten.\n findHostDirectiveDefs(hostDirectiveDef, matchedDefs, hostDirectiveDefs);\n hostDirectiveDefs.set(hostDirectiveDef, hostDirectiveConfig);\n matchedDefs.push(hostDirectiveDef);\n }\n }\n}\n/**\n * Converts an array in the form of `['publicName', 'alias', 'otherPublicName', 'otherAlias']` into\n * a map in the form of `{publicName: 'alias', otherPublicName: 'otherAlias'}`.\n */\nfunction bindingArrayToMap(bindings) {\n if (bindings === undefined || bindings.length === 0) {\n return EMPTY_OBJ;\n }\n const result = {};\n for (let i = 0; i < bindings.length; i += 2) {\n result[bindings[i]] = bindings[i + 1];\n }\n return result;\n}\n/**\n * `ngOnChanges` has some leftover legacy ViewEngine behavior where the keys inside the\n * `SimpleChanges` event refer to the *declared* name of the input, not its public name or its\n * minified name. E.g. in `@Input('alias') foo: string`, the name in the `SimpleChanges` object\n * will always be `foo`, and not `alias` or the minified name of `foo` in apps using property\n * minification.\n *\n * This is achieved through the `DirectiveDef.declaredInputs` map that is constructed when the\n * definition is declared. When a property is written to the directive instance, the\n * `NgOnChangesFeature` will try to remap the property name being written to using the\n * `declaredInputs`.\n *\n * Since the host directive input remapping happens during directive matching, `declaredInputs`\n * won't contain the new alias that the input is available under. This function addresses the\n * issue by patching the host directive aliases to the `declaredInputs`. There is *not* a risk of\n * this patching accidentally introducing new inputs to the host directive, because `declaredInputs`\n * is used *only* by the `NgOnChangesFeature` when determining what name is used in the\n * `SimpleChanges` object which won't be reached if an input doesn't exist.\n */\nfunction patchDeclaredInputs(declaredInputs, exposedInputs) {\n for (const publicName in exposedInputs) {\n if (exposedInputs.hasOwnProperty(publicName)) {\n const remappedPublicName = exposedInputs[publicName];\n const privateName = declaredInputs[publicName];\n // We *technically* shouldn't be able to hit this case because we can't have multiple\n // inputs on the same property and we have validations against conflicting aliases in\n // `validateMappings`. If we somehow did, it would lead to `ngOnChanges` being invoked\n // with the wrong name so we have a non-user-friendly assertion here just in case.\n if ((typeof ngDevMode === 'undefined' || ngDevMode) &&\n declaredInputs.hasOwnProperty(remappedPublicName)) {\n assertEqual(declaredInputs[remappedPublicName], declaredInputs[publicName], `Conflicting host directive input alias ${publicName}.`);\n }\n declaredInputs[remappedPublicName] = privateName;\n }\n }\n}\n/**\n * Verifies that the host directive has been configured correctly.\n * @param hostDirectiveConfig Host directive configuration object.\n * @param directiveDef Directive definition of the host directive.\n */\nfunction validateHostDirective(hostDirectiveConfig, directiveDef) {\n const type = hostDirectiveConfig.directive;\n if (directiveDef === null) {\n if (getComponentDef(type) !== null) {\n throw new RuntimeError(310 /* RuntimeErrorCode.HOST_DIRECTIVE_COMPONENT */, `Host directive ${type.name} cannot be a component.`);\n }\n throw new RuntimeError(307 /* RuntimeErrorCode.HOST_DIRECTIVE_UNRESOLVABLE */, `Could not resolve metadata for host directive ${type.name}. ` +\n `Make sure that the ${type.name} class is annotated with an @Directive decorator.`);\n }\n if (!directiveDef.standalone) {\n throw new RuntimeError(308 /* RuntimeErrorCode.HOST_DIRECTIVE_NOT_STANDALONE */, `Host directive ${directiveDef.type.name} must be standalone.`);\n }\n validateMappings('input', directiveDef, hostDirectiveConfig.inputs);\n validateMappings('output', directiveDef, hostDirectiveConfig.outputs);\n}\n/**\n * Checks that the host directive inputs/outputs configuration is valid.\n * @param bindingType Kind of binding that is being validated. Used in the error message.\n * @param def Definition of the host directive that is being validated against.\n * @param hostDirectiveBindings Host directive mapping object that shold be validated.\n */\nfunction validateMappings(bindingType, def, hostDirectiveBindings) {\n const className = def.type.name;\n const bindings = bindingType === 'input' ? def.inputs : def.outputs;\n for (const publicName in hostDirectiveBindings) {\n if (hostDirectiveBindings.hasOwnProperty(publicName)) {\n if (!bindings.hasOwnProperty(publicName)) {\n throw new RuntimeError(311 /* RuntimeErrorCode.HOST_DIRECTIVE_UNDEFINED_BINDING */, `Directive ${className} does not have an ${bindingType} with a public name of ${publicName}.`);\n }\n const remappedPublicName = hostDirectiveBindings[publicName];\n if (bindings.hasOwnProperty(remappedPublicName) && remappedPublicName !== publicName) {\n throw new RuntimeError(312 /* RuntimeErrorCode.HOST_DIRECTIVE_CONFLICTING_ALIAS */, `Cannot alias ${bindingType} ${publicName} of host directive ${className} to ${remappedPublicName}, because it already has a different ${bindingType} with the same public name.`);\n }\n }\n }\n}\n\n/**\n * Decorates the directive definition with support for input transform functions.\n *\n * If the directive uses inheritance, the feature should be included before the\n * `InheritDefinitionFeature` to ensure that the `inputTransforms` field is populated.\n *\n * @codeGenApi\n */\nfunction ɵɵInputTransformsFeature(definition) {\n const inputs = definition.inputConfig;\n const inputTransforms = {};\n for (const minifiedKey in inputs) {\n if (inputs.hasOwnProperty(minifiedKey)) {\n // Note: the private names are used for the keys, rather than the public ones, because public\n // names can be re-aliased in host directives which would invalidate the lookup.\n const value = inputs[minifiedKey];\n if (Array.isArray(value) && value[3]) {\n inputTransforms[minifiedKey] = value[3];\n }\n }\n }\n definition.inputTransforms = inputTransforms;\n}\n\n/**\n * Represents an instance of an `NgModule` created by an `NgModuleFactory`.\n * Provides access to the `NgModule` instance and related objects.\n *\n * @publicApi\n */\nclass NgModuleRef$1 {\n}\n/**\n * @publicApi\n *\n * @deprecated\n * This class was mostly used as a part of ViewEngine-based JIT API and is no longer needed in Ivy\n * JIT mode. Angular provides APIs that accept NgModule classes directly (such as\n * [PlatformRef.bootstrapModule](api/core/PlatformRef#bootstrapModule) and\n * [createNgModule](api/core/createNgModule)), consider switching to those APIs instead of\n * using factory-based ones.\n */\nclass NgModuleFactory$1 {\n}\n\n/**\n * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.\n *\n * @param ngModule NgModule class.\n * @param parentInjector Optional injector instance to use as a parent for the module injector. If\n * not provided, `NullInjector` will be used instead.\n * @returns NgModuleRef that represents an NgModule instance.\n *\n * @publicApi\n */\nfunction createNgModule(ngModule, parentInjector) {\n return new NgModuleRef(ngModule, parentInjector ?? null, []);\n}\n/**\n * The `createNgModule` function alias for backwards-compatibility.\n * Please avoid using it directly and use `createNgModule` instead.\n *\n * @deprecated Use `createNgModule` instead.\n */\nconst createNgModuleRef = createNgModule;\nclass NgModuleRef extends NgModuleRef$1 {\n constructor(ngModuleType, _parent, additionalProviders, runInjectorInitializers = true) {\n super();\n this.ngModuleType = ngModuleType;\n this._parent = _parent;\n // tslint:disable-next-line:require-internal-with-underscore\n this._bootstrapComponents = [];\n this.destroyCbs = [];\n // When bootstrapping a module we have a dependency graph that looks like this:\n // ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the\n // module being resolved tries to inject the ComponentFactoryResolver, it'll create a\n // circular dependency which will result in a runtime error, because the injector doesn't\n // exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves\n // and providing it, rather than letting the injector resolve it.\n this.componentFactoryResolver = new ComponentFactoryResolver(this);\n const ngModuleDef = getNgModuleDef(ngModuleType);\n ngDevMode &&\n assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);\n this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);\n this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [\n { provide: NgModuleRef$1, useValue: this },\n {\n provide: ComponentFactoryResolver$1,\n useValue: this.componentFactoryResolver,\n },\n ...additionalProviders,\n ], stringify(ngModuleType), new Set(['environment']));\n // We need to resolve the injector types separately from the injector creation, because\n // the module might be trying to use this ref in its constructor for DI which will cause a\n // circular error that will eventually error out, because the injector isn't created yet.\n if (runInjectorInitializers) {\n this.resolveInjectorInitializers();\n }\n }\n resolveInjectorInitializers() {\n this._r3Injector.resolveInjectorInitializers();\n this.instance = this._r3Injector.get(this.ngModuleType);\n }\n get injector() {\n return this._r3Injector;\n }\n destroy() {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n const injector = this._r3Injector;\n !injector.destroyed && injector.destroy();\n this.destroyCbs.forEach((fn) => fn());\n this.destroyCbs = null;\n }\n onDestroy(callback) {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs.push(callback);\n }\n}\nclass NgModuleFactory extends NgModuleFactory$1 {\n constructor(moduleType) {\n super();\n this.moduleType = moduleType;\n }\n create(parentInjector) {\n return new NgModuleRef(this.moduleType, parentInjector, []);\n }\n}\nfunction createNgModuleRefWithProviders(moduleType, parentInjector, additionalProviders) {\n return new NgModuleRef(moduleType, parentInjector, additionalProviders, false);\n}\nclass EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {\n constructor(config) {\n super();\n this.componentFactoryResolver = new ComponentFactoryResolver(this);\n this.instance = null;\n const injector = new R3Injector([\n ...config.providers,\n { provide: NgModuleRef$1, useValue: this },\n { provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },\n ], config.parent || getNullInjector(), config.debugName, new Set(['environment']));\n this.injector = injector;\n if (config.runEnvironmentInitializers) {\n injector.resolveInjectorInitializers();\n }\n }\n destroy() {\n this.injector.destroy();\n }\n onDestroy(callback) {\n this.injector.onDestroy(callback);\n }\n}\n/**\n * Create a new environment injector.\n *\n * @param providers An array of providers.\n * @param parent A parent environment injector.\n * @param debugName An optional name for this injector instance, which will be used in error\n * messages.\n *\n * @publicApi\n */\nfunction createEnvironmentInjector(providers, parent, debugName = null) {\n const adapter = new EnvironmentNgModuleRefAdapter({\n providers,\n parent,\n debugName,\n runEnvironmentInitializers: true,\n });\n return adapter.injector;\n}\n\n/**\n * A service used by the framework to create and cache injector instances.\n *\n * This service is used to create a single injector instance for each defer\n * block definition, to avoid creating an injector for each defer block instance\n * of a certain type.\n */\nclass CachedInjectorService {\n constructor() {\n this.cachedInjectors = new Map();\n }\n getOrCreateInjector(key, parentInjector, providers, debugName) {\n if (!this.cachedInjectors.has(key)) {\n const injector = providers.length > 0\n ? createEnvironmentInjector(providers, parentInjector, debugName)\n : null;\n this.cachedInjectors.set(key, injector);\n }\n return this.cachedInjectors.get(key);\n }\n ngOnDestroy() {\n try {\n for (const injector of this.cachedInjectors.values()) {\n if (injector !== null) {\n injector.destroy();\n }\n }\n }\n finally {\n this.cachedInjectors.clear();\n }\n }\n /** @nocollapse */\n static { this.ɵprov = ɵɵdefineInjectable({\n token: CachedInjectorService,\n providedIn: 'environment',\n factory: () => new CachedInjectorService(),\n }); }\n}\n\nfunction isIterable(obj) {\n return obj !== null && typeof obj === 'object' && obj[Symbol.iterator] !== undefined;\n}\nfunction isListLikeIterable(obj) {\n if (!isJsObject(obj))\n return false;\n return (Array.isArray(obj) ||\n (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]\n Symbol.iterator in obj)); // JS Iterable have a Symbol.iterator prop\n}\nfunction areIterablesEqual(a, b, comparator) {\n const iterator1 = a[Symbol.iterator]();\n const iterator2 = b[Symbol.iterator]();\n while (true) {\n const item1 = iterator1.next();\n const item2 = iterator2.next();\n if (item1.done && item2.done)\n return true;\n if (item1.done || item2.done)\n return false;\n if (!comparator(item1.value, item2.value))\n return false;\n }\n}\nfunction iterateListLike(obj, fn) {\n if (Array.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n }\n else {\n const iterator = obj[Symbol.iterator]();\n let item;\n while (!(item = iterator.next()).done) {\n fn(item.value);\n }\n }\n}\nfunction isJsObject(o) {\n return o !== null && (typeof o === 'function' || typeof o === 'object');\n}\n\nfunction devModeEqual(a, b) {\n const isListLikeIterableA = isListLikeIterable(a);\n const isListLikeIterableB = isListLikeIterable(b);\n if (isListLikeIterableA && isListLikeIterableB) {\n return areIterablesEqual(a, b, devModeEqual);\n }\n else {\n const isAObject = a && (typeof a === 'object' || typeof a === 'function');\n const isBObject = b && (typeof b === 'object' || typeof b === 'function');\n if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {\n return true;\n }\n else {\n return Object.is(a, b);\n }\n }\n}\n\n// TODO(misko): consider inlining\n/** Updates binding and returns the value. */\nfunction updateBinding(lView, bindingIndex, value) {\n return (lView[bindingIndex] = value);\n}\n/** Gets the current binding value. */\nfunction getBinding(lView, bindingIndex) {\n ngDevMode && assertIndexInRange(lView, bindingIndex);\n ngDevMode &&\n assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');\n return lView[bindingIndex];\n}\n/**\n * Updates binding if changed, then returns whether it was updated.\n *\n * This function also checks the `CheckNoChangesMode` and throws if changes are made.\n * Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE\n * behavior.\n *\n * @param lView current `LView`\n * @param bindingIndex The binding in the `LView` to check\n * @param value New value to check against `lView[bindingIndex]`\n * @returns `true` if the bindings has changed. (Throws if binding has changed during\n * `CheckNoChangesMode`)\n */\nfunction bindingUpdated(lView, bindingIndex, value) {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n ngDevMode &&\n assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);\n const oldValue = lView[bindingIndex];\n if (Object.is(oldValue, value)) {\n return false;\n }\n else {\n if (ngDevMode && isInCheckNoChangesMode()) {\n // View engine didn't report undefined values as changed on the first checkNoChanges pass\n // (before the change detection was run).\n const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;\n if (!devModeEqual(oldValueToCompare, value)) {\n const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);\n throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName, lView);\n }\n // There was a change, but the `devModeEqual` decided that the change is exempt from an error.\n // For this reason we exit as if no change. The early exit is needed to prevent the changed\n // value to be written into `LView` (If we would write the new value that we would not see it\n // as change on next CD.)\n return false;\n }\n lView[bindingIndex] = value;\n return true;\n }\n}\n/** Updates 2 bindings if changed, then returns whether either was updated. */\nfunction bindingUpdated2(lView, bindingIndex, exp1, exp2) {\n const different = bindingUpdated(lView, bindingIndex, exp1);\n return bindingUpdated(lView, bindingIndex + 1, exp2) || different;\n}\n/** Updates 3 bindings if changed, then returns whether any was updated. */\nfunction bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n}\n/** Updates 4 bindings if changed, then returns whether any was updated. */\nfunction bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;\n}\n\n/**\n * Checks whether a TNode is considered detached, i.e. not present in the\n * translated i18n template. We should not attempt hydration for such nodes\n * and instead, use a regular \"creation mode\".\n */\nfunction isDetachedByI18n(tNode) {\n return (tNode.flags & 32 /* TNodeFlags.isDetached */) === 32 /* TNodeFlags.isDetached */;\n}\n\nfunction templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, tagName, attrs, localRefsIndex) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && ngDevMode.firstCreatePass++;\n const tViewConsts = tView.consts;\n // TODO(pk): refactor getOrCreateTNode to have the \"create\" only version\n const tNode = getOrCreateTNode(tView, index, 4 /* TNodeType.Container */, tagName || null, attrs || null);\n resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));\n registerPostOrderHooks(tView, tNode);\n const embeddedTView = (tNode.tView = createTView(2 /* TViewType.Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts, null /* ssrId */));\n if (tView.queries !== null) {\n tView.queries.template(tView, tNode);\n embeddedTView.queries = tView.queries.embeddedTView(tNode);\n }\n return tNode;\n}\n/**\n * Creates an LContainer for an embedded view.\n *\n * @param declarationLView LView in which the template was declared.\n * @param declarationTView TView in which the template wa declared.\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n */\nfunction declareTemplate(declarationLView, declarationTView, index, templateFn, decls, vars, tagName, attrs, localRefsIndex, localRefExtractor) {\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = declarationTView.firstCreatePass\n ? templateFirstCreatePass(adjustedIndex, declarationTView, declarationLView, templateFn, decls, vars, tagName, attrs, localRefsIndex)\n : declarationTView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n const comment = _locateOrCreateContainerAnchor(declarationTView, declarationLView, tNode, index);\n if (wasLastNodeCreated()) {\n appendChild(declarationTView, declarationLView, comment, tNode);\n }\n attachPatchData(comment, declarationLView);\n const lContainer = createLContainer(comment, declarationLView, comment, tNode);\n declarationLView[adjustedIndex] = lContainer;\n addToViewTree(declarationLView, lContainer);\n // If hydration is enabled, looks up dehydrated views in the DOM\n // using hydration annotation info and stores those views on LContainer.\n // In client-only mode, this function is a noop.\n populateDehydratedViewsInLContainer(lContainer, tNode, declarationLView);\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(declarationTView, declarationLView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(declarationLView, tNode, localRefExtractor);\n }\n return tNode;\n}\n/**\n * Creates an LContainer for an ng-template (dynamically-inserted view), e.g.\n *\n * <ng-template #foo>\n * <div></div>\n * </ng-template>\n *\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n *\n * @codeGenApi\n */\nfunction ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const attrs = getConstant(tView.consts, attrsIndex);\n declareTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, localRefsIndex, localRefExtractor);\n return ɵɵtemplate;\n}\nlet _locateOrCreateContainerAnchor = createContainerAnchorImpl;\n/**\n * Regular creation mode for LContainers and their anchor (comment) nodes.\n */\nfunction createContainerAnchorImpl(tView, lView, tNode, index) {\n lastNodeWasCreated(true);\n return lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n}\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode for LContainers and their\n * anchor (comment) nodes.\n */\nfunction locateOrCreateContainerAnchorImpl(tView, lView, tNode, index) {\n const hydrationInfo = lView[HYDRATION];\n const isNodeCreationMode = !hydrationInfo ||\n isInSkipHydrationBlock$1() ||\n isDetachedByI18n(tNode) ||\n isDisconnectedNode$1(hydrationInfo, index);\n lastNodeWasCreated(isNodeCreationMode);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createContainerAnchorImpl(tView, lView, tNode, index);\n }\n const ssrId = hydrationInfo.data[TEMPLATES]?.[index] ?? null;\n // Apply `ssrId` value to the underlying TView if it was not previously set.\n //\n // There might be situations when the same component is present in a template\n // multiple times and some instances are opted-out of using hydration via\n // `ngSkipHydration` attribute. In this scenario, at the time a TView is created,\n // the `ssrId` might be `null` (if the first component is opted-out of hydration).\n // The code below makes sure that the `ssrId` is applied to the TView if it's still\n // `null` and verifies we never try to override it with a different value.\n if (ssrId !== null && tNode.tView !== null) {\n if (tNode.tView.ssrId === null) {\n tNode.tView.ssrId = ssrId;\n }\n else {\n ngDevMode &&\n assertEqual(tNode.tView.ssrId, ssrId, 'Unexpected value of the `ssrId` for this TView');\n }\n }\n // Hydration mode, looking up existing elements in DOM.\n const currentRNode = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateNodeExists(currentRNode, lView, tNode);\n setSegmentHead(hydrationInfo, index, currentRNode);\n const viewContainerSize = calcSerializedContainerSize(hydrationInfo, index);\n const comment = siblingAfter(viewContainerSize, currentRNode);\n if (ngDevMode) {\n validateMatchingNode(comment, Node.COMMENT_NODE, null, lView, tNode);\n markRNodeAsClaimedByHydration(comment);\n }\n return comment;\n}\nfunction enableLocateOrCreateContainerAnchorImpl() {\n _locateOrCreateContainerAnchor = locateOrCreateContainerAnchorImpl;\n}\n\n/**\n * Describes the state of defer block dependency loading.\n */\nvar DeferDependenciesLoadingState;\n(function (DeferDependenciesLoadingState) {\n /** Initial state, dependency loading is not yet triggered */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"NOT_STARTED\"] = 0] = \"NOT_STARTED\";\n /** Dependency loading is in progress */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"IN_PROGRESS\"] = 1] = \"IN_PROGRESS\";\n /** Dependency loading has completed successfully */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"COMPLETE\"] = 2] = \"COMPLETE\";\n /** Dependency loading has failed */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"FAILED\"] = 3] = \"FAILED\";\n})(DeferDependenciesLoadingState || (DeferDependenciesLoadingState = {}));\n/** Slot index where `minimum` parameter value is stored. */\nconst MINIMUM_SLOT = 0;\n/** Slot index where `after` parameter value is stored. */\nconst LOADING_AFTER_SLOT = 1;\n/**\n * Describes the current state of this defer block instance.\n *\n * @publicApi\n */\nvar DeferBlockState;\n(function (DeferBlockState) {\n /** The placeholder block content is rendered */\n DeferBlockState[DeferBlockState[\"Placeholder\"] = 0] = \"Placeholder\";\n /** The loading block content is rendered */\n DeferBlockState[DeferBlockState[\"Loading\"] = 1] = \"Loading\";\n /** The main content block content is rendered */\n DeferBlockState[DeferBlockState[\"Complete\"] = 2] = \"Complete\";\n /** The error block content is rendered */\n DeferBlockState[DeferBlockState[\"Error\"] = 3] = \"Error\";\n})(DeferBlockState || (DeferBlockState = {}));\n/**\n * Describes the initial state of this defer block instance.\n *\n * Note: this state is internal only and *must* be represented\n * with a number lower than any value in the `DeferBlockState` enum.\n */\nvar DeferBlockInternalState;\n(function (DeferBlockInternalState) {\n /** Initial state. Nothing is rendered yet. */\n DeferBlockInternalState[DeferBlockInternalState[\"Initial\"] = -1] = \"Initial\";\n})(DeferBlockInternalState || (DeferBlockInternalState = {}));\nconst NEXT_DEFER_BLOCK_STATE = 0;\n// Note: it's *important* to keep the state in this slot, because this slot\n// is used by runtime logic to differentiate between LViews, LContainers and\n// other types (see `isLView` and `isLContainer` functions). In case of defer\n// blocks, this slot would always be a number.\nconst DEFER_BLOCK_STATE = 1;\nconst STATE_IS_FROZEN_UNTIL = 2;\nconst LOADING_AFTER_CLEANUP_FN = 3;\nconst TRIGGER_CLEANUP_FNS = 4;\nconst PREFETCH_TRIGGER_CLEANUP_FNS = 5;\n/**\n * Options for configuring defer blocks behavior.\n * @publicApi\n */\nvar DeferBlockBehavior;\n(function (DeferBlockBehavior) {\n /**\n * Manual triggering mode for defer blocks. Provides control over when defer blocks render\n * and which state they render.\n */\n DeferBlockBehavior[DeferBlockBehavior[\"Manual\"] = 0] = \"Manual\";\n /**\n * Playthrough mode for defer blocks. This mode behaves like defer blocks would in a browser.\n * This is the default behavior in test environments.\n */\n DeferBlockBehavior[DeferBlockBehavior[\"Playthrough\"] = 1] = \"Playthrough\";\n})(DeferBlockBehavior || (DeferBlockBehavior = {}));\n\n/*!\n * @license\n * Copyright Google LLC 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.dev/license\n */\n/**\n * Registers a cleanup function associated with a prefetching trigger\n * or a regular trigger of a defer block.\n */\nfunction storeTriggerCleanupFn(type, lDetails, cleanupFn) {\n const key = type === 1 /* TriggerType.Prefetch */ ? PREFETCH_TRIGGER_CLEANUP_FNS : TRIGGER_CLEANUP_FNS;\n if (lDetails[key] === null) {\n lDetails[key] = [];\n }\n lDetails[key].push(cleanupFn);\n}\n/**\n * Invokes registered cleanup functions either for prefetch or for regular triggers.\n */\nfunction invokeTriggerCleanupFns(type, lDetails) {\n const key = type === 1 /* TriggerType.Prefetch */ ? PREFETCH_TRIGGER_CLEANUP_FNS : TRIGGER_CLEANUP_FNS;\n const cleanupFns = lDetails[key];\n if (cleanupFns !== null) {\n for (const cleanupFn of cleanupFns) {\n cleanupFn();\n }\n lDetails[key] = null;\n }\n}\n/**\n * Invokes registered cleanup functions for both prefetch and regular triggers.\n */\nfunction invokeAllTriggerCleanupFns(lDetails) {\n invokeTriggerCleanupFns(1 /* TriggerType.Prefetch */, lDetails);\n invokeTriggerCleanupFns(0 /* TriggerType.Regular */, lDetails);\n}\n\n/**\n * Asserts that the current stack frame is not within a reactive context. Useful\n * to disallow certain code from running inside a reactive context (see {@link toSignal}).\n *\n * @param debugFn a reference to the function making the assertion (used for the error message).\n *\n * @publicApi\n */\nfunction assertNotInReactiveContext(debugFn, extraContext) {\n // Taking a `Function` instead of a string name here prevents the un-minified name of the function\n // from being retained in the bundle regardless of minification.\n if (getActiveConsumer$1() !== null) {\n throw new RuntimeError(-602 /* RuntimeErrorCode.ASSERTION_NOT_INSIDE_REACTIVE_CONTEXT */, ngDevMode &&\n `${debugFn.name}() cannot be called from within a reactive context.${extraContext ? ` ${extraContext}` : ''}`);\n }\n}\n\n/**\n * The phase to run an `afterRender` or `afterNextRender` callback in.\n *\n * Callbacks in the same phase run in the order they are registered. Phases run in the\n * following order after each render:\n *\n * 1. `AfterRenderPhase.EarlyRead`\n * 2. `AfterRenderPhase.Write`\n * 3. `AfterRenderPhase.MixedReadWrite`\n * 4. `AfterRenderPhase.Read`\n *\n * Angular is unable to verify or enforce that phases are used correctly, and instead\n * relies on each developer to follow the guidelines documented for each value and\n * carefully choose the appropriate one, refactoring their code if necessary. By doing\n * so, Angular is better able to minimize the performance degradation associated with\n * manual DOM access, ensuring the best experience for the end users of your application\n * or library.\n *\n * @deprecated Specify the phase for your callback to run in by passing a spec-object as the first\n * parameter to `afterRender` or `afterNextRender` instead of a function.\n */\nvar AfterRenderPhase;\n(function (AfterRenderPhase) {\n /**\n * Use `AfterRenderPhase.EarlyRead` for callbacks that only need to **read** from the\n * DOM before a subsequent `AfterRenderPhase.Write` callback, for example to perform\n * custom layout that the browser doesn't natively support. Prefer the\n * `AfterRenderPhase.EarlyRead` phase if reading can wait until after the write phase.\n * **Never** write to the DOM in this phase.\n *\n * <div class=\"alert is-important\">\n *\n * Using this value can degrade performance.\n * Instead, prefer using built-in browser functionality when possible.\n *\n * </div>\n */\n AfterRenderPhase[AfterRenderPhase[\"EarlyRead\"] = 0] = \"EarlyRead\";\n /**\n * Use `AfterRenderPhase.Write` for callbacks that only **write** to the DOM. **Never**\n * read from the DOM in this phase.\n */\n AfterRenderPhase[AfterRenderPhase[\"Write\"] = 1] = \"Write\";\n /**\n * Use `AfterRenderPhase.MixedReadWrite` for callbacks that read from or write to the\n * DOM, that haven't been refactored to use a different phase. **Never** use this phase if\n * it is possible to divide the work among the other phases instead.\n *\n * <div class=\"alert is-critical\">\n *\n * Using this value can **significantly** degrade performance.\n * Instead, prefer dividing work into the appropriate phase callbacks.\n *\n * </div>\n */\n AfterRenderPhase[AfterRenderPhase[\"MixedReadWrite\"] = 2] = \"MixedReadWrite\";\n /**\n * Use `AfterRenderPhase.Read` for callbacks that only **read** from the DOM. **Never**\n * write to the DOM in this phase.\n */\n AfterRenderPhase[AfterRenderPhase[\"Read\"] = 3] = \"Read\";\n})(AfterRenderPhase || (AfterRenderPhase = {}));\n\nclass AfterRenderManager {\n constructor() {\n this.impl = null;\n }\n execute() {\n this.impl?.execute();\n }\n /** @nocollapse */\n static { this.ɵprov = ɵɵdefineInjectable({\n token: AfterRenderManager,\n providedIn: 'root',\n factory: () => new AfterRenderManager(),\n }); }\n}\nclass AfterRenderImpl {\n constructor() {\n this.ngZone = inject(NgZone);\n this.scheduler = inject(ChangeDetectionScheduler);\n this.errorHandler = inject(ErrorHandler, { optional: true });\n /** Current set of active sequences. */\n this.sequences = new Set();\n /** Tracks registrations made during the current set of executions. */\n this.deferredRegistrations = new Set();\n /** Whether the `AfterRenderManager` is currently executing hooks. */\n this.executing = false;\n }\n static { this.PHASES = [\n AfterRenderPhase.EarlyRead,\n AfterRenderPhase.Write,\n AfterRenderPhase.MixedReadWrite,\n AfterRenderPhase.Read,\n ]; }\n /**\n * Run the sequence of phases of hooks, once through. As a result of executing some hooks, more\n * might be scheduled.\n */\n execute() {\n this.executing = true;\n for (const phase of AfterRenderImpl.PHASES) {\n for (const sequence of this.sequences) {\n if (sequence.erroredOrDestroyed || !sequence.hooks[phase]) {\n continue;\n }\n try {\n sequence.pipelinedValue = this.ngZone.runOutsideAngular(() => sequence.hooks[phase](sequence.pipelinedValue));\n }\n catch (err) {\n sequence.erroredOrDestroyed = true;\n this.errorHandler?.handleError(err);\n }\n }\n }\n this.executing = false;\n // Cleanup step to reset sequence state and also collect one-shot sequences for removal.\n for (const sequence of this.sequences) {\n sequence.afterRun();\n if (sequence.once) {\n this.sequences.delete(sequence);\n // Destroy the sequence so its on destroy callbacks can be cleaned up\n // immediately, instead of waiting until the injector is destroyed.\n sequence.destroy();\n }\n }\n for (const sequence of this.deferredRegistrations) {\n this.sequences.add(sequence);\n }\n if (this.deferredRegistrations.size > 0) {\n this.scheduler.notify(7 /* NotificationSource.DeferredRenderHook */);\n }\n this.deferredRegistrations.clear();\n }\n register(sequence) {\n if (!this.executing) {\n this.sequences.add(sequence);\n // Trigger an `ApplicationRef.tick()` if one is not already pending/running, because we have a\n // new render hook that needs to run.\n this.scheduler.notify(6 /* NotificationSource.RenderHook */);\n }\n else {\n this.deferredRegistrations.add(sequence);\n }\n }\n unregister(sequence) {\n if (this.executing && this.sequences.has(sequence)) {\n // We can't remove an `AfterRenderSequence` in the middle of iteration.\n // Instead, mark it as destroyed so it doesn't run any more, and mark it as one-shot so it'll\n // be removed at the end of the current execution.\n sequence.erroredOrDestroyed = true;\n sequence.pipelinedValue = undefined;\n sequence.once = true;\n }\n else {\n // It's safe to directly remove this sequence.\n this.sequences.delete(sequence);\n this.deferredRegistrations.delete(sequence);\n }\n }\n /** @nocollapse */\n static { this.ɵprov = ɵɵdefineInjectable({\n token: AfterRenderImpl,\n providedIn: 'root',\n factory: () => new AfterRenderImpl(),\n }); }\n}\nclass AfterRenderSequence {\n constructor(impl, hooks, once, destroyRef) {\n this.impl = impl;\n this.hooks = hooks;\n this.once = once;\n /**\n * Whether this sequence errored or was destroyed during this execution, and hooks should no\n * longer run for it.\n */\n this.erroredOrDestroyed = false;\n /**\n * The value returned by the last hook execution (if any), ready to be pipelined into the next\n * one.\n */\n this.pipelinedValue = undefined;\n this.unregisterOnDestroy = destroyRef?.onDestroy(() => this.destroy());\n }\n afterRun() {\n this.erroredOrDestroyed = false;\n this.pipelinedValue = undefined;\n }\n destroy() {\n this.impl.unregister(this);\n this.unregisterOnDestroy?.();\n }\n}\n\nfunction afterRender(callbackOrSpec, options) {\n ngDevMode &&\n assertNotInReactiveContext(afterRender, 'Call `afterRender` outside of a reactive context. For example, schedule the render ' +\n 'callback inside the component constructor`.');\n !options?.injector && assertInInjectionContext(afterRender);\n const injector = options?.injector ?? inject(Injector);\n if (!isPlatformBrowser(injector)) {\n return NOOP_AFTER_RENDER_REF;\n }\n performanceMarkFeature('NgAfterRender');\n return afterRenderImpl(callbackOrSpec, injector, options, /* once */ false);\n}\nfunction afterNextRender(callbackOrSpec, options) {\n !options?.injector && assertInInjectionContext(afterNextRender);\n const injector = options?.injector ?? inject(Injector);\n if (!isPlatformBrowser(injector)) {\n return NOOP_AFTER_RENDER_REF;\n }\n performanceMarkFeature('NgAfterNextRender');\n return afterRenderImpl(callbackOrSpec, injector, options, /* once */ true);\n}\nfunction getHooks(callbackOrSpec, phase) {\n if (callbackOrSpec instanceof Function) {\n const hooks = [undefined, undefined, undefined, undefined];\n hooks[phase] = callbackOrSpec;\n return hooks;\n }\n else {\n return [\n callbackOrSpec.earlyRead,\n callbackOrSpec.write,\n callbackOrSpec.mixedReadWrite,\n callbackOrSpec.read,\n ];\n }\n}\n/**\n * Shared implementation for `afterRender` and `afterNextRender`.\n */\nfunction afterRenderImpl(callbackOrSpec, injector, options, once) {\n const manager = injector.get(AfterRenderManager);\n // Lazily initialize the handler implementation, if necessary. This is so that it can be\n // tree-shaken if `afterRender` and `afterNextRender` aren't used.\n manager.impl ??= injector.get(AfterRenderImpl);\n const hooks = options?.phase ?? AfterRenderPhase.MixedReadWrite;\n const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;\n const sequence = new AfterRenderSequence(manager.impl, getHooks(callbackOrSpec, hooks), once, destroyRef);\n manager.impl.register(sequence);\n return sequence;\n}\n/** `AfterRenderRef` that does nothing. */\nconst NOOP_AFTER_RENDER_REF = {\n destroy() { },\n};\n\n/**\n * Calculates a data slot index for defer block info (either static or\n * instance-specific), given an index of a defer instruction.\n */\nfunction getDeferBlockDataIndex(deferBlockIndex) {\n // Instance state is located at the *next* position\n // after the defer block slot in an LView or TView.data.\n return deferBlockIndex + 1;\n}\n/** Retrieves a defer block state from an LView, given a TNode that represents a block. */\nfunction getLDeferBlockDetails(lView, tNode) {\n const tView = lView[TVIEW];\n const slotIndex = getDeferBlockDataIndex(tNode.index);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n return lView[slotIndex];\n}\n/** Stores a defer block instance state in LView. */\nfunction setLDeferBlockDetails(lView, deferBlockIndex, lDetails) {\n const tView = lView[TVIEW];\n const slotIndex = getDeferBlockDataIndex(deferBlockIndex);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n lView[slotIndex] = lDetails;\n}\n/** Retrieves static info about a defer block, given a TView and a TNode that represents a block. */\nfunction getTDeferBlockDetails(tView, tNode) {\n const slotIndex = getDeferBlockDataIndex(tNode.index);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n return tView.data[slotIndex];\n}\n/** Stores a defer block static info in `TView.data`. */\nfunction setTDeferBlockDetails(tView, deferBlockIndex, deferBlockConfig) {\n const slotIndex = getDeferBlockDataIndex(deferBlockIndex);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n tView.data[slotIndex] = deferBlockConfig;\n}\nfunction getTemplateIndexForState(newState, hostLView, tNode) {\n const tView = hostLView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n switch (newState) {\n case DeferBlockState.Complete:\n return tDetails.primaryTmplIndex;\n case DeferBlockState.Loading:\n return tDetails.loadingTmplIndex;\n case DeferBlockState.Error:\n return tDetails.errorTmplIndex;\n case DeferBlockState.Placeholder:\n return tDetails.placeholderTmplIndex;\n default:\n ngDevMode && throwError(`Unexpected defer block state: ${newState}`);\n return null;\n }\n}\n/**\n * Returns a minimum amount of time that a given state should be rendered for,\n * taking into account `minimum` parameter value. If the `minimum` value is\n * not specified - returns `null`.\n */\nfunction getMinimumDurationForState(tDetails, currentState) {\n if (currentState === DeferBlockState.Placeholder) {\n return tDetails.placeholderBlockConfig?.[MINIMUM_SLOT] ?? null;\n }\n else if (currentState === DeferBlockState.Loading) {\n return tDetails.loadingBlockConfig?.[MINIMUM_SLOT] ?? null;\n }\n return null;\n}\n/** Retrieves the value of the `after` parameter on the @loading block. */\nfunction getLoadingBlockAfter(tDetails) {\n return tDetails.loadingBlockConfig?.[LOADING_AFTER_SLOT] ?? null;\n}\n/**\n * Adds downloaded dependencies into a directive or a pipe registry,\n * making sure that a dependency doesn't yet exist in the registry.\n */\nfunction addDepsToRegistry(currentDeps, newDeps) {\n if (!currentDeps || currentDeps.length === 0) {\n return newDeps;\n }\n const currentDepSet = new Set(currentDeps);\n for (const dep of newDeps) {\n currentDepSet.add(dep);\n }\n // If `currentDeps` is the same length, there were no new deps and can\n // return the original array.\n return currentDeps.length === currentDepSet.size ? currentDeps : Array.from(currentDepSet);\n}\n/** Retrieves a TNode that represents main content of a defer block. */\nfunction getPrimaryBlockTNode(tView, tDetails) {\n const adjustedIndex = tDetails.primaryTmplIndex + HEADER_OFFSET;\n return getTNode(tView, adjustedIndex);\n}\n/**\n * Asserts whether all dependencies for a defer block are loaded.\n * Always run this function (in dev mode) before rendering a defer\n * block in completed state.\n */\nfunction assertDeferredDependenciesLoaded(tDetails) {\n assertEqual(tDetails.loadingState, DeferDependenciesLoadingState.COMPLETE, 'Expecting all deferred dependencies to be loaded.');\n}\n/**\n * Determines if a given value matches the expected structure of a defer block\n *\n * We can safely rely on the primaryTmplIndex because every defer block requires\n * that a primary template exists. All the other template options are optional.\n */\nfunction isTDeferBlockDetails(value) {\n return (value !== null &&\n typeof value === 'object' &&\n typeof value.primaryTmplIndex === 'number');\n}\n\n/*!\n * @license\n * Copyright Google LLC 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.dev/license\n */\n/** Configuration object used to register passive and capturing events. */\nconst eventListenerOptions = {\n passive: true,\n capture: true,\n};\n/** Keeps track of the currently-registered `on hover` triggers. */\nconst hoverTriggers = new WeakMap();\n/** Keeps track of the currently-registered `on interaction` triggers. */\nconst interactionTriggers = new WeakMap();\n/** Currently-registered `viewport` triggers. */\nconst viewportTriggers = new WeakMap();\n/** Names of the events considered as interaction events. */\nconst interactionEventNames = ['click', 'keydown'];\n/** Names of the events considered as hover events. */\nconst hoverEventNames = ['mouseenter', 'focusin'];\n/** `IntersectionObserver` used to observe `viewport` triggers. */\nlet intersectionObserver = null;\n/** Number of elements currently observed with `viewport` triggers. */\nlet observedViewportElements = 0;\n/** Object keeping track of registered callbacks for a deferred block trigger. */\nclass DeferEventEntry {\n constructor() {\n this.callbacks = new Set();\n this.listener = () => {\n for (const callback of this.callbacks) {\n callback();\n }\n };\n }\n}\n/**\n * Registers an interaction trigger.\n * @param trigger Element that is the trigger.\n * @param callback Callback to be invoked when the trigger is interacted with.\n */\nfunction onInteraction(trigger, callback) {\n let entry = interactionTriggers.get(trigger);\n // If this is the first entry for this element, add the listeners.\n if (!entry) {\n // Note that managing events centrally like this lends itself well to using global\n // event delegation. It currently does delegation at the element level, rather than the\n // document level, because:\n // 1. Global delegation is the most effective when there are a lot of events being registered\n // at the same time. Deferred blocks are unlikely to be used in such a way.\n // 2. Matching events to their target isn't free. For each `click` and `keydown` event we\n // would have look through all the triggers and check if the target either is the element\n // itself or it's contained within the element. Given that `click` and `keydown` are some\n // of the most common events, this may end up introducing a lot of runtime overhead.\n // 3. We're still registering only two events per element, no matter how many deferred blocks\n // are referencing it.\n entry = new DeferEventEntry();\n interactionTriggers.set(trigger, entry);\n for (const name of interactionEventNames) {\n trigger.addEventListener(name, entry.listener, eventListenerOptions);\n }\n }\n entry.callbacks.add(callback);\n return () => {\n const { callbacks, listener } = entry;\n callbacks.delete(callback);\n if (callbacks.size === 0) {\n interactionTriggers.delete(trigger);\n for (const name of interactionEventNames) {\n trigger.removeEventListener(name, listener, eventListenerOptions);\n }\n }\n };\n}\n/**\n * Registers a hover trigger.\n * @param trigger Element that is the trigger.\n * @param callback Callback to be invoked when the trigger is hovered over.\n */\nfunction onHover(trigger, callback) {\n let entry = hoverTriggers.get(trigger);\n // If this is the first entry for this element, add the listener.\n if (!entry) {\n entry = new DeferEventEntry();\n hoverTriggers.set(trigger, entry);\n for (const name of hoverEventNames) {\n trigger.addEventListener(name, entry.listener, eventListenerOptions);\n }\n }\n entry.callbacks.add(callback);\n return () => {\n const { callbacks, listener } = entry;\n callbacks.delete(callback);\n if (callbacks.size === 0) {\n for (const name of hoverEventNames) {\n trigger.removeEventListener(name, listener, eventListenerOptions);\n }\n hoverTriggers.delete(trigger);\n }\n };\n}\n/**\n * Registers a viewport trigger.\n * @param trigger Element that is the trigger.\n * @param callback Callback to be invoked when the trigger comes into the viewport.\n * @param injector Injector that can be used by the trigger to resolve DI tokens.\n */\nfunction onViewport(trigger, callback, injector) {\n const ngZone = injector.get(NgZone);\n let entry = viewportTriggers.get(trigger);\n intersectionObserver =\n intersectionObserver ||\n ngZone.runOutsideAngular(() => {\n return new IntersectionObserver((entries) => {\n for (const current of entries) {\n // Only invoke the callbacks if the specific element is intersecting.\n if (current.isIntersecting && viewportTriggers.has(current.target)) {\n ngZone.run(viewportTriggers.get(current.target).listener);\n }\n }\n });\n });\n if (!entry) {\n entry = new DeferEventEntry();\n ngZone.runOutsideAngular(() => intersectionObserver.observe(trigger));\n viewportTriggers.set(trigger, entry);\n observedViewportElements++;\n }\n entry.callbacks.add(callback);\n return () => {\n // It's possible that a different cleanup callback fully removed this element already.\n if (!viewportTriggers.has(trigger)) {\n return;\n }\n entry.callbacks.delete(callback);\n if (entry.callbacks.size === 0) {\n intersectionObserver?.unobserve(trigger);\n viewportTriggers.delete(trigger);\n observedViewportElements--;\n }\n if (observedViewportElements === 0) {\n intersectionObserver?.disconnect();\n intersectionObserver = null;\n }\n };\n}\n/**\n * Helper function to get the LView in which a deferred block's trigger is rendered.\n * @param deferredHostLView LView in which the deferred block is defined.\n * @param deferredTNode TNode defining the deferred block.\n * @param walkUpTimes Number of times to go up in the view hierarchy to find the trigger's view.\n * A negative value means that the trigger is inside the block's placeholder, while an undefined\n * value means that the trigger is in the same LView as the deferred block.\n */\nfunction getTriggerLView(deferredHostLView, deferredTNode, walkUpTimes) {\n // The trigger is in the same view, we don't need to traverse.\n if (walkUpTimes == null) {\n return deferredHostLView;\n }\n // A positive value or zero means that the trigger is in a parent view.\n if (walkUpTimes >= 0) {\n return walkUpViews(walkUpTimes, deferredHostLView);\n }\n // If the value is negative, it means that the trigger is inside the placeholder.\n const deferredContainer = deferredHostLView[deferredTNode.index];\n ngDevMode && assertLContainer(deferredContainer);\n const triggerLView = deferredContainer[CONTAINER_HEADER_OFFSET] ?? null;\n // We need to null check, because the placeholder might not have been rendered yet.\n if (ngDevMode && triggerLView !== null) {\n const lDetails = getLDeferBlockDetails(deferredHostLView, deferredTNode);\n const renderedState = lDetails[DEFER_BLOCK_STATE];\n assertEqual(renderedState, DeferBlockState.Placeholder, 'Expected a placeholder to be rendered in this defer block.');\n assertLView(triggerLView);\n }\n return triggerLView;\n}\n/**\n * Gets the element that a deferred block's trigger is pointing to.\n * @param triggerLView LView in which the trigger is defined.\n * @param triggerIndex Index at which the trigger element should've been rendered.\n */\nfunction getTriggerElement(triggerLView, triggerIndex) {\n const element = getNativeByIndex(HEADER_OFFSET + triggerIndex, triggerLView);\n ngDevMode && assertElement(element);\n return element;\n}\n/**\n * Registers a DOM-node based trigger.\n * @param initialLView LView in which the defer block is rendered.\n * @param tNode TNode representing the defer block.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to go up/down in the view hierarchy to find the trigger.\n * @param registerFn Function that will register the DOM events.\n * @param callback Callback to be invoked when the trigger receives the event that should render\n * the deferred block.\n * @param type Trigger type to distinguish between regular and prefetch triggers.\n */\nfunction registerDomTrigger(initialLView, tNode, triggerIndex, walkUpTimes, registerFn, callback, type) {\n const injector = initialLView[INJECTOR];\n const zone = injector.get(NgZone);\n function pollDomTrigger() {\n // If the initial view was destroyed, we don't need to do anything.\n if (isDestroyed(initialLView)) {\n return;\n }\n const lDetails = getLDeferBlockDetails(initialLView, tNode);\n const renderedState = lDetails[DEFER_BLOCK_STATE];\n // If the block was loaded before the trigger was resolved, we don't need to do anything.\n if (renderedState !== DeferBlockInternalState.Initial &&\n renderedState !== DeferBlockState.Placeholder) {\n return;\n }\n const triggerLView = getTriggerLView(initialLView, tNode, walkUpTimes);\n // Keep polling until we resolve the trigger's LView.\n if (!triggerLView) {\n afterNextRender({ read: pollDomTrigger }, { injector });\n return;\n }\n // It's possible that the trigger's view was destroyed before we resolved the trigger element.\n if (isDestroyed(triggerLView)) {\n return;\n }\n const element = getTriggerElement(triggerLView, triggerIndex);\n const cleanup = registerFn(element, () => {\n // `pollDomTrigger` runs outside the zone (because of `afterNextRender`) and registers its\n // listeners outside the zone, so we jump back into the zone prior to running the callback.\n zone.run(() => {\n if (initialLView !== triggerLView) {\n removeLViewOnDestroy(triggerLView, cleanup);\n }\n callback();\n });\n }, injector);\n // The trigger and deferred block might be in different LViews.\n // For the main LView the cleanup would happen as a part of\n // `storeTriggerCleanupFn` logic. For trigger LView we register\n // a cleanup function there to remove event handlers in case an\n // LView gets destroyed before a trigger is invoked.\n if (initialLView !== triggerLView) {\n storeLViewOnDestroy(triggerLView, cleanup);\n }\n storeTriggerCleanupFn(type, lDetails, cleanup);\n }\n // Begin polling for the trigger.\n afterNextRender({ read: pollDomTrigger }, { injector });\n}\n\n/**\n * Helper function to schedule a callback to be invoked when a browser becomes idle.\n *\n * @param callback A function to be invoked when a browser becomes idle.\n * @param lView LView that hosts an instance of a defer block.\n */\nfunction onIdle(callback, lView) {\n const injector = lView[INJECTOR];\n const scheduler = injector.get(IdleScheduler);\n const cleanupFn = () => scheduler.remove(callback);\n scheduler.add(callback);\n return cleanupFn;\n}\n/**\n * Use shims for the `requestIdleCallback` and `cancelIdleCallback` functions for\n * environments where those functions are not available (e.g. Node.js and Safari).\n *\n * Note: we wrap the `requestIdleCallback` call into a function, so that it can be\n * overridden/mocked in test environment and picked up by the runtime code.\n */\nconst _requestIdleCallback = () => typeof requestIdleCallback !== 'undefined' ? requestIdleCallback : setTimeout;\nconst _cancelIdleCallback = () => typeof requestIdleCallback !== 'undefined' ? cancelIdleCallback : clearTimeout;\n/**\n * Helper service to schedule `requestIdleCallback`s for batches of defer blocks,\n * to avoid calling `requestIdleCallback` for each defer block (e.g. if\n * defer blocks are defined inside a for loop).\n */\nclass IdleScheduler {\n constructor() {\n // Indicates whether current callbacks are being invoked.\n this.executingCallbacks = false;\n // Currently scheduled idle callback id.\n this.idleId = null;\n // Set of callbacks to be invoked next.\n this.current = new Set();\n // Set of callbacks collected while invoking current set of callbacks.\n // Those callbacks are scheduled for the next idle period.\n this.deferred = new Set();\n this.ngZone = inject(NgZone);\n this.requestIdleCallbackFn = _requestIdleCallback().bind(globalThis);\n this.cancelIdleCallbackFn = _cancelIdleCallback().bind(globalThis);\n }\n add(callback) {\n const target = this.executingCallbacks ? this.deferred : this.current;\n target.add(callback);\n if (this.idleId === null) {\n this.scheduleIdleCallback();\n }\n }\n remove(callback) {\n const { current, deferred } = this;\n current.delete(callback);\n deferred.delete(callback);\n // If the last callback was removed and there is a pending\n // idle callback - cancel it.\n if (current.size === 0 && deferred.size === 0) {\n this.cancelIdleCallback();\n }\n }\n scheduleIdleCallback() {\n const callback = () => {\n this.cancelIdleCallback();\n this.executingCallbacks = true;\n for (const callback of this.current) {\n callback();\n }\n this.current.clear();\n this.executingCallbacks = false;\n // If there are any callbacks added during an invocation\n // of the current ones - make them \"current\" and schedule\n // a new idle callback.\n if (this.deferred.size > 0) {\n for (const callback of this.deferred) {\n this.current.add(callback);\n }\n this.deferred.clear();\n this.scheduleIdleCallback();\n }\n };\n // Ensure that the callback runs in the NgZone since\n // the `requestIdleCallback` is not currently patched by Zone.js.\n this.idleId = this.requestIdleCallbackFn(() => this.ngZone.run(callback));\n }\n cancelIdleCallback() {\n if (this.idleId !== null) {\n this.cancelIdleCallbackFn(this.idleId);\n this.idleId = null;\n }\n }\n ngOnDestroy() {\n this.cancelIdleCallback();\n this.current.clear();\n this.deferred.clear();\n }\n /** @nocollapse */\n static { this.ɵprov = ɵɵdefineInjectable({\n token: IdleScheduler,\n providedIn: 'root',\n factory: () => new IdleScheduler(),\n }); }\n}\n\n/**\n * Returns a function that captures a provided delay.\n * Invoking the returned function schedules a trigger.\n */\nfunction onTimer(delay) {\n return (callback, lView) => scheduleTimerTrigger(delay, callback, lView);\n}\n/**\n * Schedules a callback to be invoked after a given timeout.\n *\n * @param delay A number of ms to wait until firing a callback.\n * @param callback A function to be invoked after a timeout.\n * @param lView LView that hosts an instance of a defer block.\n */\nfunction scheduleTimerTrigger(delay, callback, lView) {\n const injector = lView[INJECTOR];\n const scheduler = injector.get(TimerScheduler);\n const cleanupFn = () => scheduler.remove(callback);\n scheduler.add(delay, callback);\n return cleanupFn;\n}\n/**\n * Helper service to schedule `setTimeout`s for batches of defer blocks,\n * to avoid calling `setTimeout` for each defer block (e.g. if defer blocks\n * are created inside a for loop).\n */\nclass TimerScheduler {\n constructor() {\n // Indicates whether current callbacks are being invoked.\n this.executingCallbacks = false;\n // Currently scheduled `setTimeout` id.\n this.timeoutId = null;\n // When currently scheduled timer would fire.\n this.invokeTimerAt = null;\n // List of callbacks to be invoked.\n // For each callback we also store a timestamp on when the callback\n // should be invoked. We store timestamps and callback functions\n // in a flat array to avoid creating new objects for each entry.\n // [timestamp1, callback1, timestamp2, callback2, ...]\n this.current = [];\n // List of callbacks collected while invoking current set of callbacks.\n // Those callbacks are added to the \"current\" queue at the end of\n // the current callback invocation. The shape of this list is the same\n // as the shape of the `current` list.\n this.deferred = [];\n }\n add(delay, callback) {\n const target = this.executingCallbacks ? this.deferred : this.current;\n this.addToQueue(target, Date.now() + delay, callback);\n this.scheduleTimer();\n }\n remove(callback) {\n const { current, deferred } = this;\n const callbackIndex = this.removeFromQueue(current, callback);\n if (callbackIndex === -1) {\n // Try cleaning up deferred queue only in case\n // we didn't find a callback in the \"current\" queue.\n this.removeFromQueue(deferred, callback);\n }\n // If the last callback was removed and there is a pending timeout - cancel it.\n if (current.length === 0 && deferred.length === 0) {\n this.clearTimeout();\n }\n }\n addToQueue(target, invokeAt, callback) {\n let insertAtIndex = target.length;\n for (let i = 0; i < target.length; i += 2) {\n const invokeQueuedCallbackAt = target[i];\n if (invokeQueuedCallbackAt > invokeAt) {\n // We've reached a first timer that is scheduled\n // for a later time than what we are trying to insert.\n // This is the location at which we need to insert,\n // no need to iterate further.\n insertAtIndex = i;\n break;\n }\n }\n arrayInsert2(target, insertAtIndex, invokeAt, callback);\n }\n removeFromQueue(target, callback) {\n let index = -1;\n for (let i = 0; i < target.length; i += 2) {\n const queuedCallback = target[i + 1];\n if (queuedCallback === callback) {\n index = i;\n break;\n }\n }\n if (index > -1) {\n // Remove 2 elements: a timestamp slot and\n // the following slot with a callback function.\n arraySplice(target, index, 2);\n }\n return index;\n }\n scheduleTimer() {\n const callback = () => {\n this.clearTimeout();\n this.executingCallbacks = true;\n // Clone the current state of the queue, since it might be altered\n // as we invoke callbacks.\n const current = [...this.current];\n // Invoke callbacks that were scheduled to run before the current time.\n const now = Date.now();\n for (let i = 0; i < current.length; i += 2) {\n const invokeAt = current[i];\n const callback = current[i + 1];\n if (invokeAt <= now) {\n callback();\n }\n else {\n // We've reached a timer that should not be invoked yet.\n break;\n }\n }\n // The state of the queue might've changed after callbacks invocation,\n // run the cleanup logic based on the *current* state of the queue.\n let lastCallbackIndex = -1;\n for (let i = 0; i < this.current.length; i += 2) {\n const invokeAt = this.current[i];\n if (invokeAt <= now) {\n // Add +1 to account for a callback function that\n // goes after the timestamp in events array.\n lastCallbackIndex = i + 1;\n }\n else {\n // We've reached a timer that should not be invoked yet.\n break;\n }\n }\n if (lastCallbackIndex >= 0) {\n arraySplice(this.current, 0, lastCallbackIndex + 1);\n }\n this.executingCallbacks = false;\n // If there are any callbacks added during an invocation\n // of the current ones - move them over to the \"current\"\n // queue.\n if (this.deferred.length > 0) {\n for (let i = 0; i < this.deferred.length; i += 2) {\n const invokeAt = this.deferred[i];\n const callback = this.deferred[i + 1];\n this.addToQueue(this.current, invokeAt, callback);\n }\n this.deferred.length = 0;\n }\n this.scheduleTimer();\n };\n // Avoid running timer callbacks more than once per\n // average frame duration. This is needed for better\n // batching and to avoid kicking off excessive change\n // detection cycles.\n const FRAME_DURATION_MS = 16; // 1000ms / 60fps\n if (this.current.length > 0) {\n const now = Date.now();\n // First element in the queue points at the timestamp\n // of the first (earliest) event.\n const invokeAt = this.current[0];\n if (this.timeoutId === null ||\n // Reschedule a timer in case a queue contains an item with\n // an earlier timestamp and the delta is more than an average\n // frame duration.\n (this.invokeTimerAt && this.invokeTimerAt - invokeAt > FRAME_DURATION_MS)) {\n // There was a timeout already, but an earlier event was added\n // into the queue. In this case we drop an old timer and setup\n // a new one with an updated (smaller) timeout.\n this.clearTimeout();\n const timeout = Math.max(invokeAt - now, FRAME_DURATION_MS);\n this.invokeTimerAt = invokeAt;\n this.timeoutId = setTimeout(callback, timeout);\n }\n }\n }\n clearTimeout() {\n if (this.timeoutId !== null) {\n clearTimeout(this.timeoutId);\n this.timeoutId = null;\n }\n }\n ngOnDestroy() {\n this.clearTimeout();\n this.current.length = 0;\n this.deferred.length = 0;\n }\n /** @nocollapse */\n static { this.ɵprov = ɵɵdefineInjectable({\n token: TimerScheduler,\n providedIn: 'root',\n factory: () => new TimerScheduler(),\n }); }\n}\n\n/**\n * **INTERNAL**, avoid referencing it in application code.\n * *\n * Injector token that allows to provide `DeferBlockDependencyInterceptor` class\n * implementation.\n *\n * This token is only injected in devMode\n */\nconst DEFER_BLOCK_DEPENDENCY_INTERCEPTOR = new InjectionToken('DEFER_BLOCK_DEPENDENCY_INTERCEPTOR');\n/**\n * **INTERNAL**, token used for configuring defer block behavior.\n */\nconst DEFER_BLOCK_CONFIG = new InjectionToken(ngDevMode ? 'DEFER_BLOCK_CONFIG' : '');\n/**\n * Returns whether defer blocks should be triggered.\n *\n * Currently, defer blocks are not triggered on the server,\n * only placeholder content is rendered (if provided).\n */\nfunction shouldTriggerDeferBlock(injector) {\n const config = injector.get(DEFER_BLOCK_CONFIG, null, { optional: true });\n if (config?.behavior === DeferBlockBehavior.Manual) {\n return false;\n }\n return isPlatformBrowser(injector);\n}\n/**\n * Reference to the timer-based scheduler implementation of defer block state\n * rendering method. It's used to make timer-based scheduling tree-shakable.\n * If `minimum` or `after` parameters are used, compiler generates an extra\n * argument for the `ɵɵdefer` instruction, which references a timer-based\n * implementation.\n */\nlet applyDeferBlockStateWithSchedulingImpl = null;\n/**\n * Enables timer-related scheduling if `after` or `minimum` parameters are setup\n * on the `@loading` or `@placeholder` blocks.\n */\nfunction ɵɵdeferEnableTimerScheduling(tView, tDetails, placeholderConfigIndex, loadingConfigIndex) {\n const tViewConsts = tView.consts;\n if (placeholderConfigIndex != null) {\n tDetails.placeholderBlockConfig = getConstant(tViewConsts, placeholderConfigIndex);\n }\n if (loadingConfigIndex != null) {\n tDetails.loadingBlockConfig = getConstant(tViewConsts, loadingConfigIndex);\n }\n // Enable implementation that supports timer-based scheduling.\n if (applyDeferBlockStateWithSchedulingImpl === null) {\n applyDeferBlockStateWithSchedulingImpl = applyDeferBlockStateWithScheduling;\n }\n}\n/**\n * Creates runtime data structures for defer blocks.\n *\n * @param index Index of the `defer` instruction.\n * @param primaryTmplIndex Index of the template with the primary block content.\n * @param dependencyResolverFn Function that contains dependencies for this defer block.\n * @param loadingTmplIndex Index of the template with the loading block content.\n * @param placeholderTmplIndex Index of the template with the placeholder block content.\n * @param errorTmplIndex Index of the template with the error block content.\n * @param loadingConfigIndex Index in the constants array of the configuration of the loading.\n * block.\n * @param placeholderConfigIndex Index in the constants array of the configuration of the\n * placeholder block.\n * @param enableTimerScheduling Function that enables timer-related scheduling if `after`\n * or `minimum` parameters are setup on the `@loading` or `@placeholder` blocks.\n *\n * @codeGenApi\n */\nfunction ɵɵdefer(index, primaryTmplIndex, dependencyResolverFn, loadingTmplIndex, placeholderTmplIndex, errorTmplIndex, loadingConfigIndex, placeholderConfigIndex, enableTimerScheduling) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = declareTemplate(lView, tView, index, null, 0, 0);\n if (tView.firstCreatePass) {\n performanceMarkFeature('NgDefer');\n const tDetails = {\n primaryTmplIndex,\n loadingTmplIndex: loadingTmplIndex ?? null,\n placeholderTmplIndex: placeholderTmplIndex ?? null,\n errorTmplIndex: errorTmplIndex ?? null,\n placeholderBlockConfig: null,\n loadingBlockConfig: null,\n dependencyResolverFn: dependencyResolverFn ?? null,\n loadingState: DeferDependenciesLoadingState.NOT_STARTED,\n loadingPromise: null,\n providers: null,\n };\n enableTimerScheduling?.(tView, tDetails, placeholderConfigIndex, loadingConfigIndex);\n setTDeferBlockDetails(tView, adjustedIndex, tDetails);\n }\n const lContainer = lView[adjustedIndex];\n // If hydration is enabled, looks up dehydrated views in the DOM\n // using hydration annotation info and stores those views on LContainer.\n // In client-only mode, this function is a noop.\n populateDehydratedViewsInLContainer(lContainer, tNode, lView);\n // Init instance-specific defer details and store it.\n const lDetails = [\n null, // NEXT_DEFER_BLOCK_STATE\n DeferBlockInternalState.Initial, // DEFER_BLOCK_STATE\n null, // STATE_IS_FROZEN_UNTIL\n null, // LOADING_AFTER_CLEANUP_FN\n null, // TRIGGER_CLEANUP_FNS\n null, // PREFETCH_TRIGGER_CLEANUP_FNS\n ];\n setLDeferBlockDetails(lView, adjustedIndex, lDetails);\n const cleanupTriggersFn = () => invokeAllTriggerCleanupFns(lDetails);\n // When defer block is triggered - unsubscribe from LView destroy cleanup.\n storeTriggerCleanupFn(0 /* TriggerType.Regular */, lDetails, () => removeLViewOnDestroy(lView, cleanupTriggersFn));\n storeLViewOnDestroy(lView, cleanupTriggersFn);\n}\n/**\n * Loads defer block dependencies when a trigger value becomes truthy.\n * @codeGenApi\n */\nfunction ɵɵdeferWhen(rawValue) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, rawValue)) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n const value = Boolean(rawValue); // handle truthy or falsy values\n const tNode = getSelectedTNode();\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const renderedState = lDetails[DEFER_BLOCK_STATE];\n if (value === false && renderedState === DeferBlockInternalState.Initial) {\n // If nothing is rendered yet, render a placeholder (if defined).\n renderPlaceholder(lView, tNode);\n }\n else if (value === true &&\n (renderedState === DeferBlockInternalState.Initial ||\n renderedState === DeferBlockState.Placeholder)) {\n // The `when` condition has changed to `true`, trigger defer block loading\n // if the block is either in initial (nothing is rendered) or a placeholder\n // state.\n triggerDeferBlock(lView, tNode);\n }\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n}\n/**\n * Prefetches the deferred content when a value becomes truthy.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchWhen(rawValue) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, rawValue)) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n const value = Boolean(rawValue); // handle truthy or falsy values\n const tView = lView[TVIEW];\n const tNode = getSelectedTNode();\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (value === true && tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n // If loading has not been started yet, trigger it now.\n triggerPrefetching(tDetails, lView, tNode);\n }\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n}\n/**\n * Sets up logic to handle the `on idle` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnIdle() {\n scheduleDelayedTrigger(onIdle);\n}\n/**\n * Sets up logic to handle the `prefetch on idle` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnIdle() {\n scheduleDelayedPrefetching(onIdle);\n}\n/**\n * Sets up logic to handle the `on immediate` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnImmediate() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const injector = lView[INJECTOR];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n // Render placeholder block only if loading template is not present and we're on\n // the client to avoid content flickering, since it would be immediately replaced\n // by the loading block.\n if (!shouldTriggerDeferBlock(injector) || tDetails.loadingTmplIndex === null) {\n renderPlaceholder(lView, tNode);\n }\n triggerDeferBlock(lView, tNode);\n}\n/**\n * Sets up logic to handle the `prefetch on immediate` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnImmediate() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n triggerResourceLoading(tDetails, lView, tNode);\n }\n}\n/**\n * Creates runtime data structures for the `on timer` deferred trigger.\n * @param delay Amount of time to wait before loading the content.\n * @codeGenApi\n */\nfunction ɵɵdeferOnTimer(delay) {\n scheduleDelayedTrigger(onTimer(delay));\n}\n/**\n * Creates runtime data structures for the `prefetch on timer` deferred trigger.\n * @param delay Amount of time to wait before prefetching the content.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnTimer(delay) {\n scheduleDelayedPrefetching(onTimer(delay));\n}\n/**\n * Creates runtime data structures for the `on hover` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnHover(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n renderPlaceholder(lView, tNode);\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onHover, () => triggerDeferBlock(lView, tNode), 0 /* TriggerType.Regular */);\n}\n/**\n * Creates runtime data structures for the `prefetch on hover` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnHover(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onHover, () => triggerPrefetching(tDetails, lView, tNode), 1 /* TriggerType.Prefetch */);\n }\n}\n/**\n * Creates runtime data structures for the `on interaction` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnInteraction(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n renderPlaceholder(lView, tNode);\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onInteraction, () => triggerDeferBlock(lView, tNode), 0 /* TriggerType.Regular */);\n}\n/**\n * Creates runtime data structures for the `prefetch on interaction` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnInteraction(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onInteraction, () => triggerPrefetching(tDetails, lView, tNode), 1 /* TriggerType.Prefetch */);\n }\n}\n/**\n * Creates runtime data structures for the `on viewport` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnViewport(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n renderPlaceholder(lView, tNode);\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onViewport, () => triggerDeferBlock(lView, tNode), 0 /* TriggerType.Regular */);\n}\n/**\n * Creates runtime data structures for the `prefetch on viewport` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnViewport(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onViewport, () => triggerPrefetching(tDetails, lView, tNode), 1 /* TriggerType.Prefetch */);\n }\n}\n/********** Helper functions **********/\n/**\n * Schedules triggering of a defer block for `on idle` and `on timer` conditions.\n */\nfunction scheduleDelayedTrigger(scheduleFn) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n renderPlaceholder(lView, tNode);\n // Only trigger the scheduled trigger on the browser\n // since we don't want to delay the server response.\n if (isPlatformBrowser(lView[INJECTOR])) {\n const cleanupFn = scheduleFn(() => triggerDeferBlock(lView, tNode), lView);\n const lDetails = getLDeferBlockDetails(lView, tNode);\n storeTriggerCleanupFn(0 /* TriggerType.Regular */, lDetails, cleanupFn);\n }\n}\n/**\n * Schedules prefetching for `on idle` and `on timer` triggers.\n *\n * @param scheduleFn A function that does the scheduling.\n */\nfunction scheduleDelayedPrefetching(scheduleFn) {\n const lView = getLView();\n // Only trigger the scheduled trigger on the browser\n // since we don't want to delay the server response.\n if (isPlatformBrowser(lView[INJECTOR])) {\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const prefetch = () => triggerPrefetching(tDetails, lView, tNode);\n const cleanupFn = scheduleFn(prefetch, lView);\n storeTriggerCleanupFn(1 /* TriggerType.Prefetch */, lDetails, cleanupFn);\n }\n }\n}\n/**\n * Transitions a defer block to the new state. Updates the necessary\n * data structures and renders corresponding block.\n *\n * @param newState New state that should be applied to the defer block.\n * @param tNode TNode that represents a defer block.\n * @param lContainer Represents an instance of a defer block.\n * @param skipTimerScheduling Indicates that `@loading` and `@placeholder` block\n * should be rendered immediately, even if they have `after` or `minimum` config\n * options setup. This flag to needed for testing APIs to transition defer block\n * between states via `DeferFixture.render` method.\n */\nfunction renderDeferBlockState(newState, tNode, lContainer, skipTimerScheduling = false) {\n const hostLView = lContainer[PARENT];\n const hostTView = hostLView[TVIEW];\n // Check if this view is not destroyed. Since the loading process was async,\n // the view might end up being destroyed by the time rendering happens.\n if (isDestroyed(hostLView))\n return;\n // Make sure this TNode belongs to TView that represents host LView.\n ngDevMode && assertTNodeForLView(tNode, hostLView);\n const lDetails = getLDeferBlockDetails(hostLView, tNode);\n ngDevMode && assertDefined(lDetails, 'Expected a defer block state defined');\n const currentState = lDetails[DEFER_BLOCK_STATE];\n if (isValidStateChange(currentState, newState) &&\n isValidStateChange(lDetails[NEXT_DEFER_BLOCK_STATE] ?? -1, newState)) {\n const injector = hostLView[INJECTOR];\n const tDetails = getTDeferBlockDetails(hostTView, tNode);\n // Skips scheduling on the server since it can delay the server response.\n const needsScheduling = !skipTimerScheduling &&\n isPlatformBrowser(injector) &&\n (getLoadingBlockAfter(tDetails) !== null ||\n getMinimumDurationForState(tDetails, DeferBlockState.Loading) !== null ||\n getMinimumDurationForState(tDetails, DeferBlockState.Placeholder));\n if (ngDevMode && needsScheduling) {\n assertDefined(applyDeferBlockStateWithSchedulingImpl, 'Expected scheduling function to be defined');\n }\n const applyStateFn = needsScheduling\n ? applyDeferBlockStateWithSchedulingImpl\n : applyDeferBlockState;\n try {\n applyStateFn(newState, lDetails, lContainer, tNode, hostLView);\n }\n catch (error) {\n handleError(hostLView, error);\n }\n }\n}\n/**\n * Checks whether there is a cached injector associated with a given defer block\n * declaration and returns if it exists. If there is no cached injector present -\n * creates a new injector and stores in the cache.\n */\nfunction getOrCreateEnvironmentInjector(parentInjector, tDetails, providers) {\n return parentInjector\n .get(CachedInjectorService)\n .getOrCreateInjector(tDetails, parentInjector, providers, ngDevMode ? 'DeferBlock Injector' : '');\n}\n/**\n * Creates a new injector, which contains providers collected from dependencies (NgModules) of\n * defer-loaded components. This function detects different types of parent injectors and creates\n * a new injector based on that.\n */\nfunction createDeferBlockInjector(parentInjector, tDetails, providers) {\n // Check if the parent injector is an instance of a `ChainedInjector`.\n //\n // In this case, we retain the shape of the injector and use a newly created\n // `EnvironmentInjector` as a parent in the `ChainedInjector`. That is needed to\n // make sure that the primary injector gets consulted first (since it's typically\n // a NodeInjector) and `EnvironmentInjector` tree is consulted after that.\n if (parentInjector instanceof ChainedInjector) {\n const origInjector = parentInjector.injector;\n // Guaranteed to be an environment injector\n const parentEnvInjector = parentInjector.parentInjector;\n const envInjector = getOrCreateEnvironmentInjector(parentEnvInjector, tDetails, providers);\n return new ChainedInjector(origInjector, envInjector);\n }\n const parentEnvInjector = parentInjector.get(EnvironmentInjector);\n // If the `parentInjector` is *not* an `EnvironmentInjector` - we need to create\n // a new `ChainedInjector` with the following setup:\n //\n // - the provided `parentInjector` becomes a primary injector\n // - an existing (real) `EnvironmentInjector` becomes a parent injector for\n // a newly-created one, which contains extra providers\n //\n // So the final order in which injectors would be consulted in this case would look like this:\n //\n // 1. Provided `parentInjector`\n // 2. Newly-created `EnvironmentInjector` with extra providers\n // 3. `EnvironmentInjector` from the `parentInjector`\n if (parentEnvInjector !== parentInjector) {\n const envInjector = getOrCreateEnvironmentInjector(parentEnvInjector, tDetails, providers);\n return new ChainedInjector(parentInjector, envInjector);\n }\n // The `parentInjector` is an instance of an `EnvironmentInjector`.\n // No need for special handling, we can use `parentInjector` as a\n // parent injector directly.\n return getOrCreateEnvironmentInjector(parentInjector, tDetails, providers);\n}\n/**\n * Applies changes to the DOM to reflect a given state.\n */\nfunction applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView) {\n const stateTmplIndex = getTemplateIndexForState(newState, hostLView, tNode);\n if (stateTmplIndex !== null) {\n lDetails[DEFER_BLOCK_STATE] = newState;\n const hostTView = hostLView[TVIEW];\n const adjustedIndex = stateTmplIndex + HEADER_OFFSET;\n const activeBlockTNode = getTNode(hostTView, adjustedIndex);\n // There is only 1 view that can be present in an LContainer that\n // represents a defer block, so always refer to the first one.\n const viewIndex = 0;\n removeLViewFromLContainer(lContainer, viewIndex);\n let injector;\n if (newState === DeferBlockState.Complete) {\n // When we render a defer block in completed state, there might be\n // newly loaded standalone components used within the block, which may\n // import NgModules with providers. In order to make those providers\n // available for components declared in that NgModule, we create an instance\n // of an environment injector to host those providers and pass this injector\n // to the logic that creates a view.\n const tDetails = getTDeferBlockDetails(hostTView, tNode);\n const providers = tDetails.providers;\n if (providers && providers.length > 0) {\n injector = createDeferBlockInjector(hostLView[INJECTOR], tDetails, providers);\n }\n }\n const dehydratedView = findMatchingDehydratedView(lContainer, activeBlockTNode.tView.ssrId);\n const embeddedLView = createAndRenderEmbeddedLView(hostLView, activeBlockTNode, null, {\n dehydratedView,\n injector,\n });\n addLViewToLContainer(lContainer, embeddedLView, viewIndex, shouldAddViewToDom(activeBlockTNode, dehydratedView));\n markViewDirty(embeddedLView, 2 /* NotificationSource.DeferBlockStateUpdate */);\n }\n}\n/**\n * Extends the `applyDeferBlockState` with timer-based scheduling.\n * This function becomes available on a page if there are defer blocks\n * that use `after` or `minimum` parameters in the `@loading` or\n * `@placeholder` blocks.\n */\nfunction applyDeferBlockStateWithScheduling(newState, lDetails, lContainer, tNode, hostLView) {\n const now = Date.now();\n const hostTView = hostLView[TVIEW];\n const tDetails = getTDeferBlockDetails(hostTView, tNode);\n if (lDetails[STATE_IS_FROZEN_UNTIL] === null || lDetails[STATE_IS_FROZEN_UNTIL] <= now) {\n lDetails[STATE_IS_FROZEN_UNTIL] = null;\n const loadingAfter = getLoadingBlockAfter(tDetails);\n const inLoadingAfterPhase = lDetails[LOADING_AFTER_CLEANUP_FN] !== null;\n if (newState === DeferBlockState.Loading && loadingAfter !== null && !inLoadingAfterPhase) {\n // Trying to render loading, but it has an `after` config,\n // so schedule an update action after a timeout.\n lDetails[NEXT_DEFER_BLOCK_STATE] = newState;\n const cleanupFn = scheduleDeferBlockUpdate(loadingAfter, lDetails, tNode, lContainer, hostLView);\n lDetails[LOADING_AFTER_CLEANUP_FN] = cleanupFn;\n }\n else {\n // If we transition to a complete or an error state and there is a pending\n // operation to render loading after a timeout - invoke a cleanup operation,\n // which stops the timer.\n if (newState > DeferBlockState.Loading && inLoadingAfterPhase) {\n lDetails[LOADING_AFTER_CLEANUP_FN]();\n lDetails[LOADING_AFTER_CLEANUP_FN] = null;\n lDetails[NEXT_DEFER_BLOCK_STATE] = null;\n }\n applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView);\n const duration = getMinimumDurationForState(tDetails, newState);\n if (duration !== null) {\n lDetails[STATE_IS_FROZEN_UNTIL] = now + duration;\n scheduleDeferBlockUpdate(duration, lDetails, tNode, lContainer, hostLView);\n }\n }\n }\n else {\n // We are still rendering the previous state.\n // Update the `NEXT_DEFER_BLOCK_STATE`, which would be\n // picked up once it's time to transition to the next state.\n lDetails[NEXT_DEFER_BLOCK_STATE] = newState;\n }\n}\n/**\n * Schedules an update operation after a specified timeout.\n */\nfunction scheduleDeferBlockUpdate(timeout, lDetails, tNode, lContainer, hostLView) {\n const callback = () => {\n const nextState = lDetails[NEXT_DEFER_BLOCK_STATE];\n lDetails[STATE_IS_FROZEN_UNTIL] = null;\n lDetails[NEXT_DEFER_BLOCK_STATE] = null;\n if (nextState !== null) {\n renderDeferBlockState(nextState, tNode, lContainer);\n }\n };\n return scheduleTimerTrigger(timeout, callback, hostLView);\n}\n/**\n * Checks whether we can transition to the next state.\n *\n * We transition to the next state if the previous state was represented\n * with a number that is less than the next state. For example, if the current\n * state is \"loading\" (represented as `1`), we should not show a placeholder\n * (represented as `0`), but we can show a completed state (represented as `2`)\n * or an error state (represented as `3`).\n */\nfunction isValidStateChange(currentState, newState) {\n return currentState < newState;\n}\n/**\n * Trigger prefetching of dependencies for a defer block.\n *\n * @param tDetails Static information about this defer block.\n * @param lView LView of a host view.\n */\nfunction triggerPrefetching(tDetails, lView, tNode) {\n if (lView[INJECTOR] && shouldTriggerDeferBlock(lView[INJECTOR])) {\n triggerResourceLoading(tDetails, lView, tNode);\n }\n}\n/**\n * Trigger loading of defer block dependencies if the process hasn't started yet.\n *\n * @param tDetails Static information about this defer block.\n * @param lView LView of a host view.\n */\nfunction triggerResourceLoading(tDetails, lView, tNode) {\n const injector = lView[INJECTOR];\n const tView = lView[TVIEW];\n if (tDetails.loadingState !== DeferDependenciesLoadingState.NOT_STARTED) {\n // If the loading status is different from initial one, it means that\n // the loading of dependencies is in progress and there is nothing to do\n // in this function. All details can be obtained from the `tDetails` object.\n return tDetails.loadingPromise ?? Promise.resolve();\n }\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const primaryBlockTNode = getPrimaryBlockTNode(tView, tDetails);\n // Switch from NOT_STARTED -> IN_PROGRESS state.\n tDetails.loadingState = DeferDependenciesLoadingState.IN_PROGRESS;\n // Prefetching is triggered, cleanup all registered prefetch triggers.\n invokeTriggerCleanupFns(1 /* TriggerType.Prefetch */, lDetails);\n let dependenciesFn = tDetails.dependencyResolverFn;\n if (ngDevMode) {\n // Check if dependency function interceptor is configured.\n const deferDependencyInterceptor = injector.get(DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, null, {\n optional: true,\n });\n if (deferDependencyInterceptor) {\n dependenciesFn = deferDependencyInterceptor.intercept(dependenciesFn);\n }\n }\n // Indicate that an application is not stable and has a pending task.\n const pendingTasks = injector.get(PendingTasks);\n const taskId = pendingTasks.add();\n // The `dependenciesFn` might be `null` when all dependencies within\n // a given defer block were eagerly referenced elsewhere in a file,\n // thus no dynamic `import()`s were produced.\n if (!dependenciesFn) {\n tDetails.loadingPromise = Promise.resolve().then(() => {\n tDetails.loadingPromise = null;\n tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;\n pendingTasks.remove(taskId);\n });\n return tDetails.loadingPromise;\n }\n // Start downloading of defer block dependencies.\n tDetails.loadingPromise = Promise.allSettled(dependenciesFn()).then((results) => {\n let failed = false;\n const directiveDefs = [];\n const pipeDefs = [];\n for (const result of results) {\n if (result.status === 'fulfilled') {\n const dependency = result.value;\n const directiveDef = getComponentDef(dependency) || getDirectiveDef(dependency);\n if (directiveDef) {\n directiveDefs.push(directiveDef);\n }\n else {\n const pipeDef = getPipeDef$1(dependency);\n if (pipeDef) {\n pipeDefs.push(pipeDef);\n }\n }\n }\n else {\n failed = true;\n break;\n }\n }\n // Loading is completed, we no longer need the loading Promise\n // and a pending task should also be removed.\n tDetails.loadingPromise = null;\n pendingTasks.remove(taskId);\n if (failed) {\n tDetails.loadingState = DeferDependenciesLoadingState.FAILED;\n if (tDetails.errorTmplIndex === null) {\n const templateLocation = ngDevMode ? getTemplateLocationDetails(lView) : '';\n const error = new RuntimeError(750 /* RuntimeErrorCode.DEFER_LOADING_FAILED */, ngDevMode &&\n 'Loading dependencies for `@defer` block failed, ' +\n `but no \\`@error\\` block was configured${templateLocation}. ` +\n 'Consider using the `@error` block to render an error state.');\n handleError(lView, error);\n }\n }\n else {\n tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;\n // Update directive and pipe registries to add newly downloaded dependencies.\n const primaryBlockTView = primaryBlockTNode.tView;\n if (directiveDefs.length > 0) {\n primaryBlockTView.directiveRegistry = addDepsToRegistry(primaryBlockTView.directiveRegistry, directiveDefs);\n // Extract providers from all NgModules imported by standalone components\n // used within this defer block.\n const directiveTypes = directiveDefs.map((def) => def.type);\n const providers = internalImportProvidersFrom(false, ...directiveTypes);\n tDetails.providers = providers;\n }\n if (pipeDefs.length > 0) {\n primaryBlockTView.pipeRegistry = addDepsToRegistry(primaryBlockTView.pipeRegistry, pipeDefs);\n }\n }\n });\n return tDetails.loadingPromise;\n}\n/** Utility function to render placeholder content (if present) */\nfunction renderPlaceholder(lView, tNode) {\n const lContainer = lView[tNode.index];\n ngDevMode && assertLContainer(lContainer);\n renderDeferBlockState(DeferBlockState.Placeholder, tNode, lContainer);\n}\n/**\n * Subscribes to the \"loading\" Promise and renders corresponding defer sub-block,\n * based on the loading results.\n *\n * @param lContainer Represents an instance of a defer block.\n * @param tNode Represents defer block info shared across all instances.\n */\nfunction renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer) {\n ngDevMode &&\n assertDefined(tDetails.loadingPromise, 'Expected loading Promise to exist on this defer block');\n tDetails.loadingPromise.then(() => {\n if (tDetails.loadingState === DeferDependenciesLoadingState.COMPLETE) {\n ngDevMode && assertDeferredDependenciesLoaded(tDetails);\n // Everything is loaded, show the primary block content\n renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer);\n }\n else if (tDetails.loadingState === DeferDependenciesLoadingState.FAILED) {\n renderDeferBlockState(DeferBlockState.Error, tNode, lContainer);\n }\n });\n}\n/**\n * Attempts to trigger loading of defer block dependencies.\n * If the block is already in a loading, completed or an error state -\n * no additional actions are taken.\n */\nfunction triggerDeferBlock(lView, tNode) {\n const tView = lView[TVIEW];\n const lContainer = lView[tNode.index];\n const injector = lView[INJECTOR];\n ngDevMode && assertLContainer(lContainer);\n if (!shouldTriggerDeferBlock(injector))\n return;\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const tDetails = getTDeferBlockDetails(tView, tNode);\n // Defer block is triggered, cleanup all registered trigger functions.\n invokeAllTriggerCleanupFns(lDetails);\n switch (tDetails.loadingState) {\n case DeferDependenciesLoadingState.NOT_STARTED:\n renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer);\n triggerResourceLoading(tDetails, lView, tNode);\n // The `loadingState` might have changed to \"loading\".\n if (tDetails.loadingState ===\n DeferDependenciesLoadingState.IN_PROGRESS) {\n renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer);\n }\n break;\n case DeferDependenciesLoadingState.IN_PROGRESS:\n renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer);\n renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer);\n break;\n case DeferDependenciesLoadingState.COMPLETE:\n ngDevMode && assertDeferredDependenciesLoaded(tDetails);\n renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer);\n break;\n case DeferDependenciesLoadingState.FAILED:\n renderDeferBlockState(DeferBlockState.Error, tNode, lContainer);\n break;\n default:\n if (ngDevMode) {\n throwError('Unknown defer block state');\n }\n }\n}\n\n/**\n * Updates the value of or removes a bound attribute on an Element.\n *\n * Used in the case of `[attr.title]=\"value\"`\n *\n * @param name name The name of the attribute.\n * @param value value The attribute is removed when value is `null` or `undefined`.\n * Otherwise the attribute value is set to the stringified value.\n * @param sanitizer An optional function used to sanitize the value.\n * @param namespace Optional namespace to use when setting the attribute.\n *\n * @codeGenApi\n */\nfunction ɵɵattribute(name, value, sanitizer, namespace) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);\n }\n return ɵɵattribute;\n}\n\n/**\n * Create interpolation bindings with a variable number of expressions.\n *\n * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.\n * Those are faster because there is no need to create an array of expressions and iterate over it.\n *\n * `values`:\n * - has static text at even indexes,\n * - has evaluated expressions at odd indexes.\n *\n * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nfunction interpolationV(lView, values) {\n ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');\n ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');\n let isBindingUpdated = false;\n let bindingIndex = getBindingIndex();\n for (let i = 1; i < values.length; i += 2) {\n // Check if bindings (odd indexes) have changed\n isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;\n }\n setBindingIndex(bindingIndex);\n if (!isBindingUpdated) {\n return NO_CHANGE;\n }\n // Build the updated content\n let content = values[0];\n for (let i = 1; i < values.length; i += 2) {\n content += renderStringify(values[i]) + values[i + 1];\n }\n return content;\n}\n/**\n * Creates an interpolation binding with 1 expression.\n *\n * @param prefix static value used for concatenation only.\n * @param v0 value checked for change.\n * @param suffix static value used for concatenation only.\n */\nfunction interpolation1(lView, prefix, v0, suffix) {\n const different = bindingUpdated(lView, nextBindingIndex(), v0);\n return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 2 expressions.\n */\nfunction interpolation2(lView, prefix, v0, i0, v1, suffix) {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated2(lView, bindingIndex, v0, v1);\n incrementBindingIndex(2);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 3 expressions.\n */\nfunction interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);\n incrementBindingIndex(3);\n return different\n ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix\n : NO_CHANGE;\n}\n/**\n * Create an interpolation binding with 4 expressions.\n */\nfunction interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n incrementBindingIndex(4);\n return different\n ? prefix +\n renderStringify(v0) +\n i0 +\n renderStringify(v1) +\n i1 +\n renderStringify(v2) +\n i2 +\n renderStringify(v3) +\n suffix\n : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 5 expressions.\n */\nfunction interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated(lView, bindingIndex + 4, v4) || different;\n incrementBindingIndex(5);\n return different\n ? prefix +\n renderStringify(v0) +\n i0 +\n renderStringify(v1) +\n i1 +\n renderStringify(v2) +\n i2 +\n renderStringify(v3) +\n i3 +\n renderStringify(v4) +\n suffix\n : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 6 expressions.\n */\nfunction interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;\n incrementBindingIndex(6);\n return different\n ? prefix +\n renderStringify(v0) +\n i0 +\n renderStringify(v1) +\n i1 +\n renderStringify(v2) +\n i2 +\n renderStringify(v3) +\n i3 +\n renderStringify(v4) +\n i4 +\n renderStringify(v5) +\n suffix\n : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 7 expressions.\n */\nfunction interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;\n incrementBindingIndex(7);\n return different\n ? prefix +\n renderStringify(v0) +\n i0 +\n renderStringify(v1) +\n i1 +\n renderStringify(v2) +\n i2 +\n renderStringify(v3) +\n i3 +\n renderStringify(v4) +\n i4 +\n renderStringify(v5) +\n i5 +\n renderStringify(v6) +\n suffix\n : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 8 expressions.\n */\nfunction interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;\n incrementBindingIndex(8);\n return different\n ? prefix +\n renderStringify(v0) +\n i0 +\n renderStringify(v1) +\n i1 +\n renderStringify(v2) +\n i2 +\n renderStringify(v3) +\n i3 +\n renderStringify(v4) +\n i4 +\n renderStringify(v5) +\n i5 +\n renderStringify(v6) +\n i6 +\n renderStringify(v7) +\n suffix\n : NO_CHANGE;\n}\n\n/**\n *\n * Update an interpolated attribute on an element with single bound value surrounded by text.\n *\n * Used when the value passed to a property has 1 interpolated value in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode &&\n storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);\n }\n return ɵɵattributeInterpolate1;\n}\n/**\n *\n * Update an interpolated attribute on an element with 2 bound values surrounded by text.\n *\n * Used when the value passed to a property has 2 interpolated values in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}-{{v1}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode &&\n storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);\n }\n return ɵɵattributeInterpolate2;\n}\n/**\n *\n * Update an interpolated attribute on an element with 3 bound values surrounded by text.\n *\n * Used when the value passed to a property has 3 interpolated values in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate3(\n * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode &&\n storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);\n }\n return ɵɵattributeInterpolate3;\n}\n/**\n *\n * Update an interpolated attribute on an element with 4 bound values surrounded by text.\n *\n * Used when the value passed to a property has 4 interpolated values in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate4(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode &&\n storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);\n }\n return ɵɵattributeInterpolate4;\n}\n/**\n *\n * Update an interpolated attribute on an element with 5 bound values surrounded by text.\n *\n * Used when the value passed to a property has 5 interpolated values in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate5(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode &&\n storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);\n }\n return ɵɵattributeInterpolate5;\n}\n/**\n *\n * Update an interpolated attribute on an element with 6 bound values surrounded by text.\n *\n * Used when the value passed to a property has 6 interpolated values in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate6(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate6(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode &&\n storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);\n }\n return ɵɵattributeInterpolate6;\n}\n/**\n *\n * Update an interpolated attribute on an element with 7 bound values surrounded by text.\n *\n * Used when the value passed to a property has 7 interpolated values in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate7(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate7(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode &&\n storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);\n }\n return ɵɵattributeInterpolate7;\n}\n/**\n *\n * Update an interpolated attribute on an element with 8 bound values surrounded by text.\n *\n * Used when the value passed to a property has 8 interpolated values in it:\n *\n * ```html\n * <div attr.title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolate8(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n * ```\n *\n * @param attrName The name of the attribute to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param i6 Static value used for concatenation only.\n * @param v7 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolate8(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, sanitizer, namespace) {\n const lView = getLView();\n const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);\n ngDevMode &&\n storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);\n }\n return ɵɵattributeInterpolate8;\n}\n/**\n * Update an interpolated attribute on an element with 9 or more bound values surrounded by text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div\n * title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵattributeInterpolateV(\n * 'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n * 'suffix']);\n * ```\n *\n * @param attrName The name of the attribute to update.\n * @param values The collection of values and the strings in-between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵattributeInterpolateV(attrName, values, sanitizer, namespace) {\n const lView = getLView();\n const interpolated = interpolationV(lView, values);\n if (interpolated !== NO_CHANGE) {\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, attrName, interpolated, sanitizer, namespace);\n if (ngDevMode) {\n const interpolationInBetween = [values[0]]; // prefix\n for (let i = 2; i < values.length; i += 2) {\n interpolationInBetween.push(values[i]);\n }\n storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - interpolationInBetween.length + 1, ...interpolationInBetween);\n }\n }\n return ɵɵattributeInterpolateV;\n}\n\nfunction toTStylingRange(prev, next) {\n ngDevMode && assertNumberInRange(prev, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n return ((prev << 17 /* StylingRange.PREV_SHIFT */) | (next << 2 /* StylingRange.NEXT_SHIFT */));\n}\nfunction getTStylingRangePrev(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange >> 17 /* StylingRange.PREV_SHIFT */) & 32767 /* StylingRange.UNSIGNED_MASK */;\n}\nfunction getTStylingRangePrevDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange & 2 /* StylingRange.PREV_DUPLICATE */) == 2 /* StylingRange.PREV_DUPLICATE */;\n}\nfunction setTStylingRangePrev(tStylingRange, previous) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n ngDevMode && assertNumberInRange(previous, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n return ((tStylingRange & ~4294836224 /* StylingRange.PREV_MASK */) |\n (previous << 17 /* StylingRange.PREV_SHIFT */));\n}\nfunction setTStylingRangePrevDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange | 2 /* StylingRange.PREV_DUPLICATE */);\n}\nfunction getTStylingRangeNext(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange & 131068 /* StylingRange.NEXT_MASK */) >> 2 /* StylingRange.NEXT_SHIFT */;\n}\nfunction setTStylingRangeNext(tStylingRange, next) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n return ((tStylingRange & ~131068 /* StylingRange.NEXT_MASK */) | //\n (next << 2 /* StylingRange.NEXT_SHIFT */));\n}\nfunction getTStylingRangeNextDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange & 1 /* StylingRange.NEXT_DUPLICATE */) === 1 /* StylingRange.NEXT_DUPLICATE */;\n}\nfunction setTStylingRangeNextDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange | 1 /* StylingRange.NEXT_DUPLICATE */);\n}\nfunction getTStylingRangeTail(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n const next = getTStylingRangeNext(tStylingRange);\n return next === 0 ? getTStylingRangePrev(tStylingRange) : next;\n}\n\n/**\n * NOTE: The word `styling` is used interchangeably as style or class styling.\n *\n * This file contains code to link styling instructions together so that they can be replayed in\n * priority order. The file exists because Ivy styling instruction execution order does not match\n * that of the priority order. The purpose of this code is to create a linked list so that the\n * instructions can be traversed in priority order when computing the styles.\n *\n * Assume we are dealing with the following code:\n * ```\n * @Component({\n * template: `\n * <my-cmp [style]=\" {color: '#001'} \"\n * [style.color]=\" #002 \"\n * dir-style-color-1\n * dir-style-color-2> `\n * })\n * class ExampleComponent {\n * static ngComp = ... {\n * ...\n * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n * ɵɵstyleMap({color: '#001'});\n * ɵɵstyleProp('color', '#002');\n * ...\n * }\n * }\n *\n * @Directive({\n * selector: `[dir-style-color-1]',\n * })\n * class Style1Directive {\n * @HostBinding('style') style = {color: '#005'};\n * @HostBinding('style.color') color = '#006';\n *\n * static ngDir = ... {\n * ...\n * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n * ɵɵstyleMap({color: '#005'});\n * ɵɵstyleProp('color', '#006');\n * ...\n * }\n * }\n *\n * @Directive({\n * selector: `[dir-style-color-2]',\n * })\n * class Style2Directive {\n * @HostBinding('style') style = {color: '#007'};\n * @HostBinding('style.color') color = '#008';\n *\n * static ngDir = ... {\n * ...\n * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n * ɵɵstyleMap({color: '#007'});\n * ɵɵstyleProp('color', '#008');\n * ...\n * }\n * }\n *\n * @Directive({\n * selector: `my-cmp',\n * })\n * class MyComponent {\n * @HostBinding('style') style = {color: '#003'};\n * @HostBinding('style.color') color = '#004';\n *\n * static ngComp = ... {\n * ...\n * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n * ɵɵstyleMap({color: '#003'});\n * ɵɵstyleProp('color', '#004');\n * ...\n * }\n * }\n * ```\n *\n * The Order of instruction execution is:\n *\n * NOTE: the comment binding location is for illustrative purposes only.\n *\n * ```\n * // Template: (ExampleComponent)\n * ɵɵstyleMap({color: '#001'}); // Binding index: 10\n * ɵɵstyleProp('color', '#002'); // Binding index: 12\n * // MyComponent\n * ɵɵstyleMap({color: '#003'}); // Binding index: 20\n * ɵɵstyleProp('color', '#004'); // Binding index: 22\n * // Style1Directive\n * ɵɵstyleMap({color: '#005'}); // Binding index: 24\n * ɵɵstyleProp('color', '#006'); // Binding index: 26\n * // Style2Directive\n * ɵɵstyleMap({color: '#007'}); // Binding index: 28\n * ɵɵstyleProp('color', '#008'); // Binding index: 30\n * ```\n *\n * The correct priority order of concatenation is:\n *\n * ```\n * // MyComponent\n * ɵɵstyleMap({color: '#003'}); // Binding index: 20\n * ɵɵstyleProp('color', '#004'); // Binding index: 22\n * // Style1Directive\n * ɵɵstyleMap({color: '#005'}); // Binding index: 24\n * ɵɵstyleProp('color', '#006'); // Binding index: 26\n * // Style2Directive\n * ɵɵstyleMap({color: '#007'}); // Binding index: 28\n * ɵɵstyleProp('color', '#008'); // Binding index: 30\n * // Template: (ExampleComponent)\n * ɵɵstyleMap({color: '#001'}); // Binding index: 10\n * ɵɵstyleProp('color', '#002'); // Binding index: 12\n * ```\n *\n * What color should be rendered?\n *\n * Once the items are correctly sorted in the list, the answer is simply the last item in the\n * concatenation list which is `#002`.\n *\n * To do so we keep a linked list of all of the bindings which pertain to this element.\n * Notice that the bindings are inserted in the order of execution, but the `TView.data` allows\n * us to traverse them in the order of priority.\n *\n * |Idx|`TView.data`|`LView` | Notes\n * |---|------------|-----------------|--------------\n * |...| | |\n * |10 |`null` |`{color: '#001'}`| `ɵɵstyleMap('color', {color: '#001'})`\n * |11 |`30 | 12` | ... |\n * |12 |`color` |`'#002'` | `ɵɵstyleProp('color', '#002')`\n * |13 |`10 | 0` | ... |\n * |...| | |\n * |20 |`null` |`{color: '#003'}`| `ɵɵstyleMap('color', {color: '#003'})`\n * |21 |`0 | 22` | ... |\n * |22 |`color` |`'#004'` | `ɵɵstyleProp('color', '#004')`\n * |23 |`20 | 24` | ... |\n * |24 |`null` |`{color: '#005'}`| `ɵɵstyleMap('color', {color: '#005'})`\n * |25 |`22 | 26` | ... |\n * |26 |`color` |`'#006'` | `ɵɵstyleProp('color', '#006')`\n * |27 |`24 | 28` | ... |\n * |28 |`null` |`{color: '#007'}`| `ɵɵstyleMap('color', {color: '#007'})`\n * |29 |`26 | 30` | ... |\n * |30 |`color` |`'#008'` | `ɵɵstyleProp('color', '#008')`\n * |31 |`28 | 10` | ... |\n *\n * The above data structure allows us to re-concatenate the styling no matter which data binding\n * changes.\n *\n * NOTE: in addition to keeping track of next/previous index the `TView.data` also stores prev/next\n * duplicate bit. The duplicate bit if true says there either is a binding with the same name or\n * there is a map (which may contain the name). This information is useful in knowing if other\n * styles with higher priority need to be searched for overwrites.\n *\n * NOTE: See `should support example in 'tnode_linked_list.ts' documentation` in\n * `tnode_linked_list_spec.ts` for working example.\n */\nlet __unused_const_as_closure_does_not_like_standalone_comment_blocks__;\n/**\n * Insert new `tStyleValue` at `TData` and link existing style bindings such that we maintain linked\n * list of styles and compute the duplicate flag.\n *\n * Note: this function is executed during `firstUpdatePass` only to populate the `TView.data`.\n *\n * The function works by keeping track of `tStylingRange` which contains two pointers pointing to\n * the head/tail of the template portion of the styles.\n * - if `isHost === false` (we are template) then insertion is at tail of `TStylingRange`\n * - if `isHost === true` (we are host binding) then insertion is at head of `TStylingRange`\n *\n * @param tData The `TData` to insert into.\n * @param tNode `TNode` associated with the styling element.\n * @param tStylingKey See `TStylingKey`.\n * @param index location of where `tStyleValue` should be stored (and linked into list.)\n * @param isHostBinding `true` if the insertion is for a `hostBinding`. (insertion is in front of\n * template.)\n * @param isClassBinding True if the associated `tStylingKey` as a `class` styling.\n * `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.)\n */\nfunction insertTStylingBinding(tData, tNode, tStylingKeyWithStatic, index, isHostBinding, isClassBinding) {\n ngDevMode && assertFirstUpdatePass(getTView());\n let tBindings = isClassBinding ? tNode.classBindings : tNode.styleBindings;\n let tmplHead = getTStylingRangePrev(tBindings);\n let tmplTail = getTStylingRangeNext(tBindings);\n tData[index] = tStylingKeyWithStatic;\n let isKeyDuplicateOfStatic = false;\n let tStylingKey;\n if (Array.isArray(tStylingKeyWithStatic)) {\n // We are case when the `TStylingKey` contains static fields as well.\n const staticKeyValueArray = tStylingKeyWithStatic;\n tStylingKey = staticKeyValueArray[1]; // unwrap.\n // We need to check if our key is present in the static so that we can mark it as duplicate.\n if (tStylingKey === null ||\n keyValueArrayIndexOf(staticKeyValueArray, tStylingKey) > 0) {\n // tStylingKey is present in the statics, need to mark it as duplicate.\n isKeyDuplicateOfStatic = true;\n }\n }\n else {\n tStylingKey = tStylingKeyWithStatic;\n }\n if (isHostBinding) {\n // We are inserting host bindings\n // If we don't have template bindings then `tail` is 0.\n const hasTemplateBindings = tmplTail !== 0;\n // This is important to know because that means that the `head` can't point to the first\n // template bindings (there are none.) Instead the head points to the tail of the template.\n if (hasTemplateBindings) {\n // template head's \"prev\" will point to last host binding or to 0 if no host bindings yet\n const previousNode = getTStylingRangePrev(tData[tmplHead + 1]);\n tData[index + 1] = toTStylingRange(previousNode, tmplHead);\n // if a host binding has already been registered, we need to update the next of that host\n // binding to point to this one\n if (previousNode !== 0) {\n // We need to update the template-tail value to point to us.\n tData[previousNode + 1] = setTStylingRangeNext(tData[previousNode + 1], index);\n }\n // The \"previous\" of the template binding head should point to this host binding\n tData[tmplHead + 1] = setTStylingRangePrev(tData[tmplHead + 1], index);\n }\n else {\n tData[index + 1] = toTStylingRange(tmplHead, 0);\n // if a host binding has already been registered, we need to update the next of that host\n // binding to point to this one\n if (tmplHead !== 0) {\n // We need to update the template-tail value to point to us.\n tData[tmplHead + 1] = setTStylingRangeNext(tData[tmplHead + 1], index);\n }\n // if we don't have template, the head points to template-tail, and needs to be advanced.\n tmplHead = index;\n }\n }\n else {\n // We are inserting in template section.\n // We need to set this binding's \"previous\" to the current template tail\n tData[index + 1] = toTStylingRange(tmplTail, 0);\n ngDevMode &&\n assertEqual(tmplHead !== 0 && tmplTail === 0, false, 'Adding template bindings after hostBindings is not allowed.');\n if (tmplHead === 0) {\n tmplHead = index;\n }\n else {\n // We need to update the previous value \"next\" to point to this binding\n tData[tmplTail + 1] = setTStylingRangeNext(tData[tmplTail + 1], index);\n }\n tmplTail = index;\n }\n // Now we need to update / compute the duplicates.\n // Starting with our location search towards head (least priority)\n if (isKeyDuplicateOfStatic) {\n tData[index + 1] = setTStylingRangePrevDuplicate(tData[index + 1]);\n }\n markDuplicates(tData, tStylingKey, index, true);\n markDuplicates(tData, tStylingKey, index, false);\n markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding);\n tBindings = toTStylingRange(tmplHead, tmplTail);\n if (isClassBinding) {\n tNode.classBindings = tBindings;\n }\n else {\n tNode.styleBindings = tBindings;\n }\n}\n/**\n * Look into the residual styling to see if the current `tStylingKey` is duplicate of residual.\n *\n * @param tNode `TNode` where the residual is stored.\n * @param tStylingKey `TStylingKey` to store.\n * @param tData `TData` associated with the current `LView`.\n * @param index location of where `tStyleValue` should be stored (and linked into list.)\n * @param isClassBinding True if the associated `tStylingKey` as a `class` styling.\n * `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.)\n */\nfunction markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding) {\n const residual = isClassBinding ? tNode.residualClasses : tNode.residualStyles;\n if (residual != null /* or undefined */ &&\n typeof tStylingKey == 'string' &&\n keyValueArrayIndexOf(residual, tStylingKey) >= 0) {\n // We have duplicate in the residual so mark ourselves as duplicate.\n tData[index + 1] = setTStylingRangeNextDuplicate(tData[index + 1]);\n }\n}\n/**\n * Marks `TStyleValue`s as duplicates if another style binding in the list has the same\n * `TStyleValue`.\n *\n * NOTE: this function is intended to be called twice once with `isPrevDir` set to `true` and once\n * with it set to `false` to search both the previous as well as next items in the list.\n *\n * No duplicate case\n * ```\n * [style.color]\n * [style.width.px] <<- index\n * [style.height.px]\n * ```\n *\n * In the above case adding `[style.width.px]` to the existing `[style.color]` produces no\n * duplicates because `width` is not found in any other part of the linked list.\n *\n * Duplicate case\n * ```\n * [style.color]\n * [style.width.em]\n * [style.width.px] <<- index\n * ```\n * In the above case adding `[style.width.px]` will produce a duplicate with `[style.width.em]`\n * because `width` is found in the chain.\n *\n * Map case 1\n * ```\n * [style.width.px]\n * [style.color]\n * [style] <<- index\n * ```\n * In the above case adding `[style]` will produce a duplicate with any other bindings because\n * `[style]` is a Map and as such is fully dynamic and could produce `color` or `width`.\n *\n * Map case 2\n * ```\n * [style]\n * [style.width.px]\n * [style.color] <<- index\n * ```\n * In the above case adding `[style.color]` will produce a duplicate because there is already a\n * `[style]` binding which is a Map and as such is fully dynamic and could produce `color` or\n * `width`.\n *\n * NOTE: Once `[style]` (Map) is added into the system all things are mapped as duplicates.\n * NOTE: We use `style` as example, but same logic is applied to `class`es as well.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tStylingKey `TStylingKeyPrimitive` which contains the value to compare to other keys in\n * the linked list.\n * @param index Starting location in the linked list to search from\n * @param isPrevDir Direction.\n * - `true` for previous (lower priority);\n * - `false` for next (higher priority).\n */\nfunction markDuplicates(tData, tStylingKey, index, isPrevDir) {\n const tStylingAtIndex = tData[index + 1];\n const isMap = tStylingKey === null;\n let cursor = isPrevDir\n ? getTStylingRangePrev(tStylingAtIndex)\n : getTStylingRangeNext(tStylingAtIndex);\n let foundDuplicate = false;\n // We keep iterating as long as we have a cursor\n // AND either:\n // - we found what we are looking for, OR\n // - we are a map in which case we have to continue searching even after we find what we were\n // looking for since we are a wild card and everything needs to be flipped to duplicate.\n while (cursor !== 0 && (foundDuplicate === false || isMap)) {\n ngDevMode && assertIndexInRange(tData, cursor);\n const tStylingValueAtCursor = tData[cursor];\n const tStyleRangeAtCursor = tData[cursor + 1];\n if (isStylingMatch(tStylingValueAtCursor, tStylingKey)) {\n foundDuplicate = true;\n tData[cursor + 1] = isPrevDir\n ? setTStylingRangeNextDuplicate(tStyleRangeAtCursor)\n : setTStylingRangePrevDuplicate(tStyleRangeAtCursor);\n }\n cursor = isPrevDir\n ? getTStylingRangePrev(tStyleRangeAtCursor)\n : getTStylingRangeNext(tStyleRangeAtCursor);\n }\n if (foundDuplicate) {\n // if we found a duplicate, than mark ourselves.\n tData[index + 1] = isPrevDir\n ? setTStylingRangePrevDuplicate(tStylingAtIndex)\n : setTStylingRangeNextDuplicate(tStylingAtIndex);\n }\n}\n/**\n * Determines if two `TStylingKey`s are a match.\n *\n * When computing whether a binding contains a duplicate, we need to compare if the instruction\n * `TStylingKey` has a match.\n *\n * Here are examples of `TStylingKey`s which match given `tStylingKeyCursor` is:\n * - `color`\n * - `color` // Match another color\n * - `null` // That means that `tStylingKey` is a `classMap`/`styleMap` instruction\n * - `['', 'color', 'other', true]` // wrapped `color` so match\n * - `['', null, 'other', true]` // wrapped `null` so match\n * - `['', 'width', 'color', 'value']` // wrapped static value contains a match on `'color'`\n * - `null` // `tStylingKeyCursor` always match as it is `classMap`/`styleMap` instruction\n *\n * @param tStylingKeyCursor\n * @param tStylingKey\n */\nfunction isStylingMatch(tStylingKeyCursor, tStylingKey) {\n ngDevMode &&\n assertNotEqual(Array.isArray(tStylingKey), true, \"Expected that 'tStylingKey' has been unwrapped\");\n if (tStylingKeyCursor === null || // If the cursor is `null` it means that we have map at that\n // location so we must assume that we have a match.\n tStylingKey == null || // If `tStylingKey` is `null` then it is a map therefor assume that it\n // contains a match.\n (Array.isArray(tStylingKeyCursor) ? tStylingKeyCursor[1] : tStylingKeyCursor) === tStylingKey // If the keys match explicitly than we are a match.\n ) {\n return true;\n }\n else if (Array.isArray(tStylingKeyCursor) && typeof tStylingKey === 'string') {\n // if we did not find a match, but `tStylingKeyCursor` is `KeyValueArray` that means cursor has\n // statics and we need to check those as well.\n return keyValueArrayIndexOf(tStylingKeyCursor, tStylingKey) >= 0; // see if we are matching the key\n }\n return false;\n}\n\n// Global state of the parser. (This makes parser non-reentrant, but that is not an issue)\nconst parserState = {\n textEnd: 0,\n key: 0,\n keyEnd: 0,\n value: 0,\n valueEnd: 0,\n};\n/**\n * Retrieves the last parsed `key` of style.\n * @param text the text to substring the key from.\n */\nfunction getLastParsedKey(text) {\n return text.substring(parserState.key, parserState.keyEnd);\n}\n/**\n * Retrieves the last parsed `value` of style.\n * @param text the text to substring the key from.\n */\nfunction getLastParsedValue(text) {\n return text.substring(parserState.value, parserState.valueEnd);\n}\n/**\n * Initializes `className` string for parsing and parses the first token.\n *\n * This function is intended to be used in this format:\n * ```\n * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n * const key = getLastParsedKey();\n * ...\n * }\n * ```\n * @param text `className` to parse\n * @returns index where the next invocation of `parseClassNameNext` should resume.\n */\nfunction parseClassName(text) {\n resetParserState(text);\n return parseClassNameNext(text, consumeWhitespace(text, 0, parserState.textEnd));\n}\n/**\n * Parses next `className` token.\n *\n * This function is intended to be used in this format:\n * ```\n * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n * const key = getLastParsedKey();\n * ...\n * }\n * ```\n *\n * @param text `className` to parse\n * @param index where the parsing should resume.\n * @returns index where the next invocation of `parseClassNameNext` should resume.\n */\nfunction parseClassNameNext(text, index) {\n const end = parserState.textEnd;\n if (end === index) {\n return -1;\n }\n index = parserState.keyEnd = consumeClassToken(text, (parserState.key = index), end);\n return consumeWhitespace(text, index, end);\n}\n/**\n * Initializes `cssText` string for parsing and parses the first key/values.\n *\n * This function is intended to be used in this format:\n * ```\n * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) {\n * const key = getLastParsedKey();\n * const value = getLastParsedValue();\n * ...\n * }\n * ```\n * @param text `cssText` to parse\n * @returns index where the next invocation of `parseStyleNext` should resume.\n */\nfunction parseStyle(text) {\n resetParserState(text);\n return parseStyleNext(text, consumeWhitespace(text, 0, parserState.textEnd));\n}\n/**\n * Parses the next `cssText` key/values.\n *\n * This function is intended to be used in this format:\n * ```\n * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) {\n * const key = getLastParsedKey();\n * const value = getLastParsedValue();\n * ...\n * }\n *\n * @param text `cssText` to parse\n * @param index where the parsing should resume.\n * @returns index where the next invocation of `parseStyleNext` should resume.\n */\nfunction parseStyleNext(text, startIndex) {\n const end = parserState.textEnd;\n let index = (parserState.key = consumeWhitespace(text, startIndex, end));\n if (end === index) {\n // we reached an end so just quit\n return -1;\n }\n index = parserState.keyEnd = consumeStyleKey(text, index, end);\n index = consumeSeparator(text, index, end, 58 /* CharCode.COLON */);\n index = parserState.value = consumeWhitespace(text, index, end);\n index = parserState.valueEnd = consumeStyleValue(text, index, end);\n return consumeSeparator(text, index, end, 59 /* CharCode.SEMI_COLON */);\n}\n/**\n * Reset the global state of the styling parser.\n * @param text The styling text to parse.\n */\nfunction resetParserState(text) {\n parserState.key = 0;\n parserState.keyEnd = 0;\n parserState.value = 0;\n parserState.valueEnd = 0;\n parserState.textEnd = text.length;\n}\n/**\n * Returns index of next non-whitespace character.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index of next non-whitespace character (May be the same as `start` if no whitespace at\n * that location.)\n */\nfunction consumeWhitespace(text, startIndex, endIndex) {\n while (startIndex < endIndex && text.charCodeAt(startIndex) <= 32 /* CharCode.SPACE */) {\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Returns index of last char in class token.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last char in class token.\n */\nfunction consumeClassToken(text, startIndex, endIndex) {\n while (startIndex < endIndex && text.charCodeAt(startIndex) > 32 /* CharCode.SPACE */) {\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Consumes all of the characters belonging to style key and token.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last style key character.\n */\nfunction consumeStyleKey(text, startIndex, endIndex) {\n let ch;\n while (startIndex < endIndex &&\n ((ch = text.charCodeAt(startIndex)) === 45 /* CharCode.DASH */ ||\n ch === 95 /* CharCode.UNDERSCORE */ ||\n ((ch & -33 /* CharCode.UPPER_CASE */) >= 65 /* CharCode.A */ && (ch & -33 /* CharCode.UPPER_CASE */) <= 90 /* CharCode.Z */) ||\n (ch >= 48 /* CharCode.ZERO */ && ch <= 57 /* CharCode.NINE */))) {\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Consumes all whitespace and the separator `:` after the style key.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after separator and surrounding whitespace.\n */\nfunction consumeSeparator(text, startIndex, endIndex, separator) {\n startIndex = consumeWhitespace(text, startIndex, endIndex);\n if (startIndex < endIndex) {\n if (ngDevMode && text.charCodeAt(startIndex) !== separator) {\n malformedStyleError(text, String.fromCharCode(separator), startIndex);\n }\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Consumes style value honoring `url()` and `\"\"` text.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last style value character.\n */\nfunction consumeStyleValue(text, startIndex, endIndex) {\n let ch1 = -1; // 1st previous character\n let ch2 = -1; // 2nd previous character\n let ch3 = -1; // 3rd previous character\n let i = startIndex;\n let lastChIndex = i;\n while (i < endIndex) {\n const ch = text.charCodeAt(i++);\n if (ch === 59 /* CharCode.SEMI_COLON */) {\n return lastChIndex;\n }\n else if (ch === 34 /* CharCode.DOUBLE_QUOTE */ || ch === 39 /* CharCode.SINGLE_QUOTE */) {\n lastChIndex = i = consumeQuotedText(text, ch, i, endIndex);\n }\n else if (startIndex === i - 4 && // We have seen only 4 characters so far \"URL(\" (Ignore \"foo_URL()\")\n ch3 === 85 /* CharCode.U */ &&\n ch2 === 82 /* CharCode.R */ &&\n ch1 === 76 /* CharCode.L */ &&\n ch === 40 /* CharCode.OPEN_PAREN */) {\n lastChIndex = i = consumeQuotedText(text, 41 /* CharCode.CLOSE_PAREN */, i, endIndex);\n }\n else if (ch > 32 /* CharCode.SPACE */) {\n // if we have a non-whitespace character then capture its location\n lastChIndex = i;\n }\n ch3 = ch2;\n ch2 = ch1;\n ch1 = ch & -33 /* CharCode.UPPER_CASE */;\n }\n return lastChIndex;\n}\n/**\n * Consumes all of the quoted characters.\n *\n * @param text Text to scan\n * @param quoteCharCode CharCode of either `\"` or `'` quote or `)` for `url(...)`.\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after quoted characters.\n */\nfunction consumeQuotedText(text, quoteCharCode, startIndex, endIndex) {\n let ch1 = -1; // 1st previous character\n let index = startIndex;\n while (index < endIndex) {\n const ch = text.charCodeAt(index++);\n if (ch == quoteCharCode && ch1 !== 92 /* CharCode.BACK_SLASH */) {\n return index;\n }\n if (ch == 92 /* CharCode.BACK_SLASH */ && ch1 === 92 /* CharCode.BACK_SLASH */) {\n // two back slashes cancel each other out. For example `\"\\\\\"` should properly end the\n // quotation. (It should not assume that the last `\"` is escaped.)\n ch1 = 0;\n }\n else {\n ch1 = ch;\n }\n }\n throw ngDevMode\n ? malformedStyleError(text, String.fromCharCode(quoteCharCode), endIndex)\n : new Error();\n}\nfunction malformedStyleError(text, expecting, index) {\n ngDevMode && assertEqual(typeof text === 'string', true, 'String expected here');\n throw throwError(`Malformed style at location ${index} in string '` +\n text.substring(0, index) +\n '[>>' +\n text.substring(index, index + 1) +\n '<<]' +\n text.slice(index + 1) +\n `'. Expecting '${expecting}'.`);\n}\n\n/**\n * Update a property on a selected element.\n *\n * Operates on the element selected by index via the {@link select} instruction.\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled\n *\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @returns This function returns itself so that it may be chained\n * (e.g. `property('name', ctx.name)('title', ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵproperty(propName, value, sanitizer) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, false);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵproperty;\n}\n/**\n * Given `<div style=\"...\" my-dir>` and `MyDir` with `@Input('style')` we need to write to\n * directive input.\n */\nfunction setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased) {\n const inputs = tNode.inputs;\n const property = isClassBased ? 'class' : 'style';\n // We support both 'class' and `className` hence the fallback.\n setInputsForProperty(tView, lView, inputs[property], property, value);\n}\n\n/**\n * Update a style binding on an element with the provided value.\n *\n * If the style value is falsy then it will be removed from the element\n * (or assigned a different value depending if there are any styles placed\n * on the element with `styleMap` or any static styles that are\n * present from when the element was created with `styling`).\n *\n * Note that the styling element is updated as part of `stylingApply`.\n *\n * @param prop A valid CSS property.\n * @param value New value to write (`null` or an empty string to remove).\n * @param suffix Optional suffix. Used with scalar values to add unit such as `px`.\n *\n * Note that this will apply the provided style value to the host element if this function is called\n * within a host binding function.\n *\n * @codeGenApi\n */\nfunction ɵɵstyleProp(prop, value, suffix) {\n checkStylingProperty(prop, value, suffix, false);\n return ɵɵstyleProp;\n}\n/**\n * Update a class binding on an element with the provided value.\n *\n * This instruction is meant to handle the `[class.foo]=\"exp\"` case and,\n * therefore, the class binding itself must already be allocated using\n * `styling` within the creation block.\n *\n * @param prop A valid CSS class (only one).\n * @param value A true/false value which will turn the class on or off.\n *\n * Note that this will apply the provided class value to the host element if this function\n * is called within a host binding function.\n *\n * @codeGenApi\n */\nfunction ɵɵclassProp(className, value) {\n checkStylingProperty(className, value, null, true);\n return ɵɵclassProp;\n}\n/**\n * Update style bindings using an object literal on an element.\n *\n * This instruction is meant to apply styling via the `[style]=\"exp\"` template bindings.\n * When styles are applied to the element they will then be updated with respect to\n * any styles/classes set via `styleProp`. If any styles are set to falsy\n * then they will be removed from the element.\n *\n * Note that the styling instruction will not be applied until `stylingApply` is called.\n *\n * @param styles A key/value style map of the styles that will be applied to the given element.\n * Any missing styles (that have already been applied to the element beforehand) will be\n * removed (unset) from the element's styling.\n *\n * Note that this will apply the provided styleMap value to the host element if this function\n * is called within a host binding.\n *\n * @codeGenApi\n */\nfunction ɵɵstyleMap(styles) {\n checkStylingMap(styleKeyValueArraySet, styleStringParser, styles, false);\n}\n/**\n * Parse text as style and add values to KeyValueArray.\n *\n * This code is pulled out to a separate function so that it can be tree shaken away if it is not\n * needed. It is only referenced from `ɵɵstyleMap`.\n *\n * @param keyValueArray KeyValueArray to add parsed values to.\n * @param text text to parse.\n */\nfunction styleStringParser(keyValueArray, text) {\n for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i)) {\n styleKeyValueArraySet(keyValueArray, getLastParsedKey(text), getLastParsedValue(text));\n }\n}\n/**\n * Update class bindings using an object literal or class-string on an element.\n *\n * This instruction is meant to apply styling via the `[class]=\"exp\"` template bindings.\n * When classes are applied to the element they will then be updated with\n * respect to any styles/classes set via `classProp`. If any\n * classes are set to falsy then they will be removed from the element.\n *\n * Note that the styling instruction will not be applied until `stylingApply` is called.\n * Note that this will the provided classMap value to the host element if this function is called\n * within a host binding.\n *\n * @param classes A key/value map or string of CSS classes that will be added to the\n * given element. Any missing classes (that have already been applied to the element\n * beforehand) will be removed (unset) from the element's list of CSS classes.\n *\n * @codeGenApi\n */\nfunction ɵɵclassMap(classes) {\n checkStylingMap(classKeyValueArraySet, classStringParser, classes, true);\n}\n/**\n * Parse text as class and add values to KeyValueArray.\n *\n * This code is pulled out to a separate function so that it can be tree shaken away if it is not\n * needed. It is only referenced from `ɵɵclassMap`.\n *\n * @param keyValueArray KeyValueArray to add parsed values to.\n * @param text text to parse.\n */\nfunction classStringParser(keyValueArray, text) {\n for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n keyValueArraySet(keyValueArray, getLastParsedKey(text), true);\n }\n}\n/**\n * Common code between `ɵɵclassProp` and `ɵɵstyleProp`.\n *\n * @param prop property name.\n * @param value binding value.\n * @param suffix suffix for the property (e.g. `em` or `px`)\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nfunction checkStylingProperty(prop, value, suffix, isClassBased) {\n const lView = getLView();\n const tView = getTView();\n // Styling instructions use 2 slots per binding.\n // 1. one for the value / TStylingKey\n // 2. one for the intermittent-value / TStylingRange\n const bindingIndex = incrementBindingIndex(2);\n if (tView.firstUpdatePass) {\n stylingFirstUpdatePass(tView, prop, bindingIndex, isClassBased);\n }\n if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {\n const tNode = tView.data[getSelectedIndex()];\n updateStyling(tView, tNode, lView, lView[RENDERER], prop, (lView[bindingIndex + 1] = normalizeSuffix(value, suffix)), isClassBased, bindingIndex);\n }\n}\n/**\n * Common code between `ɵɵclassMap` and `ɵɵstyleMap`.\n *\n * @param keyValueArraySet (See `keyValueArraySet` in \"util/array_utils\") Gets passed in as a\n * function so that `style` can be processed. This is done for tree shaking purposes.\n * @param stringParser Parser used to parse `value` if `string`. (Passed in as `style` and `class`\n * have different parsers.)\n * @param value bound value from application\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nfunction checkStylingMap(keyValueArraySet, stringParser, value, isClassBased) {\n const tView = getTView();\n const bindingIndex = incrementBindingIndex(2);\n if (tView.firstUpdatePass) {\n stylingFirstUpdatePass(tView, null, bindingIndex, isClassBased);\n }\n const lView = getLView();\n if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {\n // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the\n // if so as not to read unnecessarily.\n const tNode = tView.data[getSelectedIndex()];\n if (hasStylingInputShadow(tNode, isClassBased) && !isInHostBindings(tView, bindingIndex)) {\n if (ngDevMode) {\n // verify that if we are shadowing then `TData` is appropriately marked so that we skip\n // processing this binding in styling resolution.\n const tStylingKey = tView.data[bindingIndex];\n assertEqual(Array.isArray(tStylingKey) ? tStylingKey[1] : tStylingKey, false, \"Styling linked list shadow input should be marked as 'false'\");\n }\n // VE does not concatenate the static portion like we are doing here.\n // Instead VE just ignores the static completely if dynamic binding is present.\n // Because of locality we have already set the static portion because we don't know if there\n // is a dynamic portion until later. If we would ignore the static portion it would look like\n // the binding has removed it. This would confuse `[ngStyle]`/`[ngClass]` to do the wrong\n // thing as it would think that the static portion was removed. For this reason we\n // concatenate it so that `[ngStyle]`/`[ngClass]` can continue to work on changed.\n let staticPrefix = isClassBased ? tNode.classesWithoutHost : tNode.stylesWithoutHost;\n ngDevMode &&\n isClassBased === false &&\n staticPrefix !== null &&\n assertEqual(staticPrefix.endsWith(';'), true, \"Expecting static portion to end with ';'\");\n if (staticPrefix !== null) {\n // We want to make sure that falsy values of `value` become empty strings.\n value = concatStringsWithSpace(staticPrefix, value ? value : '');\n }\n // Given `<div [style] my-dir>` such that `my-dir` has `@Input('style')`.\n // This takes over the `[style]` binding. (Same for `[class]`)\n setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased);\n }\n else {\n updateStylingMap(tView, tNode, lView, lView[RENDERER], lView[bindingIndex + 1], (lView[bindingIndex + 1] = toStylingKeyValueArray(keyValueArraySet, stringParser, value)), isClassBased, bindingIndex);\n }\n }\n}\n/**\n * Determines when the binding is in `hostBindings` section\n *\n * @param tView Current `TView`\n * @param bindingIndex index of binding which we would like if it is in `hostBindings`\n */\nfunction isInHostBindings(tView, bindingIndex) {\n // All host bindings are placed after the expando section.\n return bindingIndex >= tView.expandoStartIndex;\n}\n/**\n * Collects the necessary information to insert the binding into a linked list of style bindings\n * using `insertTStylingBinding`.\n *\n * @param tView `TView` where the binding linked list will be stored.\n * @param tStylingKey Property/key of the binding.\n * @param bindingIndex Index of binding associated with the `prop`\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nfunction stylingFirstUpdatePass(tView, tStylingKey, bindingIndex, isClassBased) {\n ngDevMode && assertFirstUpdatePass(tView);\n const tData = tView.data;\n if (tData[bindingIndex + 1] === null) {\n // The above check is necessary because we don't clear first update pass until first successful\n // (no exception) template execution. This prevents the styling instruction from double adding\n // itself to the list.\n // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the\n // if so as not to read unnecessarily.\n const tNode = tData[getSelectedIndex()];\n ngDevMode && assertDefined(tNode, 'TNode expected');\n const isHostBindings = isInHostBindings(tView, bindingIndex);\n if (hasStylingInputShadow(tNode, isClassBased) && tStylingKey === null && !isHostBindings) {\n // `tStylingKey === null` implies that we are either `[style]` or `[class]` binding.\n // If there is a directive which uses `@Input('style')` or `@Input('class')` than\n // we need to neutralize this binding since that directive is shadowing it.\n // We turn this into a noop by setting the key to `false`\n tStylingKey = false;\n }\n tStylingKey = wrapInStaticStylingKey(tData, tNode, tStylingKey, isClassBased);\n insertTStylingBinding(tData, tNode, tStylingKey, bindingIndex, isHostBindings, isClassBased);\n }\n}\n/**\n * Adds static styling information to the binding if applicable.\n *\n * The linked list of styles not only stores the list and keys, but also stores static styling\n * information on some of the keys. This function determines if the key should contain the styling\n * information and computes it.\n *\n * See `TStylingStatic` for more details.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param stylingKey `TStylingKeyPrimitive` which may need to be wrapped into `TStylingKey`\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction wrapInStaticStylingKey(tData, tNode, stylingKey, isClassBased) {\n const hostDirectiveDef = getCurrentDirectiveDef(tData);\n let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;\n if (hostDirectiveDef === null) {\n // We are in template node.\n // If template node already had styling instruction then it has already collected the static\n // styling and there is no need to collect them again. We know that we are the first styling\n // instruction because the `TNode.*Bindings` points to 0 (nothing has been inserted yet).\n const isFirstStylingInstructionInTemplate = (isClassBased ? tNode.classBindings : tNode.styleBindings) === 0;\n if (isFirstStylingInstructionInTemplate) {\n // It would be nice to be able to get the statics from `mergeAttrs`, however, at this point\n // they are already merged and it would not be possible to figure which property belongs where\n // in the priority.\n stylingKey = collectStylingFromDirectives(null, tData, tNode, stylingKey, isClassBased);\n stylingKey = collectStylingFromTAttrs(stylingKey, tNode.attrs, isClassBased);\n // We know that if we have styling binding in template we can't have residual.\n residual = null;\n }\n }\n else {\n // We are in host binding node and there was no binding instruction in template node.\n // This means that we need to compute the residual.\n const directiveStylingLast = tNode.directiveStylingLast;\n const isFirstStylingInstructionInHostBinding = directiveStylingLast === -1 || tData[directiveStylingLast] !== hostDirectiveDef;\n if (isFirstStylingInstructionInHostBinding) {\n stylingKey = collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased);\n if (residual === null) {\n // - If `null` than either:\n // - Template styling instruction already ran and it has consumed the static\n // styling into its `TStylingKey` and so there is no need to update residual. Instead\n // we need to update the `TStylingKey` associated with the first template node\n // instruction. OR\n // - Some other styling instruction ran and determined that there are no residuals\n let templateStylingKey = getTemplateHeadTStylingKey(tData, tNode, isClassBased);\n if (templateStylingKey !== undefined && Array.isArray(templateStylingKey)) {\n // Only recompute if `templateStylingKey` had static values. (If no static value found\n // then there is nothing to do since this operation can only produce less static keys, not\n // more.)\n templateStylingKey = collectStylingFromDirectives(null, tData, tNode, templateStylingKey[1] /* unwrap previous statics */, isClassBased);\n templateStylingKey = collectStylingFromTAttrs(templateStylingKey, tNode.attrs, isClassBased);\n setTemplateHeadTStylingKey(tData, tNode, isClassBased, templateStylingKey);\n }\n }\n else {\n // We only need to recompute residual if it is not `null`.\n // - If existing residual (implies there was no template styling). This means that some of\n // the statics may have moved from the residual to the `stylingKey` and so we have to\n // recompute.\n // - If `undefined` this is the first time we are running.\n residual = collectResidual(tData, tNode, isClassBased);\n }\n }\n }\n if (residual !== undefined) {\n isClassBased ? (tNode.residualClasses = residual) : (tNode.residualStyles = residual);\n }\n return stylingKey;\n}\n/**\n * Retrieve the `TStylingKey` for the template styling instruction.\n *\n * This is needed since `hostBinding` styling instructions are inserted after the template\n * instruction. While the template instruction needs to update the residual in `TNode` the\n * `hostBinding` instructions need to update the `TStylingKey` of the template instruction because\n * the template instruction is downstream from the `hostBindings` instructions.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @return `TStylingKey` if found or `undefined` if not found.\n */\nfunction getTemplateHeadTStylingKey(tData, tNode, isClassBased) {\n const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;\n if (getTStylingRangeNext(bindings) === 0) {\n // There does not seem to be a styling instruction in the `template`.\n return undefined;\n }\n return tData[getTStylingRangePrev(bindings)];\n}\n/**\n * Update the `TStylingKey` of the first template instruction in `TNode`.\n *\n * Logically `hostBindings` styling instructions are of lower priority than that of the template.\n * However, they execute after the template styling instructions. This means that they get inserted\n * in front of the template styling instructions.\n *\n * If we have a template styling instruction and a new `hostBindings` styling instruction is\n * executed it means that it may need to steal static fields from the template instruction. This\n * method allows us to update the first template instruction `TStylingKey` with a new value.\n *\n * Assume:\n * ```\n * <div my-dir style=\"color: red\" [style.color]=\"tmplExp\"></div>\n *\n * @Directive({\n * host: {\n * 'style': 'width: 100px',\n * '[style.color]': 'dirExp',\n * }\n * })\n * class MyDir {}\n * ```\n *\n * when `[style.color]=\"tmplExp\"` executes it creates this data structure.\n * ```\n * ['', 'color', 'color', 'red', 'width', '100px'],\n * ```\n *\n * The reason for this is that the template instruction does not know if there are styling\n * instructions and must assume that there are none and must collect all of the static styling.\n * (both\n * `color' and 'width`)\n *\n * When `'[style.color]': 'dirExp',` executes we need to insert a new data into the linked list.\n * ```\n * ['', 'color', 'width', '100px'], // newly inserted\n * ['', 'color', 'color', 'red', 'width', '100px'], // this is wrong\n * ```\n *\n * Notice that the template statics is now wrong as it incorrectly contains `width` so we need to\n * update it like so:\n * ```\n * ['', 'color', 'width', '100px'],\n * ['', 'color', 'color', 'red'], // UPDATE\n * ```\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param tStylingKey New `TStylingKey` which is replacing the old one.\n */\nfunction setTemplateHeadTStylingKey(tData, tNode, isClassBased, tStylingKey) {\n const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;\n ngDevMode &&\n assertNotEqual(getTStylingRangeNext(bindings), 0, 'Expecting to have at least one template styling binding.');\n tData[getTStylingRangePrev(bindings)] = tStylingKey;\n}\n/**\n * Collect all static values after the current `TNode.directiveStylingLast` index.\n *\n * Collect the remaining styling information which has not yet been collected by an existing\n * styling instruction.\n *\n * @param tData `TData` where the `DirectiveDefs` are stored.\n * @param tNode `TNode` which contains the directive range.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectResidual(tData, tNode, isClassBased) {\n let residual = undefined;\n const directiveEnd = tNode.directiveEnd;\n ngDevMode &&\n assertNotEqual(tNode.directiveStylingLast, -1, 'By the time this function gets called at least one hostBindings-node styling instruction must have executed.');\n // We add `1 + tNode.directiveStart` because we need to skip the current directive (as we are\n // collecting things after the last `hostBindings` directive which had a styling instruction.)\n for (let i = 1 + tNode.directiveStylingLast; i < directiveEnd; i++) {\n const attrs = tData[i].hostAttrs;\n residual = collectStylingFromTAttrs(residual, attrs, isClassBased);\n }\n return collectStylingFromTAttrs(residual, tNode.attrs, isClassBased);\n}\n/**\n * Collect the static styling information with lower priority than `hostDirectiveDef`.\n *\n * (This is opposite of residual styling.)\n *\n * @param hostDirectiveDef `DirectiveDef` for which we want to collect lower priority static\n * styling. (Or `null` if template styling)\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param stylingKey Existing `TStylingKey` to update or wrap.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased) {\n // We need to loop because there can be directives which have `hostAttrs` but don't have\n // `hostBindings` so this loop catches up to the current directive..\n let currentDirective = null;\n const directiveEnd = tNode.directiveEnd;\n let directiveStylingLast = tNode.directiveStylingLast;\n if (directiveStylingLast === -1) {\n directiveStylingLast = tNode.directiveStart;\n }\n else {\n directiveStylingLast++;\n }\n while (directiveStylingLast < directiveEnd) {\n currentDirective = tData[directiveStylingLast];\n ngDevMode && assertDefined(currentDirective, 'expected to be defined');\n stylingKey = collectStylingFromTAttrs(stylingKey, currentDirective.hostAttrs, isClassBased);\n if (currentDirective === hostDirectiveDef)\n break;\n directiveStylingLast++;\n }\n if (hostDirectiveDef !== null) {\n // we only advance the styling cursor if we are collecting data from host bindings.\n // Template executes before host bindings and so if we would update the index,\n // host bindings would not get their statics.\n tNode.directiveStylingLast = directiveStylingLast;\n }\n return stylingKey;\n}\n/**\n * Convert `TAttrs` into `TStylingStatic`.\n *\n * @param stylingKey existing `TStylingKey` to update or wrap.\n * @param attrs `TAttributes` to process.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectStylingFromTAttrs(stylingKey, attrs, isClassBased) {\n const desiredMarker = isClassBased ? 1 /* AttributeMarker.Classes */ : 2 /* AttributeMarker.Styles */;\n let currentMarker = -1 /* AttributeMarker.ImplicitAttributes */;\n if (attrs !== null) {\n for (let i = 0; i < attrs.length; i++) {\n const item = attrs[i];\n if (typeof item === 'number') {\n currentMarker = item;\n }\n else {\n if (currentMarker === desiredMarker) {\n if (!Array.isArray(stylingKey)) {\n stylingKey = stylingKey === undefined ? [] : ['', stylingKey];\n }\n keyValueArraySet(stylingKey, item, isClassBased ? true : attrs[++i]);\n }\n }\n }\n }\n return stylingKey === undefined ? null : stylingKey;\n}\n/**\n * Convert user input to `KeyValueArray`.\n *\n * This function takes user input which could be `string`, Object literal, or iterable and converts\n * it into a consistent representation. The output of this is `KeyValueArray` (which is an array\n * where\n * even indexes contain keys and odd indexes contain values for those keys).\n *\n * The advantage of converting to `KeyValueArray` is that we can perform diff in an input\n * independent\n * way.\n * (ie we can compare `foo bar` to `['bar', 'baz'] and determine a set of changes which need to be\n * applied)\n *\n * The fact that `KeyValueArray` is sorted is very important because it allows us to compute the\n * difference in linear fashion without the need to allocate any additional data.\n *\n * For example if we kept this as a `Map` we would have to iterate over previous `Map` to determine\n * which values need to be deleted, over the new `Map` to determine additions, and we would have to\n * keep additional `Map` to keep track of duplicates or items which have not yet been visited.\n *\n * @param keyValueArraySet (See `keyValueArraySet` in \"util/array_utils\") Gets passed in as a\n * function so that `style` can be processed. This is done\n * for tree shaking purposes.\n * @param stringParser The parser is passed in so that it will be tree shakable. See\n * `styleStringParser` and `classStringParser`\n * @param value The value to parse/convert to `KeyValueArray`\n */\nfunction toStylingKeyValueArray(keyValueArraySet, stringParser, value) {\n if (value == null /*|| value === undefined */ || value === '')\n return EMPTY_ARRAY;\n const styleKeyValueArray = [];\n const unwrappedValue = unwrapSafeValue(value);\n if (Array.isArray(unwrappedValue)) {\n for (let i = 0; i < unwrappedValue.length; i++) {\n keyValueArraySet(styleKeyValueArray, unwrappedValue[i], true);\n }\n }\n else if (typeof unwrappedValue === 'object') {\n for (const key in unwrappedValue) {\n if (unwrappedValue.hasOwnProperty(key)) {\n keyValueArraySet(styleKeyValueArray, key, unwrappedValue[key]);\n }\n }\n }\n else if (typeof unwrappedValue === 'string') {\n stringParser(styleKeyValueArray, unwrappedValue);\n }\n else {\n ngDevMode &&\n throwError('Unsupported styling type ' + typeof unwrappedValue + ': ' + unwrappedValue);\n }\n return styleKeyValueArray;\n}\n/**\n * Set a `value` for a `key`.\n *\n * See: `keyValueArraySet` for details\n *\n * @param keyValueArray KeyValueArray to add to.\n * @param key Style key to add.\n * @param value The value to set.\n */\nfunction styleKeyValueArraySet(keyValueArray, key, value) {\n keyValueArraySet(keyValueArray, key, unwrapSafeValue(value));\n}\n/**\n * Class-binding-specific function for setting the `value` for a `key`.\n *\n * See: `keyValueArraySet` for details\n *\n * @param keyValueArray KeyValueArray to add to.\n * @param key Style key to add.\n * @param value The value to set.\n */\nfunction classKeyValueArraySet(keyValueArray, key, value) {\n // We use `classList.add` to eventually add the CSS classes to the DOM node. Any value passed into\n // `add` is stringified and added to the `class` attribute, e.g. even null, undefined or numbers\n // will be added. Stringify the key here so that our internal data structure matches the value in\n // the DOM. The only exceptions are empty strings and strings that contain spaces for which\n // the browser throws an error. We ignore such values, because the error is somewhat cryptic.\n const stringKey = String(key);\n if (stringKey !== '' && !stringKey.includes(' ')) {\n keyValueArraySet(keyValueArray, stringKey, value);\n }\n}\n/**\n * Update map based styling.\n *\n * Map based styling could be anything which contains more than one binding. For example `string`,\n * or object literal. Dealing with all of these types would complicate the logic so\n * instead this function expects that the complex input is first converted into normalized\n * `KeyValueArray`. The advantage of normalization is that we get the values sorted, which makes it\n * very cheap to compute deltas between the previous and current value.\n *\n * @param tView Associated `TView.data` contains the linked list of binding priorities.\n * @param tNode `TNode` where the binding is located.\n * @param lView `LView` contains the values associated with other styling binding at this `TNode`.\n * @param renderer Renderer to use if any updates.\n * @param oldKeyValueArray Previous value represented as `KeyValueArray`\n * @param newKeyValueArray Current value represented as `KeyValueArray`\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param bindingIndex Binding index of the binding.\n */\nfunction updateStylingMap(tView, tNode, lView, renderer, oldKeyValueArray, newKeyValueArray, isClassBased, bindingIndex) {\n if (oldKeyValueArray === NO_CHANGE) {\n // On first execution the oldKeyValueArray is NO_CHANGE => treat it as empty KeyValueArray.\n oldKeyValueArray = EMPTY_ARRAY;\n }\n let oldIndex = 0;\n let newIndex = 0;\n let oldKey = 0 < oldKeyValueArray.length ? oldKeyValueArray[0] : null;\n let newKey = 0 < newKeyValueArray.length ? newKeyValueArray[0] : null;\n while (oldKey !== null || newKey !== null) {\n ngDevMode && assertLessThan(oldIndex, 999, 'Are we stuck in infinite loop?');\n ngDevMode && assertLessThan(newIndex, 999, 'Are we stuck in infinite loop?');\n const oldValue = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex + 1] : undefined;\n const newValue = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex + 1] : undefined;\n let setKey = null;\n let setValue = undefined;\n if (oldKey === newKey) {\n // UPDATE: Keys are equal => new value is overwriting old value.\n oldIndex += 2;\n newIndex += 2;\n if (oldValue !== newValue) {\n setKey = newKey;\n setValue = newValue;\n }\n }\n else if (newKey === null || (oldKey !== null && oldKey < newKey)) {\n // DELETE: oldKey key is missing or we did not find the oldKey in the newValue\n // (because the keyValueArray is sorted and `newKey` is found later alphabetically).\n // `\"background\" < \"color\"` so we need to delete `\"background\"` because it is not found in the\n // new array.\n oldIndex += 2;\n setKey = oldKey;\n }\n else {\n // CREATE: newKey's is earlier alphabetically than oldKey's (or no oldKey) => we have new key.\n // `\"color\" > \"background\"` so we need to add `color` because it is in new array but not in\n // old array.\n ngDevMode && assertDefined(newKey, 'Expecting to have a valid key');\n newIndex += 2;\n setKey = newKey;\n setValue = newValue;\n }\n if (setKey !== null) {\n updateStyling(tView, tNode, lView, renderer, setKey, setValue, isClassBased, bindingIndex);\n }\n oldKey = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex] : null;\n newKey = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex] : null;\n }\n}\n/**\n * Update a simple (property name) styling.\n *\n * This function takes `prop` and updates the DOM to that value. The function takes the binding\n * value as well as binding priority into consideration to determine which value should be written\n * to DOM. (For example it may be determined that there is a higher priority overwrite which blocks\n * the DOM write, or if the value goes to `undefined` a lower priority overwrite may be consulted.)\n *\n * @param tView Associated `TView.data` contains the linked list of binding priorities.\n * @param tNode `TNode` where the binding is located.\n * @param lView `LView` contains the values associated with other styling binding at this `TNode`.\n * @param renderer Renderer to use if any updates.\n * @param prop Either style property name or a class name.\n * @param value Either style value for `prop` or `true`/`false` if `prop` is class.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param bindingIndex Binding index of the binding.\n */\nfunction updateStyling(tView, tNode, lView, renderer, prop, value, isClassBased, bindingIndex) {\n if (!(tNode.type & 3 /* TNodeType.AnyRNode */)) {\n // It is possible to have styling on non-elements (such as ng-container).\n // This is rare, but it does happen. In such a case, just ignore the binding.\n return;\n }\n const tData = tView.data;\n const tRange = tData[bindingIndex + 1];\n const higherPriorityValue = getTStylingRangeNextDuplicate(tRange)\n ? findStylingValue(tData, tNode, lView, prop, getTStylingRangeNext(tRange), isClassBased)\n : undefined;\n if (!isStylingValuePresent(higherPriorityValue)) {\n // We don't have a next duplicate, or we did not find a duplicate value.\n if (!isStylingValuePresent(value)) {\n // We should delete current value or restore to lower priority value.\n if (getTStylingRangePrevDuplicate(tRange)) {\n // We have a possible prev duplicate, let's retrieve it.\n value = findStylingValue(tData, null, lView, prop, bindingIndex, isClassBased);\n }\n }\n const rNode = getNativeByIndex(getSelectedIndex(), lView);\n applyStyling(renderer, isClassBased, rNode, prop, value);\n }\n}\n/**\n * Search for styling value with higher priority which is overwriting current value, or a\n * value of lower priority to which we should fall back if the value is `undefined`.\n *\n * When value is being applied at a location, related values need to be consulted.\n * - If there is a higher priority binding, we should be using that one instead.\n * For example `<div [style]=\"{color:exp1}\" [style.color]=\"exp2\">` change to `exp1`\n * requires that we check `exp2` to see if it is set to value other than `undefined`.\n * - If there is a lower priority binding and we are changing to `undefined`\n * For example `<div [style]=\"{color:exp1}\" [style.color]=\"exp2\">` change to `exp2` to\n * `undefined` requires that we check `exp1` (and static values) and use that as new value.\n *\n * NOTE: The styling stores two values.\n * 1. The raw value which came from the application is stored at `index + 0` location. (This value\n * is used for dirty checking).\n * 2. The normalized value is stored at `index + 1`.\n *\n * @param tData `TData` used for traversing the priority.\n * @param tNode `TNode` to use for resolving static styling. Also controls search direction.\n * - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true.\n * If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value.\n * - `null` search prev and go all the way to end. Return last value where\n * `isStylingValuePresent(value)` is true.\n * @param lView `LView` used for retrieving the actual values.\n * @param prop Property which we are interested in.\n * @param index Starting index in the linked list of styling bindings where the search should start.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction findStylingValue(tData, tNode, lView, prop, index, isClassBased) {\n // `TNode` to use for resolving static styling. Also controls search direction.\n // - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true.\n // If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value.\n // - `null` search prev and go all the way to end. Return last value where\n // `isStylingValuePresent(value)` is true.\n const isPrevDirection = tNode === null;\n let value = undefined;\n while (index > 0) {\n const rawKey = tData[index];\n const containsStatics = Array.isArray(rawKey);\n // Unwrap the key if we contain static values.\n const key = containsStatics ? rawKey[1] : rawKey;\n const isStylingMap = key === null;\n let valueAtLViewIndex = lView[index + 1];\n if (valueAtLViewIndex === NO_CHANGE) {\n // In firstUpdatePass the styling instructions create a linked list of styling.\n // On subsequent passes it is possible for a styling instruction to try to read a binding\n // which\n // has not yet executed. In that case we will find `NO_CHANGE` and we should assume that\n // we have `undefined` (or empty array in case of styling-map instruction) instead. This\n // allows the resolution to apply the value (which may later be overwritten when the\n // binding actually executes.)\n valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : undefined;\n }\n let currentValue = isStylingMap\n ? keyValueArrayGet(valueAtLViewIndex, prop)\n : key === prop\n ? valueAtLViewIndex\n : undefined;\n if (containsStatics && !isStylingValuePresent(currentValue)) {\n currentValue = keyValueArrayGet(rawKey, prop);\n }\n if (isStylingValuePresent(currentValue)) {\n value = currentValue;\n if (isPrevDirection) {\n return value;\n }\n }\n const tRange = tData[index + 1];\n index = isPrevDirection ? getTStylingRangePrev(tRange) : getTStylingRangeNext(tRange);\n }\n if (tNode !== null) {\n // in case where we are going in next direction AND we did not find anything, we need to\n // consult residual styling\n let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;\n if (residual != null /** OR residual !=== undefined */) {\n value = keyValueArrayGet(residual, prop);\n }\n }\n return value;\n}\n/**\n * Determines if the binding value should be used (or if the value is 'undefined' and hence priority\n * resolution should be used.)\n *\n * @param value Binding style value.\n */\nfunction isStylingValuePresent(value) {\n // Currently only `undefined` value is considered non-binding. That is `undefined` says I don't\n // have an opinion as to what this binding should be and you should consult other bindings by\n // priority to determine the valid value.\n // This is extracted into a single function so that we have a single place to control this.\n return value !== undefined;\n}\n/**\n * Normalizes and/or adds a suffix to the value.\n *\n * If value is `null`/`undefined` no suffix is added\n * @param value\n * @param suffix\n */\nfunction normalizeSuffix(value, suffix) {\n if (value == null || value === '') {\n // do nothing\n // Do not add the suffix if the value is going to be empty.\n // As it produce invalid CSS, which the browsers will automatically omit but Domino will not.\n // Example: `\"left\": \"px;\"` instead of `\"left\": \"\"`.\n }\n else if (typeof suffix === 'string') {\n value = value + suffix;\n }\n else if (typeof value === 'object') {\n value = stringify(unwrapSafeValue(value));\n }\n return value;\n}\n/**\n * Tests if the `TNode` has input shadow.\n *\n * An input shadow is when a directive steals (shadows) the input by using `@Input('style')` or\n * `@Input('class')` as input.\n *\n * @param tNode `TNode` which we would like to see if it has shadow.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction hasStylingInputShadow(tNode, isClassBased) {\n return (tNode.flags & (isClassBased ? 8 /* TNodeFlags.hasClassInput */ : 16 /* TNodeFlags.hasStyleInput */)) !== 0;\n}\n\n/**\n *\n * Update an interpolated class on an element with single bound value surrounded by text.\n *\n * Used when the value passed to a property has 1 interpolated value in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate1('prefix', v0, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate1(prefix, v0, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n *\n * Update an interpolated class on an element with 2 bound values surrounded by text.\n *\n * Used when the value passed to a property has 2 interpolated values in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}-{{v1}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate2('prefix', v0, '-', v1, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate2(prefix, v0, i0, v1, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n *\n * Update an interpolated class on an element with 3 bound values surrounded by text.\n *\n * Used when the value passed to a property has 3 interpolated values in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate3(\n * 'prefix', v0, '-', v1, '-', v2, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n *\n * Update an interpolated class on an element with 4 bound values surrounded by text.\n *\n * Used when the value passed to a property has 4 interpolated values in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate4(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n *\n * Update an interpolated class on an element with 5 bound values surrounded by text.\n *\n * Used when the value passed to a property has 5 interpolated values in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate5(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n *\n * Update an interpolated class on an element with 6 bound values surrounded by text.\n *\n * Used when the value passed to a property has 6 interpolated values in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate6(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n *\n * Update an interpolated class on an element with 7 bound values surrounded by text.\n *\n * Used when the value passed to a property has 7 interpolated values in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate7(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n *\n * Update an interpolated class on an element with 8 bound values surrounded by text.\n *\n * Used when the value passed to a property has 8 interpolated values in it:\n *\n * ```html\n * <div class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolate8(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param i6 Static value used for concatenation only.\n * @param v7 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n/**\n * Update an interpolated class on an element with 9 or more bound values surrounded by text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div\n * class=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵclassMapInterpolateV(\n * ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n * 'suffix']);\n * ```\n *.\n * @param values The collection of values and the strings in-between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n * @codeGenApi\n */\nfunction ɵɵclassMapInterpolateV(values) {\n const lView = getLView();\n const interpolatedValue = interpolationV(lView, values);\n checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);\n}\n\n/*!\n * @license\n * Copyright Google LLC 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.dev/license\n */\n/**\n * Instruction that returns the component instance in which the current instruction is executing.\n * This is a constant-time version of `nextContent` for the case where we know that we need the\n * component instance specifically, rather than the context of a particular template.\n *\n * @codeGenApi\n */\nfunction ɵɵcomponentInstance() {\n const instance = getLView()[DECLARATION_COMPONENT_VIEW][CONTEXT];\n ngDevMode && assertDefined(instance, 'Expected component instance to be defined');\n return instance;\n}\n\n/**\n * A type representing the live collection to be reconciled with any new (incoming) collection. This\n * is an adapter class that makes it possible to work with different internal data structures,\n * regardless of the actual values of the incoming collection.\n */\nclass LiveCollection {\n destroy(item) {\n // noop by default\n }\n updateValue(index, value) {\n // noop by default\n }\n // operations below could be implemented on top of the operations defined so far, but having\n // them explicitly allow clear expression of intent and potentially more performant\n // implementations\n swap(index1, index2) {\n const startIdx = Math.min(index1, index2);\n const endIdx = Math.max(index1, index2);\n const endItem = this.detach(endIdx);\n if (endIdx - startIdx > 1) {\n const startItem = this.detach(startIdx);\n this.attach(startIdx, endItem);\n this.attach(endIdx, startItem);\n }\n else {\n this.attach(startIdx, endItem);\n }\n }\n move(prevIndex, newIdx) {\n this.attach(newIdx, this.detach(prevIndex));\n }\n}\nfunction valuesMatching(liveIdx, liveValue, newIdx, newValue, trackBy) {\n if (liveIdx === newIdx && Object.is(liveValue, newValue)) {\n // matching and no value identity to update\n return 1;\n }\n else if (Object.is(trackBy(liveIdx, liveValue), trackBy(newIdx, newValue))) {\n // matching but requires value identity update\n return -1;\n }\n return 0;\n}\nfunction recordDuplicateKeys(keyToIdx, key, idx) {\n const idxSoFar = keyToIdx.get(key);\n if (idxSoFar !== undefined) {\n idxSoFar.add(idx);\n }\n else {\n keyToIdx.set(key, new Set([idx]));\n }\n}\n/**\n * The live collection reconciliation algorithm that perform various in-place operations, so it\n * reflects the content of the new (incoming) collection.\n *\n * The reconciliation algorithm has 2 code paths:\n * - \"fast\" path that don't require any memory allocation;\n * - \"slow\" path that requires additional memory allocation for intermediate data structures used to\n * collect additional information about the live collection.\n * It might happen that the algorithm switches between the two modes in question in a single\n * reconciliation path - generally it tries to stay on the \"fast\" path as much as possible.\n *\n * The overall complexity of the algorithm is O(n + m) for speed and O(n) for memory (where n is the\n * length of the live collection and m is the length of the incoming collection). Given the problem\n * at hand the complexity / performance constraints makes it impossible to perform the absolute\n * minimum of operation to reconcile the 2 collections. The algorithm makes different tradeoffs to\n * stay within reasonable performance bounds and may apply sub-optimal number of operations in\n * certain situations.\n *\n * @param liveCollection the current, live collection;\n * @param newCollection the new, incoming collection;\n * @param trackByFn key generation function that determines equality between items in the life and\n * incoming collection;\n */\nfunction reconcile(liveCollection, newCollection, trackByFn) {\n let detachedItems = undefined;\n let liveKeysInTheFuture = undefined;\n let liveStartIdx = 0;\n let liveEndIdx = liveCollection.length - 1;\n const duplicateKeys = ngDevMode ? new Map() : undefined;\n if (Array.isArray(newCollection)) {\n let newEndIdx = newCollection.length - 1;\n while (liveStartIdx <= liveEndIdx && liveStartIdx <= newEndIdx) {\n // compare from the beginning\n const liveStartValue = liveCollection.at(liveStartIdx);\n const newStartValue = newCollection[liveStartIdx];\n if (ngDevMode) {\n recordDuplicateKeys(duplicateKeys, trackByFn(liveStartIdx, newStartValue), liveStartIdx);\n }\n const isStartMatching = valuesMatching(liveStartIdx, liveStartValue, liveStartIdx, newStartValue, trackByFn);\n if (isStartMatching !== 0) {\n if (isStartMatching < 0) {\n liveCollection.updateValue(liveStartIdx, newStartValue);\n }\n liveStartIdx++;\n continue;\n }\n // compare from the end\n // TODO(perf): do _all_ the matching from the end\n const liveEndValue = liveCollection.at(liveEndIdx);\n const newEndValue = newCollection[newEndIdx];\n if (ngDevMode) {\n recordDuplicateKeys(duplicateKeys, trackByFn(newEndIdx, newEndValue), newEndIdx);\n }\n const isEndMatching = valuesMatching(liveEndIdx, liveEndValue, newEndIdx, newEndValue, trackByFn);\n if (isEndMatching !== 0) {\n if (isEndMatching < 0) {\n liveCollection.updateValue(liveEndIdx, newEndValue);\n }\n liveEndIdx--;\n newEndIdx--;\n continue;\n }\n // Detect swap and moves:\n const liveStartKey = trackByFn(liveStartIdx, liveStartValue);\n const liveEndKey = trackByFn(liveEndIdx, liveEndValue);\n const newStartKey = trackByFn(liveStartIdx, newStartValue);\n if (Object.is(newStartKey, liveEndKey)) {\n const newEndKey = trackByFn(newEndIdx, newEndValue);\n // detect swap on both ends;\n if (Object.is(newEndKey, liveStartKey)) {\n liveCollection.swap(liveStartIdx, liveEndIdx);\n liveCollection.updateValue(liveEndIdx, newEndValue);\n newEndIdx--;\n liveEndIdx--;\n }\n else {\n // the new item is the same as the live item with the end pointer - this is a move forward\n // to an earlier index;\n liveCollection.move(liveEndIdx, liveStartIdx);\n }\n liveCollection.updateValue(liveStartIdx, newStartValue);\n liveStartIdx++;\n continue;\n }\n // Fallback to the slow path: we need to learn more about the content of the live and new\n // collections.\n detachedItems ??= new UniqueValueMultiKeyMap();\n liveKeysInTheFuture ??= initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);\n // Check if I'm inserting a previously detached item: if so, attach it here\n if (attachPreviouslyDetached(liveCollection, detachedItems, liveStartIdx, newStartKey)) {\n liveCollection.updateValue(liveStartIdx, newStartValue);\n liveStartIdx++;\n liveEndIdx++;\n }\n else if (!liveKeysInTheFuture.has(newStartKey)) {\n // Check if we seen a new item that doesn't exist in the old collection and must be INSERTED\n const newItem = liveCollection.create(liveStartIdx, newCollection[liveStartIdx]);\n liveCollection.attach(liveStartIdx, newItem);\n liveStartIdx++;\n liveEndIdx++;\n }\n else {\n // We know that the new item exists later on in old collection but we don't know its index\n // and as the consequence can't move it (don't know where to find it). Detach the old item,\n // hoping that it unlocks the fast path again.\n detachedItems.set(liveStartKey, liveCollection.detach(liveStartIdx));\n liveEndIdx--;\n }\n }\n // Final cleanup steps:\n // - more items in the new collection => insert\n while (liveStartIdx <= newEndIdx) {\n createOrAttach(liveCollection, detachedItems, trackByFn, liveStartIdx, newCollection[liveStartIdx]);\n liveStartIdx++;\n }\n }\n else if (newCollection != null) {\n // iterable - immediately fallback to the slow path\n const newCollectionIterator = newCollection[Symbol.iterator]();\n let newIterationResult = newCollectionIterator.next();\n while (!newIterationResult.done && liveStartIdx <= liveEndIdx) {\n const liveValue = liveCollection.at(liveStartIdx);\n const newValue = newIterationResult.value;\n if (ngDevMode) {\n recordDuplicateKeys(duplicateKeys, trackByFn(liveStartIdx, newValue), liveStartIdx);\n }\n const isStartMatching = valuesMatching(liveStartIdx, liveValue, liveStartIdx, newValue, trackByFn);\n if (isStartMatching !== 0) {\n // found a match - move on, but update value\n if (isStartMatching < 0) {\n liveCollection.updateValue(liveStartIdx, newValue);\n }\n liveStartIdx++;\n newIterationResult = newCollectionIterator.next();\n }\n else {\n detachedItems ??= new UniqueValueMultiKeyMap();\n liveKeysInTheFuture ??= initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);\n // Check if I'm inserting a previously detached item: if so, attach it here\n const newKey = trackByFn(liveStartIdx, newValue);\n if (attachPreviouslyDetached(liveCollection, detachedItems, liveStartIdx, newKey)) {\n liveCollection.updateValue(liveStartIdx, newValue);\n liveStartIdx++;\n liveEndIdx++;\n newIterationResult = newCollectionIterator.next();\n }\n else if (!liveKeysInTheFuture.has(newKey)) {\n liveCollection.attach(liveStartIdx, liveCollection.create(liveStartIdx, newValue));\n liveStartIdx++;\n liveEndIdx++;\n newIterationResult = newCollectionIterator.next();\n }\n else {\n // it is a move forward - detach the current item without advancing in collections\n const liveKey = trackByFn(liveStartIdx, liveValue);\n detachedItems.set(liveKey, liveCollection.detach(liveStartIdx));\n liveEndIdx--;\n }\n }\n }\n // this is a new item as we run out of the items in the old collection - create or attach a\n // previously detached one\n while (!newIterationResult.done) {\n createOrAttach(liveCollection, detachedItems, trackByFn, liveCollection.length, newIterationResult.value);\n newIterationResult = newCollectionIterator.next();\n }\n }\n // Cleanups common to the array and iterable:\n // - more items in the live collection => delete starting from the end;\n while (liveStartIdx <= liveEndIdx) {\n liveCollection.destroy(liveCollection.detach(liveEndIdx--));\n }\n // - destroy items that were detached but never attached again.\n detachedItems?.forEach((item) => {\n liveCollection.destroy(item);\n });\n // report duplicate keys (dev mode only)\n if (ngDevMode) {\n let duplicatedKeysMsg = [];\n for (const [key, idxSet] of duplicateKeys) {\n if (idxSet.size > 1) {\n const idx = [...idxSet].sort((a, b) => a - b);\n for (let i = 1; i < idx.length; i++) {\n duplicatedKeysMsg.push(`key \"${stringifyForError(key)}\" at index \"${idx[i - 1]}\" and \"${idx[i]}\"`);\n }\n }\n }\n if (duplicatedKeysMsg.length > 0) {\n const message = formatRuntimeError(-955 /* RuntimeErrorCode.LOOP_TRACK_DUPLICATE_KEYS */, 'The provided track expression resulted in duplicated keys for a given collection. ' +\n 'Adjust the tracking expression such that it uniquely identifies all the items in the collection. ' +\n 'Duplicated keys were: \\n' +\n duplicatedKeysMsg.join(', \\n') +\n '.');\n // tslint:disable-next-line:no-console\n console.warn(message);\n }\n }\n}\nfunction attachPreviouslyDetached(prevCollection, detachedItems, index, key) {\n if (detachedItems !== undefined && detachedItems.has(key)) {\n prevCollection.attach(index, detachedItems.get(key));\n detachedItems.delete(key);\n return true;\n }\n return false;\n}\nfunction createOrAttach(liveCollection, detachedItems, trackByFn, index, value) {\n if (!attachPreviouslyDetached(liveCollection, detachedItems, index, trackByFn(index, value))) {\n const newItem = liveCollection.create(index, value);\n liveCollection.attach(index, newItem);\n }\n else {\n liveCollection.updateValue(index, value);\n }\n}\nfunction initLiveItemsInTheFuture(liveCollection, start, end, trackByFn) {\n const keys = new Set();\n for (let i = start; i <= end; i++) {\n keys.add(trackByFn(i, liveCollection.at(i)));\n }\n return keys;\n}\n/**\n * A specific, partial implementation of the Map interface with the following characteristics:\n * - allows multiple values for a given key;\n * - maintain FIFO order for multiple values corresponding to a given key;\n * - assumes that all values are unique.\n *\n * The implementation aims at having the minimal overhead for cases where keys are _not_ duplicated\n * (the most common case in the list reconciliation algorithm). To achieve this, the first value for\n * a given key is stored in a regular map. Then, when more values are set for a given key, we\n * maintain a form of linked list in a separate map. To maintain this linked list we assume that all\n * values (in the entire collection) are unique.\n */\nclass UniqueValueMultiKeyMap {\n constructor() {\n // A map from a key to the first value corresponding to this key.\n this.kvMap = new Map();\n // A map that acts as a linked list of values - each value maps to the next value in this \"linked\n // list\" (this only works if values are unique). Allocated lazily to avoid memory consumption when\n // there are no duplicated values.\n this._vMap = undefined;\n }\n has(key) {\n return this.kvMap.has(key);\n }\n delete(key) {\n if (!this.has(key))\n return false;\n const value = this.kvMap.get(key);\n if (this._vMap !== undefined && this._vMap.has(value)) {\n this.kvMap.set(key, this._vMap.get(value));\n this._vMap.delete(value);\n }\n else {\n this.kvMap.delete(key);\n }\n return true;\n }\n get(key) {\n return this.kvMap.get(key);\n }\n set(key, value) {\n if (this.kvMap.has(key)) {\n let prevValue = this.kvMap.get(key);\n ngDevMode &&\n assertNotSame(prevValue, value, `Detected a duplicated value ${value} for the key ${key}`);\n if (this._vMap === undefined) {\n this._vMap = new Map();\n }\n const vMap = this._vMap;\n while (vMap.has(prevValue)) {\n prevValue = vMap.get(prevValue);\n }\n vMap.set(prevValue, value);\n }\n else {\n this.kvMap.set(key, value);\n }\n }\n forEach(cb) {\n for (let [key, value] of this.kvMap) {\n cb(value, key);\n if (this._vMap !== undefined) {\n const vMap = this._vMap;\n while (vMap.has(value)) {\n value = vMap.get(value);\n cb(value, key);\n }\n }\n }\n }\n}\n\n/**\n * The conditional instruction represents the basic building block on the runtime side to support\n * built-in \"if\" and \"switch\". On the high level this instruction is responsible for adding and\n * removing views selected by a conditional expression.\n *\n * @param matchingTemplateIndex Index of a template TNode representing a conditional view to be\n * inserted; -1 represents a special case when there is no view to insert.\n * @param contextValue Value that should be exposed as the context of the conditional.\n * @codeGenApi\n */\nfunction ɵɵconditional(matchingTemplateIndex, contextValue) {\n performanceMarkFeature('NgControlFlow');\n const hostLView = getLView();\n const bindingIndex = nextBindingIndex();\n const prevMatchingTemplateIndex = hostLView[bindingIndex] !== NO_CHANGE ? hostLView[bindingIndex] : -1;\n const prevContainer = prevMatchingTemplateIndex !== -1\n ? getLContainer(hostLView, HEADER_OFFSET + prevMatchingTemplateIndex)\n : undefined;\n const viewInContainerIdx = 0;\n if (bindingUpdated(hostLView, bindingIndex, matchingTemplateIndex)) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n // The index of the view to show changed - remove the previously displayed one\n // (it is a noop if there are no active views in a container).\n if (prevContainer !== undefined) {\n removeLViewFromLContainer(prevContainer, viewInContainerIdx);\n }\n // Index -1 is a special case where none of the conditions evaluates to\n // a truthy value and as the consequence we've got no view to show.\n if (matchingTemplateIndex !== -1) {\n const nextLContainerIndex = HEADER_OFFSET + matchingTemplateIndex;\n const nextContainer = getLContainer(hostLView, nextLContainerIndex);\n const templateTNode = getExistingTNode(hostLView[TVIEW], nextLContainerIndex);\n const dehydratedView = findMatchingDehydratedView(nextContainer, templateTNode.tView.ssrId);\n const embeddedLView = createAndRenderEmbeddedLView(hostLView, templateTNode, contextValue, {\n dehydratedView,\n });\n addLViewToLContainer(nextContainer, embeddedLView, viewInContainerIdx, shouldAddViewToDom(templateTNode, dehydratedView));\n }\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n else if (prevContainer !== undefined) {\n // We might keep displaying the same template but the actual value of the expression could have\n // changed - re-bind in context.\n const lView = getLViewFromLContainer(prevContainer, viewInContainerIdx);\n if (lView !== undefined) {\n lView[CONTEXT] = contextValue;\n }\n }\n}\nclass RepeaterContext {\n constructor(lContainer, $implicit, $index) {\n this.lContainer = lContainer;\n this.$implicit = $implicit;\n this.$index = $index;\n }\n get $count() {\n return this.lContainer.length - CONTAINER_HEADER_OFFSET;\n }\n}\n/**\n * A built-in trackBy function used for situations where users specified collection index as a\n * tracking expression. Having this function body in the runtime avoids unnecessary code generation.\n *\n * @param index\n * @returns\n */\nfunction ɵɵrepeaterTrackByIndex(index) {\n return index;\n}\n/**\n * A built-in trackBy function used for situations where users specified collection item reference\n * as a tracking expression. Having this function body in the runtime avoids unnecessary code\n * generation.\n *\n * @param index\n * @returns\n */\nfunction ɵɵrepeaterTrackByIdentity(_, value) {\n return value;\n}\nclass RepeaterMetadata {\n constructor(hasEmptyBlock, trackByFn, liveCollection) {\n this.hasEmptyBlock = hasEmptyBlock;\n this.trackByFn = trackByFn;\n this.liveCollection = liveCollection;\n }\n}\n/**\n * The repeaterCreate instruction runs in the creation part of the template pass and initializes\n * internal data structures required by the update pass of the built-in repeater logic. Repeater\n * metadata are allocated in the data part of LView with the following layout:\n * - LView[HEADER_OFFSET + index] - metadata\n * - LView[HEADER_OFFSET + index + 1] - reference to a template function rendering an item\n * - LView[HEADER_OFFSET + index + 2] - optional reference to a template function rendering an empty\n * block\n *\n * @param index Index at which to store the metadata of the repeater.\n * @param templateFn Reference to the template of the main repeater block.\n * @param decls The number of nodes, local refs, and pipes for the main block.\n * @param vars The number of bindings for the main block.\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param trackByFn Reference to the tracking function.\n * @param trackByUsesComponentInstance Whether the tracking function has any references to the\n * component instance. If it doesn't, we can avoid rebinding it.\n * @param emptyTemplateFn Reference to the template function of the empty block.\n * @param emptyDecls The number of nodes, local refs, and pipes for the empty block.\n * @param emptyVars The number of bindings for the empty block.\n * @param emptyTagName The name of the empty block container element, if applicable\n * @param emptyAttrsIndex Index of the empty block template attributes in the `consts` array.\n *\n * @codeGenApi\n */\nfunction ɵɵrepeaterCreate(index, templateFn, decls, vars, tagName, attrsIndex, trackByFn, trackByUsesComponentInstance, emptyTemplateFn, emptyDecls, emptyVars, emptyTagName, emptyAttrsIndex) {\n performanceMarkFeature('NgControlFlow');\n ngDevMode &&\n assertFunction(trackByFn, `A track expression must be a function, was ${typeof trackByFn} instead.`);\n const lView = getLView();\n const tView = getTView();\n const hasEmptyBlock = emptyTemplateFn !== undefined;\n const hostLView = getLView();\n const boundTrackBy = trackByUsesComponentInstance\n ? // We only want to bind when necessary, because it produces a\n // new function. For pure functions it's not necessary.\n trackByFn.bind(hostLView[DECLARATION_COMPONENT_VIEW][CONTEXT])\n : trackByFn;\n const metadata = new RepeaterMetadata(hasEmptyBlock, boundTrackBy);\n hostLView[HEADER_OFFSET + index] = metadata;\n declareTemplate(lView, tView, index + 1, templateFn, decls, vars, tagName, getConstant(tView.consts, attrsIndex));\n if (hasEmptyBlock) {\n ngDevMode &&\n assertDefined(emptyDecls, 'Missing number of declarations for the empty repeater block.');\n ngDevMode &&\n assertDefined(emptyVars, 'Missing number of bindings for the empty repeater block.');\n declareTemplate(lView, tView, index + 2, emptyTemplateFn, emptyDecls, emptyVars, emptyTagName, getConstant(tView.consts, emptyAttrsIndex));\n }\n}\nfunction isViewExpensiveToRecreate(lView) {\n // assumption: anything more than a text node with a binding is considered \"expensive\"\n return lView.length - HEADER_OFFSET > 2;\n}\nclass OperationsCounter {\n constructor() {\n this.created = 0;\n this.destroyed = 0;\n }\n reset() {\n this.created = 0;\n this.destroyed = 0;\n }\n recordCreate() {\n this.created++;\n }\n recordDestroy() {\n this.destroyed++;\n }\n /**\n * A method indicating if the entire collection was re-created as part of the reconciliation pass.\n * Used to warn developers about the usage of a tracking function that might result in excessive\n * amount of view creation / destroy operations.\n *\n * @returns boolean value indicating if a live collection was re-created\n */\n wasReCreated(collectionLen) {\n return collectionLen > 0 && this.created === this.destroyed && this.created === collectionLen;\n }\n}\nclass LiveCollectionLContainerImpl extends LiveCollection {\n constructor(lContainer, hostLView, templateTNode) {\n super();\n this.lContainer = lContainer;\n this.hostLView = hostLView;\n this.templateTNode = templateTNode;\n this.operationsCounter = ngDevMode ? new OperationsCounter() : undefined;\n /**\n Property indicating if indexes in the repeater context need to be updated following the live\n collection changes. Index updates are necessary if and only if views are inserted / removed in\n the middle of LContainer. Adds and removals at the end don't require index updates.\n */\n this.needsIndexUpdate = false;\n }\n get length() {\n return this.lContainer.length - CONTAINER_HEADER_OFFSET;\n }\n at(index) {\n return this.getLView(index)[CONTEXT].$implicit;\n }\n attach(index, lView) {\n const dehydratedView = lView[HYDRATION];\n this.needsIndexUpdate ||= index !== this.length;\n addLViewToLContainer(this.lContainer, lView, index, shouldAddViewToDom(this.templateTNode, dehydratedView));\n }\n detach(index) {\n this.needsIndexUpdate ||= index !== this.length - 1;\n return detachExistingView(this.lContainer, index);\n }\n create(index, value) {\n const dehydratedView = findMatchingDehydratedView(this.lContainer, this.templateTNode.tView.ssrId);\n const embeddedLView = createAndRenderEmbeddedLView(this.hostLView, this.templateTNode, new RepeaterContext(this.lContainer, value, index), { dehydratedView });\n this.operationsCounter?.recordCreate();\n return embeddedLView;\n }\n destroy(lView) {\n destroyLView(lView[TVIEW], lView);\n this.operationsCounter?.recordDestroy();\n }\n updateValue(index, value) {\n this.getLView(index)[CONTEXT].$implicit = value;\n }\n reset() {\n this.needsIndexUpdate = false;\n this.operationsCounter?.reset();\n }\n updateIndexes() {\n if (this.needsIndexUpdate) {\n for (let i = 0; i < this.length; i++) {\n this.getLView(i)[CONTEXT].$index = i;\n }\n }\n }\n getLView(index) {\n return getExistingLViewFromLContainer(this.lContainer, index);\n }\n}\n/**\n * The repeater instruction does update-time diffing of a provided collection (against the\n * collection seen previously) and maps changes in the collection to views structure (by adding,\n * removing or moving views as needed).\n * @param collection - the collection instance to be checked for changes\n * @codeGenApi\n */\nfunction ɵɵrepeater(collection) {\n const prevConsumer = setActiveConsumer$1(null);\n const metadataSlotIdx = getSelectedIndex();\n try {\n const hostLView = getLView();\n const hostTView = hostLView[TVIEW];\n const metadata = hostLView[metadataSlotIdx];\n const containerIndex = metadataSlotIdx + 1;\n const lContainer = getLContainer(hostLView, containerIndex);\n if (metadata.liveCollection === undefined) {\n const itemTemplateTNode = getExistingTNode(hostTView, containerIndex);\n metadata.liveCollection = new LiveCollectionLContainerImpl(lContainer, hostLView, itemTemplateTNode);\n }\n else {\n metadata.liveCollection.reset();\n }\n const liveCollection = metadata.liveCollection;\n reconcile(liveCollection, collection, metadata.trackByFn);\n // Warn developers about situations where the entire collection was re-created as part of the\n // reconciliation pass. Note that this warning might be \"overreacting\" and report cases where\n // the collection re-creation is the intended behavior. Still, the assumption is that most of\n // the time it is undesired.\n if (ngDevMode &&\n metadata.trackByFn === ɵɵrepeaterTrackByIdentity &&\n liveCollection.operationsCounter?.wasReCreated(liveCollection.length) &&\n isViewExpensiveToRecreate(getExistingLViewFromLContainer(lContainer, 0))) {\n const message = formatRuntimeError(-956 /* RuntimeErrorCode.LOOP_TRACK_RECREATE */, `The configured tracking expression (track by identity) caused re-creation of the entire collection of size ${liveCollection.length}. ` +\n 'This is an expensive operation requiring destruction and subsequent creation of DOM nodes, directives, components etc. ' +\n 'Please review the \"track expression\" and make sure that it uniquely identifies items in a collection.');\n console.warn(message);\n }\n // moves in the container might caused context's index to get out of order, re-adjust if needed\n liveCollection.updateIndexes();\n // handle empty blocks\n if (metadata.hasEmptyBlock) {\n const bindingIndex = nextBindingIndex();\n const isCollectionEmpty = liveCollection.length === 0;\n if (bindingUpdated(hostLView, bindingIndex, isCollectionEmpty)) {\n const emptyTemplateIndex = metadataSlotIdx + 2;\n const lContainerForEmpty = getLContainer(hostLView, emptyTemplateIndex);\n if (isCollectionEmpty) {\n const emptyTemplateTNode = getExistingTNode(hostTView, emptyTemplateIndex);\n const dehydratedView = findMatchingDehydratedView(lContainerForEmpty, emptyTemplateTNode.tView.ssrId);\n const embeddedLView = createAndRenderEmbeddedLView(hostLView, emptyTemplateTNode, undefined, { dehydratedView });\n addLViewToLContainer(lContainerForEmpty, embeddedLView, 0, shouldAddViewToDom(emptyTemplateTNode, dehydratedView));\n }\n else {\n removeLViewFromLContainer(lContainerForEmpty, 0);\n }\n }\n }\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n }\n}\nfunction getLContainer(lView, index) {\n const lContainer = lView[index];\n ngDevMode && assertLContainer(lContainer);\n return lContainer;\n}\nfunction detachExistingView(lContainer, index) {\n const existingLView = detachView(lContainer, index);\n ngDevMode && assertLView(existingLView);\n return existingLView;\n}\nfunction getExistingLViewFromLContainer(lContainer, index) {\n const existingLView = getLViewFromLContainer(lContainer, index);\n ngDevMode && assertLView(existingLView);\n return existingLView;\n}\nfunction getExistingTNode(tView, index) {\n const tNode = getTNode(tView, index);\n ngDevMode && assertTNode(tNode);\n return tNode;\n}\n\nfunction elementStartFirstCreatePass(index, tView, lView, name, attrsIndex, localRefsIndex) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && ngDevMode.firstCreatePass++;\n const tViewConsts = tView.consts;\n const attrs = getConstant(tViewConsts, attrsIndex);\n const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, name, attrs);\n resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));\n if (tNode.attrs !== null) {\n computeStaticStyling(tNode, tNode.attrs, false);\n }\n if (tNode.mergedAttrs !== null) {\n computeStaticStyling(tNode, tNode.mergedAttrs, true);\n }\n if (tView.queries !== null) {\n tView.queries.elementStart(tView, tNode);\n }\n return tNode;\n}\n/**\n * Create DOM element. The instruction must later be followed by `elementEnd()` call.\n *\n * @param index Index of the element in the LView array\n * @param name Name of the DOM Node\n * @param attrsIndex Index of the element's attributes in the `consts` array.\n * @param localRefsIndex Index of the element's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * Attributes and localRefs are passed as an array of strings where elements with an even index\n * hold an attribute name and elements with an odd index hold an attribute value, ex.:\n * ['id', 'warning5', 'class', 'alert']\n *\n * @codeGenApi\n */\nfunction ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = HEADER_OFFSET + index;\n ngDevMode &&\n assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings');\n ngDevMode && assertIndexInRange(lView, adjustedIndex);\n const renderer = lView[RENDERER];\n const tNode = tView.firstCreatePass\n ? elementStartFirstCreatePass(adjustedIndex, tView, lView, name, attrsIndex, localRefsIndex)\n : tView.data[adjustedIndex];\n const native = _locateOrCreateElementNode(tView, lView, tNode, renderer, name, index);\n lView[adjustedIndex] = native;\n const hasDirectives = isDirectiveHost(tNode);\n if (ngDevMode && tView.firstCreatePass) {\n validateElementIsKnown(native, lView, tNode.value, tView.schemas, hasDirectives);\n }\n setCurrentTNode(tNode, true);\n setupStaticAttributes(renderer, native, tNode);\n if (!isDetachedByI18n(tNode) && wasLastNodeCreated()) {\n // In the i18n case, the translation may have removed this element, so only add it if it is not\n // detached. See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n appendChild(tView, lView, native, tNode);\n }\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n if (hasDirectives) {\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n if (localRefsIndex !== null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n return ɵɵelementStart;\n}\n/**\n * Mark the end of the element.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelementEnd() {\n let currentTNode = getCurrentTNode();\n ngDevMode && assertDefined(currentTNode, 'No parent node to close.');\n if (isCurrentTNodeParent()) {\n setCurrentTNodeAsNotParent();\n }\n else {\n ngDevMode && assertHasParent(getCurrentTNode());\n currentTNode = currentTNode.parent;\n setCurrentTNode(currentTNode, false);\n }\n const tNode = currentTNode;\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);\n if (isSkipHydrationRootTNode(tNode)) {\n leaveSkipHydrationBlock();\n }\n decreaseElementDepthCount();\n const tView = getTView();\n if (tView.firstCreatePass) {\n registerPostOrderHooks(tView, currentTNode);\n if (isContentQueryHost(currentTNode)) {\n tView.queries.elementEnd(currentTNode);\n }\n }\n if (tNode.classesWithoutHost != null && hasClassInput(tNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.classesWithoutHost, true);\n }\n if (tNode.stylesWithoutHost != null && hasStyleInput(tNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.stylesWithoutHost, false);\n }\n return ɵɵelementEnd;\n}\n/**\n * Creates an empty element using {@link elementStart} and {@link elementEnd}\n *\n * @param index Index of the element in the data array\n * @param name Name of the DOM Node\n * @param attrsIndex Index of the element's attributes in the `consts` array.\n * @param localRefsIndex Index of the element's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelement(index, name, attrsIndex, localRefsIndex) {\n ɵɵelementStart(index, name, attrsIndex, localRefsIndex);\n ɵɵelementEnd();\n return ɵɵelement;\n}\nlet _locateOrCreateElementNode = (tView, lView, tNode, renderer, name, index) => {\n lastNodeWasCreated(true);\n return createElementNode(renderer, name, getNamespace$1());\n};\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode of element nodes.\n */\nfunction locateOrCreateElementNodeImpl(tView, lView, tNode, renderer, name, index) {\n const hydrationInfo = lView[HYDRATION];\n const isNodeCreationMode = !hydrationInfo ||\n isInSkipHydrationBlock$1() ||\n isDetachedByI18n(tNode) ||\n isDisconnectedNode$1(hydrationInfo, index);\n lastNodeWasCreated(isNodeCreationMode);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createElementNode(renderer, name, getNamespace$1());\n }\n // Hydration mode, looking up an existing element in DOM.\n const native = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateMatchingNode(native, Node.ELEMENT_NODE, name, lView, tNode);\n ngDevMode && markRNodeAsClaimedByHydration(native);\n // This element might also be an anchor of a view container.\n if (getSerializedContainerViews(hydrationInfo, index)) {\n // Important note: this element acts as an anchor, but it's **not** a part\n // of the embedded view, so we start the segment **after** this element, taking\n // a reference to the next sibling. For example, the following template:\n // `<div #vcrTarget>` is represented in the DOM as `<div></div>...<!--container-->`,\n // so while processing a `<div>` instruction, point to the next sibling as a\n // start of a segment.\n ngDevMode && validateNodeExists(native.nextSibling, lView, tNode);\n setSegmentHead(hydrationInfo, index, native.nextSibling);\n }\n // Checks if the skip hydration attribute is present during hydration so we know to\n // skip attempting to hydrate this block. We check both TNode and RElement for an\n // attribute: the RElement case is needed for i18n cases, when we add it to host\n // elements during the annotation phase (after all internal data structures are setup).\n if (hydrationInfo &&\n (hasSkipHydrationAttrOnTNode(tNode) || hasSkipHydrationAttrOnRElement(native))) {\n if (isComponentHost(tNode)) {\n enterSkipHydrationBlock(tNode);\n // Since this isn't hydratable, we need to empty the node\n // so there's no duplicate content after render\n clearElementContents(native);\n ngDevMode && markRNodeAsSkippedByHydration(native);\n }\n else if (ngDevMode) {\n // If this is not a component host, throw an error.\n // Hydration can be skipped on per-component basis only.\n throw invalidSkipHydrationHost(native);\n }\n }\n return native;\n}\nfunction enableLocateOrCreateElementNodeImpl() {\n _locateOrCreateElementNode = locateOrCreateElementNodeImpl;\n}\n\nfunction elementContainerStartFirstCreatePass(index, tView, lView, attrsIndex, localRefsIndex) {\n ngDevMode && ngDevMode.firstCreatePass++;\n const tViewConsts = tView.consts;\n const attrs = getConstant(tViewConsts, attrsIndex);\n const tNode = getOrCreateTNode(tView, index, 8 /* TNodeType.ElementContainer */, 'ng-container', attrs);\n // While ng-container doesn't necessarily support styling, we use the style context to identify\n // and execute directives on the ng-container.\n if (attrs !== null) {\n computeStaticStyling(tNode, attrs, true);\n }\n const localRefs = getConstant(tViewConsts, localRefsIndex);\n resolveDirectives(tView, lView, tNode, localRefs);\n if (tView.queries !== null) {\n tView.queries.elementStart(tView, tNode);\n }\n return tNode;\n}\n/**\n * Creates a logical container for other nodes (<ng-container>) backed by a comment node in the DOM.\n * The instruction must later be followed by `elementContainerEnd()` call.\n *\n * @param index Index of the element in the LView array\n * @param attrsIndex Index of the container attributes in the `consts` array.\n * @param localRefsIndex Index of the container's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * Even if this instruction accepts a set of attributes no actual attribute values are propagated to\n * the DOM (as a comment node can't have attributes). Attributes are here only for directive\n * matching purposes and setting initial inputs of directives.\n *\n * @codeGenApi\n */\nfunction ɵɵelementContainerStart(index, attrsIndex, localRefsIndex) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n ngDevMode && assertIndexInRange(lView, adjustedIndex);\n ngDevMode &&\n assertEqual(getBindingIndex(), tView.bindingStartIndex, 'element containers should be created before any bindings');\n const tNode = tView.firstCreatePass\n ? elementContainerStartFirstCreatePass(adjustedIndex, tView, lView, attrsIndex, localRefsIndex)\n : tView.data[adjustedIndex];\n setCurrentTNode(tNode, true);\n const comment = _locateOrCreateElementContainerNode(tView, lView, tNode, index);\n lView[adjustedIndex] = comment;\n if (wasLastNodeCreated()) {\n appendChild(tView, lView, comment, tNode);\n }\n attachPatchData(comment, lView);\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n return ɵɵelementContainerStart;\n}\n/**\n * Mark the end of the <ng-container>.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelementContainerEnd() {\n let currentTNode = getCurrentTNode();\n const tView = getTView();\n if (isCurrentTNodeParent()) {\n setCurrentTNodeAsNotParent();\n }\n else {\n ngDevMode && assertHasParent(currentTNode);\n currentTNode = currentTNode.parent;\n setCurrentTNode(currentTNode, false);\n }\n ngDevMode && assertTNodeType(currentTNode, 8 /* TNodeType.ElementContainer */);\n if (tView.firstCreatePass) {\n registerPostOrderHooks(tView, currentTNode);\n if (isContentQueryHost(currentTNode)) {\n tView.queries.elementEnd(currentTNode);\n }\n }\n return ɵɵelementContainerEnd;\n}\n/**\n * Creates an empty logical container using {@link elementContainerStart}\n * and {@link elementContainerEnd}\n *\n * @param index Index of the element in the LView array\n * @param attrsIndex Index of the container attributes in the `consts` array.\n * @param localRefsIndex Index of the container's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelementContainer(index, attrsIndex, localRefsIndex) {\n ɵɵelementContainerStart(index, attrsIndex, localRefsIndex);\n ɵɵelementContainerEnd();\n return ɵɵelementContainer;\n}\nlet _locateOrCreateElementContainerNode = (tView, lView, tNode, index) => {\n lastNodeWasCreated(true);\n return createCommentNode(lView[RENDERER], ngDevMode ? 'ng-container' : '');\n};\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode of comment nodes that\n * represent <ng-container>'s anchor.\n */\nfunction locateOrCreateElementContainerNode(tView, lView, tNode, index) {\n let comment;\n const hydrationInfo = lView[HYDRATION];\n const isNodeCreationMode = !hydrationInfo ||\n isInSkipHydrationBlock$1() ||\n isDisconnectedNode$1(hydrationInfo, index) ||\n isDetachedByI18n(tNode);\n lastNodeWasCreated(isNodeCreationMode);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createCommentNode(lView[RENDERER], ngDevMode ? 'ng-container' : '');\n }\n // Hydration mode, looking up existing elements in DOM.\n const currentRNode = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateNodeExists(currentRNode, lView, tNode);\n const ngContainerSize = getNgContainerSize(hydrationInfo, index);\n ngDevMode &&\n assertNumber(ngContainerSize, 'Unexpected state: hydrating an <ng-container>, ' + 'but no hydration info is available.');\n setSegmentHead(hydrationInfo, index, currentRNode);\n comment = siblingAfter(ngContainerSize, currentRNode);\n if (ngDevMode) {\n validateMatchingNode(comment, Node.COMMENT_NODE, null, lView, tNode);\n markRNodeAsClaimedByHydration(comment);\n }\n return comment;\n}\nfunction enableLocateOrCreateElementContainerNodeImpl() {\n _locateOrCreateElementContainerNode = locateOrCreateElementContainerNode;\n}\n\n/**\n * Returns the current OpaqueViewState instance.\n *\n * Used in conjunction with the restoreView() instruction to save a snapshot\n * of the current view and restore it when listeners are invoked. This allows\n * walking the declaration view tree in listeners to get vars from parent views.\n *\n * @codeGenApi\n */\nfunction ɵɵgetCurrentView() {\n return getLView();\n}\n\n/**\n * Update a property on a host element. Only applies to native node properties, not inputs.\n *\n * Operates on the element selected by index via the {@link select} instruction.\n *\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @returns This function returns itself so that it may be chained\n * (e.g. `property('name', ctx.name)('title', ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵhostProperty(propName, value, sanitizer) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, true);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵhostProperty;\n}\n/**\n * Updates a synthetic host binding (e.g. `[@foo]`) on a component or directive.\n *\n * This instruction is for compatibility purposes and is designed to ensure that a\n * synthetic host binding (e.g. `@HostBinding('@foo')`) properly gets rendered in\n * the component's renderer. Normally all host bindings are evaluated with the parent\n * component's renderer, but, in the case of animation @triggers, they need to be\n * evaluated with the sub component's renderer (because that's where the animation\n * triggers are defined).\n *\n * Do not use this instruction as a replacement for `elementProperty`. This instruction\n * only exists to ensure compatibility with the ViewEngine's host binding behavior.\n *\n * @param index The index of the element to update in the data array\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n *\n * @codeGenApi\n */\nfunction ɵɵsyntheticHostProperty(propName, value, sanitizer) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n const currentDef = getCurrentDirectiveDef(tView.data);\n const renderer = loadComponentRenderer(currentDef, tNode, lView);\n elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, true);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵsyntheticHostProperty;\n}\n\n/**\n * NOTE: changes to the `ngI18nClosureMode` name must be synced with `compiler-cli/src/tooling.ts`.\n */\nif (typeof ngI18nClosureMode === 'undefined') {\n // These property accesses can be ignored because ngI18nClosureMode will be set to false\n // when optimizing code and the whole if statement will be dropped.\n // Make sure to refer to ngI18nClosureMode as ['ngI18nClosureMode'] for closure.\n // NOTE: we need to have it in IIFE so that the tree-shaker is happy.\n (function () {\n // tslint:disable-next-line:no-toplevel-property-access\n _global['ngI18nClosureMode'] =\n // TODO(FW-1250): validate that this actually, you know, works.\n // tslint:disable-next-line:no-toplevel-property-access\n typeof goog !== 'undefined' && typeof goog.getMsg === 'function';\n })();\n}\n\n// THIS CODE IS GENERATED - DO NOT MODIFY.\nconst u = undefined;\nfunction plural(val) {\n const n = val, i = Math.floor(Math.abs(val)), v = val.toString().replace(/^[^.]*\\.?/, '').length;\n if (i === 1 && v === 0)\n return 1;\n return 5;\n}\nvar localeEn = [\"en\", [[\"a\", \"p\"], [\"AM\", \"PM\"], u], [[\"AM\", \"PM\"], u, u], [[\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"], [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"]], u, [[\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"], [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]], u, [[\"B\", \"A\"], [\"BC\", \"AD\"], [\"Before Christ\", \"Anno Domini\"]], 0, [6, 0], [\"M/d/yy\", \"MMM d, y\", \"MMMM d, y\", \"EEEE, MMMM d, y\"], [\"h:mm a\", \"h:mm:ss a\", \"h:mm:ss a z\", \"h:mm:ss a zzzz\"], [\"{1}, {0}\", u, \"{1} 'at' {0}\", u], [\".\", \",\", \";\", \"%\", \"+\", \"-\", \"E\", \"×\", \"‰\", \"∞\", \"NaN\", \":\"], [\"#,##0.###\", \"#,##0%\", \"¤#,##0.00\", \"#E0\"], \"USD\", \"$\", \"US Dollar\", {}, \"ltr\", plural];\n\n/**\n * This const is used to store the locale data registered with `registerLocaleData`\n */\nlet LOCALE_DATA = {};\n/**\n * Register locale data to be used internally by Angular. See the\n * [\"I18n guide\"](guide/i18n/format-data-locale) to know how to import additional locale\n * data.\n *\n * The signature `registerLocaleData(data: any, extraData?: any)` is deprecated since v5.1\n */\nfunction registerLocaleData(data, localeId, extraData) {\n if (typeof localeId !== 'string') {\n extraData = localeId;\n localeId = data[LocaleDataIndex.LocaleId];\n }\n localeId = localeId.toLowerCase().replace(/_/g, '-');\n LOCALE_DATA[localeId] = data;\n if (extraData) {\n LOCALE_DATA[localeId][LocaleDataIndex.ExtraData] = extraData;\n }\n}\n/**\n * Finds the locale data for a given locale.\n *\n * @param locale The locale code.\n * @returns The locale data.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n */\nfunction findLocaleData(locale) {\n const normalizedLocale = normalizeLocale(locale);\n let match = getLocaleData(normalizedLocale);\n if (match) {\n return match;\n }\n // let's try to find a parent locale\n const parentLocale = normalizedLocale.split('-')[0];\n match = getLocaleData(parentLocale);\n if (match) {\n return match;\n }\n if (parentLocale === 'en') {\n return localeEn;\n }\n throw new RuntimeError(701 /* RuntimeErrorCode.MISSING_LOCALE_DATA */, ngDevMode && `Missing locale data for the locale \"${locale}\".`);\n}\n/**\n * Retrieves the default currency code for the given locale.\n *\n * The default is defined as the first currency which is still in use.\n *\n * @param locale The code of the locale whose currency code we want.\n * @returns The code of the default currency for the given locale.\n *\n */\nfunction getLocaleCurrencyCode(locale) {\n const data = findLocaleData(locale);\n return data[LocaleDataIndex.CurrencyCode] || null;\n}\n/**\n * Retrieves the plural function used by ICU expressions to determine the plural case to use\n * for a given locale.\n * @param locale A locale code for the locale format rules to use.\n * @returns The plural function for the locale.\n * @see {@link NgPlural}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n */\nfunction getLocalePluralCase(locale) {\n const data = findLocaleData(locale);\n return data[LocaleDataIndex.PluralCase];\n}\n/**\n * Helper function to get the given `normalizedLocale` from `LOCALE_DATA`\n * or from the global `ng.common.locale`.\n */\nfunction getLocaleData(normalizedLocale) {\n if (!(normalizedLocale in LOCALE_DATA)) {\n LOCALE_DATA[normalizedLocale] =\n _global.ng &&\n _global.ng.common &&\n _global.ng.common.locales &&\n _global.ng.common.locales[normalizedLocale];\n }\n return LOCALE_DATA[normalizedLocale];\n}\n/**\n * Helper function to remove all the locale data from `LOCALE_DATA`.\n */\nfunction unregisterAllLocaleData() {\n LOCALE_DATA = {};\n}\n/**\n * Index of each type of locale data from the locale data array\n */\nvar LocaleDataIndex;\n(function (LocaleDataIndex) {\n LocaleDataIndex[LocaleDataIndex[\"LocaleId\"] = 0] = \"LocaleId\";\n LocaleDataIndex[LocaleDataIndex[\"DayPeriodsFormat\"] = 1] = \"DayPeriodsFormat\";\n LocaleDataIndex[LocaleDataIndex[\"DayPeriodsStandalone\"] = 2] = \"DayPeriodsStandalone\";\n LocaleDataIndex[LocaleDataIndex[\"DaysFormat\"] = 3] = \"DaysFormat\";\n LocaleDataIndex[LocaleDataIndex[\"DaysStandalone\"] = 4] = \"DaysStandalone\";\n LocaleDataIndex[LocaleDataIndex[\"MonthsFormat\"] = 5] = \"MonthsFormat\";\n LocaleDataIndex[LocaleDataIndex[\"MonthsStandalone\"] = 6] = \"MonthsStandalone\";\n LocaleDataIndex[LocaleDataIndex[\"Eras\"] = 7] = \"Eras\";\n LocaleDataIndex[LocaleDataIndex[\"FirstDayOfWeek\"] = 8] = \"FirstDayOfWeek\";\n LocaleDataIndex[LocaleDataIndex[\"WeekendRange\"] = 9] = \"WeekendRange\";\n LocaleDataIndex[LocaleDataIndex[\"DateFormat\"] = 10] = \"DateFormat\";\n LocaleDataIndex[LocaleDataIndex[\"TimeFormat\"] = 11] = \"TimeFormat\";\n LocaleDataIndex[LocaleDataIndex[\"DateTimeFormat\"] = 12] = \"DateTimeFormat\";\n LocaleDataIndex[LocaleDataIndex[\"NumberSymbols\"] = 13] = \"NumberSymbols\";\n LocaleDataIndex[LocaleDataIndex[\"NumberFormats\"] = 14] = \"NumberFormats\";\n LocaleDataIndex[LocaleDataIndex[\"CurrencyCode\"] = 15] = \"CurrencyCode\";\n LocaleDataIndex[LocaleDataIndex[\"CurrencySymbol\"] = 16] = \"CurrencySymbol\";\n LocaleDataIndex[LocaleDataIndex[\"CurrencyName\"] = 17] = \"CurrencyName\";\n LocaleDataIndex[LocaleDataIndex[\"Currencies\"] = 18] = \"Currencies\";\n LocaleDataIndex[LocaleDataIndex[\"Directionality\"] = 19] = \"Directionality\";\n LocaleDataIndex[LocaleDataIndex[\"PluralCase\"] = 20] = \"PluralCase\";\n LocaleDataIndex[LocaleDataIndex[\"ExtraData\"] = 21] = \"ExtraData\";\n})(LocaleDataIndex || (LocaleDataIndex = {}));\n/**\n * Returns the canonical form of a locale name - lowercase with `_` replaced with `-`.\n */\nfunction normalizeLocale(locale) {\n return locale.toLowerCase().replace(/_/g, '-');\n}\n\nconst pluralMapping = ['zero', 'one', 'two', 'few', 'many'];\n/**\n * Returns the plural case based on the locale\n */\nfunction getPluralCase(value, locale) {\n const plural = getLocalePluralCase(locale)(parseInt(value, 10));\n const result = pluralMapping[plural];\n return result !== undefined ? result : 'other';\n}\n/**\n * The locale id that the application is using by default (for translations and ICU expressions).\n */\nconst DEFAULT_LOCALE_ID = 'en-US';\n/**\n * USD currency code that the application uses by default for CurrencyPipe when no\n * DEFAULT_CURRENCY_CODE is provided.\n */\nconst USD_CURRENCY_CODE = 'USD';\n\n/**\n * Marks that the next string is an element name.\n *\n * See `I18nMutateOpCodes` documentation.\n */\nconst ELEMENT_MARKER = {\n marker: 'element',\n};\n/**\n * Marks that the next string is comment text need for ICU.\n *\n * See `I18nMutateOpCodes` documentation.\n */\nconst ICU_MARKER = {\n marker: 'ICU',\n};\n/**\n * See `I18nCreateOpCodes`\n */\nvar I18nCreateOpCode;\n(function (I18nCreateOpCode) {\n /**\n * Number of bits to shift index so that it can be combined with the `APPEND_EAGERLY` and\n * `COMMENT`.\n */\n I18nCreateOpCode[I18nCreateOpCode[\"SHIFT\"] = 2] = \"SHIFT\";\n /**\n * Should the node be appended to parent immediately after creation.\n */\n I18nCreateOpCode[I18nCreateOpCode[\"APPEND_EAGERLY\"] = 1] = \"APPEND_EAGERLY\";\n /**\n * If set the node should be comment (rather than a text) node.\n */\n I18nCreateOpCode[I18nCreateOpCode[\"COMMENT\"] = 2] = \"COMMENT\";\n})(I18nCreateOpCode || (I18nCreateOpCode = {}));\n\n/**\n * The locale id that the application is currently using (for translations and ICU expressions).\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n */\nlet LOCALE_ID$1 = DEFAULT_LOCALE_ID;\n/**\n * Sets the locale id that will be used for translations and ICU expressions.\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n *\n * @param localeId\n */\nfunction setLocaleId(localeId) {\n ngDevMode && assertDefined(localeId, `Expected localeId to be defined`);\n if (typeof localeId === 'string') {\n LOCALE_ID$1 = localeId.toLowerCase().replace(/_/g, '-');\n }\n}\n/**\n * Gets the locale id that will be used for translations and ICU expressions.\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n */\nfunction getLocaleId() {\n return LOCALE_ID$1;\n}\n\n/**\n * Keep track of which input bindings in `ɵɵi18nExp` have changed.\n *\n * This is used to efficiently update expressions in i18n only when the corresponding input has\n * changed.\n *\n * 1) Each bit represents which of the `ɵɵi18nExp` has changed.\n * 2) There are 32 bits allowed in JS.\n * 3) Bit 32 is special as it is shared for all changes past 32. (In other words if you have more\n * than 32 `ɵɵi18nExp` then all changes past 32nd `ɵɵi18nExp` will be mapped to same bit. This means\n * that we may end up changing more than we need to. But i18n expressions with 32 bindings is rare\n * so in practice it should not be an issue.)\n */\nlet changeMask = 0b0;\n/**\n * Keeps track of which bit needs to be updated in `changeMask`\n *\n * This value gets incremented on every call to `ɵɵi18nExp`\n */\nlet changeMaskCounter = 0;\n/**\n * Keep track of which input bindings in `ɵɵi18nExp` have changed.\n *\n * `setMaskBit` gets invoked by each call to `ɵɵi18nExp`.\n *\n * @param hasChange did `ɵɵi18nExp` detect a change.\n */\nfunction setMaskBit(hasChange) {\n if (hasChange) {\n changeMask = changeMask | (1 << Math.min(changeMaskCounter, 31));\n }\n changeMaskCounter++;\n}\nfunction applyI18n(tView, lView, index) {\n if (changeMaskCounter > 0) {\n ngDevMode && assertDefined(tView, `tView should be defined`);\n const tI18n = tView.data[index];\n // When `index` points to an `ɵɵi18nAttributes` then we have an array otherwise `TI18n`\n const updateOpCodes = Array.isArray(tI18n)\n ? tI18n\n : tI18n.update;\n const bindingsStartIndex = getBindingIndex() - changeMaskCounter - 1;\n applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask);\n }\n // Reset changeMask & maskBit to default for the next update cycle\n changeMask = 0b0;\n changeMaskCounter = 0;\n}\nfunction createNodeWithoutHydration(lView, textOrName, nodeType) {\n const renderer = lView[RENDERER];\n switch (nodeType) {\n case Node.COMMENT_NODE:\n return createCommentNode(renderer, textOrName);\n case Node.TEXT_NODE:\n return createTextNode(renderer, textOrName);\n case Node.ELEMENT_NODE:\n return createElementNode(renderer, textOrName, null);\n }\n}\nlet _locateOrCreateNode = (lView, index, textOrName, nodeType) => {\n lastNodeWasCreated(true);\n return createNodeWithoutHydration(lView, textOrName, nodeType);\n};\nfunction locateOrCreateNodeImpl(lView, index, textOrName, nodeType) {\n const hydrationInfo = lView[HYDRATION];\n const noOffsetIndex = index - HEADER_OFFSET;\n const isNodeCreationMode = !isI18nHydrationSupportEnabled() ||\n !hydrationInfo ||\n isInSkipHydrationBlock$1() ||\n isDisconnectedNode$1(hydrationInfo, noOffsetIndex);\n lastNodeWasCreated(isNodeCreationMode);\n if (isNodeCreationMode) {\n return createNodeWithoutHydration(lView, textOrName, nodeType);\n }\n const native = locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex);\n // TODO: Improve error handling\n //\n // Other hydration paths use validateMatchingNode() in order to provide\n // detailed information in development mode about the expected DOM.\n // However, not every node in an i18n block has a TNode. Instead, we\n // need to be able to use the AST to generate a similar message.\n ngDevMode && assertDefined(native, 'expected native element');\n ngDevMode && assertEqual(native.nodeType, nodeType, 'expected matching nodeType');\n ngDevMode &&\n nodeType === Node.ELEMENT_NODE &&\n assertEqual(native.tagName.toLowerCase(), textOrName.toLowerCase(), 'expecting matching tagName');\n ngDevMode && markRNodeAsClaimedByHydration(native);\n return native;\n}\nfunction enableLocateOrCreateI18nNodeImpl() {\n _locateOrCreateNode = locateOrCreateNodeImpl;\n}\n/**\n * Apply `I18nCreateOpCodes` op-codes as stored in `TI18n.create`.\n *\n * Creates text (and comment) nodes which are internationalized.\n *\n * @param lView Current lView\n * @param createOpCodes Set of op-codes to apply\n * @param parentRNode Parent node (so that direct children can be added eagerly) or `null` if it is\n * a root node.\n * @param insertInFrontOf DOM node that should be used as an anchor.\n */\nfunction applyCreateOpCodes(lView, createOpCodes, parentRNode, insertInFrontOf) {\n const renderer = lView[RENDERER];\n for (let i = 0; i < createOpCodes.length; i++) {\n const opCode = createOpCodes[i++];\n const text = createOpCodes[i];\n const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;\n const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;\n const index = opCode >>> I18nCreateOpCode.SHIFT;\n let rNode = lView[index];\n let lastNodeWasCreated = false;\n if (rNode === null) {\n // We only create new DOM nodes if they don't already exist: If ICU switches case back to a\n // case which was already instantiated, no need to create new DOM nodes.\n rNode = lView[index] = _locateOrCreateNode(lView, index, text, isComment ? Node.COMMENT_NODE : Node.TEXT_NODE);\n lastNodeWasCreated = wasLastNodeCreated();\n }\n if (appendNow && parentRNode !== null && lastNodeWasCreated) {\n nativeInsertBefore(renderer, parentRNode, rNode, insertInFrontOf, false);\n }\n }\n}\n/**\n * Apply `I18nMutateOpCodes` OpCodes.\n *\n * @param tView Current `TView`\n * @param mutableOpCodes Mutable OpCodes to process\n * @param lView Current `LView`\n * @param anchorRNode place where the i18n node should be inserted.\n */\nfunction applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {\n ngDevMode && assertDomNode(anchorRNode);\n const renderer = lView[RENDERER];\n // `rootIdx` represents the node into which all inserts happen.\n let rootIdx = null;\n // `rootRNode` represents the real node into which we insert. This can be different from\n // `lView[rootIdx]` if we have projection.\n // - null we don't have a parent (as can be the case in when we are inserting into a root of\n // LView which has no parent.)\n // - `RElement` The element representing the root after taking projection into account.\n let rootRNode;\n for (let i = 0; i < mutableOpCodes.length; i++) {\n const opCode = mutableOpCodes[i];\n if (typeof opCode == 'string') {\n const textNodeIndex = mutableOpCodes[++i];\n if (lView[textNodeIndex] === null) {\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n ngDevMode && assertIndexInRange(lView, textNodeIndex);\n lView[textNodeIndex] = _locateOrCreateNode(lView, textNodeIndex, opCode, Node.TEXT_NODE);\n }\n }\n else if (typeof opCode == 'number') {\n switch (opCode & 1 /* IcuCreateOpCode.MASK_INSTRUCTION */) {\n case 0 /* IcuCreateOpCode.AppendChild */:\n const parentIdx = getParentFromIcuCreateOpCode(opCode);\n if (rootIdx === null) {\n // The first operation should save the `rootIdx` because the first operation\n // must insert into the root. (Only subsequent operations can insert into a dynamic\n // parent)\n rootIdx = parentIdx;\n rootRNode = nativeParentNode(renderer, anchorRNode);\n }\n let insertInFrontOf;\n let parentRNode;\n if (parentIdx === rootIdx) {\n insertInFrontOf = anchorRNode;\n parentRNode = rootRNode;\n }\n else {\n insertInFrontOf = null;\n parentRNode = unwrapRNode(lView[parentIdx]);\n }\n // FIXME(misko): Refactor with `processI18nText`\n if (parentRNode !== null) {\n // This can happen if the `LView` we are adding to is not attached to a parent `LView`.\n // In such a case there is no \"root\" we can attach to. This is fine, as we still need to\n // create the elements. When the `LView` gets later added to a parent these \"root\" nodes\n // get picked up and added.\n ngDevMode && assertDomNode(parentRNode);\n const refIdx = getRefFromIcuCreateOpCode(opCode);\n ngDevMode && assertGreaterThan(refIdx, HEADER_OFFSET, 'Missing ref');\n // `unwrapRNode` is not needed here as all of these point to RNodes as part of the i18n\n // which can't have components.\n const child = lView[refIdx];\n ngDevMode && assertDomNode(child);\n nativeInsertBefore(renderer, parentRNode, child, insertInFrontOf, false);\n const tIcu = getTIcu(tView, refIdx);\n if (tIcu !== null && typeof tIcu === 'object') {\n // If we just added a comment node which has ICU then that ICU may have already been\n // rendered and therefore we need to re-add it here.\n ngDevMode && assertTIcu(tIcu);\n const caseIndex = getCurrentICUCaseIndex(tIcu, lView);\n if (caseIndex !== null) {\n applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, lView[tIcu.anchorIdx]);\n }\n }\n }\n break;\n case 1 /* IcuCreateOpCode.Attr */:\n const elementNodeIndex = opCode >>> 1 /* IcuCreateOpCode.SHIFT_REF */;\n const attrName = mutableOpCodes[++i];\n const attrValue = mutableOpCodes[++i];\n // This code is used for ICU expressions only, since we don't support\n // directives/components in ICUs, we don't need to worry about inputs here\n setElementAttribute(renderer, getNativeByIndex(elementNodeIndex, lView), null, null, attrName, attrValue, null);\n break;\n default:\n if (ngDevMode) {\n throw new RuntimeError(700 /* RuntimeErrorCode.INVALID_I18N_STRUCTURE */, `Unable to determine the type of mutate operation for \"${opCode}\"`);\n }\n }\n }\n else {\n switch (opCode) {\n case ICU_MARKER:\n const commentValue = mutableOpCodes[++i];\n const commentNodeIndex = mutableOpCodes[++i];\n if (lView[commentNodeIndex] === null) {\n ngDevMode &&\n assertEqual(typeof commentValue, 'string', `Expected \"${commentValue}\" to be a comment node value`);\n ngDevMode && ngDevMode.rendererCreateComment++;\n ngDevMode && assertIndexInExpandoRange(lView, commentNodeIndex);\n const commentRNode = (lView[commentNodeIndex] = _locateOrCreateNode(lView, commentNodeIndex, commentValue, Node.COMMENT_NODE));\n // FIXME(misko): Attaching patch data is only needed for the root (Also add tests)\n attachPatchData(commentRNode, lView);\n }\n break;\n case ELEMENT_MARKER:\n const tagName = mutableOpCodes[++i];\n const elementNodeIndex = mutableOpCodes[++i];\n if (lView[elementNodeIndex] === null) {\n ngDevMode &&\n assertEqual(typeof tagName, 'string', `Expected \"${tagName}\" to be an element node tag name`);\n ngDevMode && ngDevMode.rendererCreateElement++;\n ngDevMode && assertIndexInExpandoRange(lView, elementNodeIndex);\n const elementRNode = (lView[elementNodeIndex] = _locateOrCreateNode(lView, elementNodeIndex, tagName, Node.ELEMENT_NODE));\n // FIXME(misko): Attaching patch data is only needed for the root (Also add tests)\n attachPatchData(elementRNode, lView);\n }\n break;\n default:\n ngDevMode &&\n throwError(`Unable to determine the type of mutate operation for \"${opCode}\"`);\n }\n }\n }\n}\n/**\n * Apply `I18nUpdateOpCodes` OpCodes\n *\n * @param tView Current `TView`\n * @param lView Current `LView`\n * @param updateOpCodes OpCodes to process\n * @param bindingsStartIndex Location of the first `ɵɵi18nApply`\n * @param changeMask Each bit corresponds to a `ɵɵi18nExp` (Counting backwards from\n * `bindingsStartIndex`)\n */\nfunction applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask) {\n for (let i = 0; i < updateOpCodes.length; i++) {\n // bit code to check if we should apply the next update\n const checkBit = updateOpCodes[i];\n // Number of opCodes to skip until next set of update codes\n const skipCodes = updateOpCodes[++i];\n if (checkBit & changeMask) {\n // The value has been updated since last checked\n let value = '';\n for (let j = i + 1; j <= i + skipCodes; j++) {\n const opCode = updateOpCodes[j];\n if (typeof opCode == 'string') {\n value += opCode;\n }\n else if (typeof opCode == 'number') {\n if (opCode < 0) {\n // Negative opCode represent `i18nExp` values offset.\n value += renderStringify(lView[bindingsStartIndex - opCode]);\n }\n else {\n const nodeIndex = opCode >>> 2 /* I18nUpdateOpCode.SHIFT_REF */;\n switch (opCode & 3 /* I18nUpdateOpCode.MASK_OPCODE */) {\n case 1 /* I18nUpdateOpCode.Attr */:\n const propName = updateOpCodes[++j];\n const sanitizeFn = updateOpCodes[++j];\n const tNodeOrTagName = tView.data[nodeIndex];\n ngDevMode && assertDefined(tNodeOrTagName, 'Experting TNode or string');\n if (typeof tNodeOrTagName === 'string') {\n // IF we don't have a `TNode`, then we are an element in ICU (as ICU content does\n // not have TNode), in which case we know that there are no directives, and hence\n // we use attribute setting.\n setElementAttribute(lView[RENDERER], lView[nodeIndex], null, tNodeOrTagName, propName, value, sanitizeFn);\n }\n else {\n elementPropertyInternal(tView, tNodeOrTagName, lView, propName, value, lView[RENDERER], sanitizeFn, false);\n }\n break;\n case 0 /* I18nUpdateOpCode.Text */:\n const rText = lView[nodeIndex];\n rText !== null && updateTextNode(lView[RENDERER], rText, value);\n break;\n case 2 /* I18nUpdateOpCode.IcuSwitch */:\n applyIcuSwitchCase(tView, getTIcu(tView, nodeIndex), lView, value);\n break;\n case 3 /* I18nUpdateOpCode.IcuUpdate */:\n applyIcuUpdateCase(tView, getTIcu(tView, nodeIndex), bindingsStartIndex, lView);\n break;\n }\n }\n }\n }\n }\n else {\n const opCode = updateOpCodes[i + 1];\n if (opCode > 0 && (opCode & 3 /* I18nUpdateOpCode.MASK_OPCODE */) === 3 /* I18nUpdateOpCode.IcuUpdate */) {\n // Special case for the `icuUpdateCase`. It could be that the mask did not match, but\n // we still need to execute `icuUpdateCase` because the case has changed recently due to\n // previous `icuSwitchCase` instruction. (`icuSwitchCase` and `icuUpdateCase` always come in\n // pairs.)\n const nodeIndex = opCode >>> 2 /* I18nUpdateOpCode.SHIFT_REF */;\n const tIcu = getTIcu(tView, nodeIndex);\n const currentIndex = lView[tIcu.currentCaseLViewIndex];\n if (currentIndex < 0) {\n applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView);\n }\n }\n }\n i += skipCodes;\n }\n}\n/**\n * Apply OpCodes associated with updating an existing ICU.\n *\n * @param tView Current `TView`\n * @param tIcu Current `TIcu`\n * @param bindingsStartIndex Location of the first `ɵɵi18nApply`\n * @param lView Current `LView`\n */\nfunction applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView) {\n ngDevMode && assertIndexInRange(lView, tIcu.currentCaseLViewIndex);\n let activeCaseIndex = lView[tIcu.currentCaseLViewIndex];\n if (activeCaseIndex !== null) {\n let mask = changeMask;\n if (activeCaseIndex < 0) {\n // Clear the flag.\n // Negative number means that the ICU was freshly created and we need to force the update.\n activeCaseIndex = lView[tIcu.currentCaseLViewIndex] = ~activeCaseIndex;\n // -1 is same as all bits on, which simulates creation since it marks all bits dirty\n mask = -1;\n }\n applyUpdateOpCodes(tView, lView, tIcu.update[activeCaseIndex], bindingsStartIndex, mask);\n }\n}\n/**\n * Apply OpCodes associated with switching a case on ICU.\n *\n * This involves tearing down existing case and than building up a new case.\n *\n * @param tView Current `TView`\n * @param tIcu Current `TIcu`\n * @param lView Current `LView`\n * @param value Value of the case to update to.\n */\nfunction applyIcuSwitchCase(tView, tIcu, lView, value) {\n // Rebuild a new case for this ICU\n const caseIndex = getCaseIndex(tIcu, value);\n let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);\n if (activeCaseIndex !== caseIndex) {\n applyIcuSwitchCaseRemove(tView, tIcu, lView);\n lView[tIcu.currentCaseLViewIndex] = caseIndex === null ? null : ~caseIndex;\n if (caseIndex !== null) {\n // Add the nodes for the new case\n const anchorRNode = lView[tIcu.anchorIdx];\n if (anchorRNode) {\n ngDevMode && assertDomNode(anchorRNode);\n applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, anchorRNode);\n }\n claimDehydratedIcuCase(lView, tIcu.anchorIdx, caseIndex);\n }\n }\n}\n/**\n * Apply OpCodes associated with tearing ICU case.\n *\n * This involves tearing down existing case and than building up a new case.\n *\n * @param tView Current `TView`\n * @param tIcu Current `TIcu`\n * @param lView Current `LView`\n */\nfunction applyIcuSwitchCaseRemove(tView, tIcu, lView) {\n let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);\n if (activeCaseIndex !== null) {\n const removeCodes = tIcu.remove[activeCaseIndex];\n for (let i = 0; i < removeCodes.length; i++) {\n const nodeOrIcuIndex = removeCodes[i];\n if (nodeOrIcuIndex > 0) {\n // Positive numbers are `RNode`s.\n const rNode = getNativeByIndex(nodeOrIcuIndex, lView);\n rNode !== null && nativeRemoveNode(lView[RENDERER], rNode);\n }\n else {\n // Negative numbers are ICUs\n applyIcuSwitchCaseRemove(tView, getTIcu(tView, ~nodeOrIcuIndex), lView);\n }\n }\n }\n}\n/**\n * Returns the index of the current case of an ICU expression depending on the main binding value\n *\n * @param icuExpression\n * @param bindingValue The value of the main binding used by this ICU expression\n */\nfunction getCaseIndex(icuExpression, bindingValue) {\n let index = icuExpression.cases.indexOf(bindingValue);\n if (index === -1) {\n switch (icuExpression.type) {\n case 1 /* IcuType.plural */: {\n const resolvedCase = getPluralCase(bindingValue, getLocaleId());\n index = icuExpression.cases.indexOf(resolvedCase);\n if (index === -1 && resolvedCase !== 'other') {\n index = icuExpression.cases.indexOf('other');\n }\n break;\n }\n case 0 /* IcuType.select */: {\n index = icuExpression.cases.indexOf('other');\n break;\n }\n }\n }\n return index === -1 ? null : index;\n}\n\n/**\n * Converts `I18nCreateOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nCreateOpCodes.debug` property if `ngDevMode` is enabled.\n * This function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nCreateOpCodes` if attached as a method.\n * @param opcodes `I18nCreateOpCodes` if invoked as a function.\n */\nfunction i18nCreateOpCodesToString(opcodes) {\n const createOpCodes = opcodes || (Array.isArray(this) ? this : []);\n let lines = [];\n for (let i = 0; i < createOpCodes.length; i++) {\n const opCode = createOpCodes[i++];\n const text = createOpCodes[i];\n const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;\n const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;\n const index = opCode >>> I18nCreateOpCode.SHIFT;\n lines.push(`lView[${index}] = document.${isComment ? 'createComment' : 'createText'}(${JSON.stringify(text)});`);\n if (appendNow) {\n lines.push(`parent.appendChild(lView[${index}]);`);\n }\n }\n return lines;\n}\n/**\n * Converts `I18nUpdateOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nUpdateOpCodes.debug` property if `ngDevMode` is enabled.\n * This function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nUpdateOpCodes` if attached as a method.\n * @param opcodes `I18nUpdateOpCodes` if invoked as a function.\n */\nfunction i18nUpdateOpCodesToString(opcodes) {\n const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));\n let lines = [];\n function consumeOpCode(value) {\n const ref = value >>> 2 /* I18nUpdateOpCode.SHIFT_REF */;\n const opCode = value & 3 /* I18nUpdateOpCode.MASK_OPCODE */;\n switch (opCode) {\n case 0 /* I18nUpdateOpCode.Text */:\n return `(lView[${ref}] as Text).textContent = $$$`;\n case 1 /* I18nUpdateOpCode.Attr */:\n const attrName = parser.consumeString();\n const sanitizationFn = parser.consumeFunction();\n const value = sanitizationFn ? `(${sanitizationFn})($$$)` : '$$$';\n return `(lView[${ref}] as Element).setAttribute('${attrName}', ${value})`;\n case 2 /* I18nUpdateOpCode.IcuSwitch */:\n return `icuSwitchCase(${ref}, $$$)`;\n case 3 /* I18nUpdateOpCode.IcuUpdate */:\n return `icuUpdateCase(${ref})`;\n }\n throw new Error('unexpected OpCode');\n }\n while (parser.hasMore()) {\n let mask = parser.consumeNumber();\n let size = parser.consumeNumber();\n const end = parser.i + size;\n const statements = [];\n let statement = '';\n while (parser.i < end) {\n let value = parser.consumeNumberOrString();\n if (typeof value === 'string') {\n statement += value;\n }\n else if (value < 0) {\n // Negative numbers are ref indexes\n // Here `i` refers to current binding index. It is to signify that the value is relative,\n // rather than absolute.\n statement += '${lView[i' + value + ']}';\n }\n else {\n // Positive numbers are operations.\n const opCodeText = consumeOpCode(value);\n statements.push(opCodeText.replace('$$$', '`' + statement + '`') + ';');\n statement = '';\n }\n }\n lines.push(`if (mask & 0b${mask.toString(2)}) { ${statements.join(' ')} }`);\n }\n return lines;\n}\n/**\n * Converts `I18nCreateOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nCreateOpCodes.debug` if `ngDevMode` is enabled. This\n * function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nCreateOpCodes` if attached as a method.\n * @param opcodes `I18nCreateOpCodes` if invoked as a function.\n */\nfunction icuCreateOpCodesToString(opcodes) {\n const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));\n let lines = [];\n function consumeOpCode(opCode) {\n const parent = getParentFromIcuCreateOpCode(opCode);\n const ref = getRefFromIcuCreateOpCode(opCode);\n switch (getInstructionFromIcuCreateOpCode(opCode)) {\n case 0 /* IcuCreateOpCode.AppendChild */:\n return `(lView[${parent}] as Element).appendChild(lView[${lastRef}])`;\n case 1 /* IcuCreateOpCode.Attr */:\n return `(lView[${ref}] as Element).setAttribute(\"${parser.consumeString()}\", \"${parser.consumeString()}\")`;\n }\n throw new Error('Unexpected OpCode: ' + getInstructionFromIcuCreateOpCode(opCode));\n }\n let lastRef = -1;\n while (parser.hasMore()) {\n let value = parser.consumeNumberStringOrMarker();\n if (value === ICU_MARKER) {\n const text = parser.consumeString();\n lastRef = parser.consumeNumber();\n lines.push(`lView[${lastRef}] = document.createComment(\"${text}\")`);\n }\n else if (value === ELEMENT_MARKER) {\n const text = parser.consumeString();\n lastRef = parser.consumeNumber();\n lines.push(`lView[${lastRef}] = document.createElement(\"${text}\")`);\n }\n else if (typeof value === 'string') {\n lastRef = parser.consumeNumber();\n lines.push(`lView[${lastRef}] = document.createTextNode(\"${value}\")`);\n }\n else if (typeof value === 'number') {\n const line = consumeOpCode(value);\n line && lines.push(line);\n }\n else {\n throw new Error('Unexpected value');\n }\n }\n return lines;\n}\n/**\n * Converts `I18nRemoveOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nRemoveOpCodes.debug` if `ngDevMode` is enabled. This\n * function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nRemoveOpCodes` if attached as a method.\n * @param opcodes `I18nRemoveOpCodes` if invoked as a function.\n */\nfunction i18nRemoveOpCodesToString(opcodes) {\n const removeCodes = opcodes || (Array.isArray(this) ? this : []);\n let lines = [];\n for (let i = 0; i < removeCodes.length; i++) {\n const nodeOrIcuIndex = removeCodes[i];\n if (nodeOrIcuIndex > 0) {\n // Positive numbers are `RNode`s.\n lines.push(`remove(lView[${nodeOrIcuIndex}])`);\n }\n else {\n // Negative numbers are ICUs\n lines.push(`removeNestedICU(${~nodeOrIcuIndex})`);\n }\n }\n return lines;\n}\nclass OpCodeParser {\n constructor(codes) {\n this.i = 0;\n this.codes = codes;\n }\n hasMore() {\n return this.i < this.codes.length;\n }\n consumeNumber() {\n let value = this.codes[this.i++];\n assertNumber(value, 'expecting number in OpCode');\n return value;\n }\n consumeString() {\n let value = this.codes[this.i++];\n assertString(value, 'expecting string in OpCode');\n return value;\n }\n consumeFunction() {\n let value = this.codes[this.i++];\n if (value === null || typeof value === 'function') {\n return value;\n }\n throw new Error('expecting function in OpCode');\n }\n consumeNumberOrString() {\n let value = this.codes[this.i++];\n if (typeof value === 'string') {\n return value;\n }\n assertNumber(value, 'expecting number or string in OpCode');\n return value;\n }\n consumeNumberStringOrMarker() {\n let value = this.codes[this.i++];\n if (typeof value === 'string' ||\n typeof value === 'number' ||\n value == ICU_MARKER ||\n value == ELEMENT_MARKER) {\n return value;\n }\n assertNumber(value, 'expecting number, string, ICU_MARKER or ELEMENT_MARKER in OpCode');\n return value;\n }\n}\n\nconst BINDING_REGEXP = /<2F>(\\d+):?\\d*<2A>/gi;\nconst ICU_REGEXP = /({\\s*<2A>\\d+:?\\d*<2A>\\s*,\\s*\\S{6}\\s*,[\\s\\S]*})/gi;\nconst NESTED_ICU = /<2F>(\\d+)<29>/;\nconst ICU_BLOCK_REGEXP = /^\\s*(<28>\\d+:?\\d*<2A>)\\s*,\\s*(select|plural)\\s*,/;\nconst MARKER = `<60>`;\nconst SUBTEMPLATE_REGEXP = /<2F>\\/?\\*(\\d+:\\d+)<29>/gi;\nconst PH_REGEXP = /<2F>(\\/?[#*]\\d+):?\\d*<2A>/gi;\n/**\n * Angular uses the special entity &ngsp; as a placeholder for non-removable space.\n * It's replaced by the 0xE500 PUA (Private Use Areas) unicode character and later on replaced by a\n * space.\n * We are re-implementing the same idea since translations might contain this special character.\n */\nconst NGSP_UNICODE_REGEXP = /\\uE500/g;\nfunction replaceNgsp(value) {\n return value.replace(NGSP_UNICODE_REGEXP, ' ');\n}\n/**\n * Patch a `debug` property getter on top of the existing object.\n *\n * NOTE: always call this method with `ngDevMode && attachDebugObject(...)`\n *\n * @param obj Object to patch\n * @param debugGetter Getter returning a value to patch\n */\nfunction attachDebugGetter(obj, debugGetter) {\n if (ngDevMode) {\n Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });\n }\n else {\n throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');\n }\n}\n/**\n * Create dynamic nodes from i18n translation block.\n *\n * - Text nodes are created synchronously\n * - TNodes are linked into tree lazily\n *\n * @param tView Current `TView`\n * @parentTNodeIndex index to the parent TNode of this i18n block\n * @param lView Current `LView`\n * @param index Index of `ɵɵi18nStart` instruction.\n * @param message Message to translate.\n * @param subTemplateIndex Index into the sub template of message translation. (ie in case of\n * `ngIf`) (-1 otherwise)\n */\nfunction i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message, subTemplateIndex) {\n const rootTNode = getCurrentParentTNode();\n const createOpCodes = [];\n const updateOpCodes = [];\n const existingTNodeStack = [[]];\n const astStack = [[]];\n if (ngDevMode) {\n attachDebugGetter(createOpCodes, i18nCreateOpCodesToString);\n attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n }\n message = getTranslationForTemplate(message, subTemplateIndex);\n const msgParts = replaceNgsp(message).split(PH_REGEXP);\n for (let i = 0; i < msgParts.length; i++) {\n let value = msgParts[i];\n if ((i & 1) === 0) {\n // Even indexes are text (including bindings & ICU expressions)\n const parts = i18nParseTextIntoPartsAndICU(value);\n for (let j = 0; j < parts.length; j++) {\n let part = parts[j];\n if ((j & 1) === 0) {\n // `j` is odd therefore `part` is string\n const text = part;\n ngDevMode && assertString(text, 'Parsed ICU part should be string');\n if (text !== '') {\n i18nStartFirstCreatePassProcessTextNode(astStack[0], tView, rootTNode, existingTNodeStack[0], createOpCodes, updateOpCodes, lView, text);\n }\n }\n else {\n // `j` is Even therefor `part` is an `ICUExpression`\n const icuExpression = part;\n // Verify that ICU expression has the right shape. Translations might contain invalid\n // constructions (while original messages were correct), so ICU parsing at runtime may\n // not succeed (thus `icuExpression` remains a string).\n // Note: we intentionally retain the error here by not using `ngDevMode`, because\n // the value can change based on the locale and users aren't guaranteed to hit\n // an invalid string while they're developing.\n if (typeof icuExpression !== 'object') {\n throw new Error(`Unable to parse ICU expression in \"${message}\" message.`);\n }\n const icuContainerTNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodeStack[0], lView, createOpCodes, ngDevMode ? `ICU ${index}:${icuExpression.mainBinding}` : '', true);\n const icuNodeIndex = icuContainerTNode.index;\n ngDevMode &&\n assertGreaterThanOrEqual(icuNodeIndex, HEADER_OFFSET, 'Index must be in absolute LView offset');\n icuStart(astStack[0], tView, lView, updateOpCodes, parentTNodeIndex, icuExpression, icuNodeIndex);\n }\n }\n }\n else {\n // Odd indexes are placeholders (elements and sub-templates)\n // At this point value is something like: '/#1:2' (originally coming from '<27>/#1:2<>')\n const isClosing = value.charCodeAt(0) === 47 /* CharCode.SLASH */;\n const type = value.charCodeAt(isClosing ? 1 : 0);\n ngDevMode && assertOneOf(type, 42 /* CharCode.STAR */, 35 /* CharCode.HASH */);\n const index = HEADER_OFFSET + Number.parseInt(value.substring(isClosing ? 2 : 1));\n if (isClosing) {\n existingTNodeStack.shift();\n astStack.shift();\n setCurrentTNode(getCurrentParentTNode(), false);\n }\n else {\n const tNode = createTNodePlaceholder(tView, existingTNodeStack[0], index);\n existingTNodeStack.unshift([]);\n setCurrentTNode(tNode, true);\n const placeholderNode = {\n kind: 2 /* I18nNodeKind.PLACEHOLDER */,\n index,\n children: [],\n type: type === 35 /* CharCode.HASH */ ? 0 /* I18nPlaceholderType.ELEMENT */ : 1 /* I18nPlaceholderType.SUBTEMPLATE */,\n };\n astStack[0].push(placeholderNode);\n astStack.unshift(placeholderNode.children);\n }\n }\n }\n tView.data[index] = {\n create: createOpCodes,\n update: updateOpCodes,\n ast: astStack[0],\n parentTNodeIndex,\n };\n}\n/**\n * Allocate space in i18n Range add create OpCode instruction to create a text or comment node.\n *\n * @param tView Current `TView` needed to allocate space in i18n range.\n * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will be\n * added as part of the `i18nStart` instruction or as part of the `TNode.insertBeforeIndex`.\n * @param existingTNodes internal state for `addTNodeAndUpdateInsertBeforeIndex`.\n * @param lView Current `LView` needed to allocate space in i18n range.\n * @param createOpCodes Array storing `I18nCreateOpCodes` where new opCodes will be added.\n * @param text Text to be added when the `Text` or `Comment` node will be created.\n * @param isICU true if a `Comment` node for ICU (instead of `Text`) node should be created.\n */\nfunction createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, text, isICU) {\n const i18nNodeIdx = allocExpando(tView, lView, 1, null);\n let opCode = i18nNodeIdx << I18nCreateOpCode.SHIFT;\n let parentTNode = getCurrentParentTNode();\n if (rootTNode === parentTNode) {\n // FIXME(misko): A null `parentTNode` should represent when we fall of the `LView` boundary.\n // (there is no parent), but in some circumstances (because we are inconsistent about how we set\n // `previousOrParentTNode`) it could point to `rootTNode` So this is a work around.\n parentTNode = null;\n }\n if (parentTNode === null) {\n // If we don't have a parent that means that we can eagerly add nodes.\n // If we have a parent than these nodes can't be added now (as the parent has not been created\n // yet) and instead the `parentTNode` is responsible for adding it. See\n // `TNode.insertBeforeIndex`\n opCode |= I18nCreateOpCode.APPEND_EAGERLY;\n }\n if (isICU) {\n opCode |= I18nCreateOpCode.COMMENT;\n ensureIcuContainerVisitorLoaded(loadIcuContainerVisitor);\n }\n createOpCodes.push(opCode, text === null ? '' : text);\n // We store `{{?}}` so that when looking at debug `TNodeType.template` we can see where the\n // bindings are.\n const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 /* TNodeType.Icu */ : 1 /* TNodeType.Text */, text === null ? (ngDevMode ? '{{?}}' : '') : text, null);\n addTNodeAndUpdateInsertBeforeIndex(existingTNodes, tNode);\n const tNodeIdx = tNode.index;\n setCurrentTNode(tNode, false /* Text nodes are self closing */);\n if (parentTNode !== null && rootTNode !== parentTNode) {\n // We are a child of deeper node (rather than a direct child of `i18nStart` instruction.)\n // We have to make sure to add ourselves to the parent.\n setTNodeInsertBeforeIndex(parentTNode, tNodeIdx);\n }\n return tNode;\n}\n/**\n * Processes text node in i18n block.\n *\n * Text nodes can have:\n * - Create instruction in `createOpCodes` for creating the text node.\n * - Allocate spec for text node in i18n range of `LView`\n * - If contains binding:\n * - bindings => allocate space in i18n range of `LView` to store the binding value.\n * - populate `updateOpCodes` with update instructions.\n *\n * @param tView Current `TView`\n * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will\n * be added as part of the `i18nStart` instruction or as part of the\n * `TNode.insertBeforeIndex`.\n * @param existingTNodes internal state for `addTNodeAndUpdateInsertBeforeIndex`.\n * @param createOpCodes Location where the creation OpCodes will be stored.\n * @param lView Current `LView`\n * @param text The translated text (which may contain binding)\n */\nfunction i18nStartFirstCreatePassProcessTextNode(ast, tView, rootTNode, existingTNodes, createOpCodes, updateOpCodes, lView, text) {\n const hasBinding = text.match(BINDING_REGEXP);\n const tNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, hasBinding ? null : text, false);\n const index = tNode.index;\n if (hasBinding) {\n generateBindingUpdateOpCodes(updateOpCodes, text, index, null, 0, null);\n }\n ast.push({ kind: 0 /* I18nNodeKind.TEXT */, index });\n}\n/**\n * See `i18nAttributes` above.\n */\nfunction i18nAttributesFirstPass(tView, index, values) {\n const previousElement = getCurrentTNode();\n const previousElementIndex = previousElement.index;\n const updateOpCodes = [];\n if (ngDevMode) {\n attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n }\n if (tView.firstCreatePass && tView.data[index] === null) {\n for (let i = 0; i < values.length; i += 2) {\n const attrName = values[i];\n const message = values[i + 1];\n if (message !== '') {\n // Check if attribute value contains an ICU and throw an error if that's the case.\n // ICUs in element attributes are not supported.\n // Note: we intentionally retain the error here by not using `ngDevMode`, because\n // the `value` can change based on the locale and users aren't guaranteed to hit\n // an invalid string while they're developing.\n if (ICU_REGEXP.test(message)) {\n throw new Error(`ICU expressions are not supported in attributes. Message: \"${message}\".`);\n }\n // i18n attributes that hit this code path are guaranteed to have bindings, because\n // the compiler treats static i18n attributes as regular attribute bindings.\n // Since this may not be the first i18n attribute on this element we need to pass in how\n // many previous bindings there have already been.\n generateBindingUpdateOpCodes(updateOpCodes, message, previousElementIndex, attrName, countBindings(updateOpCodes), null);\n }\n }\n tView.data[index] = updateOpCodes;\n }\n}\n/**\n * Generate the OpCodes to update the bindings of a string.\n *\n * @param updateOpCodes Place where the update opcodes will be stored.\n * @param str The string containing the bindings.\n * @param destinationNode Index of the destination node which will receive the binding.\n * @param attrName Name of the attribute, if the string belongs to an attribute.\n * @param sanitizeFn Sanitization function used to sanitize the string after update, if necessary.\n * @param bindingStart The lView index of the next expression that can be bound via an opCode.\n * @returns The mask value for these bindings\n */\nfunction generateBindingUpdateOpCodes(updateOpCodes, str, destinationNode, attrName, bindingStart, sanitizeFn) {\n ngDevMode &&\n assertGreaterThanOrEqual(destinationNode, HEADER_OFFSET, 'Index must be in absolute LView offset');\n const maskIndex = updateOpCodes.length; // Location of mask\n const sizeIndex = maskIndex + 1; // location of size for skipping\n updateOpCodes.push(null, null); // Alloc space for mask and size\n const startIndex = maskIndex + 2; // location of first allocation.\n if (ngDevMode) {\n attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n }\n const textParts = str.split(BINDING_REGEXP);\n let mask = 0;\n for (let j = 0; j < textParts.length; j++) {\n const textValue = textParts[j];\n if (j & 1) {\n // Odd indexes are bindings\n const bindingIndex = bindingStart + parseInt(textValue, 10);\n updateOpCodes.push(-1 - bindingIndex);\n mask = mask | toMaskBit(bindingIndex);\n }\n else if (textValue !== '') {\n // Even indexes are text\n updateOpCodes.push(textValue);\n }\n }\n updateOpCodes.push((destinationNode << 2 /* I18nUpdateOpCode.SHIFT_REF */) |\n (attrName ? 1 /* I18nUpdateOpCode.Attr */ : 0 /* I18nUpdateOpCode.Text */));\n if (attrName) {\n updateOpCodes.push(attrName, sanitizeFn);\n }\n updateOpCodes[maskIndex] = mask;\n updateOpCodes[sizeIndex] = updateOpCodes.length - startIndex;\n return mask;\n}\n/**\n * Count the number of bindings in the given `opCodes`.\n *\n * It could be possible to speed this up, by passing the number of bindings found back from\n * `generateBindingUpdateOpCodes()` to `i18nAttributesFirstPass()` but this would then require more\n * complexity in the code and/or transient objects to be created.\n *\n * Since this function is only called once when the template is instantiated, is trivial in the\n * first instance (since `opCodes` will be an empty array), and it is not common for elements to\n * contain multiple i18n bound attributes, it seems like this is a reasonable compromise.\n */\nfunction countBindings(opCodes) {\n let count = 0;\n for (let i = 0; i < opCodes.length; i++) {\n const opCode = opCodes[i];\n // Bindings are negative numbers.\n if (typeof opCode === 'number' && opCode < 0) {\n count++;\n }\n }\n return count;\n}\n/**\n * Convert binding index to mask bit.\n *\n * Each index represents a single bit on the bit-mask. Because bit-mask only has 32 bits, we make\n * the 32nd bit share all masks for all bindings higher than 32. Since it is extremely rare to\n * have more than 32 bindings this will be hit very rarely. The downside of hitting this corner\n * case is that we will execute binding code more often than necessary. (penalty of performance)\n */\nfunction toMaskBit(bindingIndex) {\n return 1 << Math.min(bindingIndex, 31);\n}\n/**\n * Removes everything inside the sub-templates of a message.\n */\nfunction removeInnerTemplateTranslation(message) {\n let match;\n let res = '';\n let index = 0;\n let inTemplate = false;\n let tagMatched;\n while ((match = SUBTEMPLATE_REGEXP.exec(message)) !== null) {\n if (!inTemplate) {\n res += message.substring(index, match.index + match[0].length);\n tagMatched = match[1];\n inTemplate = true;\n }\n else {\n if (match[0] === `${MARKER}/*${tagMatched}${MARKER}`) {\n index = match.index;\n inTemplate = false;\n }\n }\n }\n ngDevMode &&\n assertEqual(inTemplate, false, `Tag mismatch: unable to find the end of the sub-template in the translation \"${message}\"`);\n res += message.slice(index);\n return res;\n}\n/**\n * Extracts a part of a message and removes the rest.\n *\n * This method is used for extracting a part of the message associated with a template. A\n * translated message can span multiple templates.\n *\n * Example:\n * ```\n * <div i18n>Translate <span *ngIf>me</span>!</div>\n * ```\n *\n * @param message The message to crop\n * @param subTemplateIndex Index of the sub-template to extract. If undefined it returns the\n * external template and removes all sub-templates.\n */\nfunction getTranslationForTemplate(message, subTemplateIndex) {\n if (isRootTemplateMessage(subTemplateIndex)) {\n // We want the root template message, ignore all sub-templates\n return removeInnerTemplateTranslation(message);\n }\n else {\n // We want a specific sub-template\n const start = message.indexOf(`:${subTemplateIndex}${MARKER}`) + 2 + subTemplateIndex.toString().length;\n const end = message.search(new RegExp(`${MARKER}\\\\/\\\\*\\\\d+:${subTemplateIndex}${MARKER}`));\n return removeInnerTemplateTranslation(message.substring(start, end));\n }\n}\n/**\n * Generate the OpCodes for ICU expressions.\n *\n * @param icuExpression\n * @param index Index where the anchor is stored and an optional `TIcuContainerNode`\n * - `lView[anchorIdx]` points to a `Comment` node representing the anchor for the ICU.\n * - `tView.data[anchorIdx]` points to the `TIcuContainerNode` if ICU is root (`null` otherwise)\n */\nfunction icuStart(ast, tView, lView, updateOpCodes, parentIdx, icuExpression, anchorIdx) {\n ngDevMode && assertDefined(icuExpression, 'ICU expression must be defined');\n let bindingMask = 0;\n const tIcu = {\n type: icuExpression.type,\n currentCaseLViewIndex: allocExpando(tView, lView, 1, null),\n anchorIdx,\n cases: [],\n create: [],\n remove: [],\n update: [],\n };\n addUpdateIcuSwitch(updateOpCodes, icuExpression, anchorIdx);\n setTIcu(tView, anchorIdx, tIcu);\n const values = icuExpression.values;\n const cases = [];\n for (let i = 0; i < values.length; i++) {\n // Each value is an array of strings & other ICU expressions\n const valueArr = values[i];\n const nestedIcus = [];\n for (let j = 0; j < valueArr.length; j++) {\n const value = valueArr[j];\n if (typeof value !== 'string') {\n // It is an nested ICU expression\n const icuIndex = nestedIcus.push(value) - 1;\n // Replace nested ICU expression by a comment node\n valueArr[j] = `<!--<2D>${icuIndex}<7D>-->`;\n }\n }\n const caseAst = [];\n cases.push(caseAst);\n bindingMask =\n parseIcuCase(caseAst, tView, tIcu, lView, updateOpCodes, parentIdx, icuExpression.cases[i], valueArr.join(''), nestedIcus) | bindingMask;\n }\n if (bindingMask) {\n addUpdateIcuUpdate(updateOpCodes, bindingMask, anchorIdx);\n }\n ast.push({\n kind: 3 /* I18nNodeKind.ICU */,\n index: anchorIdx,\n cases,\n currentCaseLViewIndex: tIcu.currentCaseLViewIndex,\n });\n}\n/**\n * Parses text containing an ICU expression and produces a JSON object for it.\n * Original code from closure library, modified for Angular.\n *\n * @param pattern Text containing an ICU expression that needs to be parsed.\n *\n */\nfunction parseICUBlock(pattern) {\n const cases = [];\n const values = [];\n let icuType = 1 /* IcuType.plural */;\n let mainBinding = 0;\n pattern = pattern.replace(ICU_BLOCK_REGEXP, function (str, binding, type) {\n if (type === 'select') {\n icuType = 0 /* IcuType.select */;\n }\n else {\n icuType = 1 /* IcuType.plural */;\n }\n mainBinding = parseInt(binding.slice(1), 10);\n return '';\n });\n const parts = i18nParseTextIntoPartsAndICU(pattern);\n // Looking for (key block)+ sequence. One of the keys has to be \"other\".\n for (let pos = 0; pos < parts.length;) {\n let key = parts[pos++].trim();\n if (icuType === 1 /* IcuType.plural */) {\n // Key can be \"=x\", we just want \"x\"\n key = key.replace(/\\s*(?:=)?(\\w+)\\s*/, '$1');\n }\n if (key.length) {\n cases.push(key);\n }\n const blocks = i18nParseTextIntoPartsAndICU(parts[pos++]);\n if (cases.length > values.length) {\n values.push(blocks);\n }\n }\n // TODO(ocombe): support ICU expressions in attributes, see #21615\n return { type: icuType, mainBinding: mainBinding, cases, values };\n}\n/**\n * Breaks pattern into strings and top level {...} blocks.\n * Can be used to break a message into text and ICU expressions, or to break an ICU expression\n * into keys and cases. Original code from closure library, modified for Angular.\n *\n * @param pattern (sub)Pattern to be broken.\n * @returns An `Array<string|IcuExpression>` where:\n * - odd positions: `string` => text between ICU expressions\n * - even positions: `ICUExpression` => ICU expression parsed into `ICUExpression` record.\n */\nfunction i18nParseTextIntoPartsAndICU(pattern) {\n if (!pattern) {\n return [];\n }\n let prevPos = 0;\n const braceStack = [];\n const results = [];\n const braces = /[{}]/g;\n // lastIndex doesn't get set to 0 so we have to.\n braces.lastIndex = 0;\n let match;\n while ((match = braces.exec(pattern))) {\n const pos = match.index;\n if (match[0] == '}') {\n braceStack.pop();\n if (braceStack.length == 0) {\n // End of the block.\n const block = pattern.substring(prevPos, pos);\n if (ICU_BLOCK_REGEXP.test(block)) {\n results.push(parseICUBlock(block));\n }\n else {\n results.push(block);\n }\n prevPos = pos + 1;\n }\n }\n else {\n if (braceStack.length == 0) {\n const substring = pattern.substring(prevPos, pos);\n results.push(substring);\n prevPos = pos + 1;\n }\n braceStack.push('{');\n }\n }\n const substring = pattern.substring(prevPos);\n results.push(substring);\n return results;\n}\n/**\n * Parses a node, its children and its siblings, and generates the mutate & update OpCodes.\n *\n */\nfunction parseIcuCase(ast, tView, tIcu, lView, updateOpCodes, parentIdx, caseName, unsafeCaseHtml, nestedIcus) {\n const create = [];\n const remove = [];\n const update = [];\n if (ngDevMode) {\n attachDebugGetter(create, icuCreateOpCodesToString);\n attachDebugGetter(remove, i18nRemoveOpCodesToString);\n attachDebugGetter(update, i18nUpdateOpCodesToString);\n }\n tIcu.cases.push(caseName);\n tIcu.create.push(create);\n tIcu.remove.push(remove);\n tIcu.update.push(update);\n const inertBodyHelper = getInertBodyHelper(getDocument());\n const inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeCaseHtml);\n ngDevMode && assertDefined(inertBodyElement, 'Unable to generate inert body element');\n const inertRootNode = getTemplateContent(inertBodyElement) || inertBodyElement;\n if (inertRootNode) {\n return walkIcuTree(ast, tView, tIcu, lView, updateOpCodes, create, remove, update, inertRootNode, parentIdx, nestedIcus, 0);\n }\n else {\n return 0;\n }\n}\nfunction walkIcuTree(ast, tView, tIcu, lView, sharedUpdateOpCodes, create, remove, update, parentNode, parentIdx, nestedIcus, depth) {\n let bindingMask = 0;\n let currentNode = parentNode.firstChild;\n while (currentNode) {\n const newIndex = allocExpando(tView, lView, 1, null);\n switch (currentNode.nodeType) {\n case Node.ELEMENT_NODE:\n const element = currentNode;\n const tagName = element.tagName.toLowerCase();\n if (VALID_ELEMENTS.hasOwnProperty(tagName)) {\n addCreateNodeAndAppend(create, ELEMENT_MARKER, tagName, parentIdx, newIndex);\n tView.data[newIndex] = tagName;\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const attr = elAttrs.item(i);\n const lowerAttrName = attr.name.toLowerCase();\n const hasBinding = !!attr.value.match(BINDING_REGEXP);\n // we assume the input string is safe, unless it's using a binding\n if (hasBinding) {\n if (VALID_ATTRS.hasOwnProperty(lowerAttrName)) {\n if (URI_ATTRS[lowerAttrName]) {\n generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, _sanitizeUrl);\n }\n else {\n generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, null);\n }\n }\n else {\n ngDevMode &&\n console.warn(`WARNING: ignoring unsafe attribute value ` +\n `${lowerAttrName} on element ${tagName} ` +\n `(see ${XSS_SECURITY_URL})`);\n }\n }\n else {\n addCreateAttribute(create, newIndex, attr);\n }\n }\n const elementNode = {\n kind: 1 /* I18nNodeKind.ELEMENT */,\n index: newIndex,\n children: [],\n };\n ast.push(elementNode);\n // Parse the children of this node (if any)\n bindingMask =\n walkIcuTree(elementNode.children, tView, tIcu, lView, sharedUpdateOpCodes, create, remove, update, currentNode, newIndex, nestedIcus, depth + 1) | bindingMask;\n addRemoveNode(remove, newIndex, depth);\n }\n break;\n case Node.TEXT_NODE:\n const value = currentNode.textContent || '';\n const hasBinding = value.match(BINDING_REGEXP);\n addCreateNodeAndAppend(create, null, hasBinding ? '' : value, parentIdx, newIndex);\n addRemoveNode(remove, newIndex, depth);\n if (hasBinding) {\n bindingMask =\n generateBindingUpdateOpCodes(update, value, newIndex, null, 0, null) | bindingMask;\n }\n ast.push({\n kind: 0 /* I18nNodeKind.TEXT */,\n index: newIndex,\n });\n break;\n case Node.COMMENT_NODE:\n // Check if the comment node is a placeholder for a nested ICU\n const isNestedIcu = NESTED_ICU.exec(currentNode.textContent || '');\n if (isNestedIcu) {\n const nestedIcuIndex = parseInt(isNestedIcu[1], 10);\n const icuExpression = nestedIcus[nestedIcuIndex];\n // Create the comment node that will anchor the ICU expression\n addCreateNodeAndAppend(create, ICU_MARKER, ngDevMode ? `nested ICU ${nestedIcuIndex}` : '', parentIdx, newIndex);\n icuStart(ast, tView, lView, sharedUpdateOpCodes, parentIdx, icuExpression, newIndex);\n addRemoveNestedIcu(remove, newIndex, depth);\n }\n break;\n }\n currentNode = currentNode.nextSibling;\n }\n return bindingMask;\n}\nfunction addRemoveNode(remove, index, depth) {\n if (depth === 0) {\n remove.push(index);\n }\n}\nfunction addRemoveNestedIcu(remove, index, depth) {\n if (depth === 0) {\n remove.push(~index); // remove ICU at `index`\n remove.push(index); // remove ICU comment at `index`\n }\n}\nfunction addUpdateIcuSwitch(update, icuExpression, index) {\n update.push(toMaskBit(icuExpression.mainBinding), 2, -1 - icuExpression.mainBinding, (index << 2 /* I18nUpdateOpCode.SHIFT_REF */) | 2 /* I18nUpdateOpCode.IcuSwitch */);\n}\nfunction addUpdateIcuUpdate(update, bindingMask, index) {\n update.push(bindingMask, 1, (index << 2 /* I18nUpdateOpCode.SHIFT_REF */) | 3 /* I18nUpdateOpCode.IcuUpdate */);\n}\nfunction addCreateNodeAndAppend(create, marker, text, appendToParentIdx, createAtIdx) {\n if (marker !== null) {\n create.push(marker);\n }\n create.push(text, createAtIdx, icuCreateOpCode(0 /* IcuCreateOpCode.AppendChild */, appendToParentIdx, createAtIdx));\n}\nfunction addCreateAttribute(create, newIndex, attr) {\n create.push((newIndex << 1 /* IcuCreateOpCode.SHIFT_REF */) | 1 /* IcuCreateOpCode.Attr */, attr.name, attr.value);\n}\n\n// i18nPostprocess consts\nconst ROOT_TEMPLATE_ID = 0;\nconst PP_MULTI_VALUE_PLACEHOLDERS_REGEXP = /\\[(<28>.+?<3F>?)\\]/;\nconst PP_PLACEHOLDERS_REGEXP = /\\[(<28>.+?<3F>?)\\]|(<28>\\/?\\*\\d+:\\d+<2B>)/g;\nconst PP_ICU_VARS_REGEXP = /({\\s*)(VAR_(PLURAL|SELECT)(_\\d+)?)(\\s*,)/g;\nconst PP_ICU_PLACEHOLDERS_REGEXP = /{([A-Z0-9_]+)}/g;\nconst PP_ICUS_REGEXP = /<2F>I18N_EXP_(ICU(_\\d+)?)<29>/g;\nconst PP_CLOSE_TEMPLATE_REGEXP = /\\/\\*/;\nconst PP_TEMPLATE_ID_REGEXP = /\\d+\\:(\\d+)/;\n/**\n * Handles message string post-processing for internationalization.\n *\n * Handles message string post-processing by transforming it from intermediate\n * format (that might contain some markers that we need to replace) to the final\n * form, consumable by i18nStart instruction. Post processing steps include:\n *\n * 1. Resolve all multi-value cases (like [<5B>*1:1<><31>#2:1<>|<7C>#4:1<>|<7C>5<EFBFBD>])\n * 2. Replace all ICU vars (like \"VAR_PLURAL\")\n * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n * 4. Replace all ICU references with corresponding values (like <20>ICU_EXP_ICU_1<5F>)\n * in case multiple ICUs have the same placeholder name\n *\n * @param message Raw translation string for post processing\n * @param replacements Set of replacements that should be applied\n *\n * @returns Transformed string that can be consumed by i18nStart instruction\n *\n * @codeGenApi\n */\nfunction i18nPostprocess(message, replacements = {}) {\n /**\n * Step 1: resolve all multi-value placeholders like [<5B>#5<>|<7C>*1:1<><31>#2:1<>|<7C>#4:1<>]\n *\n * Note: due to the way we process nested templates (BFS), multi-value placeholders are typically\n * grouped by templates, for example: [<5B>#5<>|<7C>#6<>|<7C>#1:1<>|<7C>#3:2<>] where <20>#5<> and <20>#6<> belong to root\n * template, <20>#1:1<> belong to nested template with index 1 and <20>#1:2<> - nested template with index\n * 3. However in real templates the order might be different: i.e. <20>#1:1<> and/or <20>#3:2<> may go in\n * front of <20>#6<>. The post processing step restores the right order by keeping track of the\n * template id stack and looks for placeholders that belong to the currently active template.\n */\n let result = message;\n if (PP_MULTI_VALUE_PLACEHOLDERS_REGEXP.test(message)) {\n const matches = {};\n const templateIdsStack = [ROOT_TEMPLATE_ID];\n result = result.replace(PP_PLACEHOLDERS_REGEXP, (m, phs, tmpl) => {\n const content = phs || tmpl;\n const placeholders = matches[content] || [];\n if (!placeholders.length) {\n content.split('|').forEach((placeholder) => {\n const match = placeholder.match(PP_TEMPLATE_ID_REGEXP);\n const templateId = match ? parseInt(match[1], 10) : ROOT_TEMPLATE_ID;\n const isCloseTemplateTag = PP_CLOSE_TEMPLATE_REGEXP.test(placeholder);\n placeholders.push([templateId, isCloseTemplateTag, placeholder]);\n });\n matches[content] = placeholders;\n }\n if (!placeholders.length) {\n throw new Error(`i18n postprocess: unmatched placeholder - ${content}`);\n }\n const currentTemplateId = templateIdsStack[templateIdsStack.length - 1];\n let idx = 0;\n // find placeholder index that matches current template id\n for (let i = 0; i < placeholders.length; i++) {\n if (placeholders[i][0] === currentTemplateId) {\n idx = i;\n break;\n }\n }\n // update template id stack based on the current tag extracted\n const [templateId, isCloseTemplateTag, placeholder] = placeholders[idx];\n if (isCloseTemplateTag) {\n templateIdsStack.pop();\n }\n else if (currentTemplateId !== templateId) {\n templateIdsStack.push(templateId);\n }\n // remove processed tag from the list\n placeholders.splice(idx, 1);\n return placeholder;\n });\n }\n // return current result if no replacements specified\n if (!Object.keys(replacements).length) {\n return result;\n }\n /**\n * Step 2: replace all ICU vars (like \"VAR_PLURAL\")\n */\n result = result.replace(PP_ICU_VARS_REGEXP, (match, start, key, _type, _idx, end) => {\n return replacements.hasOwnProperty(key) ? `${start}${replacements[key]}${end}` : match;\n });\n /**\n * Step 3: replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n */\n result = result.replace(PP_ICU_PLACEHOLDERS_REGEXP, (match, key) => {\n return replacements.hasOwnProperty(key) ? replacements[key] : match;\n });\n /**\n * Step 4: replace all ICU references with corresponding values (like <20>ICU_EXP_ICU_1<5F>) in case\n * multiple ICUs have the same placeholder name\n */\n result = result.replace(PP_ICUS_REGEXP, (match, key) => {\n if (replacements.hasOwnProperty(key)) {\n const list = replacements[key];\n if (!list.length) {\n throw new Error(`i18n postprocess: unmatched ICU - ${match} with key: ${key}`);\n }\n return list.shift();\n }\n return match;\n });\n return result;\n}\n\n/**\n * Marks a block of text as translatable.\n *\n * The instructions `i18nStart` and `i18nEnd` mark the translation block in the template.\n * The translation `message` is the value which is locale specific. The translation string may\n * contain placeholders which associate inner elements and sub-templates within the translation.\n *\n * The translation `message` placeholders are:\n * - `<60>{index}(:{block})<29>`: *Binding Placeholder*: Marks a location where an expression will be\n * interpolated into. The placeholder `index` points to the expression binding index. An optional\n * `block` that matches the sub-template in which it was declared.\n * - `<60>#{index}(:{block})<29>`/`<60>/#{index}(:{block})<29>`: *Element Placeholder*: Marks the beginning\n * and end of DOM element that were embedded in the original translation block. The placeholder\n * `index` points to the element index in the template instructions set. An optional `block` that\n * matches the sub-template in which it was declared.\n * - `<60>*{index}:{block}<7D>`/`<60>/*{index}:{block}<7D>`: *Sub-template Placeholder*: Sub-templates must be\n * split up and translated separately in each angular template function. The `index` points to the\n * `template` instruction index. A `block` that matches the sub-template in which it was declared.\n *\n * @param index A unique index of the translation in the static block.\n * @param messageIndex An index of the translation message from the `def.consts` array.\n * @param subTemplateIndex Optional sub-template index in the `message`.\n *\n * @codeGenApi\n */\nfunction ɵɵi18nStart(index, messageIndex, subTemplateIndex = -1) {\n const tView = getTView();\n const lView = getLView();\n const adjustedIndex = HEADER_OFFSET + index;\n ngDevMode && assertDefined(tView, `tView should be defined`);\n const message = getConstant(tView.consts, messageIndex);\n const parentTNode = getCurrentParentTNode();\n if (tView.firstCreatePass) {\n i18nStartFirstCreatePass(tView, parentTNode === null ? 0 : parentTNode.index, lView, adjustedIndex, message, subTemplateIndex);\n }\n // Set a flag that this LView has i18n blocks.\n // The flag is later used to determine whether this component should\n // be hydrated (currently hydration is not supported for i18n blocks).\n if (tView.type === 2 /* TViewType.Embedded */) {\n // Annotate host component's LView (not embedded view's LView),\n // since hydration can be skipped on per-component basis only.\n const componentLView = lView[DECLARATION_COMPONENT_VIEW];\n componentLView[FLAGS] |= 32 /* LViewFlags.HasI18n */;\n }\n else {\n lView[FLAGS] |= 32 /* LViewFlags.HasI18n */;\n }\n const tI18n = tView.data[adjustedIndex];\n const sameViewParentTNode = parentTNode === lView[T_HOST] ? null : parentTNode;\n const parentRNode = getClosestRElement(tView, sameViewParentTNode, lView);\n // If `parentTNode` is an `ElementContainer` than it has `<!--ng-container--->`.\n // When we do inserts we have to make sure to insert in front of `<!--ng-container--->`.\n const insertInFrontOf = parentTNode && parentTNode.type & 8 /* TNodeType.ElementContainer */ ? lView[parentTNode.index] : null;\n prepareI18nBlockForHydration(lView, adjustedIndex, parentTNode, subTemplateIndex);\n applyCreateOpCodes(lView, tI18n.create, parentRNode, insertInFrontOf);\n setInI18nBlock(true);\n}\n/**\n * Translates a translation block marked by `i18nStart` and `i18nEnd`. It inserts the text/ICU nodes\n * into the render tree, moves the placeholder nodes and removes the deleted nodes.\n *\n * @codeGenApi\n */\nfunction ɵɵi18nEnd() {\n setInI18nBlock(false);\n}\n/**\n *\n * Use this instruction to create a translation block that doesn't contain any placeholder.\n * It calls both {@link i18nStart} and {@link i18nEnd} in one instruction.\n *\n * The translation `message` is the value which is locale specific. The translation string may\n * contain placeholders which associate inner elements and sub-templates within the translation.\n *\n * The translation `message` placeholders are:\n * - `<60>{index}(:{block})<29>`: *Binding Placeholder*: Marks a location where an expression will be\n * interpolated into. The placeholder `index` points to the expression binding index. An optional\n * `block` that matches the sub-template in which it was declared.\n * - `<60>#{index}(:{block})<29>`/`<60>/#{index}(:{block})<29>`: *Element Placeholder*: Marks the beginning\n * and end of DOM element that were embedded in the original translation block. The placeholder\n * `index` points to the element index in the template instructions set. An optional `block` that\n * matches the sub-template in which it was declared.\n * - `<60>*{index}:{block}<7D>`/`<60>/*{index}:{block}<7D>`: *Sub-template Placeholder*: Sub-templates must be\n * split up and translated separately in each angular template function. The `index` points to the\n * `template` instruction index. A `block` that matches the sub-template in which it was declared.\n *\n * @param index A unique index of the translation in the static block.\n * @param messageIndex An index of the translation message from the `def.consts` array.\n * @param subTemplateIndex Optional sub-template index in the `message`.\n *\n * @codeGenApi\n */\nfunction ɵɵi18n(index, messageIndex, subTemplateIndex) {\n ɵɵi18nStart(index, messageIndex, subTemplateIndex);\n ɵɵi18nEnd();\n}\n/**\n * Marks a list of attributes as translatable.\n *\n * @param index A unique index in the static block\n * @param values\n *\n * @codeGenApi\n */\nfunction ɵɵi18nAttributes(index, attrsIndex) {\n const tView = getTView();\n ngDevMode && assertDefined(tView, `tView should be defined`);\n const attrs = getConstant(tView.consts, attrsIndex);\n i18nAttributesFirstPass(tView, index + HEADER_OFFSET, attrs);\n}\n/**\n * Stores the values of the bindings during each update cycle in order to determine if we need to\n * update the translated nodes.\n *\n * @param value The binding's value\n * @returns This function returns itself so that it may be chained\n * (e.g. `i18nExp(ctx.name)(ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵi18nExp(value) {\n const lView = getLView();\n setMaskBit(bindingUpdated(lView, nextBindingIndex(), value));\n return ɵɵi18nExp;\n}\n/**\n * Updates a translation block or an i18n attribute when the bindings have changed.\n *\n * @param index Index of either {@link i18nStart} (translation block) or {@link i18nAttributes}\n * (i18n attribute) on which it should update the content.\n *\n * @codeGenApi\n */\nfunction ɵɵi18nApply(index) {\n applyI18n(getTView(), getLView(), index + HEADER_OFFSET);\n}\n/**\n * Handles message string post-processing for internationalization.\n *\n * Handles message string post-processing by transforming it from intermediate\n * format (that might contain some markers that we need to replace) to the final\n * form, consumable by i18nStart instruction. Post processing steps include:\n *\n * 1. Resolve all multi-value cases (like [<5B>*1:1<><31>#2:1<>|<7C>#4:1<>|<7C>5<EFBFBD>])\n * 2. Replace all ICU vars (like \"VAR_PLURAL\")\n * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n * 4. Replace all ICU references with corresponding values (like <20>ICU_EXP_ICU_1<5F>)\n * in case multiple ICUs have the same placeholder name\n *\n * @param message Raw translation string for post processing\n * @param replacements Set of replacements that should be applied\n *\n * @returns Transformed string that can be consumed by i18nStart instruction\n *\n * @codeGenApi\n */\nfunction ɵɵi18nPostprocess(message, replacements = {}) {\n return i18nPostprocess(message, replacements);\n}\n\n/**\n * Contains a reference to a function that disables event replay feature\n * for server-side rendered applications. This function is overridden with\n * an actual implementation when the event replay feature is enabled via\n * `withEventReplay()` call.\n */\nlet stashEventListener = (el, eventName, listenerFn) => { };\nfunction setStashFn(fn) {\n stashEventListener = fn;\n}\n/**\n * Adds an event listener to the current node.\n *\n * If an output exists on one of the node's directives, it also subscribes to the output\n * and saves the subscription for later cleanup.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param useCapture Whether or not to use capture in event listener - this argument is a reminder\n * from the Renderer3 infrastructure and should be removed from the instruction arguments\n * @param eventTargetResolver Function that returns global target information in case this listener\n * should be attached to a global object like window, document or body\n *\n * @codeGenApi\n */\nfunction ɵɵlistener(eventName, listenerFn, useCapture, eventTargetResolver) {\n const lView = getLView();\n const tView = getTView();\n const tNode = getCurrentTNode();\n listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn, eventTargetResolver);\n return ɵɵlistener;\n}\n/**\n * Registers a synthetic host listener (e.g. `(@foo.start)`) on a component or directive.\n *\n * This instruction is for compatibility purposes and is designed to ensure that a\n * synthetic host listener (e.g. `@HostListener('@foo.start')`) properly gets rendered\n * in the component's renderer. Normally all host listeners are evaluated with the\n * parent component's renderer, but, in the case of animation @triggers, they need\n * to be evaluated with the sub component's renderer (because that's where the\n * animation triggers are defined).\n *\n * Do not use this instruction as a replacement for `listener`. This instruction\n * only exists to ensure compatibility with the ViewEngine's host binding behavior.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param useCapture Whether or not to use capture in event listener\n * @param eventTargetResolver Function that returns global target information in case this listener\n * should be attached to a global object like window, document or body\n *\n * @codeGenApi\n */\nfunction ɵɵsyntheticHostListener(eventName, listenerFn) {\n const tNode = getCurrentTNode();\n const lView = getLView();\n const tView = getTView();\n const currentDef = getCurrentDirectiveDef(tView.data);\n const renderer = loadComponentRenderer(currentDef, tNode, lView);\n listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn);\n return ɵɵsyntheticHostListener;\n}\n/**\n * A utility function that checks if a given element has already an event handler registered for an\n * event with a specified name. The TView.cleanup data structure is used to find out which events\n * are registered for a given element.\n */\nfunction findExistingListener(tView, lView, eventName, tNodeIdx) {\n const tCleanup = tView.cleanup;\n if (tCleanup != null) {\n for (let i = 0; i < tCleanup.length - 1; i += 2) {\n const cleanupEventName = tCleanup[i];\n if (cleanupEventName === eventName && tCleanup[i + 1] === tNodeIdx) {\n // We have found a matching event name on the same node but it might not have been\n // registered yet, so we must explicitly verify entries in the LView cleanup data\n // structures.\n const lCleanup = lView[CLEANUP];\n const listenerIdxInLCleanup = tCleanup[i + 2];\n return lCleanup.length > listenerIdxInLCleanup ? lCleanup[listenerIdxInLCleanup] : null;\n }\n // TView.cleanup can have a mix of 4-elements entries (for event handler cleanups) or\n // 2-element entries (for directive and queries destroy hooks). As such we can encounter\n // blocks of 4 or 2 items in the tView.cleanup and this is why we iterate over 2 elements\n // first and jump another 2 elements if we detect listeners cleanup (4 elements). Also check\n // documentation of TView.cleanup for more details of this data structure layout.\n if (typeof cleanupEventName === 'string') {\n i += 2;\n }\n }\n }\n return null;\n}\nfunction listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, eventTargetResolver) {\n const isTNodeDirectiveHost = isDirectiveHost(tNode);\n const firstCreatePass = tView.firstCreatePass;\n const tCleanup = firstCreatePass && getOrCreateTViewCleanup(tView);\n const context = lView[CONTEXT];\n // When the ɵɵlistener instruction was generated and is executed we know that there is either a\n // native listener or a directive output on this element. As such we we know that we will have to\n // register a listener and store its cleanup function on LView.\n const lCleanup = getOrCreateLViewCleanup(lView);\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);\n let processOutputs = true;\n // Adding a native event listener is applicable when:\n // - The corresponding TNode represents a DOM element.\n // - The event target has a resolver (usually resulting in a global object,\n // such as `window` or `document`).\n if (tNode.type & 3 /* TNodeType.AnyRNode */ || eventTargetResolver) {\n const native = getNativeByTNode(tNode, lView);\n const target = eventTargetResolver ? eventTargetResolver(native) : native;\n const lCleanupIndex = lCleanup.length;\n const idxOrTargetGetter = eventTargetResolver\n ? (_lView) => eventTargetResolver(unwrapRNode(_lView[tNode.index]))\n : tNode.index;\n // In order to match current behavior, native DOM event listeners must be added for all\n // events (including outputs).\n // There might be cases where multiple directives on the same element try to register an event\n // handler function for the same event. In this situation we want to avoid registration of\n // several native listeners as each registration would be intercepted by NgZone and\n // trigger change detection. This would mean that a single user action would result in several\n // change detections being invoked. To avoid this situation we want to have only one call to\n // native handler registration (for the same element and same type of event).\n //\n // In order to have just one native event handler in presence of multiple handler functions,\n // we just register a first handler function as a native event listener and then chain\n // (coalesce) other handler functions on top of the first native handler function.\n let existingListener = null;\n // Please note that the coalescing described here doesn't happen for events specifying an\n // alternative target (ex. (document:click)) - this is to keep backward compatibility with the\n // view engine.\n // Also, we don't have to search for existing listeners is there are no directives\n // matching on a given node as we can't register multiple event handlers for the same event in\n // a template (this would mean having duplicate attributes).\n if (!eventTargetResolver && isTNodeDirectiveHost) {\n existingListener = findExistingListener(tView, lView, eventName, tNode.index);\n }\n if (existingListener !== null) {\n // Attach a new listener to coalesced listeners list, maintaining the order in which\n // listeners are registered. For performance reasons, we keep a reference to the last\n // listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through\n // the entire set each time we need to add a new listener.\n const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;\n lastListenerFn.__ngNextListenerFn__ = listenerFn;\n existingListener.__ngLastListenerFn__ = listenerFn;\n processOutputs = false;\n }\n else {\n listenerFn = wrapListener(tNode, lView, context, listenerFn);\n stashEventListener(native, eventName, listenerFn);\n const cleanupFn = renderer.listen(target, eventName, listenerFn);\n ngDevMode && ngDevMode.rendererAddEventListener++;\n lCleanup.push(listenerFn, cleanupFn);\n tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);\n }\n }\n else {\n // Even if there is no native listener to add, we still need to wrap the listener so that OnPush\n // ancestors are marked dirty when an event occurs.\n listenerFn = wrapListener(tNode, lView, context, listenerFn);\n }\n // subscribe to directive outputs\n const outputs = tNode.outputs;\n let props;\n if (processOutputs && outputs !== null && (props = outputs[eventName])) {\n const propsLength = props.length;\n if (propsLength) {\n for (let i = 0; i < propsLength; i += 2) {\n const index = props[i];\n ngDevMode && assertIndexInRange(lView, index);\n const minifiedName = props[i + 1];\n const directiveInstance = lView[index];\n const output = directiveInstance[minifiedName];\n if (ngDevMode && !isOutputSubscribable(output)) {\n throw new Error(`@Output ${minifiedName} not initialized in '${directiveInstance.constructor.name}'.`);\n }\n const subscription = output.subscribe(listenerFn);\n const idx = lCleanup.length;\n lCleanup.push(listenerFn, subscription);\n tCleanup && tCleanup.push(eventName, tNode.index, idx, -(idx + 1));\n }\n }\n }\n}\nfunction executeListenerWithErrorHandling(lView, context, listenerFn, e) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n profiler(6 /* ProfilerEvent.OutputStart */, context, listenerFn);\n // Only explicitly returning false from a listener should preventDefault\n return listenerFn(e) !== false;\n }\n catch (error) {\n handleError(lView, error);\n return false;\n }\n finally {\n profiler(7 /* ProfilerEvent.OutputEnd */, context, listenerFn);\n setActiveConsumer$1(prevConsumer);\n }\n}\n/**\n * Wraps an event listener with a function that marks ancestors dirty and prevents default behavior,\n * if applicable.\n *\n * @param tNode The TNode associated with this listener\n * @param lView The LView that contains this listener\n * @param listenerFn The listener function to call\n * @param wrapWithPreventDefault Whether or not to prevent default behavior\n * (the procedural renderer does this already, so in those cases, we should skip)\n */\nfunction wrapListener(tNode, lView, context, listenerFn) {\n // Note: we are performing most of the work in the listener function itself\n // to optimize listener registration.\n return function wrapListenerIn_markDirtyAndPreventDefault(e) {\n // Ivy uses `Function` as a special token that allows us to unwrap the function\n // so that it can be invoked programmatically by `DebugNode.triggerEventHandler`.\n if (e === Function) {\n return listenerFn;\n }\n // In order to be backwards compatible with View Engine, events on component host nodes\n // must also mark the component view itself dirty (i.e. the view that it owns).\n const startView = tNode.componentOffset > -1 ? getComponentLViewByIndex(tNode.index, lView) : lView;\n markViewDirty(startView, 5 /* NotificationSource.Listener */);\n let result = executeListenerWithErrorHandling(lView, context, listenerFn, e);\n // A just-invoked listener function might have coalesced listeners so we need to check for\n // their presence and invoke as needed.\n let nextListenerFn = wrapListenerIn_markDirtyAndPreventDefault.__ngNextListenerFn__;\n while (nextListenerFn) {\n // We should prevent default if any of the listeners explicitly return false\n result = executeListenerWithErrorHandling(lView, context, nextListenerFn, e) && result;\n nextListenerFn = nextListenerFn.__ngNextListenerFn__;\n }\n return result;\n };\n}\n/**\n * Whether the given value represents a subscribable output.\n *\n * For example, an `EventEmitter, a `Subject`, an `Observable` or an\n * `OutputEmitter`.\n */\nfunction isOutputSubscribable(value) {\n return (value != null && typeof value.subscribe === 'function');\n}\n\n/**\n * Retrieves a context at the level specified and saves it as the global, contextViewData.\n * Will get the next level up if level is not specified.\n *\n * This is used to save contexts of parent views so they can be bound in embedded views, or\n * in conjunction with reference() to bind a ref from a parent view.\n *\n * @param level The relative level of the view from which to grab context compared to contextVewData\n * @returns context\n *\n * @codeGenApi\n */\nfunction ɵɵnextContext(level = 1) {\n return nextContextImpl(level);\n}\n\n/**\n * Checks a given node against matching projection slots and returns the\n * determined slot index. Returns \"null\" if no slot matched the given node.\n *\n * This function takes into account the parsed ngProjectAs selector from the\n * node's attributes. If present, it will check whether the ngProjectAs selector\n * matches any of the projection slot selectors.\n */\nfunction matchingProjectionSlotIndex(tNode, projectionSlots) {\n let wildcardNgContentIndex = null;\n const ngProjectAsAttrVal = getProjectAsAttrValue(tNode);\n for (let i = 0; i < projectionSlots.length; i++) {\n const slotValue = projectionSlots[i];\n // The last wildcard projection slot should match all nodes which aren't matching\n // any selector. This is necessary to be backwards compatible with view engine.\n if (slotValue === '*') {\n wildcardNgContentIndex = i;\n continue;\n }\n // If we ran into an `ngProjectAs` attribute, we should match its parsed selector\n // to the list of selectors, otherwise we fall back to matching against the node.\n if (ngProjectAsAttrVal === null\n ? isNodeMatchingSelectorList(tNode, slotValue, /* isProjectionMode */ true)\n : isSelectorInSelectorList(ngProjectAsAttrVal, slotValue)) {\n return i; // first matching selector \"captures\" a given node\n }\n }\n return wildcardNgContentIndex;\n}\n/**\n * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.\n * It takes all the selectors from the entire component's template and decides where\n * each projected node belongs (it re-distributes nodes among \"buckets\" where each \"bucket\" is\n * backed by a selector).\n *\n * This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text,\n * un-parsed form.\n *\n * The parsed form is needed for efficient matching of a node against a given CSS selector.\n * The un-parsed, textual form is needed for support of the ngProjectAs attribute.\n *\n * Having a CSS selector in 2 different formats is not ideal, but alternatives have even more\n * drawbacks:\n * - having only a textual form would require runtime parsing of CSS selectors;\n * - we can't have only a parsed as we can't re-construct textual form from it (as entered by a\n * template author).\n *\n * @param projectionSlots? A collection of projection slots. A projection slot can be based\n * on a parsed CSS selectors or set to the wildcard selector (\"*\") in order to match\n * all nodes which do not match any selector. If not specified, a single wildcard\n * selector projection slot will be defined.\n *\n * @codeGenApi\n */\nfunction ɵɵprojectionDef(projectionSlots) {\n const componentNode = getLView()[DECLARATION_COMPONENT_VIEW][T_HOST];\n if (!componentNode.projection) {\n // If no explicit projection slots are defined, fall back to a single\n // projection slot with the wildcard selector.\n const numProjectionSlots = projectionSlots ? projectionSlots.length : 1;\n const projectionHeads = (componentNode.projection = newArray(numProjectionSlots, null));\n const tails = projectionHeads.slice();\n let componentChild = componentNode.child;\n while (componentChild !== null) {\n // Do not project let declarations so they don't occupy a slot.\n if (componentChild.type !== 128 /* TNodeType.LetDeclaration */) {\n const slotIndex = projectionSlots\n ? matchingProjectionSlotIndex(componentChild, projectionSlots)\n : 0;\n if (slotIndex !== null) {\n if (tails[slotIndex]) {\n tails[slotIndex].projectionNext = componentChild;\n }\n else {\n projectionHeads[slotIndex] = componentChild;\n }\n tails[slotIndex] = componentChild;\n }\n }\n componentChild = componentChild.next;\n }\n }\n}\n/**\n * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call\n * to the projectionDef instruction.\n *\n * @param nodeIndex Index of the projection node.\n * @param selectorIndex Index of the slot selector.\n * - 0 when the selector is `*` (or unspecified as this is the default value),\n * - 1 based index of the selector from the {@link projectionDef}\n * @param attrs Static attributes set on the `ng-content` node.\n * @param fallbackTemplateFn Template function with fallback content.\n * Will be rendered if the slot is empty at runtime.\n * @param fallbackDecls Number of declarations in the fallback template.\n * @param fallbackVars Number of variables in the fallback template.\n *\n * @codeGenApi\n */\nfunction ɵɵprojection(nodeIndex, selectorIndex = 0, attrs, fallbackTemplateFn, fallbackDecls, fallbackVars) {\n const lView = getLView();\n const tView = getTView();\n const fallbackIndex = fallbackTemplateFn ? nodeIndex + 1 : null;\n // Fallback content needs to be declared no matter whether the slot is empty since different\n // instances of the component may or may not insert it. Also it needs to be declare *before*\n // the projection node in order to work correctly with hydration.\n if (fallbackIndex !== null) {\n declareTemplate(lView, tView, fallbackIndex, fallbackTemplateFn, fallbackDecls, fallbackVars, null, attrs);\n }\n const tProjectionNode = getOrCreateTNode(tView, HEADER_OFFSET + nodeIndex, 16 /* TNodeType.Projection */, null, attrs || null);\n // We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views.\n if (tProjectionNode.projection === null) {\n tProjectionNode.projection = selectorIndex;\n }\n // `<ng-content>` has no content. Even if there's fallback\n // content, the fallback is shown next to it.\n setCurrentTNodeAsNotParent();\n const hydrationInfo = lView[HYDRATION];\n const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1();\n const componentHostNode = lView[DECLARATION_COMPONENT_VIEW][T_HOST];\n const isEmpty = componentHostNode.projection[tProjectionNode.projection] === null;\n if (isEmpty && fallbackIndex !== null) {\n insertFallbackContent(lView, tView, fallbackIndex);\n }\n else if (isNodeCreationMode &&\n (tProjectionNode.flags & 32 /* TNodeFlags.isDetached */) !== 32 /* TNodeFlags.isDetached */) {\n // re-distribution of projectable nodes is stored on a component's view level\n applyProjection(tView, lView, tProjectionNode);\n }\n}\n/** Inserts the fallback content of a projection slot. Assumes there's no projected content. */\nfunction insertFallbackContent(lView, tView, fallbackIndex) {\n const adjustedIndex = HEADER_OFFSET + fallbackIndex;\n const fallbackTNode = tView.data[adjustedIndex];\n const fallbackLContainer = lView[adjustedIndex];\n ngDevMode && assertTNode(fallbackTNode);\n ngDevMode && assertLContainer(fallbackLContainer);\n const dehydratedView = findMatchingDehydratedView(fallbackLContainer, fallbackTNode.tView.ssrId);\n const fallbackLView = createAndRenderEmbeddedLView(lView, fallbackTNode, undefined, {\n dehydratedView,\n });\n addLViewToLContainer(fallbackLContainer, fallbackLView, 0, shouldAddViewToDom(fallbackTNode, dehydratedView));\n}\n\n/**\n *\n * Update an interpolated property on an element with a lone bound value\n *\n * Used when the value passed to a property has 1 interpolated value in it, an no additional text\n * surrounds that interpolated value:\n *\n * ```html\n * <div title=\"{{v0}}\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate('title', v0);\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate(propName, v0, sanitizer) {\n ɵɵpropertyInterpolate1(propName, '', v0, '', sanitizer);\n return ɵɵpropertyInterpolate;\n}\n/**\n *\n * Update an interpolated property on an element with single bound value surrounded by text.\n *\n * Used when the value passed to a property has 1 interpolated value in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate1('title', 'prefix', v0, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate1(propName, prefix, v0, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 1, prefix, suffix);\n }\n return ɵɵpropertyInterpolate1;\n}\n/**\n *\n * Update an interpolated property on an element with 2 bound values surrounded by text.\n *\n * Used when the value passed to a property has 2 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate2(propName, prefix, v0, i0, v1, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 2, prefix, i0, suffix);\n }\n return ɵɵpropertyInterpolate2;\n}\n/**\n *\n * Update an interpolated property on an element with 3 bound values surrounded by text.\n *\n * Used when the value passed to a property has 3 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate3(\n * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate3(propName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 3, prefix, i0, i1, suffix);\n }\n return ɵɵpropertyInterpolate3;\n}\n/**\n *\n * Update an interpolated property on an element with 4 bound values surrounded by text.\n *\n * Used when the value passed to a property has 4 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate4(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate4(propName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);\n }\n return ɵɵpropertyInterpolate4;\n}\n/**\n *\n * Update an interpolated property on an element with 5 bound values surrounded by text.\n *\n * Used when the value passed to a property has 5 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate5(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate5(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);\n }\n return ɵɵpropertyInterpolate5;\n}\n/**\n *\n * Update an interpolated property on an element with 6 bound values surrounded by text.\n *\n * Used when the value passed to a property has 6 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate6(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate6(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);\n }\n return ɵɵpropertyInterpolate6;\n}\n/**\n *\n * Update an interpolated property on an element with 7 bound values surrounded by text.\n *\n * Used when the value passed to a property has 7 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate7(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate7(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);\n }\n return ɵɵpropertyInterpolate7;\n}\n/**\n *\n * Update an interpolated property on an element with 8 bound values surrounded by text.\n *\n * Used when the value passed to a property has 8 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate8(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param i6 Static value used for concatenation only.\n * @param v7 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolate8(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);\n }\n return ɵɵpropertyInterpolate8;\n}\n/**\n * Update an interpolated property on an element with 9 or more bound values surrounded by text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div\n * title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolateV(\n * 'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n * 'suffix']);\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update.\n * @param values The collection of values and the strings in between those values, beginning with a\n * string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵpropertyInterpolateV(propName, values, sanitizer) {\n const lView = getLView();\n const interpolatedValue = interpolationV(lView, values);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n if (ngDevMode) {\n const interpolationInBetween = [values[0]]; // prefix\n for (let i = 2; i < values.length; i += 2) {\n interpolationInBetween.push(values[i]);\n }\n storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - interpolationInBetween.length + 1, ...interpolationInBetween);\n }\n }\n return ɵɵpropertyInterpolateV;\n}\n\n/**\n * Registers a QueryList, associated with a content query, for later refresh (part of a view\n * refresh).\n *\n * @param directiveIndex Current directive index\n * @param predicate The type for which the query will search\n * @param flags Flags associated with the query\n * @param read What to save in the query\n * @returns QueryList<T>\n *\n * @codeGenApi\n */\nfunction ɵɵcontentQuery(directiveIndex, predicate, flags, read) {\n createContentQuery(directiveIndex, predicate, flags, read);\n}\n/**\n * Creates a new view query by initializing internal data structures.\n *\n * @param predicate The type for which the query will search\n * @param flags Flags associated with the query\n * @param read What to save in the query\n *\n * @codeGenApi\n */\nfunction ɵɵviewQuery(predicate, flags, read) {\n createViewQuery(predicate, flags, read);\n}\n/**\n * Refreshes a query by combining matches from all active views and removing matches from deleted\n * views.\n *\n * @returns `true` if a query got dirty during change detection or if this is a static query\n * resolving in creation mode, `false` otherwise.\n *\n * @codeGenApi\n */\nfunction ɵɵqueryRefresh(queryList) {\n const lView = getLView();\n const tView = getTView();\n const queryIndex = getCurrentQueryIndex();\n setCurrentQueryIndex(queryIndex + 1);\n const tQuery = getTQuery(tView, queryIndex);\n if (queryList.dirty &&\n isCreationMode(lView) ===\n ((tQuery.metadata.flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */)) {\n if (tQuery.matches === null) {\n queryList.reset([]);\n }\n else {\n const result = getQueryResults(lView, queryIndex);\n queryList.reset(result, unwrapElementRef);\n queryList.notifyOnChanges();\n }\n return true;\n }\n return false;\n}\n/**\n * Loads a QueryList corresponding to the current view or content query.\n *\n * @codeGenApi\n */\nfunction ɵɵloadQuery() {\n return loadQueryInternal(getLView(), getCurrentQueryIndex());\n}\n\n/**\n * Creates a new content query and binds it to a signal created by an authoring function.\n *\n * @param directiveIndex Current directive index\n * @param target The target signal to which the query should be bound\n * @param predicate The type for which the query will search\n * @param flags Flags associated with the query\n * @param read What to save in the query\n *\n * @codeGenApi\n */\nfunction ɵɵcontentQuerySignal(directiveIndex, target, predicate, flags, read) {\n bindQueryToSignal(target, createContentQuery(directiveIndex, predicate, flags, read));\n}\n/**\n * Creates a new view query by initializing internal data structures and binding a new query to the\n * target signal.\n *\n * @param target The target signal to assign the query results to.\n * @param predicate The type or label that should match a given query\n * @param flags Flags associated with the query\n * @param read What to save in the query\n *\n * @codeGenApi\n */\nfunction ɵɵviewQuerySignal(target, predicate, flags, read) {\n bindQueryToSignal(target, createViewQuery(predicate, flags, read));\n}\n/**\n * Advances the current query index by a specified offset.\n *\n * Adjusting the current query index is necessary in cases where a given directive has a mix of\n * zone-based and signal-based queries. The signal-based queries don't require tracking of the\n * current index (those are refreshed on demand and not during change detection) so this instruction\n * is only necessary for backward-compatibility.\n *\n * @param index offset to apply to the current query index (defaults to 1)\n *\n * @codeGenApi\n */\nfunction ɵɵqueryAdvance(indexOffset = 1) {\n setCurrentQueryIndex(getCurrentQueryIndex() + indexOffset);\n}\n\n/** Store a value in the `data` at a given `index`. */\nfunction store(tView, lView, index, value) {\n // We don't store any static data for local variables, so the first time\n // we see the template, we should store as null to avoid a sparse array\n if (index >= tView.data.length) {\n tView.data[index] = null;\n tView.blueprint[index] = null;\n }\n lView[index] = value;\n}\n/**\n * Retrieves a local reference from the current contextViewData.\n *\n * If the reference to retrieve is in a parent view, this instruction is used in conjunction\n * with a nextContext() call, which walks up the tree and updates the contextViewData instance.\n *\n * @param index The index of the local ref in contextViewData.\n *\n * @codeGenApi\n */\nfunction ɵɵreference(index) {\n const contextLView = getContextLView();\n return load(contextLView, HEADER_OFFSET + index);\n}\n\n/**\n *\n * Update an interpolated style on an element with single bound value surrounded by text.\n *\n * Used when the value passed to a property has 1 interpolated value in it:\n *\n * ```html\n * <div style=\"key: {{v0}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate1('key: ', v0, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate1(prefix, v0, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n *\n * Update an interpolated style on an element with 2 bound values surrounded by text.\n *\n * Used when the value passed to a property has 2 interpolated values in it:\n *\n * ```html\n * <div style=\"key: {{v0}}; key1: {{v1}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate2('key: ', v0, '; key1: ', v1, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate2(prefix, v0, i0, v1, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n *\n * Update an interpolated style on an element with 3 bound values surrounded by text.\n *\n * Used when the value passed to a property has 3 interpolated values in it:\n *\n * ```html\n * <div style=\"key: {{v0}}; key2: {{v1}}; key2: {{v2}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate3(\n * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n *\n * Update an interpolated style on an element with 4 bound values surrounded by text.\n *\n * Used when the value passed to a property has 4 interpolated values in it:\n *\n * ```html\n * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate4(\n * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n *\n * Update an interpolated style on an element with 5 bound values surrounded by text.\n *\n * Used when the value passed to a property has 5 interpolated values in it:\n *\n * ```html\n * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate5(\n * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n *\n * Update an interpolated style on an element with 6 bound values surrounded by text.\n *\n * Used when the value passed to a property has 6 interpolated values in it:\n *\n * ```html\n * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}};\n * key5: {{v5}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate6(\n * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,\n * 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n *\n * Update an interpolated style on an element with 7 bound values surrounded by text.\n *\n * Used when the value passed to a property has 7 interpolated values in it:\n *\n * ```html\n * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};\n * key6: {{v6}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate7(\n * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,\n * '; key6: ', v6, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n *\n * Update an interpolated style on an element with 8 bound values surrounded by text.\n *\n * Used when the value passed to a property has 8 interpolated values in it:\n *\n * ```html\n * <div style=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};\n * key6: {{v6}}; key7: {{v7}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolate8(\n * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,\n * '; key6: ', v6, '; key7: ', v7, 'suffix');\n * ```\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param i6 Static value used for concatenation only.\n * @param v7 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n const lView = getLView();\n const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n ɵɵstyleMap(interpolatedValue);\n}\n/**\n * Update an interpolated style on an element with 9 or more bound values surrounded by text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div\n * class=\"key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};\n * key6: {{v6}}; key7: {{v7}}; key8: {{v8}}; key9: {{v9}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstyleMapInterpolateV(\n * ['key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,\n * '; key6: ', v6, '; key7: ', v7, '; key8: ', v8, '; key9: ', v9, 'suffix']);\n * ```\n *.\n * @param values The collection of values and the strings in-between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '; key2: ', value1, '; key2: ', value2, ..., value99, 'suffix']`)\n * @codeGenApi\n */\nfunction ɵɵstyleMapInterpolateV(values) {\n const lView = getLView();\n const interpolatedValue = interpolationV(lView, values);\n ɵɵstyleMap(interpolatedValue);\n}\n\n/**\n *\n * Update an interpolated style property on an element with single bound value surrounded by text.\n *\n * Used when the value passed to a property has 1 interpolated value in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate1(0, 'prefix', v0, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate1(prop, prefix, v0, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate1;\n}\n/**\n *\n * Update an interpolated style property on an element with 2 bound values surrounded by text.\n *\n * Used when the value passed to a property has 2 interpolated values in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}-{{v1}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate2(0, 'prefix', v0, '-', v1, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate2(prop, prefix, v0, i0, v1, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate2;\n}\n/**\n *\n * Update an interpolated style property on an element with 3 bound values surrounded by text.\n *\n * Used when the value passed to a property has 3 interpolated values in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate3(0, 'prefix', v0, '-', v1, '-', v2, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate3(prop, prefix, v0, i0, v1, i1, v2, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate3;\n}\n/**\n *\n * Update an interpolated style property on an element with 4 bound values surrounded by text.\n *\n * Used when the value passed to a property has 4 interpolated values in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate4(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate4(prop, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate4;\n}\n/**\n *\n * Update an interpolated style property on an element with 5 bound values surrounded by text.\n *\n * Used when the value passed to a property has 5 interpolated values in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate5(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate5(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate5;\n}\n/**\n *\n * Update an interpolated style property on an element with 6 bound values surrounded by text.\n *\n * Used when the value passed to a property has 6 interpolated values in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate6(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate6(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate6;\n}\n/**\n *\n * Update an interpolated style property on an element with 7 bound values surrounded by text.\n *\n * Used when the value passed to a property has 7 interpolated values in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate7(\n * 0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate7(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate7;\n}\n/**\n *\n * Update an interpolated style property on an element with 8 bound values surrounded by text.\n *\n * Used when the value passed to a property has 8 interpolated values in it:\n *\n * ```html\n * <div style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix\"></div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolate8(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6,\n * '-', v7, 'suffix');\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`.\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param i6 Static value used for concatenation only.\n * @param v7 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolate8(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolate8;\n}\n/**\n * Update an interpolated style property on an element with 9 or more bound values surrounded by\n * text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div\n * style.color=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix\">\n * </div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵstylePropInterpolateV(\n * 0, ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n * 'suffix']);\n * ```\n *\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `styling`..\n * @param values The collection of values and the strings in-between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵstylePropInterpolateV(prop, values, valueSuffix) {\n const lView = getLView();\n const interpolatedValue = interpolationV(lView, values);\n checkStylingProperty(prop, interpolatedValue, valueSuffix, false);\n return ɵɵstylePropInterpolateV;\n}\n\n/**\n * Create static text node\n *\n * @param index Index of the node in the data array\n * @param value Static string value to write.\n *\n * @codeGenApi\n */\nfunction ɵɵtext(index, value = '') {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n ngDevMode &&\n assertEqual(getBindingIndex(), tView.bindingStartIndex, 'text nodes should be created before any bindings');\n ngDevMode && assertIndexInRange(lView, adjustedIndex);\n const tNode = tView.firstCreatePass\n ? getOrCreateTNode(tView, adjustedIndex, 1 /* TNodeType.Text */, value, null)\n : tView.data[adjustedIndex];\n const textNative = _locateOrCreateTextNode(tView, lView, tNode, value, index);\n lView[adjustedIndex] = textNative;\n if (wasLastNodeCreated()) {\n appendChild(tView, lView, textNative, tNode);\n }\n // Text nodes are self closing.\n setCurrentTNode(tNode, false);\n}\nlet _locateOrCreateTextNode = (tView, lView, tNode, value, index) => {\n lastNodeWasCreated(true);\n return createTextNode(lView[RENDERER], value);\n};\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode of text nodes.\n */\nfunction locateOrCreateTextNodeImpl(tView, lView, tNode, value, index) {\n const hydrationInfo = lView[HYDRATION];\n const isNodeCreationMode = !hydrationInfo ||\n isInSkipHydrationBlock$1() ||\n isDetachedByI18n(tNode) ||\n isDisconnectedNode$1(hydrationInfo, index);\n lastNodeWasCreated(isNodeCreationMode);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createTextNode(lView[RENDERER], value);\n }\n // Hydration mode, looking up an existing element in DOM.\n const textNative = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateMatchingNode(textNative, Node.TEXT_NODE, null, lView, tNode);\n ngDevMode && markRNodeAsClaimedByHydration(textNative);\n return textNative;\n}\nfunction enableLocateOrCreateTextNodeImpl() {\n _locateOrCreateTextNode = locateOrCreateTextNodeImpl;\n}\n\n/**\n *\n * Update text content with a lone bound value\n *\n * Used when a text node has 1 interpolated value in it, an no additional text\n * surrounds that interpolated value:\n *\n * ```html\n * <div>{{v0}}</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate(v0);\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate(v0) {\n ɵɵtextInterpolate1('', v0, '');\n return ɵɵtextInterpolate;\n}\n/**\n *\n * Update text content with single bound value surrounded by other text.\n *\n * Used when a text node has 1 interpolated value in it:\n *\n * ```html\n * <div>prefix{{v0}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate1('prefix', v0, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate1(prefix, v0, suffix) {\n const lView = getLView();\n const interpolated = interpolation1(lView, prefix, v0, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate1;\n}\n/**\n *\n * Update text content with 2 bound values surrounded by other text.\n *\n * Used when a text node has 2 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate2('prefix', v0, '-', v1, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate2(prefix, v0, i0, v1, suffix) {\n const lView = getLView();\n const interpolated = interpolation2(lView, prefix, v0, i0, v1, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate2;\n}\n/**\n *\n * Update text content with 3 bound values surrounded by other text.\n *\n * Used when a text node has 3 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate3(\n * 'prefix', v0, '-', v1, '-', v2, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) {\n const lView = getLView();\n const interpolated = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate3;\n}\n/**\n *\n * Update text content with 4 bound values surrounded by other text.\n *\n * Used when a text node has 4 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate4(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see ɵɵtextInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n const lView = getLView();\n const interpolated = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate4;\n}\n/**\n *\n * Update text content with 5 bound values surrounded by other text.\n *\n * Used when a text node has 5 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate5(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n const lView = getLView();\n const interpolated = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate5;\n}\n/**\n *\n * Update text content with 6 bound values surrounded by other text.\n *\n * Used when a text node has 6 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate6(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n * ```\n *\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change. @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n const lView = getLView();\n const interpolated = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate6;\n}\n/**\n *\n * Update text content with 7 bound values surrounded by other text.\n *\n * Used when a text node has 7 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate7(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n const lView = getLView();\n const interpolated = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate7;\n}\n/**\n *\n * Update text content with 8 bound values surrounded by other text.\n *\n * Used when a text node has 8 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate8(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n const lView = getLView();\n const interpolated = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate8;\n}\n/**\n * Update text content with 9 or more bound values other surrounded by text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolateV(\n * ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n * 'suffix']);\n * ```\n *.\n * @param values The collection of values and the strings in between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n *\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵtextInterpolateV(values) {\n const lView = getLView();\n const interpolated = interpolationV(lView, values);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolateV;\n}\n\n/*!\n * @license\n * Copyright Google LLC 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.dev/license\n */\n/**\n * Update a two-way bound property on a selected element.\n *\n * Operates on the element selected by index via the {@link select} instruction.\n *\n * @param propName Name of property.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @returns This function returns itself so that it may be chained\n * (e.g. `twoWayProperty('name', ctx.name)('title', ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵtwoWayProperty(propName, value, sanitizer) {\n // TODO(crisbeto): perf impact of re-evaluating this on each change detection?\n if (isWritableSignal(value)) {\n value = value();\n }\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, false);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵtwoWayProperty;\n}\n/**\n * Function used inside two-way listeners to conditionally set the value of the bound expression.\n *\n * @param target Field on which to set the value.\n * @param value Value to be set to the field.\n *\n * @codeGenApi\n */\nfunction ɵɵtwoWayBindingSet(target, value) {\n const canWrite = isWritableSignal(target);\n canWrite && target.set(value);\n return canWrite;\n}\n/**\n * Adds an event listener that updates a two-way binding to the current node.\n *\n * @param eventName Name of the event.\n * @param listenerFn The function to be called when event emits.\n *\n * @codeGenApi\n */\nfunction ɵɵtwoWayListener(eventName, listenerFn) {\n const lView = getLView();\n const tView = getTView();\n const tNode = getCurrentTNode();\n listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn);\n return ɵɵtwoWayListener;\n}\n\n/*!\n * @license\n * Copyright Google LLC 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.dev/license\n */\n/** Object that indicates the value of a `@let` declaration that hasn't been initialized yet. */\nconst UNINITIALIZED_LET = {};\n/**\n * Declares an `@let` at a specific data slot. Returns itself to allow chaining.\n *\n * @param index Index at which to declare the `@let`.\n *\n * @codeGenApi\n */\nfunction ɵɵdeclareLet(index) {\n const tView = getTView();\n const lView = getLView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = getOrCreateTNode(tView, adjustedIndex, 128 /* TNodeType.LetDeclaration */, null, null);\n setCurrentTNode(tNode, false);\n store(tView, lView, adjustedIndex, UNINITIALIZED_LET);\n return ɵɵdeclareLet;\n}\n/**\n * Instruction that stores the value of a `@let` declaration on the current view.\n * Returns the value to allow usage inside variable initializers.\n *\n * @codeGenApi\n */\nfunction ɵɵstoreLet(value) {\n performanceMarkFeature('NgLet');\n const tView = getTView();\n const lView = getLView();\n const index = getSelectedIndex();\n store(tView, lView, index, value);\n return value;\n}\n/**\n * Retrieves the value of a `@let` declaration defined in a parent view.\n *\n * @param index Index of the declaration within the view.\n *\n * @codeGenApi\n */\nfunction ɵɵreadContextLet(index) {\n const contextLView = getContextLView();\n const value = load(contextLView, HEADER_OFFSET + index);\n if (value === UNINITIALIZED_LET) {\n throw new RuntimeError(314 /* RuntimeErrorCode.UNINITIALIZED_LET_ACCESS */, ngDevMode && 'Attempting to access a @let declaration whose value is not available yet');\n }\n return value;\n}\n\n/*\n * This file re-exports all symbols contained in this directory.\n *\n * Why is this file not `index.ts`?\n *\n * There seems to be an inconsistent path resolution of an `index.ts` file\n * when only the parent directory is referenced. This could be due to the\n * node module resolution configuration differing from rollup and/or typescript.\n *\n * With commit\n * https://github.com/angular/angular/commit/d5e3f2c64bd13ce83e7c70788b7fc514ca4a9918\n * the `instructions.ts` file was moved to `instructions/instructions.ts` and an\n * `index.ts` file was used to re-export everything. Having had file names that were\n * importing from `instructions' directly (not the from the sub file or the `index.ts`\n * file) caused strange CI issues. `index.ts` had to be renamed to `all.ts` for this\n * to work.\n *\n * Jira Issue = FW-1184\n */\n\n/**\n * Resolves the providers which are defined in the DirectiveDef.\n *\n * When inserting the tokens and the factories in their respective arrays, we can assume that\n * this method is called first for the component (if any), and then for other directives on the same\n * node.\n * As a consequence,the providers are always processed in that order:\n * 1) The view providers of the component\n * 2) The providers of the component\n * 3) The providers of the other directives\n * This matches the structure of the injectables arrays of a view (for each node).\n * So the tokens and the factories can be pushed at the end of the arrays, except\n * in one case for multi providers.\n *\n * @param def the directive definition\n * @param providers: Array of `providers`.\n * @param viewProviders: Array of `viewProviders`.\n */\nfunction providersResolver(def, providers, viewProviders) {\n const tView = getTView();\n if (tView.firstCreatePass) {\n const isComponent = isComponentDef(def);\n // The list of view providers is processed first, and the flags are updated\n resolveProvider(viewProviders, tView.data, tView.blueprint, isComponent, true);\n // Then, the list of providers is processed, and the flags are updated\n resolveProvider(providers, tView.data, tView.blueprint, isComponent, false);\n }\n}\n/**\n * Resolves a provider and publishes it to the DI system.\n */\nfunction resolveProvider(provider, tInjectables, lInjectablesBlueprint, isComponent, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (let i = 0; i < provider.length; i++) {\n resolveProvider(provider[i], tInjectables, lInjectablesBlueprint, isComponent, isViewProvider);\n }\n }\n else {\n const tView = getTView();\n const lView = getLView();\n const tNode = getCurrentTNode();\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n const providerFactory = providerToFactory(provider);\n if (ngDevMode) {\n const injector = new NodeInjector(tNode, lView);\n runInInjectorProfilerContext(injector, token, () => {\n emitProviderConfiguredEvent(provider, isViewProvider);\n });\n }\n const beginIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;\n const endIndex = tNode.directiveStart;\n const cptViewProvidersCount = tNode.providerIndexes >> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */;\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n const factory = new NodeInjectorFactory(providerFactory, isViewProvider, ɵɵdirectiveInject);\n const existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex === -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 1048576 /* TNodeProviderIndexes.CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n }\n else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n const existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n const existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n const doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 && lInjectablesBlueprint[existingProvidersFactoryIndex];\n const doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if ((isViewProvider && !doesViewProvidersFactoryExist) ||\n (!isViewProvider && !doesProvidersFactoryExist)) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n const factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length, 0);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 1048576 /* TNodeProviderIndexes.CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n // Cases 1.b and 2.b\n const indexInFactory = multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent);\n registerDestroyHooksIfSupported(tView, provider, existingProvidersFactoryIndex > -1\n ? existingProvidersFactoryIndex\n : existingViewProvidersFactoryIndex, indexInFactory);\n }\n if (!isViewProvider && isComponent && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}\n/**\n * Registers the `ngOnDestroy` hook of a provider, if the provider supports destroy hooks.\n * @param tView `TView` in which to register the hook.\n * @param provider Provider whose hook should be registered.\n * @param contextIndex Index under which to find the context for the hook when it's being invoked.\n * @param indexInFactory Only required for `multi` providers. Index of the provider in the multi\n * provider factory.\n */\nfunction registerDestroyHooksIfSupported(tView, provider, contextIndex, indexInFactory) {\n const providerIsTypeProvider = isTypeProvider(provider);\n const providerIsClassProvider = isClassProvider(provider);\n if (providerIsTypeProvider || providerIsClassProvider) {\n // Resolve forward references as `useClass` can hold a forward reference.\n const classToken = providerIsClassProvider ? resolveForwardRef(provider.useClass) : provider;\n const prototype = classToken.prototype;\n const ngOnDestroy = prototype.ngOnDestroy;\n if (ngOnDestroy) {\n const hooks = tView.destroyHooks || (tView.destroyHooks = []);\n if (!providerIsTypeProvider && provider.multi) {\n ngDevMode &&\n assertDefined(indexInFactory, 'indexInFactory when registering multi factory destroy hook');\n const existingCallbacksIndex = hooks.indexOf(contextIndex);\n if (existingCallbacksIndex === -1) {\n hooks.push(contextIndex, [indexInFactory, ngOnDestroy]);\n }\n else {\n hooks[existingCallbacksIndex + 1].push(indexInFactory, ngOnDestroy);\n }\n }\n else {\n hooks.push(contextIndex, ngOnDestroy);\n }\n }\n }\n}\n/**\n * Add a factory in a multi factory.\n * @returns Index at which the factory was inserted.\n */\nfunction multiFactoryAdd(multiFactory, factory, isComponentProvider) {\n if (isComponentProvider) {\n multiFactory.componentProviders++;\n }\n return multiFactory.multi.push(factory) - 1;\n}\n/**\n * Returns the index of item in the array, but only in the begin to end range.\n */\nfunction indexOf(item, arr, begin, end) {\n for (let i = begin; i < end; i++) {\n if (arr[i] === item)\n return i;\n }\n return -1;\n}\n/**\n * Use this with `multi` `providers`.\n */\nfunction multiProvidersFactoryResolver(_, tData, lData, tNode) {\n return multiResolve(this.multi, []);\n}\n/**\n * Use this with `multi` `viewProviders`.\n *\n * This factory knows how to concatenate itself with the existing `multi` `providers`.\n */\nfunction multiViewProvidersFactoryResolver(_, tData, lView, tNode) {\n const factories = this.multi;\n let result;\n if (this.providerFactory) {\n const componentCount = this.providerFactory.componentProviders;\n const multiProviders = getNodeInjectable(lView, lView[TVIEW], this.providerFactory.index, tNode);\n // Copy the section of the array which contains `multi` `providers` from the component\n result = multiProviders.slice(0, componentCount);\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n // Copy the section of the array which contains `multi` `providers` from other directives\n for (let i = componentCount; i < multiProviders.length; i++) {\n result.push(multiProviders[i]);\n }\n }\n else {\n result = [];\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n }\n return result;\n}\n/**\n * Maps an array of factories into an array of values.\n */\nfunction multiResolve(factories, result) {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i];\n result.push(factory());\n }\n return result;\n}\n/**\n * Creates a multi factory.\n */\nfunction multiFactory(factoryFn, index, isViewProvider, isComponent, f) {\n const factory = new NodeInjectorFactory(factoryFn, isViewProvider, ɵɵdirectiveInject);\n factory.multi = [];\n factory.index = index;\n factory.componentProviders = 0;\n multiFactoryAdd(factory, f, isComponent && !isViewProvider);\n return factory;\n}\n\n/**\n * This feature resolves the providers of a directive (or component),\n * and publish them into the DI system, making it visible to others for injection.\n *\n * For example:\n * ```ts\n * class ComponentWithProviders {\n * constructor(private greeter: GreeterDE) {}\n *\n * static ɵcmp = defineComponent({\n * type: ComponentWithProviders,\n * selectors: [['component-with-providers']],\n * factory: () => new ComponentWithProviders(directiveInject(GreeterDE as any)),\n * decls: 1,\n * vars: 1,\n * template: function(fs: RenderFlags, ctx: ComponentWithProviders) {\n * if (fs & RenderFlags.Create) {\n * ɵɵtext(0);\n * }\n * if (fs & RenderFlags.Update) {\n * ɵɵtextInterpolate(ctx.greeter.greet());\n * }\n * },\n * features: [ɵɵProvidersFeature([GreeterDE])]\n * });\n * }\n * ```\n *\n * @param definition\n *\n * @codeGenApi\n */\nfunction ɵɵProvidersFeature(providers, viewProviders = []) {\n return (definition) => {\n definition.providersResolver = (def, processProvidersFn) => {\n return providersResolver(def, //\n processProvidersFn ? processProvidersFn(providers) : providers, //\n viewProviders);\n };\n };\n}\n\n/**\n * A service used by the framework to create instances of standalone injectors. Those injectors are\n * created on demand in case of dynamic component instantiation and contain ambient providers\n * collected from the imports graph rooted at a given standalone component.\n */\nclass StandaloneService {\n constructor(_injector) {\n this._injector = _injector;\n this.cachedInjectors = new Map();\n }\n getOrCreateStandaloneInjector(componentDef) {\n if (!componentDef.standalone) {\n return null;\n }\n if (!this.cachedInjectors.has(componentDef)) {\n const providers = internalImportProvidersFrom(false, componentDef.type);\n const standaloneInjector = providers.length > 0\n ? createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`)\n : null;\n this.cachedInjectors.set(componentDef, standaloneInjector);\n }\n return this.cachedInjectors.get(componentDef);\n }\n ngOnDestroy() {\n try {\n for (const injector of this.cachedInjectors.values()) {\n if (injector !== null) {\n injector.destroy();\n }\n }\n }\n finally {\n this.cachedInjectors.clear();\n }\n }\n /** @nocollapse */\n static { this.ɵprov = ɵɵdefineInjectable({\n token: StandaloneService,\n providedIn: 'environment',\n factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),\n }); }\n}\n/**\n * A feature that acts as a setup code for the {@link StandaloneService}.\n *\n * The most important responsibility of this feature is to expose the \"getStandaloneInjector\"\n * function (an entry points to a standalone injector creation) on a component definition object. We\n * go through the features infrastructure to make sure that the standalone injector creation logic\n * is tree-shakable and not included in applications that don't use standalone components.\n *\n * @codeGenApi\n */\nfunction ɵɵStandaloneFeature(definition) {\n performanceMarkFeature('NgStandalone');\n definition.getStandaloneInjector = (parentInjector) => {\n return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);\n };\n}\n\n/**\n * Generated next to NgModules to monkey-patch directive and pipe references onto a component's\n * definition, when generating a direct reference in the component file would otherwise create an\n * import cycle.\n *\n * See [this explanation](https://hackmd.io/Odw80D0pR6yfsOjg_7XCJg?view) for more details.\n *\n * @codeGenApi\n */\nfunction ɵɵsetComponentScope(type, directives, pipes) {\n const def = type.ɵcmp;\n def.directiveDefs = extractDefListOrFactory(directives, /* pipeDef */ false);\n def.pipeDefs = extractDefListOrFactory(pipes, /* pipeDef */ true);\n}\n/**\n * Adds the module metadata that is necessary to compute the module's transitive scope to an\n * existing module definition.\n *\n * Scope metadata of modules is not used in production builds, so calls to this function can be\n * marked pure to tree-shake it from the bundle, allowing for all referenced declarations\n * to become eligible for tree-shaking as well.\n *\n * @codeGenApi\n */\nfunction ɵɵsetNgModuleScope(type, scope) {\n return noSideEffects(() => {\n const ngModuleDef = getNgModuleDef(type, true);\n ngModuleDef.declarations = convertToTypeArray(scope.declarations || EMPTY_ARRAY);\n ngModuleDef.imports = convertToTypeArray(scope.imports || EMPTY_ARRAY);\n ngModuleDef.exports = convertToTypeArray(scope.exports || EMPTY_ARRAY);\n if (scope.bootstrap) {\n // This only happens in local compilation mode.\n ngModuleDef.bootstrap = convertToTypeArray(scope.bootstrap);\n }\n depsTracker.registerNgModule(type, scope);\n });\n}\nfunction convertToTypeArray(values) {\n if (typeof values === 'function') {\n return values;\n }\n const flattenValues = flatten(values);\n if (flattenValues.some(isForwardRef)) {\n return () => flattenValues.map(resolveForwardRef).map(maybeUnwrapModuleWithProviders);\n }\n else {\n return flattenValues.map(maybeUnwrapModuleWithProviders);\n }\n}\nfunction maybeUnwrapModuleWithProviders(value) {\n return isModuleWithProviders(value) ? value.ngModule : value;\n}\n\n/**\n * The name of a field that Angular monkey-patches onto a component\n * class to store a function that loads defer-loadable dependencies\n * and applies metadata to a class.\n */\nconst ASYNC_COMPONENT_METADATA_FN = '__ngAsyncComponentMetadataFn__';\n/**\n * If a given component has unresolved async metadata - returns a reference\n * to a function that applies component metadata after resolving defer-loadable\n * dependencies. Otherwise - this function returns `null`.\n */\nfunction getAsyncClassMetadataFn(type) {\n const componentClass = type; // cast to `any`, so that we can read a monkey-patched field\n return componentClass[ASYNC_COMPONENT_METADATA_FN] ?? null;\n}\n/**\n * Handles the process of applying metadata info to a component class in case\n * component template has defer blocks (thus some dependencies became deferrable).\n *\n * @param type Component class where metadata should be added\n * @param dependencyLoaderFn Function that loads dependencies\n * @param metadataSetterFn Function that forms a scope in which the `setClassMetadata` is invoked\n */\nfunction setClassMetadataAsync(type, dependencyLoaderFn, metadataSetterFn) {\n const componentClass = type; // cast to `any`, so that we can monkey-patch it\n componentClass[ASYNC_COMPONENT_METADATA_FN] = () => Promise.all(dependencyLoaderFn()).then((dependencies) => {\n metadataSetterFn(...dependencies);\n // Metadata is now set, reset field value to indicate that this component\n // can by used/compiled synchronously.\n componentClass[ASYNC_COMPONENT_METADATA_FN] = null;\n return dependencies;\n });\n return componentClass[ASYNC_COMPONENT_METADATA_FN];\n}\n/**\n * Adds decorator, constructor, and property metadata to a given type via static metadata fields\n * on the type.\n *\n * These metadata fields can later be read with Angular's `ReflectionCapabilities` API.\n *\n * Calls to `setClassMetadata` can be guarded by ngDevMode, resulting in the metadata assignments\n * being tree-shaken away during production builds.\n */\nfunction setClassMetadata(type, decorators, ctorParameters, propDecorators) {\n return noSideEffects(() => {\n const clazz = type;\n if (decorators !== null) {\n if (clazz.hasOwnProperty('decorators') && clazz.decorators !== undefined) {\n clazz.decorators.push(...decorators);\n }\n else {\n clazz.decorators = decorators;\n }\n }\n if (ctorParameters !== null) {\n // Rather than merging, clobber the existing parameters. If other projects exist which\n // use tsickle-style annotations and reflect over them in the same way, this could\n // cause issues, but that is vanishingly unlikely.\n clazz.ctorParameters = ctorParameters;\n }\n if (propDecorators !== null) {\n // The property decorator objects are merged as it is possible different fields have\n // different decorator types. Decorators on individual fields are not merged, as it's\n // also incredibly unlikely that a field will be decorated both with an Angular\n // decorator and a non-Angular decorator that's also been downleveled.\n if (clazz.hasOwnProperty('propDecorators') && clazz.propDecorators !== undefined) {\n clazz.propDecorators = { ...clazz.propDecorators, ...propDecorators };\n }\n else {\n clazz.propDecorators = propDecorators;\n }\n }\n });\n}\n\n/**\n * Bindings for pure functions are stored after regular bindings.\n *\n * |-------decls------|---------vars---------| |----- hostVars (dir1) ------|\n * ------------------------------------------------------------------------------------------\n * | nodes/refs/pipes | bindings | fn slots | injector | dir1 | host bindings | host slots |\n * ------------------------------------------------------------------------------------------\n * ^ ^\n * TView.bindingStartIndex TView.expandoStartIndex\n *\n * Pure function instructions are given an offset from the binding root. Adding the offset to the\n * binding root gives the first index where the bindings are stored. In component views, the binding\n * root is the bindingStartIndex. In host bindings, the binding root is the expandoStartIndex +\n * any directive instances + any hostVars in directives evaluated before it.\n *\n * See VIEW_DATA.md for more information about host binding resolution.\n */\n/**\n * If the value hasn't been saved, calls the pure function to store and return the\n * value. If it has been saved, returns the saved value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns a value\n * @param thisArg Optional calling context of pureFn\n * @returns value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction0(slotOffset, pureFn, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n return lView[bindingIndex] === NO_CHANGE\n ? updateBinding(lView, bindingIndex, thisArg ? pureFn.call(thisArg) : pureFn())\n : getBinding(lView, bindingIndex);\n}\n/**\n * If the value of the provided exp has changed, calls the pure function to return\n * an updated value. Or if the value has not changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns an updated value\n * @param exp Updated expression value\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction1(slotOffset, pureFn, exp, thisArg) {\n return pureFunction1Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction2(slotOffset, pureFn, exp1, exp2, thisArg) {\n return pureFunction2Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction3(slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n return pureFunction3Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction4(slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {\n return pureFunction4Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction5(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated(lView, bindingIndex + 4, exp5) || different\n ? updateBinding(lView, bindingIndex + 5, thisArg\n ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5)\n : pureFn(exp1, exp2, exp3, exp4, exp5))\n : getBinding(lView, bindingIndex + 5);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction6(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different\n ? updateBinding(lView, bindingIndex + 6, thisArg\n ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6)\n : pureFn(exp1, exp2, exp3, exp4, exp5, exp6))\n : getBinding(lView, bindingIndex + 6);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction7(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n let different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated3(lView, bindingIndex + 4, exp5, exp6, exp7) || different\n ? updateBinding(lView, bindingIndex + 7, thisArg\n ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7)\n : pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7))\n : getBinding(lView, bindingIndex + 7);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param exp8\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction8(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated4(lView, bindingIndex + 4, exp5, exp6, exp7, exp8) || different\n ? updateBinding(lView, bindingIndex + 8, thisArg\n ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8)\n : pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8))\n : getBinding(lView, bindingIndex + 8);\n}\n/**\n * pureFunction instruction that can support any number of bindings.\n *\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn A pure function that takes binding values and builds an object or array\n * containing those values.\n * @param exps An array of binding values\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunctionV(slotOffset, pureFn, exps, thisArg) {\n return pureFunctionVInternal(getLView(), getBindingRoot(), slotOffset, pureFn, exps, thisArg);\n}\n/**\n * Results of a pure function invocation are stored in LView in a dedicated slot that is initialized\n * to NO_CHANGE. In rare situations a pure pipe might throw an exception on the very first\n * invocation and not produce any valid results. In this case LView would keep holding the NO_CHANGE\n * value. The NO_CHANGE is not something that we can use in expressions / bindings thus we convert\n * it to `undefined`.\n */\nfunction getPureFunctionReturnValue(lView, returnValueIndex) {\n ngDevMode && assertIndexInRange(lView, returnValueIndex);\n const lastReturnValue = lView[returnValueIndex];\n return lastReturnValue === NO_CHANGE ? undefined : lastReturnValue;\n}\n/**\n * If the value of the provided exp has changed, calls the pure function to return\n * an updated value. Or if the value has not changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns an updated value\n * @param exp Updated expression value\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunction1Internal(lView, bindingRoot, slotOffset, pureFn, exp, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated(lView, bindingIndex, exp)\n ? updateBinding(lView, bindingIndex + 1, thisArg ? pureFn.call(thisArg, exp) : pureFn(exp))\n : getPureFunctionReturnValue(lView, bindingIndex + 1);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunction2Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated2(lView, bindingIndex, exp1, exp2)\n ? updateBinding(lView, bindingIndex + 2, thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2))\n : getPureFunctionReturnValue(lView, bindingIndex + 2);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3)\n ? updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3))\n : getPureFunctionReturnValue(lView, bindingIndex + 3);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n */\nfunction pureFunction4Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4)\n ? updateBinding(lView, bindingIndex + 4, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4))\n : getPureFunctionReturnValue(lView, bindingIndex + 4);\n}\n/**\n * pureFunction instruction that can support any number of bindings.\n *\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn A pure function that takes binding values and builds an object or array\n * containing those values.\n * @param exps An array of binding values\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunctionVInternal(lView, bindingRoot, slotOffset, pureFn, exps, thisArg) {\n let bindingIndex = bindingRoot + slotOffset;\n let different = false;\n for (let i = 0; i < exps.length; i++) {\n bindingUpdated(lView, bindingIndex++, exps[i]) && (different = true);\n }\n return different\n ? updateBinding(lView, bindingIndex, pureFn.apply(thisArg, exps))\n : getPureFunctionReturnValue(lView, bindingIndex);\n}\n\n/**\n * Create a pipe.\n *\n * @param index Pipe index where the pipe will be stored.\n * @param pipeName The name of the pipe\n * @returns T the instance of the pipe.\n *\n * @codeGenApi\n */\nfunction ɵɵpipe(index, pipeName) {\n const tView = getTView();\n let pipeDef;\n const adjustedIndex = index + HEADER_OFFSET;\n if (tView.firstCreatePass) {\n // The `getPipeDef` throws if a pipe with a given name is not found\n // (so we use non-null assertion below).\n pipeDef = getPipeDef(pipeName, tView.pipeRegistry);\n tView.data[adjustedIndex] = pipeDef;\n if (pipeDef.onDestroy) {\n (tView.destroyHooks ??= []).push(adjustedIndex, pipeDef.onDestroy);\n }\n }\n else {\n pipeDef = tView.data[adjustedIndex];\n }\n const pipeFactory = pipeDef.factory || (pipeDef.factory = getFactoryDef(pipeDef.type, true));\n let previousInjectorProfilerContext;\n if (ngDevMode) {\n previousInjectorProfilerContext = setInjectorProfilerContext({\n injector: new NodeInjector(getCurrentTNode(), getLView()),\n token: pipeDef.type,\n });\n }\n const previousInjectImplementation = setInjectImplementation(ɵɵdirectiveInject);\n try {\n // DI for pipes is supposed to behave like directives when placed on a component\n // host node, which means that we have to disable access to `viewProviders`.\n const previousIncludeViewProviders = setIncludeViewProviders(false);\n const pipeInstance = pipeFactory();\n setIncludeViewProviders(previousIncludeViewProviders);\n store(tView, getLView(), adjustedIndex, pipeInstance);\n return pipeInstance;\n }\n finally {\n // we have to restore the injector implementation in finally, just in case the creation of the\n // pipe throws an error.\n setInjectImplementation(previousInjectImplementation);\n ngDevMode && setInjectorProfilerContext(previousInjectorProfilerContext);\n }\n}\n/**\n * Searches the pipe registry for a pipe with the given name. If one is found,\n * returns the pipe. Otherwise, an error is thrown because the pipe cannot be resolved.\n *\n * @param name Name of pipe to resolve\n * @param registry Full list of available pipes\n * @returns Matching PipeDef\n */\nfunction getPipeDef(name, registry) {\n if (registry) {\n if (ngDevMode) {\n const pipes = registry.filter((pipe) => pipe.name === name);\n // TODO: Throw an error in the next major\n if (pipes.length > 1) {\n console.warn(formatRuntimeError(313 /* RuntimeErrorCode.MULTIPLE_MATCHING_PIPES */, getMultipleMatchingPipesMessage(name)));\n }\n }\n for (let i = registry.length - 1; i >= 0; i--) {\n const pipeDef = registry[i];\n if (name === pipeDef.name) {\n return pipeDef;\n }\n }\n }\n if (ngDevMode) {\n throw new RuntimeError(-302 /* RuntimeErrorCode.PIPE_NOT_FOUND */, getPipeNotFoundErrorMessage(name));\n }\n return;\n}\n/**\n * Generates a helpful error message for the user when multiple pipes match the name.\n *\n * @param name Name of the pipe\n * @returns The error message\n */\nfunction getMultipleMatchingPipesMessage(name) {\n const lView = getLView();\n const declarationLView = lView[DECLARATION_COMPONENT_VIEW];\n const context = declarationLView[CONTEXT];\n const hostIsStandalone = isHostComponentStandalone(lView);\n const componentInfoMessage = context ? ` in the '${context.constructor.name}' component` : '';\n const verifyMessage = `check ${hostIsStandalone ? \"'@Component.imports' of this component\" : 'the imports of this module'}`;\n const errorMessage = `Multiple pipes match the name \\`${name}\\`${componentInfoMessage}. ${verifyMessage}`;\n return errorMessage;\n}\n/**\n * Generates a helpful error message for the user when a pipe is not found.\n *\n * @param name Name of the missing pipe\n * @returns The error message\n */\nfunction getPipeNotFoundErrorMessage(name) {\n const lView = getLView();\n const declarationLView = lView[DECLARATION_COMPONENT_VIEW];\n const context = declarationLView[CONTEXT];\n const hostIsStandalone = isHostComponentStandalone(lView);\n const componentInfoMessage = context ? ` in the '${context.constructor.name}' component` : '';\n const verifyMessage = `Verify that it is ${hostIsStandalone\n ? \"included in the '@Component.imports' of this component\"\n : 'declared or imported in this module'}`;\n const errorMessage = `The pipe '${name}' could not be found${componentInfoMessage}. ${verifyMessage}`;\n return errorMessage;\n}\n/**\n * Invokes a pipe with 1 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param offset the binding offset\n * @param v1 1st argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind1(index, offset, v1) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex)\n ? pureFunction1Internal(lView, getBindingRoot(), offset, pipeInstance.transform, v1, pipeInstance)\n : pipeInstance.transform(v1);\n}\n/**\n * Invokes a pipe with 2 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind2(index, slotOffset, v1, v2) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex)\n ? pureFunction2Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, pipeInstance)\n : pipeInstance.transform(v1, v2);\n}\n/**\n * Invokes a pipe with 3 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 4rd argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind3(index, slotOffset, v1, v2, v3) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex)\n ? pureFunction3Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, pipeInstance)\n : pipeInstance.transform(v1, v2, v3);\n}\n/**\n * Invokes a pipe with 4 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 3rd argument to {@link PipeTransform#transform}.\n * @param v4 4th argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind4(index, slotOffset, v1, v2, v3, v4) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex)\n ? pureFunction4Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, v4, pipeInstance)\n : pipeInstance.transform(v1, v2, v3, v4);\n}\n/**\n * Invokes a pipe with variable number of arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param values Array of arguments to pass to {@link PipeTransform#transform} method.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBindV(index, slotOffset, values) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex)\n ? pureFunctionVInternal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, values, pipeInstance)\n : pipeInstance.transform.apply(pipeInstance, values);\n}\nfunction isPure(lView, index) {\n return lView[TVIEW].data[index].pure;\n}\n\n/**\n * Retrieves `TemplateRef` instance from `Injector` when a local reference is placed on the\n * `<ng-template>` element.\n *\n * @codeGenApi\n */\nfunction ɵɵtemplateRefExtractor(tNode, lView) {\n return createTemplateRef(tNode, lView);\n}\n\nfunction ɵɵgetComponentDepsFactory(type, rawImports) {\n return () => {\n try {\n return depsTracker.getComponentDependencies(type, rawImports).dependencies;\n }\n catch (e) {\n console.error(`Computing dependencies in local compilation mode for the component \"${type.name}\" failed with the exception:`, e);\n throw e;\n }\n };\n}\n\n/**\n * Sets the debug info for an Angular class.\n *\n * This runtime is guarded by ngDevMode flag.\n */\nfunction ɵsetClassDebugInfo(type, debugInfo) {\n const def = getComponentDef(type);\n if (def !== null) {\n def.debugInfo = debugInfo;\n }\n}\n\n/**\n * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.\n *\n * This should be kept up to date with the public exports of @angular/core.\n */\nconst angularCoreEnv = (() => ({\n 'ɵɵattribute': ɵɵattribute,\n 'ɵɵattributeInterpolate1': ɵɵattributeInterpolate1,\n 'ɵɵattributeInterpolate2': ɵɵattributeInterpolate2,\n 'ɵɵattributeInterpolate3': ɵɵattributeInterpolate3,\n 'ɵɵattributeInterpolate4': ɵɵattributeInterpolate4,\n 'ɵɵattributeInterpolate5': ɵɵattributeInterpolate5,\n 'ɵɵattributeInterpolate6': ɵɵattributeInterpolate6,\n 'ɵɵattributeInterpolate7': ɵɵattributeInterpolate7,\n 'ɵɵattributeInterpolate8': ɵɵattributeInterpolate8,\n 'ɵɵattributeInterpolateV': ɵɵattributeInterpolateV,\n 'ɵɵdefineComponent': ɵɵdefineComponent,\n 'ɵɵdefineDirective': ɵɵdefineDirective,\n 'ɵɵdefineInjectable': ɵɵdefineInjectable,\n 'ɵɵdefineInjector': ɵɵdefineInjector,\n 'ɵɵdefineNgModule': ɵɵdefineNgModule,\n 'ɵɵdefinePipe': ɵɵdefinePipe,\n 'ɵɵdirectiveInject': ɵɵdirectiveInject,\n 'ɵɵgetInheritedFactory': ɵɵgetInheritedFactory,\n 'ɵɵinject': ɵɵinject,\n 'ɵɵinjectAttribute': ɵɵinjectAttribute,\n 'ɵɵinvalidFactory': ɵɵinvalidFactory,\n 'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,\n 'ɵɵtemplateRefExtractor': ɵɵtemplateRefExtractor,\n 'ɵɵresetView': ɵɵresetView,\n 'ɵɵHostDirectivesFeature': ɵɵHostDirectivesFeature,\n 'ɵɵNgOnChangesFeature': ɵɵNgOnChangesFeature,\n 'ɵɵProvidersFeature': ɵɵProvidersFeature,\n 'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature,\n 'ɵɵInheritDefinitionFeature': ɵɵInheritDefinitionFeature,\n 'ɵɵInputTransformsFeature': ɵɵInputTransformsFeature,\n 'ɵɵStandaloneFeature': ɵɵStandaloneFeature,\n 'ɵɵnextContext': ɵɵnextContext,\n 'ɵɵnamespaceHTML': ɵɵnamespaceHTML,\n 'ɵɵnamespaceMathML': ɵɵnamespaceMathML,\n 'ɵɵnamespaceSVG': ɵɵnamespaceSVG,\n 'ɵɵenableBindings': ɵɵenableBindings,\n 'ɵɵdisableBindings': ɵɵdisableBindings,\n 'ɵɵelementStart': ɵɵelementStart,\n 'ɵɵelementEnd': ɵɵelementEnd,\n 'ɵɵelement': ɵɵelement,\n 'ɵɵelementContainerStart': ɵɵelementContainerStart,\n 'ɵɵelementContainerEnd': ɵɵelementContainerEnd,\n 'ɵɵelementContainer': ɵɵelementContainer,\n 'ɵɵpureFunction0': ɵɵpureFunction0,\n 'ɵɵpureFunction1': ɵɵpureFunction1,\n 'ɵɵpureFunction2': ɵɵpureFunction2,\n 'ɵɵpureFunction3': ɵɵpureFunction3,\n 'ɵɵpureFunction4': ɵɵpureFunction4,\n 'ɵɵpureFunction5': ɵɵpureFunction5,\n 'ɵɵpureFunction6': ɵɵpureFunction6,\n 'ɵɵpureFunction7': ɵɵpureFunction7,\n 'ɵɵpureFunction8': ɵɵpureFunction8,\n 'ɵɵpureFunctionV': ɵɵpureFunctionV,\n 'ɵɵgetCurrentView': ɵɵgetCurrentView,\n 'ɵɵrestoreView': ɵɵrestoreView,\n 'ɵɵlistener': ɵɵlistener,\n 'ɵɵprojection': ɵɵprojection,\n 'ɵɵsyntheticHostProperty': ɵɵsyntheticHostProperty,\n 'ɵɵsyntheticHostListener': ɵɵsyntheticHostListener,\n 'ɵɵpipeBind1': ɵɵpipeBind1,\n 'ɵɵpipeBind2': ɵɵpipeBind2,\n 'ɵɵpipeBind3': ɵɵpipeBind3,\n 'ɵɵpipeBind4': ɵɵpipeBind4,\n 'ɵɵpipeBindV': ɵɵpipeBindV,\n 'ɵɵprojectionDef': ɵɵprojectionDef,\n 'ɵɵhostProperty': ɵɵhostProperty,\n 'ɵɵproperty': ɵɵproperty,\n 'ɵɵpropertyInterpolate': ɵɵpropertyInterpolate,\n 'ɵɵpropertyInterpolate1': ɵɵpropertyInterpolate1,\n 'ɵɵpropertyInterpolate2': ɵɵpropertyInterpolate2,\n 'ɵɵpropertyInterpolate3': ɵɵpropertyInterpolate3,\n 'ɵɵpropertyInterpolate4': ɵɵpropertyInterpolate4,\n 'ɵɵpropertyInterpolate5': ɵɵpropertyInterpolate5,\n 'ɵɵpropertyInterpolate6': ɵɵpropertyInterpolate6,\n 'ɵɵpropertyInterpolate7': ɵɵpropertyInterpolate7,\n 'ɵɵpropertyInterpolate8': ɵɵpropertyInterpolate8,\n 'ɵɵpropertyInterpolateV': ɵɵpropertyInterpolateV,\n 'ɵɵpipe': ɵɵpipe,\n 'ɵɵqueryRefresh': ɵɵqueryRefresh,\n 'ɵɵqueryAdvance': ɵɵqueryAdvance,\n 'ɵɵviewQuery': ɵɵviewQuery,\n 'ɵɵviewQuerySignal': ɵɵviewQuerySignal,\n 'ɵɵloadQuery': ɵɵloadQuery,\n 'ɵɵcontentQuery': ɵɵcontentQuery,\n 'ɵɵcontentQuerySignal': ɵɵcontentQuerySignal,\n 'ɵɵreference': ɵɵreference,\n 'ɵɵclassMap': ɵɵclassMap,\n 'ɵɵclassMapInterpolate1': ɵɵclassMapInterpolate1,\n 'ɵɵclassMapInterpolate2': ɵɵclassMapInterpolate2,\n 'ɵɵclassMapInterpolate3': ɵɵclassMapInterpolate3,\n 'ɵɵclassMapInterpolate4': ɵɵclassMapInterpolate4,\n 'ɵɵclassMapInterpolate5': ɵɵclassMapInterpolate5,\n 'ɵɵclassMapInterpolate6': ɵɵclassMapInterpolate6,\n 'ɵɵclassMapInterpolate7': ɵɵclassMapInterpolate7,\n 'ɵɵclassMapInterpolate8': ɵɵclassMapInterpolate8,\n 'ɵɵclassMapInterpolateV': ɵɵclassMapInterpolateV,\n 'ɵɵstyleMap': ɵɵstyleMap,\n 'ɵɵstyleMapInterpolate1': ɵɵstyleMapInterpolate1,\n 'ɵɵstyleMapInterpolate2': ɵɵstyleMapInterpolate2,\n 'ɵɵstyleMapInterpolate3': ɵɵstyleMapInterpolate3,\n 'ɵɵstyleMapInterpolate4': ɵɵstyleMapInterpolate4,\n 'ɵɵstyleMapInterpolate5': ɵɵstyleMapInterpolate5,\n 'ɵɵstyleMapInterpolate6': ɵɵstyleMapInterpolate6,\n 'ɵɵstyleMapInterpolate7': ɵɵstyleMapInterpolate7,\n 'ɵɵstyleMapInterpolate8': ɵɵstyleMapInterpolate8,\n 'ɵɵstyleMapInterpolateV': ɵɵstyleMapInterpolateV,\n 'ɵɵstyleProp': ɵɵstyleProp,\n 'ɵɵstylePropInterpolate1': ɵɵstylePropInterpolate1,\n 'ɵɵstylePropInterpolate2': ɵɵstylePropInterpolate2,\n 'ɵɵstylePropInterpolate3': ɵɵstylePropInterpolate3,\n 'ɵɵstylePropInterpolate4': ɵɵstylePropInterpolate4,\n 'ɵɵstylePropInterpolate5': ɵɵstylePropInterpolate5,\n 'ɵɵstylePropInterpolate6': ɵɵstylePropInterpolate6,\n 'ɵɵstylePropInterpolate7': ɵɵstylePropInterpolate7,\n 'ɵɵstylePropInterpolate8': ɵɵstylePropInterpolate8,\n 'ɵɵstylePropInterpolateV': ɵɵstylePropInterpolateV,\n 'ɵɵclassProp': ɵɵclassProp,\n 'ɵɵadvance': ɵɵadvance,\n 'ɵɵtemplate': ɵɵtemplate,\n 'ɵɵconditional': ɵɵconditional,\n 'ɵɵdefer': ɵɵdefer,\n 'ɵɵdeferWhen': ɵɵdeferWhen,\n 'ɵɵdeferOnIdle': ɵɵdeferOnIdle,\n 'ɵɵdeferOnImmediate': ɵɵdeferOnImmediate,\n 'ɵɵdeferOnTimer': ɵɵdeferOnTimer,\n 'ɵɵdeferOnHover': ɵɵdeferOnHover,\n 'ɵɵdeferOnInteraction': ɵɵdeferOnInteraction,\n 'ɵɵdeferOnViewport': ɵɵdeferOnViewport,\n 'ɵɵdeferPrefetchWhen': ɵɵdeferPrefetchWhen,\n 'ɵɵdeferPrefetchOnIdle': ɵɵdeferPrefetchOnIdle,\n 'ɵɵdeferPrefetchOnImmediate': ɵɵdeferPrefetchOnImmediate,\n 'ɵɵdeferPrefetchOnTimer': ɵɵdeferPrefetchOnTimer,\n 'ɵɵdeferPrefetchOnHover': ɵɵdeferPrefetchOnHover,\n 'ɵɵdeferPrefetchOnInteraction': ɵɵdeferPrefetchOnInteraction,\n 'ɵɵdeferPrefetchOnViewport': ɵɵdeferPrefetchOnViewport,\n 'ɵɵdeferEnableTimerScheduling': ɵɵdeferEnableTimerScheduling,\n 'ɵɵrepeater': ɵɵrepeater,\n 'ɵɵrepeaterCreate': ɵɵrepeaterCreate,\n 'ɵɵrepeaterTrackByIndex': ɵɵrepeaterTrackByIndex,\n 'ɵɵrepeaterTrackByIdentity': ɵɵrepeaterTrackByIdentity,\n 'ɵɵcomponentInstance': ɵɵcomponentInstance,\n 'ɵɵtext': ɵɵtext,\n 'ɵɵtextInterpolate': ɵɵtextInterpolate,\n 'ɵɵtextInterpolate1': ɵɵtextInterpolate1,\n 'ɵɵtextInterpolate2': ɵɵtextInterpolate2,\n 'ɵɵtextInterpolate3': ɵɵtextInterpolate3,\n 'ɵɵtextInterpolate4': ɵɵtextInterpolate4,\n 'ɵɵtextInterpolate5': ɵɵtextInterpolate5,\n 'ɵɵtextInterpolate6': ɵɵtextInterpolate6,\n 'ɵɵtextInterpolate7': ɵɵtextInterpolate7,\n 'ɵɵtextInterpolate8': ɵɵtextInterpolate8,\n 'ɵɵtextInterpolateV': ɵɵtextInterpolateV,\n 'ɵɵi18n': ɵɵi18n,\n 'ɵɵi18nAttributes': ɵɵi18nAttributes,\n 'ɵɵi18nExp': ɵɵi18nExp,\n 'ɵɵi18nStart': ɵɵi18nStart,\n 'ɵɵi18nEnd': ɵɵi18nEnd,\n 'ɵɵi18nApply': ɵɵi18nApply,\n 'ɵɵi18nPostprocess': ɵɵi18nPostprocess,\n 'ɵɵresolveWindow': ɵɵresolveWindow,\n 'ɵɵresolveDocument': ɵɵresolveDocument,\n 'ɵɵresolveBody': ɵɵresolveBody,\n 'ɵɵsetComponentScope': ɵɵsetComponentScope,\n 'ɵɵsetNgModuleScope': ɵɵsetNgModuleScope,\n 'ɵɵregisterNgModuleType': registerNgModuleType,\n 'ɵɵgetComponentDepsFactory': ɵɵgetComponentDepsFactory,\n 'ɵsetClassDebugInfo': ɵsetClassDebugInfo,\n 'ɵɵdeclareLet': ɵɵdeclareLet,\n 'ɵɵstoreLet': ɵɵstoreLet,\n 'ɵɵreadContextLet': ɵɵreadContextLet,\n 'ɵɵsanitizeHtml': ɵɵsanitizeHtml,\n 'ɵɵsanitizeStyle': ɵɵsanitizeStyle,\n 'ɵɵsanitizeResourceUrl': ɵɵsanitizeResourceUrl,\n 'ɵɵsanitizeScript': ɵɵsanitizeScript,\n 'ɵɵsanitizeUrl': ɵɵsanitizeUrl,\n 'ɵɵsanitizeUrlOrResourceUrl': ɵɵsanitizeUrlOrResourceUrl,\n 'ɵɵtrustConstantHtml': ɵɵtrustConstantHtml,\n 'ɵɵtrustConstantResourceUrl': ɵɵtrustConstantResourceUrl,\n 'ɵɵvalidateIframeAttribute': ɵɵvalidateIframeAttribute,\n 'forwardRef': forwardRef,\n 'resolveForwardRef': resolveForwardRef,\n 'ɵɵtwoWayProperty': ɵɵtwoWayProperty,\n 'ɵɵtwoWayBindingSet': ɵɵtwoWayBindingSet,\n 'ɵɵtwoWayListener': ɵɵtwoWayListener,\n}))();\n\nlet jitOptions = null;\nfunction setJitOptions(options) {\n if (jitOptions !== null) {\n if (options.defaultEncapsulation !== jitOptions.defaultEncapsulation) {\n ngDevMode &&\n console.error('Provided value for `defaultEncapsulation` can not be changed once it has been set.');\n return;\n }\n if (options.preserveWhitespaces !== jitOptions.preserveWhitespaces) {\n ngDevMode &&\n console.error('Provided value for `preserveWhitespaces` can not be changed once it has been set.');\n return;\n }\n }\n jitOptions = options;\n}\nfunction getJitOptions() {\n return jitOptions;\n}\nfunction resetJitOptions() {\n jitOptions = null;\n}\n\nfunction patchModuleCompilation() {\n // Does nothing, but exists as a target for patching.\n}\n\nconst moduleQueue = [];\n/**\n * Enqueues moduleDef to be checked later to see if scope can be set on its\n * component declarations.\n */\nfunction enqueueModuleForDelayedScoping(moduleType, ngModule) {\n moduleQueue.push({ moduleType, ngModule });\n}\nlet flushingModuleQueue = false;\n/**\n * Loops over queued module definitions, if a given module definition has all of its\n * declarations resolved, it dequeues that module definition and sets the scope on\n * its declarations.\n */\nfunction flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (let i = moduleQueue.length - 1; i >= 0; i--) {\n const { moduleType, ngModule } = moduleQueue[i];\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n }\n finally {\n flushingModuleQueue = false;\n }\n }\n}\n/**\n * Returns truthy if a declaration has resolved. If the declaration happens to be\n * an array of declarations, it will recurse to check each declaration in that array\n * (which may also be arrays).\n */\nfunction isResolvedDeclaration(declaration) {\n if (Array.isArray(declaration)) {\n return declaration.every(isResolvedDeclaration);\n }\n return !!resolveForwardRef(declaration);\n}\n/**\n * Compiles a module in JIT mode.\n *\n * This function automatically gets called when a class has a `@NgModule` decorator.\n */\nfunction compileNgModule(moduleType, ngModule = {}) {\n patchModuleCompilation();\n compileNgModuleDefs(moduleType, ngModule);\n if (ngModule.id !== undefined) {\n registerNgModuleType(moduleType, ngModule.id);\n }\n // Because we don't know if all declarations have resolved yet at the moment the\n // NgModule decorator is executing, we're enqueueing the setting of module scope\n // on its declarations to be run at a later time when all declarations for the module,\n // including forward refs, have resolved.\n enqueueModuleForDelayedScoping(moduleType, ngModule);\n}\n/**\n * Compiles and adds the `ɵmod`, `ɵfac` and `ɵinj` properties to the module class.\n *\n * It's possible to compile a module via this API which will allow duplicate declarations in its\n * root.\n */\nfunction compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInRoot = false) {\n ngDevMode && assertDefined(moduleType, 'Required value moduleType');\n ngDevMode && assertDefined(ngModule, 'Required value ngModule');\n const declarations = flatten(ngModule.declarations || EMPTY_ARRAY);\n let ngModuleDef = null;\n Object.defineProperty(moduleType, NG_MOD_DEF, {\n configurable: true,\n get: () => {\n if (ngModuleDef === null) {\n if (ngDevMode && ngModule.imports && ngModule.imports.indexOf(moduleType) > -1) {\n // We need to assert this immediately, because allowing it to continue will cause it to\n // go into an infinite loop before we've reached the point where we throw all the errors.\n throw new Error(`'${stringifyForError(moduleType)}' module can't import itself`);\n }\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'NgModule',\n type: moduleType,\n });\n ngModuleDef = compiler.compileNgModule(angularCoreEnv, `ng:///${moduleType.name}/ɵmod.js`, {\n type: moduleType,\n bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY).map(resolveForwardRef),\n declarations: declarations.map(resolveForwardRef),\n imports: flatten(ngModule.imports || EMPTY_ARRAY)\n .map(resolveForwardRef)\n .map(expandModuleWithProviders),\n exports: flatten(ngModule.exports || EMPTY_ARRAY)\n .map(resolveForwardRef)\n .map(expandModuleWithProviders),\n schemas: ngModule.schemas ? flatten(ngModule.schemas) : null,\n id: ngModule.id || null,\n });\n // Set `schemas` on ngModuleDef to an empty array in JIT mode to indicate that runtime\n // should verify that there are no unknown elements in a template. In AOT mode, that check\n // happens at compile time and `schemas` information is not present on Component and Module\n // defs after compilation (so the check doesn't happen the second time at runtime).\n if (!ngModuleDef.schemas) {\n ngModuleDef.schemas = [];\n }\n }\n return ngModuleDef;\n },\n });\n let ngFactoryDef = null;\n Object.defineProperty(moduleType, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'NgModule',\n type: moduleType,\n });\n ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${moduleType.name}/ɵfac.js`, {\n name: moduleType.name,\n type: moduleType,\n deps: reflectDependencies(moduleType),\n target: compiler.FactoryTarget.NgModule,\n typeArgumentCount: 0,\n });\n }\n return ngFactoryDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n let ngInjectorDef = null;\n Object.defineProperty(moduleType, NG_INJ_DEF, {\n get: () => {\n if (ngInjectorDef === null) {\n ngDevMode && verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot);\n const meta = {\n name: moduleType.name,\n type: moduleType,\n providers: ngModule.providers || EMPTY_ARRAY,\n imports: [\n (ngModule.imports || EMPTY_ARRAY).map(resolveForwardRef),\n (ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef),\n ],\n };\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'NgModule',\n type: moduleType,\n });\n ngInjectorDef = compiler.compileInjector(angularCoreEnv, `ng:///${moduleType.name}/ɵinj.js`, meta);\n }\n return ngInjectorDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\nfunction generateStandaloneInDeclarationsError(type, location) {\n const prefix = `Unexpected \"${stringifyForError(type)}\" found in the \"declarations\" array of the`;\n const suffix = `\"${stringifyForError(type)}\" is marked as standalone and can't be declared ` +\n 'in any NgModule - did you intend to import it instead (by adding it to the \"imports\" array)?';\n return `${prefix} ${location}, ${suffix}`;\n}\nfunction verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot, importingModule) {\n if (verifiedNgModule.get(moduleType))\n return;\n // skip verifications of standalone components, directives, and pipes\n if (isStandalone(moduleType))\n return;\n verifiedNgModule.set(moduleType, true);\n moduleType = resolveForwardRef(moduleType);\n let ngModuleDef;\n if (importingModule) {\n ngModuleDef = getNgModuleDef(moduleType);\n if (!ngModuleDef) {\n throw new Error(`Unexpected value '${moduleType.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);\n }\n }\n else {\n ngModuleDef = getNgModuleDef(moduleType, true);\n }\n const errors = [];\n const declarations = maybeUnwrapFn(ngModuleDef.declarations);\n const imports = maybeUnwrapFn(ngModuleDef.imports);\n flatten(imports)\n .map(unwrapModuleWithProvidersImports)\n .forEach((modOrStandaloneCmpt) => {\n verifySemanticsOfNgModuleImport(modOrStandaloneCmpt, moduleType);\n verifySemanticsOfNgModuleDef(modOrStandaloneCmpt, false, moduleType);\n });\n const exports = maybeUnwrapFn(ngModuleDef.exports);\n declarations.forEach(verifyDeclarationsHaveDefinitions);\n declarations.forEach(verifyDirectivesHaveSelector);\n declarations.forEach((declarationType) => verifyNotStandalone(declarationType, moduleType));\n const combinedDeclarations = [\n ...declarations.map(resolveForwardRef),\n ...flatten(imports.map(computeCombinedExports)).map(resolveForwardRef),\n ];\n exports.forEach(verifyExportsAreDeclaredOrReExported);\n declarations.forEach((decl) => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot));\n const ngModule = getAnnotation(moduleType, 'NgModule');\n if (ngModule) {\n ngModule.imports &&\n flatten(ngModule.imports)\n .map(unwrapModuleWithProvidersImports)\n .forEach((mod) => {\n verifySemanticsOfNgModuleImport(mod, moduleType);\n verifySemanticsOfNgModuleDef(mod, false, moduleType);\n });\n ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyCorrectBootstrapType);\n ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyComponentIsPartOfNgModule);\n }\n // Throw Error if any errors were detected.\n if (errors.length) {\n throw new Error(errors.join('\\n'));\n }\n ////////////////////////////////////////////////////////////////////////////////////////////////\n function verifyDeclarationsHaveDefinitions(type) {\n type = resolveForwardRef(type);\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);\n if (!def) {\n errors.push(`Unexpected value '${stringifyForError(type)}' declared by the module '${stringifyForError(moduleType)}'. Please add a @Pipe/@Directive/@Component annotation.`);\n }\n }\n function verifyDirectivesHaveSelector(type) {\n type = resolveForwardRef(type);\n const def = getDirectiveDef(type);\n if (!getComponentDef(type) && def && def.selectors.length == 0) {\n errors.push(`Directive ${stringifyForError(type)} has no selector, please add it!`);\n }\n }\n function verifyNotStandalone(type, moduleType) {\n type = resolveForwardRef(type);\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);\n if (def?.standalone) {\n const location = `\"${stringifyForError(moduleType)}\" NgModule`;\n errors.push(generateStandaloneInDeclarationsError(type, location));\n }\n }\n function verifyExportsAreDeclaredOrReExported(type) {\n type = resolveForwardRef(type);\n const kind = (getComponentDef(type) && 'component') ||\n (getDirectiveDef(type) && 'directive') ||\n (getPipeDef$1(type) && 'pipe');\n if (kind) {\n // only checked if we are declared as Component, Directive, or Pipe\n // Modules don't need to be declared or imported.\n if (combinedDeclarations.lastIndexOf(type) === -1) {\n // We are exporting something which we don't explicitly declare or import.\n errors.push(`Can't export ${kind} ${stringifyForError(type)} from ${stringifyForError(moduleType)} as it was neither declared nor imported!`);\n }\n }\n }\n function verifyDeclarationIsUnique(type, suppressErrors) {\n type = resolveForwardRef(type);\n const existingModule = ownerNgModule.get(type);\n if (existingModule && existingModule !== moduleType) {\n if (!suppressErrors) {\n const modules = [existingModule, moduleType].map(stringifyForError).sort();\n errors.push(`Type ${stringifyForError(type)} is part of the declarations of 2 modules: ${modules[0]} and ${modules[1]}! ` +\n `Please consider moving ${stringifyForError(type)} to a higher module that imports ${modules[0]} and ${modules[1]}. ` +\n `You can also create a new NgModule that exports and includes ${stringifyForError(type)} then import that NgModule in ${modules[0]} and ${modules[1]}.`);\n }\n }\n else {\n // Mark type as having owner.\n ownerNgModule.set(type, moduleType);\n }\n }\n function verifyComponentIsPartOfNgModule(type) {\n type = resolveForwardRef(type);\n const existingModule = ownerNgModule.get(type);\n if (!existingModule && !isStandalone(type)) {\n errors.push(`Component ${stringifyForError(type)} is not part of any NgModule or the module has not been imported into your module.`);\n }\n }\n function verifyCorrectBootstrapType(type) {\n type = resolveForwardRef(type);\n if (!getComponentDef(type)) {\n errors.push(`${stringifyForError(type)} cannot be used as an entry component.`);\n }\n if (isStandalone(type)) {\n // Note: this error should be the same as the\n // `NGMODULE_BOOTSTRAP_IS_STANDALONE` one in AOT compiler.\n errors.push(`The \\`${stringifyForError(type)}\\` class is a standalone component, which can ` +\n `not be used in the \\`@NgModule.bootstrap\\` array. Use the \\`bootstrapApplication\\` ` +\n `function for bootstrap instead.`);\n }\n }\n function verifySemanticsOfNgModuleImport(type, importingModule) {\n type = resolveForwardRef(type);\n const directiveDef = getComponentDef(type) || getDirectiveDef(type);\n if (directiveDef !== null && !directiveDef.standalone) {\n throw new Error(`Unexpected directive '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);\n }\n const pipeDef = getPipeDef$1(type);\n if (pipeDef !== null && !pipeDef.standalone) {\n throw new Error(`Unexpected pipe '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);\n }\n }\n}\nfunction unwrapModuleWithProvidersImports(typeOrWithProviders) {\n typeOrWithProviders = resolveForwardRef(typeOrWithProviders);\n return typeOrWithProviders.ngModule || typeOrWithProviders;\n}\nfunction getAnnotation(type, name) {\n let annotation = null;\n collect(type.__annotations__);\n collect(type.decorators);\n return annotation;\n function collect(annotations) {\n if (annotations) {\n annotations.forEach(readAnnotation);\n }\n }\n function readAnnotation(decorator) {\n if (!annotation) {\n const proto = Object.getPrototypeOf(decorator);\n if (proto.ngMetadataName == name) {\n annotation = decorator;\n }\n else if (decorator.type) {\n const proto = Object.getPrototypeOf(decorator.type);\n if (proto.ngMetadataName == name) {\n annotation = decorator.args[0];\n }\n }\n }\n }\n}\n/**\n * Keep track of compiled components. This is needed because in tests we often want to compile the\n * same component with more than one NgModule. This would cause an error unless we reset which\n * NgModule the component belongs to. We keep the list of compiled components here so that the\n * TestBed can reset it later.\n */\nlet ownerNgModule = new WeakMap();\nlet verifiedNgModule = new WeakMap();\nfunction resetCompiledComponents() {\n ownerNgModule = new WeakMap();\n verifiedNgModule = new WeakMap();\n moduleQueue.length = 0;\n GENERATED_COMP_IDS.clear();\n}\n/**\n * Computes the combined declarations of explicit declarations, as well as declarations inherited by\n * traversing the exports of imported modules.\n * @param type\n */\nfunction computeCombinedExports(type) {\n type = resolveForwardRef(type);\n const ngModuleDef = getNgModuleDef(type);\n // a standalone component, directive or pipe\n if (ngModuleDef === null) {\n return [type];\n }\n return flatten(maybeUnwrapFn(ngModuleDef.exports).map((type) => {\n const ngModuleDef = getNgModuleDef(type);\n if (ngModuleDef) {\n verifySemanticsOfNgModuleDef(type, false);\n return computeCombinedExports(type);\n }\n else {\n return type;\n }\n }));\n}\n/**\n * Some declared components may be compiled asynchronously, and thus may not have their\n * ɵcmp set yet. If this is the case, then a reference to the module is written into\n * the `ngSelectorScope` property of the declared type.\n */\nfunction setScopeOnDeclaredComponents(moduleType, ngModule) {\n const declarations = flatten(ngModule.declarations || EMPTY_ARRAY);\n const transitiveScopes = transitiveScopesFor(moduleType);\n declarations.forEach((declaration) => {\n declaration = resolveForwardRef(declaration);\n if (declaration.hasOwnProperty(NG_COMP_DEF)) {\n // A `ɵcmp` field exists - go ahead and patch the component directly.\n const component = declaration;\n const componentDef = getComponentDef(component);\n patchComponentDefWithScope(componentDef, transitiveScopes);\n }\n else if (!declaration.hasOwnProperty(NG_DIR_DEF) &&\n !declaration.hasOwnProperty(NG_PIPE_DEF)) {\n // Set `ngSelectorScope` for future reference when the component compilation finishes.\n declaration.ngSelectorScope = moduleType;\n }\n });\n}\n/**\n * Patch the definition of a component with directives and pipes from the compilation scope of\n * a given module.\n */\nfunction patchComponentDefWithScope(componentDef, transitiveScopes) {\n componentDef.directiveDefs = () => Array.from(transitiveScopes.compilation.directives)\n .map((dir) => dir.hasOwnProperty(NG_COMP_DEF) ? getComponentDef(dir) : getDirectiveDef(dir))\n .filter((def) => !!def);\n componentDef.pipeDefs = () => Array.from(transitiveScopes.compilation.pipes).map((pipe) => getPipeDef$1(pipe));\n componentDef.schemas = transitiveScopes.schemas;\n // Since we avoid Components/Directives/Pipes recompiling in case there are no overrides, we\n // may face a problem where previously compiled defs available to a given Component/Directive\n // are cached in TView and may become stale (in case any of these defs gets recompiled). In\n // order to avoid this problem, we force fresh TView to be created.\n componentDef.tView = null;\n}\n/**\n * Compute the pair of transitive scopes (compilation scope and exported scope) for a given type\n * (either a NgModule or a standalone component / directive / pipe).\n */\nfunction transitiveScopesFor(type) {\n if (isNgModule(type)) {\n if (USE_RUNTIME_DEPS_TRACKER_FOR_JIT) {\n const scope = depsTracker.getNgModuleScope(type);\n const def = getNgModuleDef(type, true);\n return {\n schemas: def.schemas || null,\n ...scope,\n };\n }\n else {\n return transitiveScopesForNgModule(type);\n }\n }\n else if (isStandalone(type)) {\n const directiveDef = getComponentDef(type) || getDirectiveDef(type);\n if (directiveDef !== null) {\n return {\n schemas: null,\n compilation: {\n directives: new Set(),\n pipes: new Set(),\n },\n exported: {\n directives: new Set([type]),\n pipes: new Set(),\n },\n };\n }\n const pipeDef = getPipeDef$1(type);\n if (pipeDef !== null) {\n return {\n schemas: null,\n compilation: {\n directives: new Set(),\n pipes: new Set(),\n },\n exported: {\n directives: new Set(),\n pipes: new Set([type]),\n },\n };\n }\n }\n // TODO: change the error message to be more user-facing and take standalone into account\n throw new Error(`${type.name} does not have a module def (ɵmod property)`);\n}\n/**\n * Compute the pair of transitive scopes (compilation scope and exported scope) for a given module.\n *\n * This operation is memoized and the result is cached on the module's definition. This function can\n * be called on modules with components that have not fully compiled yet, but the result should not\n * be used until they have.\n *\n * @param moduleType module that transitive scope should be calculated for.\n */\nfunction transitiveScopesForNgModule(moduleType) {\n const def = getNgModuleDef(moduleType, true);\n if (def.transitiveCompileScopes !== null) {\n return def.transitiveCompileScopes;\n }\n const scopes = {\n schemas: def.schemas || null,\n compilation: {\n directives: new Set(),\n pipes: new Set(),\n },\n exported: {\n directives: new Set(),\n pipes: new Set(),\n },\n };\n maybeUnwrapFn(def.imports).forEach((imported) => {\n // When this module imports another, the imported module's exported directives and pipes are\n // added to the compilation scope of this module.\n const importedScope = transitiveScopesFor(imported);\n importedScope.exported.directives.forEach((entry) => scopes.compilation.directives.add(entry));\n importedScope.exported.pipes.forEach((entry) => scopes.compilation.pipes.add(entry));\n });\n maybeUnwrapFn(def.declarations).forEach((declared) => {\n const declaredWithDefs = declared;\n if (getPipeDef$1(declaredWithDefs)) {\n scopes.compilation.pipes.add(declared);\n }\n else {\n // Either declared has a ɵcmp or ɵdir, or it's a component which hasn't\n // had its template compiled yet. In either case, it gets added to the compilation's\n // directives.\n scopes.compilation.directives.add(declared);\n }\n });\n maybeUnwrapFn(def.exports).forEach((exported) => {\n const exportedType = exported;\n // Either the type is a module, a pipe, or a component/directive (which may not have a\n // ɵcmp as it might be compiled asynchronously).\n if (isNgModule(exportedType)) {\n // When this module exports another, the exported module's exported directives and pipes are\n // added to both the compilation and exported scopes of this module.\n const exportedScope = transitiveScopesFor(exportedType);\n exportedScope.exported.directives.forEach((entry) => {\n scopes.compilation.directives.add(entry);\n scopes.exported.directives.add(entry);\n });\n exportedScope.exported.pipes.forEach((entry) => {\n scopes.compilation.pipes.add(entry);\n scopes.exported.pipes.add(entry);\n });\n }\n else if (getPipeDef$1(exportedType)) {\n scopes.exported.pipes.add(exportedType);\n }\n else {\n scopes.exported.directives.add(exportedType);\n }\n });\n def.transitiveCompileScopes = scopes;\n return scopes;\n}\nfunction expandModuleWithProviders(value) {\n if (isModuleWithProviders(value)) {\n return value.ngModule;\n }\n return value;\n}\n\n/**\n * Keep track of the compilation depth to avoid reentrancy issues during JIT compilation. This\n * matters in the following scenario:\n *\n * Consider a component 'A' that extends component 'B', both declared in module 'M'. During\n * the compilation of 'A' the definition of 'B' is requested to capture the inheritance chain,\n * potentially triggering compilation of 'B'. If this nested compilation were to trigger\n * `flushModuleScopingQueueAsMuchAsPossible` it may happen that module 'M' is still pending in the\n * queue, resulting in 'A' and 'B' to be patched with the NgModule scope. As the compilation of\n * 'A' is still in progress, this would introduce a circular dependency on its compilation. To avoid\n * this issue, the module scope queue is only flushed for compilations at the depth 0, to ensure\n * all compilations have finished.\n */\nlet compilationDepth = 0;\n/**\n * Compile an Angular component according to its decorator metadata, and patch the resulting\n * component def (ɵcmp) onto the component type.\n *\n * Compilation may be asynchronous (due to the need to resolve URLs for the component template or\n * other resources, for example). In the event that compilation is not immediate, `compileComponent`\n * will enqueue resource resolution into a global queue and will fail to return the `ɵcmp`\n * until the global queue has been resolved with a call to `resolveComponentResources`.\n */\nfunction compileComponent(type, metadata) {\n // Initialize ngDevMode. This must be the first statement in compileComponent.\n // See the `initNgDevMode` docstring for more information.\n (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();\n let ngComponentDef = null;\n // Metadata may have resources which need to be resolved.\n maybeQueueResolutionOfComponentResources(type, metadata);\n // Note that we're using the same function as `Directive`, because that's only subset of metadata\n // that we need to create the ngFactoryDef. We're avoiding using the component metadata\n // because we'd have to resolve the asynchronous templates.\n addDirectiveFactoryDef(type, metadata);\n Object.defineProperty(type, NG_COMP_DEF, {\n get: () => {\n if (ngComponentDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'component',\n type: type,\n });\n if (componentNeedsResolution(metadata)) {\n const error = [`Component '${type.name}' is not resolved:`];\n if (metadata.templateUrl) {\n error.push(` - templateUrl: ${metadata.templateUrl}`);\n }\n if (metadata.styleUrls && metadata.styleUrls.length) {\n error.push(` - styleUrls: ${JSON.stringify(metadata.styleUrls)}`);\n }\n if (metadata.styleUrl) {\n error.push(` - styleUrl: ${metadata.styleUrl}`);\n }\n error.push(`Did you run and wait for 'resolveComponentResources()'?`);\n throw new Error(error.join('\\n'));\n }\n // This const was called `jitOptions` previously but had to be renamed to `options` because\n // of a bug with Terser that caused optimized JIT builds to throw a `ReferenceError`.\n // This bug was investigated in https://github.com/angular/angular-cli/issues/17264.\n // We should not rename it back until https://github.com/terser/terser/issues/615 is fixed.\n const options = getJitOptions();\n let preserveWhitespaces = metadata.preserveWhitespaces;\n if (preserveWhitespaces === undefined) {\n if (options !== null && options.preserveWhitespaces !== undefined) {\n preserveWhitespaces = options.preserveWhitespaces;\n }\n else {\n preserveWhitespaces = false;\n }\n }\n let encapsulation = metadata.encapsulation;\n if (encapsulation === undefined) {\n if (options !== null && options.defaultEncapsulation !== undefined) {\n encapsulation = options.defaultEncapsulation;\n }\n else {\n encapsulation = ViewEncapsulation$1.Emulated;\n }\n }\n const templateUrl = metadata.templateUrl || `ng:///${type.name}/template.html`;\n const meta = {\n ...directiveMetadata(type, metadata),\n typeSourceSpan: compiler.createParseSourceSpan('Component', type.name, templateUrl),\n template: metadata.template || '',\n preserveWhitespaces,\n styles: typeof metadata.styles === 'string'\n ? [metadata.styles]\n : metadata.styles || EMPTY_ARRAY,\n animations: metadata.animations,\n // JIT components are always compiled against an empty set of `declarations`. Instead, the\n // `directiveDefs` and `pipeDefs` are updated at a later point:\n // * for NgModule-based components, they're set when the NgModule which declares the\n // component resolves in the module scoping queue\n // * for standalone components, they're set just below, after `compileComponent`.\n declarations: [],\n changeDetection: metadata.changeDetection,\n encapsulation,\n interpolation: metadata.interpolation,\n viewProviders: metadata.viewProviders || null,\n };\n compilationDepth++;\n try {\n if (meta.usesInheritance) {\n addDirectiveDefToUndecoratedParents(type);\n }\n ngComponentDef = compiler.compileComponent(angularCoreEnv, templateUrl, meta);\n if (metadata.standalone) {\n // Patch the component definition for standalone components with `directiveDefs` and\n // `pipeDefs` functions which lazily compute the directives/pipes available in the\n // standalone component. Also set `dependencies` to the lazily resolved list of imports.\n const imports = flatten(metadata.imports || EMPTY_ARRAY);\n const { directiveDefs, pipeDefs } = getStandaloneDefFunctions(type, imports);\n ngComponentDef.directiveDefs = directiveDefs;\n ngComponentDef.pipeDefs = pipeDefs;\n ngComponentDef.dependencies = () => imports.map(resolveForwardRef);\n }\n }\n finally {\n // Ensure that the compilation depth is decremented even when the compilation failed.\n compilationDepth--;\n }\n if (compilationDepth === 0) {\n // When NgModule decorator executed, we enqueued the module definition such that\n // it would only dequeue and add itself as module scope to all of its declarations,\n // but only if if all of its declarations had resolved. This call runs the check\n // to see if any modules that are in the queue can be dequeued and add scope to\n // their declarations.\n flushModuleScopingQueueAsMuchAsPossible();\n }\n // If component compilation is async, then the @NgModule annotation which declares the\n // component may execute and set an ngSelectorScope property on the component type. This\n // allows the component to patch itself with directiveDefs from the module after it\n // finishes compiling.\n if (hasSelectorScope(type)) {\n const scopes = transitiveScopesFor(type.ngSelectorScope);\n patchComponentDefWithScope(ngComponentDef, scopes);\n }\n if (metadata.schemas) {\n if (metadata.standalone) {\n ngComponentDef.schemas = metadata.schemas;\n }\n else {\n throw new Error(`The 'schemas' was specified for the ${stringifyForError(type)} but is only valid on a component that is standalone.`);\n }\n }\n else if (metadata.standalone) {\n ngComponentDef.schemas = [];\n }\n }\n return ngComponentDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\n/**\n * Build memoized `directiveDefs` and `pipeDefs` functions for the component definition of a\n * standalone component, which process `imports` and filter out directives and pipes. The use of\n * memoized functions here allows for the delayed resolution of any `forwardRef`s present in the\n * component's `imports`.\n */\nfunction getStandaloneDefFunctions(type, imports) {\n let cachedDirectiveDefs = null;\n let cachedPipeDefs = null;\n const directiveDefs = () => {\n if (!USE_RUNTIME_DEPS_TRACKER_FOR_JIT) {\n if (cachedDirectiveDefs === null) {\n // Standalone components are always able to self-reference, so include the component's own\n // definition in its `directiveDefs`.\n cachedDirectiveDefs = [getComponentDef(type)];\n const seen = new Set([type]);\n for (const rawDep of imports) {\n ngDevMode && verifyStandaloneImport(rawDep, type);\n const dep = resolveForwardRef(rawDep);\n if (seen.has(dep)) {\n continue;\n }\n seen.add(dep);\n if (!!getNgModuleDef(dep)) {\n const scope = transitiveScopesFor(dep);\n for (const dir of scope.exported.directives) {\n const def = getComponentDef(dir) || getDirectiveDef(dir);\n if (def && !seen.has(dir)) {\n seen.add(dir);\n cachedDirectiveDefs.push(def);\n }\n }\n }\n else {\n const def = getComponentDef(dep) || getDirectiveDef(dep);\n if (def) {\n cachedDirectiveDefs.push(def);\n }\n }\n }\n }\n return cachedDirectiveDefs;\n }\n else {\n if (ngDevMode) {\n for (const rawDep of imports) {\n verifyStandaloneImport(rawDep, type);\n }\n }\n if (!isComponent(type)) {\n return [];\n }\n const scope = depsTracker.getStandaloneComponentScope(type, imports);\n return [...scope.compilation.directives]\n .map((p) => (getComponentDef(p) || getDirectiveDef(p)))\n .filter((d) => d !== null);\n }\n };\n const pipeDefs = () => {\n if (!USE_RUNTIME_DEPS_TRACKER_FOR_JIT) {\n if (cachedPipeDefs === null) {\n cachedPipeDefs = [];\n const seen = new Set();\n for (const rawDep of imports) {\n const dep = resolveForwardRef(rawDep);\n if (seen.has(dep)) {\n continue;\n }\n seen.add(dep);\n if (!!getNgModuleDef(dep)) {\n const scope = transitiveScopesFor(dep);\n for (const pipe of scope.exported.pipes) {\n const def = getPipeDef$1(pipe);\n if (def && !seen.has(pipe)) {\n seen.add(pipe);\n cachedPipeDefs.push(def);\n }\n }\n }\n else {\n const def = getPipeDef$1(dep);\n if (def) {\n cachedPipeDefs.push(def);\n }\n }\n }\n }\n return cachedPipeDefs;\n }\n else {\n if (ngDevMode) {\n for (const rawDep of imports) {\n verifyStandaloneImport(rawDep, type);\n }\n }\n if (!isComponent(type)) {\n return [];\n }\n const scope = depsTracker.getStandaloneComponentScope(type, imports);\n return [...scope.compilation.pipes].map((p) => getPipeDef$1(p)).filter((d) => d !== null);\n }\n };\n return {\n directiveDefs,\n pipeDefs,\n };\n}\nfunction hasSelectorScope(component) {\n return component.ngSelectorScope !== undefined;\n}\n/**\n * Compile an Angular directive according to its decorator metadata, and patch the resulting\n * directive def onto the component type.\n *\n * In the event that compilation is not immediate, `compileDirective` will return a `Promise` which\n * will resolve when compilation completes and the directive becomes usable.\n */\nfunction compileDirective(type, directive) {\n let ngDirectiveDef = null;\n addDirectiveFactoryDef(type, directive || {});\n Object.defineProperty(type, NG_DIR_DEF, {\n get: () => {\n if (ngDirectiveDef === null) {\n // `directive` can be null in the case of abstract directives as a base class\n // that use `@Directive()` with no selector. In that case, pass empty object to the\n // `directiveMetadata` function instead of null.\n const meta = getDirectiveMetadata(type, directive || {});\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'directive',\n type,\n });\n ngDirectiveDef = compiler.compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata);\n }\n return ngDirectiveDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\nfunction getDirectiveMetadata(type, metadata) {\n const name = type && type.name;\n const sourceMapUrl = `ng:///${name}/ɵdir.js`;\n const compiler = getCompilerFacade({ usage: 0 /* JitCompilerUsage.Decorator */, kind: 'directive', type });\n const facade = directiveMetadata(type, metadata);\n facade.typeSourceSpan = compiler.createParseSourceSpan('Directive', name, sourceMapUrl);\n if (facade.usesInheritance) {\n addDirectiveDefToUndecoratedParents(type);\n }\n return { metadata: facade, sourceMapUrl };\n}\nfunction addDirectiveFactoryDef(type, metadata) {\n let ngFactoryDef = null;\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const meta = getDirectiveMetadata(type, metadata);\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'directive',\n type,\n });\n ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${type.name}/ɵfac.js`, {\n name: meta.metadata.name,\n type: meta.metadata.type,\n typeArgumentCount: 0,\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Directive,\n });\n }\n return ngFactoryDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\nfunction extendsDirectlyFromObject(type) {\n return Object.getPrototypeOf(type.prototype) === Object.prototype;\n}\n/**\n * Extract the `R3DirectiveMetadata` for a particular directive (either a `Directive` or a\n * `Component`).\n */\nfunction directiveMetadata(type, metadata) {\n // Reflect inputs and outputs.\n const reflect = getReflect();\n const propMetadata = reflect.ownPropMetadata(type);\n return {\n name: type.name,\n type: type,\n selector: metadata.selector !== undefined ? metadata.selector : null,\n host: metadata.host || EMPTY_OBJ,\n propMetadata: propMetadata,\n inputs: metadata.inputs || EMPTY_ARRAY,\n outputs: metadata.outputs || EMPTY_ARRAY,\n queries: extractQueriesMetadata(type, propMetadata, isContentQuery),\n lifecycle: { usesOnChanges: reflect.hasLifecycleHook(type, 'ngOnChanges') },\n typeSourceSpan: null,\n usesInheritance: !extendsDirectlyFromObject(type),\n exportAs: extractExportAs(metadata.exportAs),\n providers: metadata.providers || null,\n viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery),\n isStandalone: !!metadata.standalone,\n isSignal: !!metadata.signals,\n hostDirectives: metadata.hostDirectives?.map((directive) => typeof directive === 'function' ? { directive } : directive) || null,\n };\n}\n/**\n * Adds a directive definition to all parent classes of a type that don't have an Angular decorator.\n */\nfunction addDirectiveDefToUndecoratedParents(type) {\n const objPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objPrototype) {\n // Since inheritance works if the class was annotated already, we only need to add\n // the def if there are no annotations and the def hasn't been created already.\n if (!getDirectiveDef(parent) &&\n !getComponentDef(parent) &&\n shouldAddAbstractDirective(parent)) {\n compileDirective(parent, null);\n }\n parent = Object.getPrototypeOf(parent);\n }\n}\nfunction convertToR3QueryPredicate(selector) {\n return typeof selector === 'string' ? splitByComma(selector) : resolveForwardRef(selector);\n}\nfunction convertToR3QueryMetadata(propertyName, ann) {\n return {\n propertyName: propertyName,\n predicate: convertToR3QueryPredicate(ann.selector),\n descendants: ann.descendants,\n first: ann.first,\n read: ann.read ? ann.read : null,\n static: !!ann.static,\n emitDistinctChangesOnly: !!ann.emitDistinctChangesOnly,\n isSignal: !!ann.isSignal,\n };\n}\nfunction extractQueriesMetadata(type, propMetadata, isQueryAnn) {\n const queriesMeta = [];\n for (const field in propMetadata) {\n if (propMetadata.hasOwnProperty(field)) {\n const annotations = propMetadata[field];\n annotations.forEach((ann) => {\n if (isQueryAnn(ann)) {\n if (!ann.selector) {\n throw new Error(`Can't construct a query for the property \"${field}\" of ` +\n `\"${stringifyForError(type)}\" since the query selector wasn't defined.`);\n }\n if (annotations.some(isInputAnnotation)) {\n throw new Error(`Cannot combine @Input decorators with query decorators`);\n }\n queriesMeta.push(convertToR3QueryMetadata(field, ann));\n }\n });\n }\n }\n return queriesMeta;\n}\nfunction extractExportAs(exportAs) {\n return exportAs === undefined ? null : splitByComma(exportAs);\n}\nfunction isContentQuery(value) {\n const name = value.ngMetadataName;\n return name === 'ContentChild' || name === 'ContentChildren';\n}\nfunction isViewQuery(value) {\n const name = value.ngMetadataName;\n return name === 'ViewChild' || name === 'ViewChildren';\n}\nfunction isInputAnnotation(value) {\n return value.ngMetadataName === 'Input';\n}\nfunction splitByComma(value) {\n return value.split(',').map((piece) => piece.trim());\n}\nconst LIFECYCLE_HOOKS = [\n 'ngOnChanges',\n 'ngOnInit',\n 'ngOnDestroy',\n 'ngDoCheck',\n 'ngAfterViewInit',\n 'ngAfterViewChecked',\n 'ngAfterContentInit',\n 'ngAfterContentChecked',\n];\nfunction shouldAddAbstractDirective(type) {\n const reflect = getReflect();\n if (LIFECYCLE_HOOKS.some((hookName) => reflect.hasLifecycleHook(type, hookName))) {\n return true;\n }\n const propMetadata = reflect.propMetadata(type);\n for (const field in propMetadata) {\n const annotations = propMetadata[field];\n for (let i = 0; i < annotations.length; i++) {\n const current = annotations[i];\n const metadataName = current.ngMetadataName;\n if (isInputAnnotation(current) ||\n isContentQuery(current) ||\n isViewQuery(current) ||\n metadataName === 'Output' ||\n metadataName === 'HostBinding' ||\n metadataName === 'HostListener') {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction compilePipe(type, meta) {\n let ngPipeDef = null;\n let ngFactoryDef = null;\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const metadata = getPipeMetadata(type, meta);\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'pipe',\n type: metadata.type,\n });\n ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${metadata.name}/ɵfac.js`, {\n name: metadata.name,\n type: metadata.type,\n typeArgumentCount: 0,\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Pipe,\n });\n }\n return ngFactoryDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n Object.defineProperty(type, NG_PIPE_DEF, {\n get: () => {\n if (ngPipeDef === null) {\n const metadata = getPipeMetadata(type, meta);\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'pipe',\n type: metadata.type,\n });\n ngPipeDef = compiler.compilePipe(angularCoreEnv, `ng:///${metadata.name}/ɵpipe.js`, metadata);\n }\n return ngPipeDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\nfunction getPipeMetadata(type, meta) {\n return {\n type: type,\n name: type.name,\n pipeName: meta.name,\n pure: meta.pure !== undefined ? meta.pure : true,\n isStandalone: !!meta.standalone,\n };\n}\n\n/**\n * Type of the Directive metadata.\n *\n * @publicApi\n */\nconst Directive = makeDecorator('Directive', (dir = {}) => dir, undefined, undefined, (type, meta) => compileDirective(type, meta));\n/**\n * Component decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Component = makeDecorator('Component', (c = {}) => ({ changeDetection: ChangeDetectionStrategy.Default, ...c }), Directive, undefined, (type, meta) => compileComponent(type, meta));\n/**\n * @Annotation\n * @publicApi\n */\nconst Pipe = makeDecorator('Pipe', (p) => ({ pure: true, ...p }), undefined, undefined, (type, meta) => compilePipe(type, meta));\n/**\n * @Annotation\n * @publicApi\n */\nconst Input = makePropDecorator('Input', (arg) => {\n if (!arg) {\n return {};\n }\n return typeof arg === 'string' ? { alias: arg } : arg;\n});\n/**\n * @Annotation\n * @publicApi\n */\nconst Output = makePropDecorator('Output', (alias) => ({ alias }));\n/**\n * @Annotation\n * @publicApi\n */\nconst HostBinding = makePropDecorator('HostBinding', (hostPropertyName) => ({ hostPropertyName }));\n/**\n * @Annotation\n * @publicApi\n */\nconst HostListener = makePropDecorator('HostListener', (eventName, args) => ({ eventName, args }));\n\n/**\n * @Annotation\n */\nconst NgModule = makeDecorator('NgModule', (ngModule) => ngModule, undefined, undefined, \n/**\n * Decorator that marks the following class as an NgModule, and supplies\n * configuration metadata for it.\n *\n * * The `declarations` option configures the compiler\n * with information about what belongs to the NgModule.\n * * The `providers` options configures the NgModule's injector to provide\n * dependencies the NgModule members.\n * * The `imports` and `exports` options bring in members from other modules, and make\n * this module's members available to others.\n */\n(type, meta) => compileNgModule(type, meta));\n\n/**\n * This indirection is needed to free up Component, etc symbols in the public API\n * to be used by the decorator versions of these annotations.\n */\n\n/**\n * @description Represents the version of Angular\n *\n * @publicApi\n */\nclass Version {\n constructor(full) {\n this.full = full;\n const parts = full.split('.');\n this.major = parts[0];\n this.minor = parts[1];\n this.patch = parts.slice(2).join('.');\n }\n}\n/**\n * @publicApi\n */\nconst VERSION = new Version('18.2.10');\n\n/*\n * This file exists to support compilation of @angular/core in Ivy mode.\n *\n * When the Angular compiler processes a compilation unit, it normally writes imports to\n * @angular/core. When compiling the core package itself this strategy isn't usable. Instead, the\n * compiler writes imports to this file.\n *\n * Only a subset of such imports are supported - core is not allowed to declare components or pipes.\n * A check in ngtsc's `R3SymbolsImportRewriter` validates this condition. The rewriter is only used\n * when compiling @angular/core and is responsible for translating an external name (prefixed with\n * ɵ) to the internal symbol name as exported below.\n *\n * The below symbols are used for @Injectable and @NgModule compilation.\n */\n/**\n * The existence of this constant (in this particular file) informs the Angular compiler that the\n * current program is actually @angular/core, which needs to be compiled specially.\n */\nconst ITS_JUST_ANGULAR = true;\n\nclass Console {\n log(message) {\n // tslint:disable-next-line:no-console\n console.log(message);\n }\n // Note: for reporting errors use `DOM.logError()` as it is platform specific\n warn(message) {\n // tslint:disable-next-line:no-console\n console.warn(message);\n }\n static { this.ɵfac = function Console_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Console)(); }; }\n static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Console, factory: Console.ɵfac, providedIn: 'platform' }); }\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(Console, [{\n type: Injectable,\n args: [{ providedIn: 'platform' }]\n }], null, null); })();\n\n/**\n * These are the data structures that our framework injector profiler will fill with data in order\n * to support DI debugging APIs.\n *\n * resolverToTokenToDependencies: Maps an injector to a Map of tokens to an Array of\n * dependencies. Injector -> Token -> Dependencies This is used to support the\n * getDependenciesFromInjectable API, which takes in an injector and a token and returns it's\n * dependencies.\n *\n * resolverToProviders: Maps a DI resolver (an Injector or a TNode) to the providers configured\n * within it This is used to support the getInjectorProviders API, which takes in an injector and\n * returns the providers that it was configured with. Note that for the element injector case we\n * use the TNode instead of the LView as the DI resolver. This is because the registration of\n * providers happens only once per type of TNode. If an injector is created with an identical TNode,\n * the providers for that injector will not be reconfigured.\n *\n * standaloneInjectorToComponent: Maps the injector of a standalone component to the standalone\n * component that it is associated with. Used in the getInjectorProviders API, specificially in the\n * discovery of import paths for each provider. This is necessary because the imports array of a\n * standalone component is processed and configured in its standalone injector, but exists within\n * the component's definition. Because getInjectorProviders takes in an injector, if that injector\n * is the injector of a standalone component, we need to be able to discover the place where the\n * imports array is located (the component) in order to flatten the imports array within it to\n * discover all of it's providers.\n *\n *\n * All of these data structures are instantiated with WeakMaps. This will ensure that the presence\n * of any object in the keys of these maps does not prevent the garbage collector from collecting\n * those objects. Because of this property of WeakMaps, these data structures will never be the\n * source of a memory leak.\n *\n * An example of this advantage: When components are destroyed, we don't need to do\n * any additional work to remove that component from our mappings.\n *\n */\nclass DIDebugData {\n constructor() {\n this.resolverToTokenToDependencies = new WeakMap();\n this.resolverToProviders = new WeakMap();\n this.standaloneInjectorToComponent = new WeakMap();\n }\n reset() {\n this.resolverToTokenToDependencies = new WeakMap();\n this.resolverToProviders = new WeakMap();\n this.standaloneInjectorToComponent = new WeakMap();\n }\n}\nlet frameworkDIDebugData = new DIDebugData();\nfunction getFrameworkDIDebugData() {\n return frameworkDIDebugData;\n}\n/**\n * Initalize default handling of injector events. This handling parses events\n * as they are emitted and constructs the data structures necessary to support\n * some of debug APIs.\n *\n * See handleInjectEvent, handleCreateEvent and handleProviderConfiguredEvent\n * for descriptions of each handler\n *\n * Supported APIs:\n * - getDependenciesFromInjectable\n * - getInjectorProviders\n */\nfunction setupFrameworkInjectorProfiler() {\n frameworkDIDebugData.reset();\n setInjectorProfiler((injectorProfilerEvent) => handleInjectorProfilerEvent(injectorProfilerEvent));\n}\nfunction handleInjectorProfilerEvent(injectorProfilerEvent) {\n const { context, type } = injectorProfilerEvent;\n if (type === 0 /* InjectorProfilerEventType.Inject */) {\n handleInjectEvent(context, injectorProfilerEvent.service);\n }\n else if (type === 1 /* InjectorProfilerEventType.InstanceCreatedByInjector */) {\n handleInstanceCreatedByInjectorEvent(context, injectorProfilerEvent.instance);\n }\n else if (type === 2 /* InjectorProfilerEventType.ProviderConfigured */) {\n handleProviderConfiguredEvent(context, injectorProfilerEvent.providerRecord);\n }\n}\n/**\n *\n * Stores the injected service in frameworkDIDebugData.resolverToTokenToDependencies\n * based on it's injector and token.\n *\n * @param context InjectorProfilerContext the injection context that this event occurred in.\n * @param data InjectedService the service associated with this inject event.\n *\n */\nfunction handleInjectEvent(context, data) {\n const diResolver = getDIResolver(context.injector);\n if (diResolver === null) {\n throwError('An Inject event must be run within an injection context.');\n }\n const diResolverToInstantiatedToken = frameworkDIDebugData.resolverToTokenToDependencies;\n if (!diResolverToInstantiatedToken.has(diResolver)) {\n diResolverToInstantiatedToken.set(diResolver, new WeakMap());\n }\n // if token is a primitive type, ignore this event. We do this because we cannot keep track of\n // non-primitive tokens in WeakMaps since they are not garbage collectable.\n if (!canBeHeldWeakly(context.token)) {\n return;\n }\n const instantiatedTokenToDependencies = diResolverToInstantiatedToken.get(diResolver);\n if (!instantiatedTokenToDependencies.has(context.token)) {\n instantiatedTokenToDependencies.set(context.token, []);\n }\n const { token, value, flags } = data;\n assertDefined(context.token, 'Injector profiler context token is undefined.');\n const dependencies = instantiatedTokenToDependencies.get(context.token);\n assertDefined(dependencies, 'Could not resolve dependencies for token.');\n if (context.injector instanceof NodeInjector) {\n dependencies.push({ token, value, flags, injectedIn: getNodeInjectorContext(context.injector) });\n }\n else {\n dependencies.push({ token, value, flags });\n }\n}\n/**\n *\n * Returns the LView and TNode associated with a NodeInjector. Returns undefined if the injector\n * is not a NodeInjector.\n *\n * @param injector\n * @returns {lView: LView, tNode: TNode}|undefined\n */\nfunction getNodeInjectorContext(injector) {\n if (!(injector instanceof NodeInjector)) {\n throwError('getNodeInjectorContext must be called with a NodeInjector');\n }\n const lView = getNodeInjectorLView(injector);\n const tNode = getNodeInjectorTNode(injector);\n if (tNode === null) {\n return;\n }\n assertTNodeForLView(tNode, lView);\n return { lView, tNode };\n}\n/**\n *\n * If the created instance is an instance of a standalone component, maps the injector to that\n * standalone component in frameworkDIDebugData.standaloneInjectorToComponent\n *\n * @param context InjectorProfilerContext the injection context that this event occurred in.\n * @param data InjectorCreatedInstance an object containing the instance that was just created\n *\n */\nfunction handleInstanceCreatedByInjectorEvent(context, data) {\n const { value } = data;\n if (getDIResolver(context.injector) === null) {\n throwError('An InjectorCreatedInstance event must be run within an injection context.');\n }\n // if our value is an instance of a standalone component, map the injector of that standalone\n // component to the component class. Otherwise, this event is a noop.\n let standaloneComponent = undefined;\n if (typeof value === 'object') {\n standaloneComponent = value?.constructor;\n }\n // We want to also cover if `standaloneComponent === null` in addition to `undefined`\n if (standaloneComponent == undefined || !isStandaloneComponent(standaloneComponent)) {\n return;\n }\n const environmentInjector = context.injector.get(EnvironmentInjector, null, { optional: true });\n // Standalone components should have an environment injector. If one cannot be\n // found we may be in a test case for low level functionality that did not explicitly\n // setup this injector. In those cases, we simply ignore this event.\n if (environmentInjector === null) {\n return;\n }\n const { standaloneInjectorToComponent } = frameworkDIDebugData;\n // If our injector has already been mapped, as is the case\n // when a standalone component imports another standalone component,\n // we consider the original component (the component doing the importing)\n // as the component connected to our injector.\n if (standaloneInjectorToComponent.has(environmentInjector)) {\n return;\n }\n // If our injector hasn't been mapped, then we map it to the standalone component\n standaloneInjectorToComponent.set(environmentInjector, standaloneComponent);\n}\nfunction isStandaloneComponent(value) {\n const def = getComponentDef(value);\n return !!def?.standalone;\n}\n/**\n *\n * Stores the emitted ProviderRecords from the InjectorProfilerEventType.ProviderConfigured\n * event in frameworkDIDebugData.resolverToProviders\n *\n * @param context InjectorProfilerContext the injection context that this event occurred in.\n * @param data ProviderRecord an object containing the instance that was just created\n *\n */\nfunction handleProviderConfiguredEvent(context, data) {\n const { resolverToProviders } = frameworkDIDebugData;\n let diResolver;\n if (context?.injector instanceof NodeInjector) {\n diResolver = getNodeInjectorTNode(context.injector);\n }\n else {\n diResolver = context.injector;\n }\n if (diResolver === null) {\n throwError('A ProviderConfigured event must be run within an injection context.');\n }\n if (!resolverToProviders.has(diResolver)) {\n resolverToProviders.set(diResolver, []);\n }\n resolverToProviders.get(diResolver).push(data);\n}\nfunction getDIResolver(injector) {\n let diResolver = null;\n if (injector === undefined) {\n return diResolver;\n }\n // We use the LView as the diResolver for NodeInjectors because they\n // do not persist anywhere in the framework. They are simply wrappers around an LView and a TNode\n // that do persist. Because of this, we rely on the LView of the NodeInjector in order to use\n // as a concrete key to represent this injector. If we get the same LView back later, we know\n // we're looking at the same injector.\n if (injector instanceof NodeInjector) {\n diResolver = getNodeInjectorLView(injector);\n }\n // Other injectors can be used a keys for a map because their instances\n // persist\n else {\n diResolver = injector;\n }\n return diResolver;\n}\n// inspired by\n// https://tc39.es/ecma262/multipage/executable-code-and-execution-contexts.html#sec-canbeheldweakly\nfunction canBeHeldWeakly(value) {\n // we check for value !== null here because typeof null === 'object\n return (value !== null &&\n (typeof value === 'object' || typeof value === 'function' || typeof value === 'symbol'));\n}\n\n/**\n * Marks a component for check (in case of OnPush components) and synchronously\n * performs change detection on the application this component belongs to.\n *\n * @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}.\n *\n * @publicApi\n */\nfunction applyChanges(component) {\n ngDevMode && assertDefined(component, 'component');\n markViewDirty(getComponentViewByInstance(component), 3 /* NotificationSource.DebugApplyChanges */);\n getRootComponents(component).forEach((rootComponent) => detectChanges(rootComponent));\n}\n/**\n * Synchronously perform change detection on a component (and possibly its sub-components).\n *\n * This function triggers change detection in a synchronous way on a component.\n *\n * @param component The component which the change detection should be performed on.\n */\nfunction detectChanges(component) {\n const view = getComponentViewByInstance(component);\n view[FLAGS] |= 1024 /* LViewFlags.RefreshView */;\n detectChangesInternal(view);\n}\n\n/**\n * Discovers the dependencies of an injectable instance. Provides DI information about each\n * dependency that the injectable was instantiated with, including where they were provided from.\n *\n * @param injector An injector instance\n * @param token a DI token that was constructed by the given injector instance\n * @returns an object that contains the created instance of token as well as all of the dependencies\n * that it was instantiated with OR undefined if the token was not created within the given\n * injector.\n */\nfunction getDependenciesFromInjectable(injector, token) {\n // First we check to see if the token given maps to an actual instance in the injector given.\n // We use `self: true` because we only want to look at the injector we were given.\n // We use `optional: true` because it's possible that the token we were given was never\n // constructed by the injector we were given.\n const instance = injector.get(token, null, { self: true, optional: true });\n if (instance === null) {\n throw new Error(`Unable to determine instance of ${token} in given injector`);\n }\n const unformattedDependencies = getDependenciesForTokenInInjector(token, injector);\n const resolutionPath = getInjectorResolutionPath(injector);\n const dependencies = unformattedDependencies.map((dep) => {\n // injectedIn contains private fields, so we omit it from the response\n const formattedDependency = {\n value: dep.value,\n };\n // convert injection flags to booleans\n const flags = dep.flags;\n formattedDependency.flags = {\n optional: (8 /* InternalInjectFlags.Optional */ & flags) === 8 /* InternalInjectFlags.Optional */,\n host: (1 /* InternalInjectFlags.Host */ & flags) === 1 /* InternalInjectFlags.Host */,\n self: (2 /* InternalInjectFlags.Self */ & flags) === 2 /* InternalInjectFlags.Self */,\n skipSelf: (4 /* InternalInjectFlags.SkipSelf */ & flags) === 4 /* InternalInjectFlags.SkipSelf */,\n };\n // find the injector that provided the dependency\n for (let i = 0; i < resolutionPath.length; i++) {\n const injectorToCheck = resolutionPath[i];\n // if skipSelf is true we skip the first injector\n if (i === 0 && formattedDependency.flags.skipSelf) {\n continue;\n }\n // host only applies to NodeInjectors\n if (formattedDependency.flags.host && injectorToCheck instanceof EnvironmentInjector) {\n break;\n }\n const instance = injectorToCheck.get(dep.token, null, {\n self: true,\n optional: true,\n });\n if (instance !== null) {\n // if host flag is true we double check that we can get the service from the first element\n // in the resolution path by using the host flag. This is done to make sure that we've found\n // the correct providing injector, and not a node injector that is connected to our path via\n // a router outlet.\n if (formattedDependency.flags.host) {\n const firstInjector = resolutionPath[0];\n const lookupFromFirstInjector = firstInjector.get(dep.token, null, {\n ...formattedDependency.flags,\n optional: true,\n });\n if (lookupFromFirstInjector !== null) {\n formattedDependency.providedIn = injectorToCheck;\n }\n break;\n }\n formattedDependency.providedIn = injectorToCheck;\n break;\n }\n // if self is true we stop after the first injector\n if (i === 0 && formattedDependency.flags.self) {\n break;\n }\n }\n if (dep.token)\n formattedDependency.token = dep.token;\n return formattedDependency;\n });\n return { instance, dependencies };\n}\nfunction getDependenciesForTokenInInjector(token, injector) {\n const { resolverToTokenToDependencies } = getFrameworkDIDebugData();\n if (!(injector instanceof NodeInjector)) {\n return resolverToTokenToDependencies.get(injector)?.get?.(token) ?? [];\n }\n const lView = getNodeInjectorLView(injector);\n const tokenDependencyMap = resolverToTokenToDependencies.get(lView);\n const dependencies = tokenDependencyMap?.get(token) ?? [];\n // In the NodeInjector case, all injections for every node are stored in the same lView.\n // We use the injectedIn field of the dependency to filter out the dependencies that\n // do not come from the same node as the instance we're looking at.\n return dependencies.filter((dependency) => {\n const dependencyNode = dependency.injectedIn?.tNode;\n if (dependencyNode === undefined) {\n return false;\n }\n const instanceNode = getNodeInjectorTNode(injector);\n assertTNode(dependencyNode);\n assertTNode(instanceNode);\n return dependencyNode === instanceNode;\n });\n}\n/**\n * Gets the class associated with an injector that contains a provider `imports` array in it's\n * definition\n *\n * For Module Injectors this returns the NgModule constructor.\n *\n * For Standalone injectors this returns the standalone component constructor.\n *\n * @param injector Injector an injector instance\n * @returns the constructor where the `imports` array that configures this injector is located\n */\nfunction getProviderImportsContainer(injector) {\n const { standaloneInjectorToComponent } = getFrameworkDIDebugData();\n // standalone components configure providers through a component def, so we have to\n // use the standalone component associated with this injector if Injector represents\n // a standalone components EnvironmentInjector\n if (standaloneInjectorToComponent.has(injector)) {\n return standaloneInjectorToComponent.get(injector);\n }\n // Module injectors configure providers through their NgModule def, so we use the\n // injector to lookup its NgModuleRef and through that grab its instance\n const defTypeRef = injector.get(NgModuleRef$1, null, { self: true, optional: true });\n // If we can't find an associated imports container, return null.\n // This could be the case if this function is called with an R3Injector that does not represent\n // a standalone component or NgModule.\n if (defTypeRef === null) {\n return null;\n }\n // In standalone applications, the root environment injector created by bootstrapApplication\n // may have no associated \"instance\".\n if (defTypeRef.instance === null) {\n return null;\n }\n return defTypeRef.instance.constructor;\n}\n/**\n * Gets the providers configured on a NodeInjector\n *\n * @param injector A NodeInjector instance\n * @returns ProviderRecord[] an array of objects representing the providers configured on this\n * injector\n */\nfunction getNodeInjectorProviders(injector) {\n const diResolver = getNodeInjectorTNode(injector);\n const { resolverToProviders } = getFrameworkDIDebugData();\n return resolverToProviders.get(diResolver) ?? [];\n}\n/**\n * Gets a mapping of providers configured on an injector to their import paths\n *\n * ModuleA -> imports ModuleB\n * ModuleB -> imports ModuleC\n * ModuleB -> provides MyServiceA\n * ModuleC -> provides MyServiceB\n *\n * getProviderImportPaths(ModuleA)\n * > Map(2) {\n * MyServiceA => [ModuleA, ModuleB]\n * MyServiceB => [ModuleA, ModuleB, ModuleC]\n * }\n *\n * @param providerImportsContainer constructor of class that contains an `imports` array in it's\n * definition\n * @returns A Map object that maps providers to an array of constructors representing it's import\n * path\n *\n */\nfunction getProviderImportPaths(providerImportsContainer) {\n const providerToPath = new Map();\n const visitedContainers = new Set();\n const visitor = walkProviderTreeToDiscoverImportPaths(providerToPath, visitedContainers);\n walkProviderTree(providerImportsContainer, visitor, [], new Set());\n return providerToPath;\n}\n/**\n *\n * Higher order function that returns a visitor for WalkProviderTree\n *\n * Takes in a Map and Set to keep track of the providers and containers\n * visited, so that we can discover the import paths of these providers\n * during the traversal.\n *\n * This visitor takes advantage of the fact that walkProviderTree performs a\n * postorder traversal of the provider tree for the passed in container. Because postorder\n * traversal recursively processes subtrees from leaf nodes until the traversal reaches the root,\n * we write a visitor that constructs provider import paths in reverse.\n *\n *\n * We use the visitedContainers set defined outside this visitor\n * because we want to run some logic only once for\n * each container in the tree. That logic can be described as:\n *\n *\n * 1. for each discovered_provider and discovered_path in the incomplete provider paths we've\n * already discovered\n * 2. get the first container in discovered_path\n * 3. if that first container is in the imports array of the container we're visiting\n * Then the container we're visiting is also in the import path of discovered_provider, so we\n * unshift discovered_path with the container we're currently visiting\n *\n *\n * Example Run:\n * ```\n * ┌──────────┐\n * │containerA│\n * ┌─imports-─┤ ├──imports─┐\n * │ │ provA │ │\n * │ │ provB │ │\n * │ └──────────┘ │\n * │ │\n * ┌▼─────────┐ ┌────────▼─┐\n * │containerB│ │containerC│\n * │ │ │ │\n * │ provD │ │ provF │\n * │ provE │ │ provG │\n * └──────────┘ └──────────┘\n * ```\n *\n * Each step of the traversal,\n *\n * ```\n * visitor(provD, containerB)\n * providerToPath === Map { provD => [containerB] }\n * visitedContainers === Set { containerB }\n *\n * visitor(provE, containerB)\n * providerToPath === Map { provD => [containerB], provE => [containerB] }\n * visitedContainers === Set { containerB }\n *\n * visitor(provF, containerC)\n * providerToPath === Map { provD => [containerB], provE => [containerB], provF => [containerC] }\n * visitedContainers === Set { containerB, containerC }\n *\n * visitor(provG, containerC)\n * providerToPath === Map {\n * provD => [containerB], provE => [containerB], provF => [containerC], provG => [containerC]\n * }\n * visitedContainers === Set { containerB, containerC }\n *\n * visitor(provA, containerA)\n * providerToPath === Map {\n * provD => [containerA, containerB],\n * provE => [containerA, containerB],\n * provF => [containerA, containerC],\n * provG => [containerA, containerC],\n * provA => [containerA]\n * }\n * visitedContainers === Set { containerB, containerC, containerA }\n *\n * visitor(provB, containerA)\n * providerToPath === Map {\n * provD => [containerA, containerB],\n * provE => [containerA, containerB],\n * provF => [containerA, containerC],\n * provG => [containerA, containerC],\n * provA => [containerA]\n * provB => [containerA]\n * }\n * visitedContainers === Set { containerB, containerC, containerA }\n * ```\n *\n * @param providerToPath Map map of providers to paths that this function fills\n * @param visitedContainers Set a set to keep track of the containers we've already visited\n * @return function(provider SingleProvider, container: Type<unknown> | InjectorType<unknown>) =>\n * void\n */\nfunction walkProviderTreeToDiscoverImportPaths(providerToPath, visitedContainers) {\n return (provider, container) => {\n // If the provider is not already in the providerToPath map,\n // add an entry with the provider as the key and an array containing the current container as\n // the value\n if (!providerToPath.has(provider)) {\n providerToPath.set(provider, [container]);\n }\n // This block will run exactly once for each container in the import tree.\n // This is where we run the logic to check the imports array of the current\n // container to see if it's the next container in the path for our currently\n // discovered providers.\n if (!visitedContainers.has(container)) {\n // Iterate through the providers we've already seen\n for (const prov of providerToPath.keys()) {\n const existingImportPath = providerToPath.get(prov);\n let containerDef = getInjectorDef(container);\n if (!containerDef) {\n const ngModule = container.ngModule;\n containerDef = getInjectorDef(ngModule);\n }\n if (!containerDef) {\n return;\n }\n const lastContainerAddedToPath = existingImportPath[0];\n let isNextStepInPath = false;\n deepForEach(containerDef.imports, (moduleImport) => {\n if (isNextStepInPath) {\n return;\n }\n isNextStepInPath =\n moduleImport.ngModule === lastContainerAddedToPath ||\n moduleImport === lastContainerAddedToPath;\n if (isNextStepInPath) {\n providerToPath.get(prov)?.unshift(container);\n }\n });\n }\n }\n visitedContainers.add(container);\n };\n}\n/**\n * Gets the providers configured on an EnvironmentInjector\n *\n * @param injector EnvironmentInjector\n * @returns an array of objects representing the providers of the given injector\n */\nfunction getEnvironmentInjectorProviders(injector) {\n const providerRecordsWithoutImportPaths = getFrameworkDIDebugData().resolverToProviders.get(injector) ?? [];\n // platform injector has no provider imports container so can we skip trying to\n // find import paths\n if (isPlatformInjector(injector)) {\n return providerRecordsWithoutImportPaths;\n }\n const providerImportsContainer = getProviderImportsContainer(injector);\n if (providerImportsContainer === null) {\n // We assume that if an environment injector exists without an associated provider imports\n // container, it was created without such a container. Some examples cases where this could\n // happen:\n // - The root injector of a standalone application\n // - A router injector created by using the providers array in a lazy loaded route\n // - A manually created injector that is attached to the injector tree\n // Since each of these cases has no provider container, there is no concept of import paths,\n // so we can simply return the provider records.\n return providerRecordsWithoutImportPaths;\n }\n const providerToPath = getProviderImportPaths(providerImportsContainer);\n const providerRecords = [];\n for (const providerRecord of providerRecordsWithoutImportPaths) {\n const provider = providerRecord.provider;\n // Ignore these special providers for now until we have a cleaner way of\n // determing when they are provided by the framework vs provided by the user.\n const token = provider.provide;\n if (token === ENVIRONMENT_INITIALIZER || token === INJECTOR_DEF_TYPES) {\n continue;\n }\n let importPath = providerToPath.get(provider) ?? [];\n const def = getComponentDef(providerImportsContainer);\n const isStandaloneComponent = !!def?.standalone;\n // We prepend the component constructor in the standalone case\n // because walkProviderTree does not visit this constructor during it's traversal\n if (isStandaloneComponent) {\n importPath = [providerImportsContainer, ...importPath];\n }\n providerRecords.push({ ...providerRecord, importPath });\n }\n return providerRecords;\n}\nfunction isPlatformInjector(injector) {\n return injector instanceof R3Injector && injector.scopes.has('platform');\n}\n/**\n * Gets the providers configured on an injector.\n *\n * @param injector the injector to lookup the providers of\n * @returns ProviderRecord[] an array of objects representing the providers of the given injector\n */\nfunction getInjectorProviders(injector) {\n if (injector instanceof NodeInjector) {\n return getNodeInjectorProviders(injector);\n }\n else if (injector instanceof EnvironmentInjector) {\n return getEnvironmentInjectorProviders(injector);\n }\n throwError('getInjectorProviders only supports NodeInjector and EnvironmentInjector');\n}\n/**\n *\n * Given an injector, this function will return\n * an object containing the type and source of the injector.\n *\n * | | type | source |\n * |--------------|-------------|-------------------------------------------------------------|\n * | NodeInjector | element | DOM element that created this injector |\n * | R3Injector | environment | `injector.source` |\n * | NullInjector | null | null |\n *\n * @param injector the Injector to get metadata for\n * @returns an object containing the type and source of the given injector. If the injector metadata\n * cannot be determined, returns null.\n */\nfunction getInjectorMetadata(injector) {\n if (injector instanceof NodeInjector) {\n const lView = getNodeInjectorLView(injector);\n const tNode = getNodeInjectorTNode(injector);\n assertTNodeForLView(tNode, lView);\n return { type: 'element', source: getNativeByTNode(tNode, lView) };\n }\n if (injector instanceof R3Injector) {\n return { type: 'environment', source: injector.source ?? null };\n }\n if (injector instanceof NullInjector) {\n return { type: 'null', source: null };\n }\n return null;\n}\nfunction getInjectorResolutionPath(injector) {\n const resolutionPath = [injector];\n getInjectorResolutionPathHelper(injector, resolutionPath);\n return resolutionPath;\n}\nfunction getInjectorResolutionPathHelper(injector, resolutionPath) {\n const parent = getInjectorParent(injector);\n // if getInjectorParent can't find a parent, then we've either reached the end\n // of the path, or we need to move from the Element Injector tree to the\n // module injector tree using the first injector in our path as the connection point.\n if (parent === null) {\n if (injector instanceof NodeInjector) {\n const firstInjector = resolutionPath[0];\n if (firstInjector instanceof NodeInjector) {\n const moduleInjector = getModuleInjectorOfNodeInjector(firstInjector);\n if (moduleInjector === null) {\n throwError('NodeInjector must have some connection to the module injector tree');\n }\n resolutionPath.push(moduleInjector);\n getInjectorResolutionPathHelper(moduleInjector, resolutionPath);\n }\n return resolutionPath;\n }\n }\n else {\n resolutionPath.push(parent);\n getInjectorResolutionPathHelper(parent, resolutionPath);\n }\n return resolutionPath;\n}\n/**\n * Gets the parent of an injector.\n *\n * This function is not able to make the jump from the Element Injector Tree to the Module\n * injector tree. This is because the \"parent\" (the next step in the reoslution path)\n * of a root NodeInjector is dependent on which NodeInjector ancestor initiated\n * the DI lookup. See getInjectorResolutionPath for a function that can make this jump.\n *\n * In the below diagram:\n * ```ts\n * getInjectorParent(NodeInjectorB)\n * > NodeInjectorA\n * getInjectorParent(NodeInjectorA) // or getInjectorParent(getInjectorParent(NodeInjectorB))\n * > null // cannot jump to ModuleInjector tree\n * ```\n *\n * ```\n * ┌───────┐ ┌───────────────────┐\n * ┌───────────┤ModuleA├───Injector────►│EnvironmentInjector│\n * │ └───┬───┘ └───────────────────┘\n * │ │\n * │ bootstraps\n * │ │\n * │ │\n * │ ┌────▼─────┐ ┌─────────────┐\n * declares │ComponentA├────Injector────►│NodeInjectorA│\n * │ └────┬─────┘ └─────▲───────┘\n * │ │ │\n * │ renders parent\n * │ │ │\n * │ ┌────▼─────┐ ┌─────┴───────┐\n * └─────────►│ComponentB├────Injector────►│NodeInjectorB│\n * └──────────┘ └─────────────┘\n *```\n *\n * @param injector an Injector to get the parent of\n * @returns Injector the parent of the given injector\n */\nfunction getInjectorParent(injector) {\n if (injector instanceof R3Injector) {\n const parent = injector.parent;\n if (isRouterOutletInjector(parent)) {\n // This is a special case for a `ChainedInjector` instance, which represents\n // a combination of a Router's `OutletInjector` and an EnvironmentInjector,\n // which represents a `@defer` block. Since the `OutletInjector` doesn't store\n // any tokens itself, we point to the parent injector instead. See the\n // `OutletInjector.__ngOutletInjector` field for additional information.\n return parent.parentInjector;\n }\n return parent;\n }\n let tNode;\n let lView;\n if (injector instanceof NodeInjector) {\n tNode = getNodeInjectorTNode(injector);\n lView = getNodeInjectorLView(injector);\n }\n else if (injector instanceof NullInjector) {\n return null;\n }\n else if (injector instanceof ChainedInjector) {\n return injector.parentInjector;\n }\n else {\n throwError('getInjectorParent only support injectors of type R3Injector, NodeInjector, NullInjector');\n }\n const parentLocation = getParentInjectorLocation(tNode, lView);\n if (hasParentInjector(parentLocation)) {\n const parentInjectorIndex = getParentInjectorIndex(parentLocation);\n const parentLView = getParentInjectorView(parentLocation, lView);\n const parentTView = parentLView[TVIEW];\n const parentTNode = parentTView.data[parentInjectorIndex + 8 /* NodeInjectorOffset.TNODE */];\n return new NodeInjector(parentTNode, parentLView);\n }\n else {\n const chainedInjector = lView[INJECTOR];\n // Case where chainedInjector.injector is an OutletInjector and chainedInjector.injector.parent\n // is a NodeInjector.\n // todo(aleksanderbodurri): ideally nothing in packages/core should deal\n // directly with router concerns. Refactor this so that we can make the jump from\n // NodeInjector -> OutletInjector -> NodeInjector\n // without explicitly relying on types contracts from packages/router\n const injectorParent = chainedInjector.injector?.parent;\n if (injectorParent instanceof NodeInjector) {\n return injectorParent;\n }\n }\n return null;\n}\n/**\n * Gets the module injector of a NodeInjector.\n *\n * @param injector NodeInjector to get module injector of\n * @returns Injector representing module injector of the given NodeInjector\n */\nfunction getModuleInjectorOfNodeInjector(injector) {\n let lView;\n if (injector instanceof NodeInjector) {\n lView = getNodeInjectorLView(injector);\n }\n else {\n throwError('getModuleInjectorOfNodeInjector must be called with a NodeInjector');\n }\n const inj = lView[INJECTOR];\n const moduleInjector = inj instanceof ChainedInjector ? inj.parentInjector : inj.parent;\n if (!moduleInjector) {\n throwError('NodeInjector must have some connection to the module injector tree');\n }\n return moduleInjector;\n}\n\n/**\n * This file introduces series of globally accessible debug tools\n * to allow for the Angular debugging story to function.\n *\n * To see this in action run the following command:\n *\n * bazel run //packages/core/test/bundling/todo:devserver\n *\n * Then load `localhost:5432` and start using the console tools.\n */\n/**\n * This value reflects the property on the window where the dev\n * tools are patched (window.ng).\n * */\nconst GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';\nconst globalUtilsFunctions = {\n /**\n * Warning: functions that start with `ɵ` are considered *INTERNAL* and should not be relied upon\n * in application's code. The contract of those functions might be changed in any release and/or a\n * function can be removed completely.\n */\n 'ɵgetDependenciesFromInjectable': getDependenciesFromInjectable,\n 'ɵgetInjectorProviders': getInjectorProviders,\n 'ɵgetInjectorResolutionPath': getInjectorResolutionPath,\n 'ɵgetInjectorMetadata': getInjectorMetadata,\n 'ɵsetProfiler': setProfiler,\n 'getDirectiveMetadata': getDirectiveMetadata$1,\n 'getComponent': getComponent$1,\n 'getContext': getContext,\n 'getListeners': getListeners,\n 'getOwningComponent': getOwningComponent,\n 'getHostElement': getHostElement,\n 'getInjector': getInjector,\n 'getRootComponents': getRootComponents,\n 'getDirectives': getDirectives,\n 'applyChanges': applyChanges,\n 'isSignal': isSignal,\n};\nlet _published = false;\n/**\n * Publishes a collection of default debug tools onto`window.ng`.\n *\n * These functions are available globally when Angular is in development\n * mode and are automatically stripped away from prod mode is on.\n */\nfunction publishDefaultGlobalUtils$1() {\n if (!_published) {\n _published = true;\n if (typeof window !== 'undefined') {\n // Only configure the injector profiler when running in the browser.\n setupFrameworkInjectorProfiler();\n }\n for (const [methodName, method] of Object.entries(globalUtilsFunctions)) {\n publishGlobalUtil(methodName, method);\n }\n }\n}\n/**\n * Publishes the given function to `window.ng` so that it can be\n * used from the browser console when an application is not in production.\n */\nfunction publishGlobalUtil(name, fn) {\n if (typeof COMPILED === 'undefined' || !COMPILED) {\n // Note: we can't export `ng` when using closure enhanced optimization as:\n // - closure declares globals itself for minified names, which sometimes clobber our `ng` global\n // - we can't declare a closure extern as the namespace `ng` is already used within Google\n // for typings for AngularJS (via `goog.provide('ng....')`).\n const w = _global;\n ngDevMode && assertDefined(fn, 'function not defined');\n w[GLOBAL_PUBLISH_EXPANDO_KEY] ??= {};\n w[GLOBAL_PUBLISH_EXPANDO_KEY][name] = fn;\n }\n}\n\n/**\n * Internal injection token that can used to access an instance of a Testability class.\n *\n * This token acts as a bridge between the core bootstrap code and the `Testability` class. This is\n * needed to ensure that there are no direct references to the `Testability` class, so it can be\n * tree-shaken away (if not referenced). For the environments/setups when the `Testability` class\n * should be available, this token is used to add a provider that references the `Testability`\n * class. Otherwise, only this token is retained in a bundle, but the `Testability` class is not.\n */\nconst TESTABILITY = new InjectionToken('');\n/**\n * Internal injection token to retrieve Testability getter class instance.\n */\nconst TESTABILITY_GETTER = new InjectionToken('');\n/**\n * The Testability service provides testing hooks that can be accessed from\n * the browser.\n *\n * Angular applications bootstrapped using an NgModule (via `@NgModule.bootstrap` field) will also\n * instantiate Testability by default (in both development and production modes).\n *\n * For applications bootstrapped using the `bootstrapApplication` function, Testability is not\n * included by default. You can include it into your applications by getting the list of necessary\n * providers using the `provideProtractorTestingSupport()` function and adding them into the\n * `options.providers` array. Example:\n *\n * ```typescript\n * import {provideProtractorTestingSupport} from '@angular/platform-browser';\n *\n * await bootstrapApplication(RootComponent, providers: [provideProtractorTestingSupport()]);\n * ```\n *\n * @publicApi\n */\nclass Testability {\n constructor(_ngZone, registry, testabilityGetter) {\n this._ngZone = _ngZone;\n this.registry = registry;\n this._isZoneStable = true;\n this._callbacks = [];\n this.taskTrackingZone = null;\n // If there was no Testability logic registered in the global scope\n // before, register the current testability getter as a global one.\n if (!_testabilityGetter) {\n setTestabilityGetter(testabilityGetter);\n testabilityGetter.addToWindow(registry);\n }\n this._watchAngularEvents();\n _ngZone.run(() => {\n this.taskTrackingZone =\n typeof Zone == 'undefined' ? null : Zone.current.get('TaskTrackingZone');\n });\n }\n _watchAngularEvents() {\n this._ngZone.onUnstable.subscribe({\n next: () => {\n this._isZoneStable = false;\n },\n });\n this._ngZone.runOutsideAngular(() => {\n this._ngZone.onStable.subscribe({\n next: () => {\n NgZone.assertNotInAngularZone();\n queueMicrotask(() => {\n this._isZoneStable = true;\n this._runCallbacksIfReady();\n });\n },\n });\n });\n }\n /**\n * Whether an associated application is stable\n */\n isStable() {\n return this._isZoneStable && !this._ngZone.hasPendingMacrotasks;\n }\n _runCallbacksIfReady() {\n if (this.isStable()) {\n // Schedules the call backs in a new frame so that it is always async.\n queueMicrotask(() => {\n while (this._callbacks.length !== 0) {\n let cb = this._callbacks.pop();\n clearTimeout(cb.timeoutId);\n cb.doneCb();\n }\n });\n }\n else {\n // Still not stable, send updates.\n let pending = this.getPendingTasks();\n this._callbacks = this._callbacks.filter((cb) => {\n if (cb.updateCb && cb.updateCb(pending)) {\n clearTimeout(cb.timeoutId);\n return false;\n }\n return true;\n });\n }\n }\n getPendingTasks() {\n if (!this.taskTrackingZone) {\n return [];\n }\n // Copy the tasks data so that we don't leak tasks.\n return this.taskTrackingZone.macroTasks.map((t) => {\n return {\n source: t.source,\n // From TaskTrackingZone:\n // https://github.com/angular/zone.js/blob/master/lib/zone-spec/task-tracking.ts#L40\n creationLocation: t.creationLocation,\n data: t.data,\n };\n });\n }\n addCallback(cb, timeout, updateCb) {\n let timeoutId = -1;\n if (timeout && timeout > 0) {\n timeoutId = setTimeout(() => {\n this._callbacks = this._callbacks.filter((cb) => cb.timeoutId !== timeoutId);\n cb();\n }, timeout);\n }\n this._callbacks.push({ doneCb: cb, timeoutId: timeoutId, updateCb: updateCb });\n }\n /**\n * Wait for the application to be stable with a timeout. If the timeout is reached before that\n * happens, the callback receives a list of the macro tasks that were pending, otherwise null.\n *\n * @param doneCb The callback to invoke when Angular is stable or the timeout expires\n * whichever comes first.\n * @param timeout Optional. The maximum time to wait for Angular to become stable. If not\n * specified, whenStable() will wait forever.\n * @param updateCb Optional. If specified, this callback will be invoked whenever the set of\n * pending macrotasks changes. If this callback returns true doneCb will not be invoked\n * and no further updates will be issued.\n */\n whenStable(doneCb, timeout, updateCb) {\n if (updateCb && !this.taskTrackingZone) {\n throw new Error('Task tracking zone is required when passing an update callback to ' +\n 'whenStable(). Is \"zone.js/plugins/task-tracking\" loaded?');\n }\n this.addCallback(doneCb, timeout, updateCb);\n this._runCallbacksIfReady();\n }\n /**\n * Registers an application with a testability hook so that it can be tracked.\n * @param token token of application, root element\n *\n * @internal\n */\n registerApplication(token) {\n this.registry.registerApplication(token, this);\n }\n /**\n * Unregisters an application.\n * @param token token of application, root element\n *\n * @internal\n */\n unregisterApplication(token) {\n this.registry.unregisterApplication(token);\n }\n /**\n * Find providers by name\n * @param using The root element to search from\n * @param provider The name of binding variable\n * @param exactMatch Whether using exactMatch\n */\n findProviders(using, provider, exactMatch) {\n // TODO(juliemr): implement.\n return [];\n }\n static { this.ɵfac = function Testability_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Testability)(ɵɵinject(NgZone), ɵɵinject(TestabilityRegistry), ɵɵinject(TESTABILITY_GETTER)); }; }\n static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Testability, factory: Testability.ɵfac }); }\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(Testability, [{\n type: Injectable\n }], () => [{ type: NgZone }, { type: TestabilityRegistry }, { type: undefined, decorators: [{\n type: Inject,\n args: [TESTABILITY_GETTER]\n }] }], null); })();\n/**\n * A global registry of {@link Testability} instances for specific elements.\n * @publicApi\n */\nclass TestabilityRegistry {\n constructor() {\n /** @internal */\n this._applications = new Map();\n }\n /**\n * Registers an application with a testability hook so that it can be tracked\n * @param token token of application, root element\n * @param testability Testability hook\n */\n registerApplication(token, testability) {\n this._applications.set(token, testability);\n }\n /**\n * Unregisters an application.\n * @param token token of application, root element\n */\n unregisterApplication(token) {\n this._applications.delete(token);\n }\n /**\n * Unregisters all applications\n */\n unregisterAllApplications() {\n this._applications.clear();\n }\n /**\n * Get a testability hook associated with the application\n * @param elem root element\n */\n getTestability(elem) {\n return this._applications.get(elem) || null;\n }\n /**\n * Get all registered testabilities\n */\n getAllTestabilities() {\n return Array.from(this._applications.values());\n }\n /**\n * Get all registered applications(root elements)\n */\n getAllRootElements() {\n return Array.from(this._applications.keys());\n }\n /**\n * Find testability of a node in the Tree\n * @param elem node\n * @param findInAncestors whether finding testability in ancestors if testability was not found in\n * current node\n */\n findTestabilityInTree(elem, findInAncestors = true) {\n return _testabilityGetter?.findTestabilityInTree(this, elem, findInAncestors) ?? null;\n }\n static { this.ɵfac = function TestabilityRegistry_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TestabilityRegistry)(); }; }\n static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac, providedIn: 'platform' }); }\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(TestabilityRegistry, [{\n type: Injectable,\n args: [{ providedIn: 'platform' }]\n }], null, null); })();\n/**\n * Set the {@link GetTestability} implementation used by the Angular testing framework.\n * @publicApi\n */\nfunction setTestabilityGetter(getter) {\n _testabilityGetter = getter;\n}\nlet _testabilityGetter;\n\n/**\n * Determine if the argument is shaped like a Promise\n */\nfunction isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}\n/**\n * Determine if the argument is a Subscribable\n */\nfunction isSubscribable(obj) {\n return !!obj && typeof obj.subscribe === 'function';\n}\n\n/**\n * A DI token that you can use to provide\n * one or more initialization functions.\n *\n * The provided functions are injected at application startup and executed during\n * app initialization. If any of these functions returns a Promise or an Observable, initialization\n * does not complete until the Promise is resolved or the Observable is completed.\n *\n * You can, for example, create a factory function that loads language data\n * or an external configuration, and provide that function to the `APP_INITIALIZER` token.\n * The function is executed during the application bootstrap process,\n * and the needed data is available on startup.\n *\n * @see {@link ApplicationInitStatus}\n *\n * @usageNotes\n *\n * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token\n * and a function returning a promise.\n * ### Example with NgModule-based application\n * ```\n * function initializeApp(): Promise<any> {\n * return new Promise((resolve, reject) => {\n * // Do some asynchronous stuff\n * resolve();\n * });\n * }\n *\n * @NgModule({\n * imports: [BrowserModule],\n * declarations: [AppComponent],\n * bootstrap: [AppComponent],\n * providers: [{\n * provide: APP_INITIALIZER,\n * useFactory: () => initializeApp,\n * multi: true\n * }]\n * })\n * export class AppModule {}\n * ```\n *\n * ### Example with standalone application\n * ```\n * export function initializeApp(http: HttpClient) {\n * return (): Promise<any> =>\n * firstValueFrom(\n * http\n * .get(\"https://someUrl.com/api/user\")\n * .pipe(tap(user => { ... }))\n * );\n * }\n *\n * bootstrapApplication(App, {\n * providers: [\n * provideHttpClient(),\n * {\n * provide: APP_INITIALIZER,\n * useFactory: initializeApp,\n * multi: true,\n * deps: [HttpClient],\n * },\n * ],\n * });\n\n * ```\n *\n *\n * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function\n * returning an observable, see an example below. Note: the `HttpClient` in this example is used for\n * demo purposes to illustrate how the factory function can work with other providers available\n * through DI.\n *\n * ### Example with NgModule-based application\n * ```\n * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {\n * return () => httpClient.get(\"https://someUrl.com/api/user\")\n * .pipe(\n * tap(user => { ... })\n * );\n * }\n *\n * @NgModule({\n * imports: [BrowserModule, HttpClientModule],\n * declarations: [AppComponent],\n * bootstrap: [AppComponent],\n * providers: [{\n * provide: APP_INITIALIZER,\n * useFactory: initializeAppFactory,\n * deps: [HttpClient],\n * multi: true\n * }]\n * })\n * export class AppModule {}\n * ```\n *\n * ### Example with standalone application\n * ```\n * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {\n * return () => httpClient.get(\"https://someUrl.com/api/user\")\n * .pipe(\n * tap(user => { ... })\n * );\n * }\n *\n * bootstrapApplication(App, {\n * providers: [\n * provideHttpClient(),\n * {\n * provide: APP_INITIALIZER,\n * useFactory: initializeAppFactory,\n * multi: true,\n * deps: [HttpClient],\n * },\n * ],\n * });\n * ```\n *\n * @publicApi\n */\nconst APP_INITIALIZER = new InjectionToken(ngDevMode ? 'Application Initializer' : '');\n/**\n * A class that reflects the state of running {@link APP_INITIALIZER} functions.\n *\n * @publicApi\n */\nclass ApplicationInitStatus {\n constructor() {\n this.initialized = false;\n this.done = false;\n this.donePromise = new Promise((res, rej) => {\n this.resolve = res;\n this.reject = rej;\n });\n this.appInits = inject(APP_INITIALIZER, { optional: true }) ?? [];\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !Array.isArray(this.appInits)) {\n throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_INITIALIZER` token value ' +\n `(expected an array, but got ${typeof this.appInits}). ` +\n 'Please check that the `APP_INITIALIZER` token is configured as a ' +\n '`multi: true` provider.');\n }\n }\n /** @internal */\n runInitializers() {\n if (this.initialized) {\n return;\n }\n const asyncInitPromises = [];\n for (const appInits of this.appInits) {\n const initResult = appInits();\n if (isPromise(initResult)) {\n asyncInitPromises.push(initResult);\n }\n else if (isSubscribable(initResult)) {\n const observableAsPromise = new Promise((resolve, reject) => {\n initResult.subscribe({ complete: resolve, error: reject });\n });\n asyncInitPromises.push(observableAsPromise);\n }\n }\n const complete = () => {\n // @ts-expect-error overwriting a readonly\n this.done = true;\n this.resolve();\n };\n Promise.all(asyncInitPromises)\n .then(() => {\n complete();\n })\n .catch((e) => {\n this.reject(e);\n });\n if (asyncInitPromises.length === 0) {\n complete();\n }\n this.initialized = true;\n }\n static { this.ɵfac = function ApplicationInitStatus_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ApplicationInitStatus)(); }; }\n static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' }); }\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], () => [], null); })();\n\n/**\n * A DI token that provides a set of callbacks to\n * be called for every component that is bootstrapped.\n *\n * Each callback must take a `ComponentRef` instance and return nothing.\n *\n * `(componentRef: ComponentRef) => void`\n *\n * @publicApi\n */\nconst APP_BOOTSTRAP_LISTENER = new InjectionToken(ngDevMode ? 'appBootstrapListener' : '');\nfunction publishDefaultGlobalUtils() {\n ngDevMode && publishDefaultGlobalUtils$1();\n}\n/**\n * Sets the error for an invalid write to a signal to be an Angular `RuntimeError`.\n */\nfunction publishSignalConfiguration() {\n setThrowInvalidWriteToSignalError$1(() => {\n throw new RuntimeError(600 /* RuntimeErrorCode.SIGNAL_WRITE_FROM_ILLEGAL_CONTEXT */, ngDevMode &&\n 'Writing to signals is not allowed in a `computed` or an `effect` by default. ' +\n 'Use `allowSignalWrites` in the `CreateEffectOptions` to enable this inside effects.');\n });\n}\nfunction isBoundToModule(cf) {\n return cf.isBoundToModule;\n}\n/**\n * A token for third-party components that can register themselves with NgProbe.\n *\n * @deprecated\n * @publicApi\n */\nclass NgProbeToken {\n constructor(name, token) {\n this.name = name;\n this.token = token;\n }\n}\n/** Maximum number of times ApplicationRef will refresh all attached views in a single tick. */\nconst MAXIMUM_REFRESH_RERUNS = 10;\nfunction _callAndReportToErrorHandler(errorHandler, ngZone, callback) {\n try {\n const result = callback();\n if (isPromise(result)) {\n return result.catch((e) => {\n ngZone.runOutsideAngular(() => errorHandler.handleError(e));\n // rethrow as the exception handler might not do it\n throw e;\n });\n }\n return result;\n }\n catch (e) {\n ngZone.runOutsideAngular(() => errorHandler.handleError(e));\n // rethrow as the exception handler might not do it\n throw e;\n }\n}\nfunction optionsReducer(dst, objs) {\n if (Array.isArray(objs)) {\n return objs.reduce(optionsReducer, dst);\n }\n return { ...dst, ...objs };\n}\n/**\n * A reference to an Angular application running on a page.\n *\n * @usageNotes\n * {@a is-stable-examples}\n * ### isStable examples and caveats\n *\n * Note two important points about `isStable`, demonstrated in the examples below:\n * - the application will never be stable if you start any kind\n * of recurrent asynchronous task when the application starts\n * (for example for a polling process, started with a `setInterval`, a `setTimeout`\n * or using RxJS operators like `interval`);\n * - the `isStable` Observable runs outside of the Angular zone.\n *\n * Let's imagine that you start a recurrent task\n * (here incrementing a counter, using RxJS `interval`),\n * and at the same time subscribe to `isStable`.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * filter(stable => stable)\n * ).subscribe(() => console.log('App is stable now');\n * interval(1000).subscribe(counter => console.log(counter));\n * }\n * ```\n * In this example, `isStable` will never emit `true`,\n * and the trace \"App is stable now\" will never get logged.\n *\n * If you want to execute something when the app is stable,\n * you have to wait for the application to be stable\n * before starting your polling process.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * tap(stable => console.log('App is stable now')),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => console.log(counter));\n * }\n * ```\n * In this example, the trace \"App is stable now\" will be logged\n * and then the counter starts incrementing every second.\n *\n * Note also that this Observable runs outside of the Angular zone,\n * which means that the code in the subscription\n * to this Observable will not trigger the change detection.\n *\n * Let's imagine that instead of logging the counter value,\n * you update a field of your component\n * and display it in its template.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => this.value = counter);\n * }\n * ```\n * As the `isStable` Observable runs outside the zone,\n * the `value` field will be updated properly,\n * but the template will not be refreshed!\n *\n * You'll have to manually trigger the change detection to update the template.\n *\n * ```\n * constructor(appRef: ApplicationRef, cd: ChangeDetectorRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => {\n * this.value = counter;\n * cd.detectChanges();\n * });\n * }\n * ```\n *\n * Or make the subscription callback run inside the zone.\n *\n * ```\n * constructor(appRef: ApplicationRef, zone: NgZone) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => zone.run(() => this.value = counter));\n * }\n * ```\n *\n * @publicApi\n */\nclass ApplicationRef {\n constructor() {\n /** @internal */\n this._bootstrapListeners = [];\n /** @internal */\n this._runningTick = false;\n this._destroyed = false;\n this._destroyListeners = [];\n /** @internal */\n this._views = [];\n this.internalErrorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);\n this.afterRenderManager = inject(AfterRenderManager);\n this.zonelessEnabled = inject(ZONELESS_ENABLED);\n /**\n * Current dirty state of the application across a number of dimensions (views, afterRender hooks,\n * etc).\n *\n * A flag set here means that `tick()` will attempt to resolve the dirtiness when executed.\n *\n * @internal\n */\n this.dirtyFlags = 0 /* ApplicationRefDirtyFlags.None */;\n /**\n * Like `dirtyFlags` but don't cause `tick()` to loop.\n *\n * @internal\n */\n this.deferredDirtyFlags = 0 /* ApplicationRefDirtyFlags.None */;\n // Needed for ComponentFixture temporarily during migration of autoDetect behavior\n // Eventually the hostView of the fixture should just attach to ApplicationRef.\n this.externalTestViews = new Set();\n this.beforeRender = new Subject();\n /** @internal */\n this.afterTick = new Subject();\n /**\n * Get a list of component types registered to this application.\n * This list is populated even before the component is created.\n */\n this.componentTypes = [];\n /**\n * Get a list of components registered to this application.\n */\n this.components = [];\n /**\n * Returns an Observable that indicates when the application is stable or unstable.\n */\n this.isStable = inject(PendingTasks).hasPendingTasks.pipe(map((pending) => !pending));\n this._injector = inject(EnvironmentInjector);\n }\n /** @internal */\n get allViews() {\n return [...this.externalTestViews.keys(), ...this._views];\n }\n /**\n * Indicates whether this instance was destroyed.\n */\n get destroyed() {\n return this._destroyed;\n }\n /**\n * @returns A promise that resolves when the application becomes stable\n */\n whenStable() {\n let subscription;\n return new Promise((resolve) => {\n subscription = this.isStable.subscribe({\n next: (stable) => {\n if (stable) {\n resolve();\n }\n },\n });\n }).finally(() => {\n subscription.unsubscribe();\n });\n }\n /**\n * The `EnvironmentInjector` used to create this application.\n */\n get injector() {\n return this._injector;\n }\n /**\n * Bootstrap a component onto the element identified by its selector or, optionally, to a\n * specified element.\n *\n * @usageNotes\n * ### Bootstrap process\n *\n * When bootstrapping a component, Angular mounts it onto a target DOM element\n * and kicks off automatic change detection. The target DOM element can be\n * provided using the `rootSelectorOrNode` argument.\n *\n * If the target DOM element is not provided, Angular tries to find one on a page\n * using the `selector` of the component that is being bootstrapped\n * (first matched element is used).\n *\n * ### Example\n *\n * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,\n * but it requires us to know the component while writing the application code.\n *\n * Imagine a situation where we have to wait for an API call to decide about the component to\n * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to\n * dynamically bootstrap a component.\n *\n * {@example core/ts/platform/platform.ts region='componentSelector'}\n *\n * Optionally, a component can be mounted onto a DOM element that does not match the\n * selector of the bootstrapped component.\n *\n * In the following example, we are providing a CSS selector to match the target element.\n *\n * {@example core/ts/platform/platform.ts region='cssSelector'}\n *\n * While in this example, we are providing reference to a DOM node.\n *\n * {@example core/ts/platform/platform.ts region='domNode'}\n */\n bootstrap(componentOrFactory, rootSelectorOrNode) {\n (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();\n const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;\n const initStatus = this._injector.get(ApplicationInitStatus);\n if (!initStatus.done) {\n const standalone = !isComponentFactory && isStandalone(componentOrFactory);\n const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) &&\n 'Cannot bootstrap as there are still asynchronous initializers running.' +\n (standalone\n ? ''\n : ' Bootstrap components in the `ngDoBootstrap` method of the root module.');\n throw new RuntimeError(405 /* RuntimeErrorCode.ASYNC_INITIALIZERS_STILL_RUNNING */, errorMessage);\n }\n let componentFactory;\n if (isComponentFactory) {\n componentFactory = componentOrFactory;\n }\n else {\n const resolver = this._injector.get(ComponentFactoryResolver$1);\n componentFactory = resolver.resolveComponentFactory(componentOrFactory);\n }\n this.componentTypes.push(componentFactory.componentType);\n // Create a factory associated with the current module if it's not bound to some other\n const ngModule = isBoundToModule(componentFactory)\n ? undefined\n : this._injector.get(NgModuleRef$1);\n const selectorOrNode = rootSelectorOrNode || componentFactory.selector;\n const compRef = componentFactory.create(Injector.NULL, [], selectorOrNode, ngModule);\n const nativeElement = compRef.location.nativeElement;\n const testability = compRef.injector.get(TESTABILITY, null);\n testability?.registerApplication(nativeElement);\n compRef.onDestroy(() => {\n this.detachView(compRef.hostView);\n remove(this.components, compRef);\n testability?.unregisterApplication(nativeElement);\n });\n this._loadComponent(compRef);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const _console = this._injector.get(Console);\n _console.log(`Angular is running in development mode.`);\n }\n return compRef;\n }\n /**\n * Invoke this method to explicitly process change detection and its side-effects.\n *\n * In development mode, `tick()` also performs a second change detection cycle to ensure that no\n * further changes are detected. If additional changes are picked up during this second cycle,\n * bindings in the app have side-effects that cannot be resolved in a single change detection\n * pass.\n * In this case, Angular throws an error, since an Angular application can only have one change\n * detection pass during which all change detection must complete.\n */\n tick() {\n if (!this.zonelessEnabled) {\n this.dirtyFlags |= 1 /* ApplicationRefDirtyFlags.ViewTreeGlobal */;\n }\n this._tick();\n }\n /** @internal */\n _tick() {\n (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();\n if (this._runningTick) {\n throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, ngDevMode && 'ApplicationRef.tick is called recursively');\n }\n const prevConsumer = setActiveConsumer$1(null);\n try {\n this._runningTick = true;\n this.synchronize();\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n for (let view of this._views) {\n view.checkNoChanges();\n }\n }\n }\n catch (e) {\n // Attention: Don't rethrow as it could cancel subscriptions to Observables!\n this.internalErrorHandler(e);\n }\n finally {\n this._runningTick = false;\n setActiveConsumer$1(prevConsumer);\n this.afterTick.next();\n }\n }\n /**\n * Performs the core work of synchronizing the application state with the UI, resolving any\n * pending dirtiness (potentially in a loop).\n */\n synchronize() {\n let rendererFactory = null;\n if (!this._injector.destroyed) {\n rendererFactory = this._injector.get(RendererFactory2, null, { optional: true });\n }\n // When beginning synchronization, all deferred dirtiness becomes active dirtiness.\n this.dirtyFlags |= this.deferredDirtyFlags;\n this.deferredDirtyFlags = 0 /* ApplicationRefDirtyFlags.None */;\n let runs = 0;\n while (this.dirtyFlags !== 0 /* ApplicationRefDirtyFlags.None */ && runs++ < MAXIMUM_REFRESH_RERUNS) {\n this.synchronizeOnce(rendererFactory);\n }\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && runs >= MAXIMUM_REFRESH_RERUNS) {\n throw new RuntimeError(103 /* RuntimeErrorCode.INFINITE_CHANGE_DETECTION */, ngDevMode &&\n 'Infinite change detection while refreshing application views. ' +\n 'Ensure views are not calling `markForCheck` on every template execution or ' +\n 'that afterRender hooks always mark views for check.');\n }\n }\n /**\n * Perform a single synchronization pass.\n */\n synchronizeOnce(rendererFactory) {\n // If we happened to loop, deferred dirtiness can be processed as active dirtiness again.\n this.dirtyFlags |= this.deferredDirtyFlags;\n this.deferredDirtyFlags = 0 /* ApplicationRefDirtyFlags.None */;\n // First check dirty views, if there are any.\n if (this.dirtyFlags & 7 /* ApplicationRefDirtyFlags.ViewTreeAny */) {\n // Change detection on views starts in targeted mode (only check components if they're\n // marked as dirty) unless global checking is specifically requested via APIs like\n // `ApplicationRef.tick()` and the `NgZone` integration.\n const useGlobalCheck = Boolean(this.dirtyFlags & 1 /* ApplicationRefDirtyFlags.ViewTreeGlobal */);\n // Clear the view-related dirty flags.\n this.dirtyFlags &= ~7 /* ApplicationRefDirtyFlags.ViewTreeAny */;\n // Set the AfterRender bit, as we're checking views and will need to run afterRender hooks.\n this.dirtyFlags |= 8 /* ApplicationRefDirtyFlags.AfterRender */;\n // Check all potentially dirty views.\n this.beforeRender.next(useGlobalCheck);\n for (let { _lView, notifyErrorHandler } of this._views) {\n detectChangesInViewIfRequired(_lView, notifyErrorHandler, useGlobalCheck, this.zonelessEnabled);\n }\n // If `markForCheck()` was called during view checking, it will have set the `ViewTreeCheck`\n // flag. We clear the flag here because, for backwards compatibility, `markForCheck()`\n // during view checking doesn't cause the view to be re-checked.\n this.dirtyFlags &= ~4 /* ApplicationRefDirtyFlags.ViewTreeCheck */;\n // Check if any views are still dirty after checking and we need to loop back.\n this.syncDirtyFlagsWithViews();\n if (this.dirtyFlags & 7 /* ApplicationRefDirtyFlags.ViewTreeAny */) {\n // If any views are still dirty after checking, loop back before running render hooks.\n return;\n }\n }\n else {\n // If we skipped refreshing views above, there might still be unflushed animations\n // because we never called `detectChangesInternal` on the views.\n rendererFactory?.begin?.();\n rendererFactory?.end?.();\n }\n // Even if there were no dirty views, afterRender hooks might still be dirty.\n if (this.dirtyFlags & 8 /* ApplicationRefDirtyFlags.AfterRender */) {\n this.dirtyFlags &= ~8 /* ApplicationRefDirtyFlags.AfterRender */;\n this.afterRenderManager.execute();\n // afterRender hooks might influence dirty flags.\n }\n this.syncDirtyFlagsWithViews();\n }\n /**\n * Checks `allViews` for views which require refresh/traversal, and updates `dirtyFlags`\n * accordingly, with two potential behaviors:\n *\n * 1. If any of our views require updating, then this adds the `ViewTreeTraversal` dirty flag.\n * This _should_ be a no-op, since the scheduler should've added the flag at the same time the\n * view was marked as needing updating.\n *\n * TODO(alxhub): figure out if this behavior is still needed for edge cases.\n *\n * 2. If none of our views require updating, then clear the view-related `dirtyFlag`s. This\n * happens when the scheduler is notified of a view becoming dirty, but the view itself isn't\n * reachable through traversal from our roots (e.g. it's detached from the CD tree).\n */\n syncDirtyFlagsWithViews() {\n if (this.allViews.some(({ _lView }) => requiresRefreshOrTraversal(_lView))) {\n // If after running all afterRender callbacks new views are dirty, ensure we loop back.\n this.dirtyFlags |= 2 /* ApplicationRefDirtyFlags.ViewTreeTraversal */;\n return;\n }\n else {\n // Even though this flag may be set, none of _our_ views require traversal, and so the\n // `ApplicationRef` doesn't require any repeated checking.\n this.dirtyFlags &= ~7 /* ApplicationRefDirtyFlags.ViewTreeAny */;\n }\n }\n /**\n * Attaches a view so that it will be dirty checked.\n * The view will be automatically detached when it is destroyed.\n * This will throw if the view is already attached to a ViewContainer.\n */\n attachView(viewRef) {\n (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();\n const view = viewRef;\n this._views.push(view);\n view.attachToAppRef(this);\n }\n /**\n * Detaches a view from dirty checking again.\n */\n detachView(viewRef) {\n (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();\n const view = viewRef;\n remove(this._views, view);\n view.detachFromAppRef();\n }\n _loadComponent(componentRef) {\n this.attachView(componentRef.hostView);\n this.tick();\n this.components.push(componentRef);\n // Get the listeners lazily to prevent DI cycles.\n const listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, []);\n if (ngDevMode && !Array.isArray(listeners)) {\n throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_BOOTSTRAP_LISTENER` token value ' +\n `(expected an array, but got ${typeof listeners}). ` +\n 'Please check that the `APP_BOOTSTRAP_LISTENER` token is configured as a ' +\n '`multi: true` provider.');\n }\n [...this._bootstrapListeners, ...listeners].forEach((listener) => listener(componentRef));\n }\n /** @internal */\n ngOnDestroy() {\n if (this._destroyed)\n return;\n try {\n // Call all the lifecycle hooks.\n this._destroyListeners.forEach((listener) => listener());\n // Destroy all registered views.\n this._views.slice().forEach((view) => view.destroy());\n }\n finally {\n // Indicate that this instance is destroyed.\n this._destroyed = true;\n // Release all references.\n this._views = [];\n this._bootstrapListeners = [];\n this._destroyListeners = [];\n }\n }\n /**\n * Registers a listener to be called when an instance is destroyed.\n *\n * @param callback A callback function to add as a listener.\n * @returns A function which unregisters a listener.\n */\n onDestroy(callback) {\n (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();\n this._destroyListeners.push(callback);\n return () => remove(this._destroyListeners, callback);\n }\n /**\n * Destroys an Angular application represented by this `ApplicationRef`. Calling this function\n * will destroy the associated environment injectors as well as all the bootstrapped components\n * with their views.\n */\n destroy() {\n if (this._destroyed) {\n throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');\n }\n const injector = this._injector;\n // Check that this injector instance supports destroy operation.\n if (injector.destroy && !injector.destroyed) {\n // Destroying an underlying injector will trigger the `ngOnDestroy` lifecycle\n // hook, which invokes the remaining cleanup actions.\n injector.destroy();\n }\n }\n /**\n * Returns the number of attached views.\n */\n get viewCount() {\n return this._views.length;\n }\n warnIfDestroyed() {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && this._destroyed) {\n console.warn(formatRuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));\n }\n }\n static { this.ɵfac = function ApplicationRef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ApplicationRef)(); }; }\n static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' }); }\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ApplicationRef, [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], null, null); })();\nfunction remove(list, el) {\n const index = list.indexOf(el);\n if (index > -1) {\n list.splice(index, 1);\n }\n}\nlet whenStableStore;\n/**\n * Returns a Promise that resolves when the application becomes stable after this method is called\n * the first time.\n */\nfunction whenStable(applicationRef) {\n whenStableStore ??= new WeakMap();\n const cachedWhenStable = whenStableStore.get(applicationRef);\n if (cachedWhenStable) {\n return cachedWhenStable;\n }\n const whenStablePromise = applicationRef.isStable\n .pipe(first((isStable) => isStable))\n .toPromise()\n .then(() => void 0);\n whenStableStore.set(applicationRef, whenStablePromise);\n // Be a good citizen and clean the store `onDestroy` even though we are using `WeakMap`.\n applicationRef.onDestroy(() => whenStableStore?.delete(applicationRef));\n return whenStablePromise;\n}\nfunction detectChangesInViewIfRequired(lView, notifyErrorHandler, isFirstPass, zonelessEnabled) {\n // When re-checking, only check views which actually need it.\n if (!isFirstPass && !requiresRefreshOrTraversal(lView)) {\n return;\n }\n const mode = isFirstPass && !zonelessEnabled\n ? // The first pass is always in Global mode, which includes `CheckAlways` views.\n 0 /* ChangeDetectionMode.Global */\n : // Only refresh views with the `RefreshView` flag or views is a changed signal\n 1 /* ChangeDetectionMode.Targeted */;\n detectChangesInternal(lView, notifyErrorHandler, mode);\n}\n\n/**\n * Combination of NgModuleFactory and ComponentFactories.\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n */\nclass ModuleWithComponentFactories {\n constructor(ngModuleFactory, componentFactories) {\n this.ngModuleFactory = ngModuleFactory;\n this.componentFactories = componentFactories;\n }\n}\n/**\n * Low-level service for running the angular compiler during runtime\n * to create {@link ComponentFactory}s, which\n * can later be used to create and render a Component instance.\n *\n * Each `@NgModule` provides an own `Compiler` to its injector,\n * that will use the directives/pipes of the ng module for compilation\n * of components.\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n */\nclass Compiler {\n /**\n * Compiles the given NgModule and all of its components. All templates of the components\n * have to be inlined.\n */\n compileModuleSync(moduleType) {\n return new NgModuleFactory(moduleType);\n }\n /**\n * Compiles the given NgModule and all of its components\n */\n compileModuleAsync(moduleType) {\n return Promise.resolve(this.compileModuleSync(moduleType));\n }\n /**\n * Same as {@link Compiler#compileModuleSync compileModuleSync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsSync(moduleType) {\n const ngModuleFactory = this.compileModuleSync(moduleType);\n const moduleDef = getNgModuleDef(moduleType);\n const componentFactories = maybeUnwrapFn(moduleDef.declarations).reduce((factories, declaration) => {\n const componentDef = getComponentDef(declaration);\n componentDef && factories.push(new ComponentFactory(componentDef));\n return factories;\n }, []);\n return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);\n }\n /**\n * Same as {@link Compiler#compileModuleAsync compileModuleAsync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsAsync(moduleType) {\n return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));\n }\n /**\n * Clears all caches.\n */\n clearCache() { }\n /**\n * Clears the cache for the given component/ngModule.\n */\n clearCacheFor(type) { }\n /**\n * Returns the id for a given NgModule, if one is defined and known to the compiler.\n */\n getModuleId(moduleType) {\n return undefined;\n }\n static { this.ɵfac = function Compiler_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Compiler)(); }; }\n static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac, providedIn: 'root' }); }\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(Compiler, [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], null, null); })();\n/**\n * Token to provide CompilerOptions in the platform injector.\n *\n * @publicApi\n */\nconst COMPILER_OPTIONS = new InjectionToken(ngDevMode ? 'compilerOptions' : '');\n/**\n * A factory for creating a Compiler\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n */\nclass CompilerFactory {\n}\n\nfunction compileNgModuleFactory(injector, options, moduleType) {\n ngDevMode && assertNgModuleType(moduleType);\n const moduleFactory = new NgModuleFactory(moduleType);\n // All of the logic below is irrelevant for AOT-compiled code.\n if (typeof ngJitMode !== 'undefined' && !ngJitMode) {\n return Promise.resolve(moduleFactory);\n }\n const compilerOptions = injector.get(COMPILER_OPTIONS, []).concat(options);\n // Configure the compiler to use the provided options. This call may fail when multiple modules\n // are bootstrapped with incompatible options, as a component can only be compiled according to\n // a single set of options.\n setJitOptions({\n defaultEncapsulation: _lastDefined(compilerOptions.map((opts) => opts.defaultEncapsulation)),\n preserveWhitespaces: _lastDefined(compilerOptions.map((opts) => opts.preserveWhitespaces)),\n });\n if (isComponentResourceResolutionQueueEmpty()) {\n return Promise.resolve(moduleFactory);\n }\n const compilerProviders = compilerOptions.flatMap((option) => option.providers ?? []);\n // In case there are no compiler providers, we just return the module factory as\n // there won't be any resource loader. This can happen with Ivy, because AOT compiled\n // modules can be still passed through \"bootstrapModule\". In that case we shouldn't\n // unnecessarily require the JIT compiler.\n if (compilerProviders.length === 0) {\n return Promise.resolve(moduleFactory);\n }\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'NgModule',\n type: moduleType,\n });\n const compilerInjector = Injector.create({ providers: compilerProviders });\n const resourceLoader = compilerInjector.get(compiler.ResourceLoader);\n // The resource loader can also return a string while the \"resolveComponentResources\"\n // always expects a promise. Therefore we need to wrap the returned value in a promise.\n return resolveComponentResources((url) => Promise.resolve(resourceLoader.get(url))).then(() => moduleFactory);\n}\nfunction _lastDefined(args) {\n for (let i = args.length - 1; i >= 0; i--) {\n if (args[i] !== undefined) {\n return args[i];\n }\n }\n return undefined;\n}\n\nclass NgZoneChangeDetectionScheduler {\n constructor() {\n this.zone = inject(NgZone);\n this.changeDetectionScheduler = inject(ChangeDetectionScheduler);\n this.applicationRef = inject(ApplicationRef);\n }\n initialize() {\n if (this._onMicrotaskEmptySubscription) {\n return;\n }\n this._onMicrotaskEmptySubscription = this.zone.onMicrotaskEmpty.subscribe({\n next: () => {\n // `onMicroTaskEmpty` can happen _during_ the zoneless scheduler change detection because\n // zone.run(() => {}) will result in `checkStable` at the end of the `zone.run` closure\n // and emit `onMicrotaskEmpty` synchronously if run coalsecing is false.\n if (this.changeDetectionScheduler.runningTick) {\n return;\n }\n this.zone.run(() => {\n this.applicationRef.tick();\n });\n },\n });\n }\n ngOnDestroy() {\n this._onMicrotaskEmptySubscription?.unsubscribe();\n }\n static { this.ɵfac = function NgZoneChangeDetectionScheduler_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgZoneChangeDetectionScheduler)(); }; }\n static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: NgZoneChangeDetectionScheduler, factory: NgZoneChangeDetectionScheduler.ɵfac, providedIn: 'root' }); }\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(NgZoneChangeDetectionScheduler, [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], null, null); })();\n/**\n * Internal token used to verify that `provideZoneChangeDetection` is not used\n * with the bootstrapModule API.\n */\nconst PROVIDED_NG_ZONE = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'provideZoneChangeDetection token' : '', { factory: () => false });\nfunction internalProvideZoneChangeDetection({ ngZoneFactory, ignoreChangesOutsideZone, scheduleInRootZone, }) {\n ngZoneFactory ??= () => new NgZone({ ...getNgZoneOptions(), scheduleInRootZone });\n return [\n { provide: NgZone, useFactory: ngZoneFactory },\n {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory: () => {\n const ngZoneChangeDetectionScheduler = inject(NgZoneChangeDetectionScheduler, {\n optional: true,\n });\n if ((typeof ngDevMode === 'undefined' || ngDevMode) &&\n ngZoneChangeDetectionScheduler === null) {\n throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, `A required Injectable was not found in the dependency injection tree. ` +\n 'If you are bootstrapping an NgModule, make sure that the `BrowserModule` is imported.');\n }\n return () => ngZoneChangeDetectionScheduler.initialize();\n },\n },\n {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory: () => {\n const service = inject(ZoneStablePendingTask);\n return () => {\n service.initialize();\n };\n },\n },\n // Always disable scheduler whenever explicitly disabled, even if another place called\n // `provideZoneChangeDetection` without the 'ignore' option.\n ignoreChangesOutsideZone === true ? { provide: ZONELESS_SCHEDULER_DISABLED, useValue: true } : [],\n {\n provide: SCHEDULE_IN_ROOT_ZONE,\n useValue: scheduleInRootZone ?? SCHEDULE_IN_ROOT_ZONE_DEFAULT,\n },\n ];\n}\n/**\n * Provides `NgZone`-based change detection for the application bootstrapped using\n * `bootstrapApplication`.\n *\n * `NgZone` is already provided in applications by default. This provider allows you to configure\n * options like `eventCoalescing` in the `NgZone`.\n * This provider is not available for `platformBrowser().bootstrapModule`, which uses\n * `BootstrapOptions` instead.\n *\n * @usageNotes\n * ```typescript\n * bootstrapApplication(MyApp, {providers: [\n * provideZoneChangeDetection({eventCoalescing: true}),\n * ]});\n * ```\n *\n * @publicApi\n * @see {@link bootstrapApplication}\n * @see {@link NgZoneOptions}\n */\nfunction provideZoneChangeDetection(options) {\n const ignoreChangesOutsideZone = options?.ignoreChangesOutsideZone;\n const scheduleInRootZone = options?.scheduleInRootZone;\n const zoneProviders = internalProvideZoneChangeDetection({\n ngZoneFactory: () => {\n const ngZoneOptions = getNgZoneOptions(options);\n ngZoneOptions.scheduleInRootZone = scheduleInRootZone;\n if (ngZoneOptions.shouldCoalesceEventChangeDetection) {\n performanceMarkFeature('NgZone_CoalesceEvent');\n }\n return new NgZone(ngZoneOptions);\n },\n ignoreChangesOutsideZone,\n scheduleInRootZone,\n });\n return makeEnvironmentProviders([\n { provide: PROVIDED_NG_ZONE, useValue: true },\n { provide: ZONELESS_ENABLED, useValue: false },\n zoneProviders,\n ]);\n}\n// Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->\n// `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in\n// a set of default options returned.\nfunction getNgZoneOptions(options) {\n return {\n enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,\n shouldCoalesceEventChangeDetection: options?.eventCoalescing ?? false,\n shouldCoalesceRunChangeDetection: options?.runCoalescing ?? false,\n };\n}\nclass ZoneStablePendingTask {\n constructor() {\n this.subscription = new Subscription();\n this.initialized = false;\n this.zone = inject(NgZone);\n this.pendingTasks = inject(PendingTasks);\n }\n initialize() {\n if (this.initialized) {\n return;\n }\n this.initialized = true;\n let task = null;\n if (!this.zone.isStable && !this.zone.hasPendingMacrotasks && !this.zone.hasPendingMicrotasks) {\n task = this.pendingTasks.add();\n }\n this.zone.runOutsideAngular(() => {\n this.subscription.add(this.zone.onStable.subscribe(() => {\n NgZone.assertNotInAngularZone();\n // Check whether there are no pending macro/micro tasks in the next tick\n // to allow for NgZone to update the state.\n queueMicrotask(() => {\n if (task !== null &&\n !this.zone.hasPendingMacrotasks &&\n !this.zone.hasPendingMicrotasks) {\n this.pendingTasks.remove(task);\n task = null;\n }\n });\n }));\n });\n this.subscription.add(this.zone.onUnstable.subscribe(() => {\n NgZone.assertInAngularZone();\n task ??= this.pendingTasks.add();\n }));\n }\n ngOnDestroy() {\n this.subscription.unsubscribe();\n }\n static { this.ɵfac = function ZoneStablePendingTask_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ZoneStablePendingTask)(); }; }\n static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ZoneStablePendingTask, factory: ZoneStablePendingTask.ɵfac, providedIn: 'root' }); }\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ZoneStablePendingTask, [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], null, null); })();\n\nconst CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT = 100;\nlet consecutiveMicrotaskNotifications = 0;\nlet stackFromLastFewNotifications = [];\nfunction trackMicrotaskNotificationForDebugging() {\n consecutiveMicrotaskNotifications++;\n if (CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT - consecutiveMicrotaskNotifications < 5) {\n const stack = new Error().stack;\n if (stack) {\n stackFromLastFewNotifications.push(stack);\n }\n }\n if (consecutiveMicrotaskNotifications === CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT) {\n throw new RuntimeError(103 /* RuntimeErrorCode.INFINITE_CHANGE_DETECTION */, 'Angular could not stabilize because there were endless change notifications within the browser event loop. ' +\n 'The stack from the last several notifications: \\n' +\n stackFromLastFewNotifications.join('\\n'));\n }\n}\nclass ChangeDetectionSchedulerImpl {\n constructor() {\n this.appRef = inject(ApplicationRef);\n this.taskService = inject(PendingTasks);\n this.ngZone = inject(NgZone);\n this.zonelessEnabled = inject(ZONELESS_ENABLED);\n this.disableScheduling = inject(ZONELESS_SCHEDULER_DISABLED, { optional: true }) ?? false;\n this.zoneIsDefined = typeof Zone !== 'undefined' && !!Zone.root.run;\n this.schedulerTickApplyArgs = [{ data: { '__scheduler_tick__': true } }];\n this.subscriptions = new Subscription();\n this.angularZoneId = this.zoneIsDefined\n ? this.ngZone._inner?.get(angularZoneInstanceIdProperty)\n : null;\n this.scheduleInRootZone = !this.zonelessEnabled &&\n this.zoneIsDefined &&\n (inject(SCHEDULE_IN_ROOT_ZONE, { optional: true }) ?? false);\n this.cancelScheduledCallback = null;\n this.useMicrotaskScheduler = false;\n this.runningTick = false;\n this.pendingRenderTaskId = null;\n this.subscriptions.add(this.appRef.afterTick.subscribe(() => {\n // If the scheduler isn't running a tick but the application ticked, that means\n // someone called ApplicationRef.tick manually. In this case, we should cancel\n // any change detections that had been scheduled so we don't run an extra one.\n if (!this.runningTick) {\n this.cleanup();\n }\n }));\n this.subscriptions.add(this.ngZone.onUnstable.subscribe(() => {\n // If the zone becomes unstable when we're not running tick (this happens from the zone.run),\n // we should cancel any scheduled change detection here because at this point we\n // know that the zone will stabilize at some point and run change detection itself.\n if (!this.runningTick) {\n this.cleanup();\n }\n }));\n // TODO(atscott): These conditions will need to change when zoneless is the default\n // Instead, they should flip to checking if ZoneJS scheduling is provided\n this.disableScheduling ||=\n !this.zonelessEnabled &&\n // NoopNgZone without enabling zoneless means no scheduling whatsoever\n (this.ngZone instanceof NoopNgZone ||\n // The same goes for the lack of Zone without enabling zoneless scheduling\n !this.zoneIsDefined);\n }\n notify(source) {\n if (!this.zonelessEnabled && source === 5 /* NotificationSource.Listener */) {\n // When the notification comes from a listener, we skip the notification unless the\n // application has enabled zoneless. Ideally, listeners wouldn't notify the scheduler at all\n // automatically. We do not know that a developer made a change in the listener callback that\n // requires an `ApplicationRef.tick` (synchronize templates / run render hooks). We do this\n // only for an easier migration from OnPush components to zoneless. Because listeners are\n // usually executed inside the Angular zone and listeners automatically call `markViewDirty`,\n // developers never needed to manually use `ChangeDetectorRef.markForCheck` or some other API\n // to make listener callbacks work correctly with `OnPush` components.\n return;\n }\n switch (source) {\n case 0 /* NotificationSource.MarkAncestorsForTraversal */: {\n this.appRef.dirtyFlags |= 2 /* ApplicationRefDirtyFlags.ViewTreeTraversal */;\n break;\n }\n case 3 /* NotificationSource.DebugApplyChanges */:\n case 2 /* NotificationSource.DeferBlockStateUpdate */:\n case 4 /* NotificationSource.MarkForCheck */:\n case 5 /* NotificationSource.Listener */:\n case 1 /* NotificationSource.SetInput */: {\n this.appRef.dirtyFlags |= 4 /* ApplicationRefDirtyFlags.ViewTreeCheck */;\n break;\n }\n case 7 /* NotificationSource.DeferredRenderHook */: {\n // Render hooks are \"deferred\" when they're triggered from other render hooks. Using the\n // deferred dirty flags ensures that adding new hooks doesn't automatically trigger a loop\n // inside tick().\n this.appRef.deferredDirtyFlags |= 8 /* ApplicationRefDirtyFlags.AfterRender */;\n break;\n }\n case 9 /* NotificationSource.ViewDetachedFromDOM */:\n case 8 /* NotificationSource.ViewAttached */:\n case 6 /* NotificationSource.RenderHook */:\n case 10 /* NotificationSource.AsyncAnimationsLoaded */:\n default: {\n // These notifications only schedule a tick but do not change whether we should refresh\n // views. Instead, we only need to run render hooks unless another notification from the\n // other set is also received before `tick` happens.\n this.appRef.dirtyFlags |= 8 /* ApplicationRefDirtyFlags.AfterRender */;\n }\n }\n if (!this.shouldScheduleTick()) {\n return;\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (this.useMicrotaskScheduler) {\n trackMicrotaskNotificationForDebugging();\n }\n else {\n consecutiveMicrotaskNotifications = 0;\n stackFromLastFewNotifications.length = 0;\n }\n }\n const scheduleCallback = this.useMicrotaskScheduler\n ? scheduleCallbackWithMicrotask\n : scheduleCallbackWithRafRace;\n this.pendingRenderTaskId = this.taskService.add();\n if (this.scheduleInRootZone) {\n this.cancelScheduledCallback = Zone.root.run(() => scheduleCallback(() => this.tick()));\n }\n else {\n this.cancelScheduledCallback = this.ngZone.runOutsideAngular(() => scheduleCallback(() => this.tick()));\n }\n }\n shouldScheduleTick() {\n if (this.disableScheduling) {\n return false;\n }\n // already scheduled or running\n if (this.pendingRenderTaskId !== null || this.runningTick || this.appRef._runningTick) {\n return false;\n }\n // If we're inside the zone don't bother with scheduler. Zone will stabilize\n // eventually and run change detection.\n if (!this.zonelessEnabled &&\n this.zoneIsDefined &&\n Zone.current.get(angularZoneInstanceIdProperty + this.angularZoneId)) {\n return false;\n }\n return true;\n }\n /**\n * Calls ApplicationRef._tick inside the `NgZone`.\n *\n * Calling `tick` directly runs change detection and cancels any change detection that had been\n * scheduled previously.\n *\n * @param shouldRefreshViews Passed directly to `ApplicationRef._tick` and skips straight to\n * render hooks when `false`.\n */\n tick() {\n // When ngZone.run below exits, onMicrotaskEmpty may emit if the zone is\n // stable. We want to prevent double ticking so we track whether the tick is\n // already running and skip it if so.\n if (this.runningTick || this.appRef.destroyed) {\n return;\n }\n // The scheduler used to pass \"whether to check views\" as a boolean flag instead of setting\n // fine-grained dirtiness flags, and global checking was always used on the first pass. This\n // created an interesting edge case: if a notification made a view dirty and then ticked via the\n // scheduler (and not the zone) a global check was still performed.\n //\n // Ideally, this would not be the case, and only zone-based ticks would do global passes.\n // However this is a breaking change and requires fixes in g3. Until this cleanup can be done,\n // we add the `ViewTreeGlobal` flag to request a global check if any views are dirty in a\n // scheduled tick (unless zoneless is enabled, in which case global checks aren't really a\n // thing).\n //\n // TODO(alxhub): clean up and remove this workaround as a breaking change.\n if (!this.zonelessEnabled && this.appRef.dirtyFlags & 7 /* ApplicationRefDirtyFlags.ViewTreeAny */) {\n this.appRef.dirtyFlags |= 1 /* ApplicationRefDirtyFlags.ViewTreeGlobal */;\n }\n const task = this.taskService.add();\n try {\n this.ngZone.run(() => {\n this.runningTick = true;\n this.appRef._tick();\n }, undefined, this.schedulerTickApplyArgs);\n }\n catch (e) {\n this.taskService.remove(task);\n throw e;\n }\n finally {\n this.cleanup();\n }\n // If we're notified of a change within 1 microtask of running change\n // detection, run another round in the same event loop. This allows code\n // which uses Promise.resolve (see NgModel) to avoid\n // ExpressionChanged...Error to still be reflected in a single browser\n // paint, even if that spans multiple rounds of change detection.\n this.useMicrotaskScheduler = true;\n scheduleCallbackWithMicrotask(() => {\n this.useMicrotaskScheduler = false;\n this.taskService.remove(task);\n });\n }\n ngOnDestroy() {\n this.subscriptions.unsubscribe();\n this.cleanup();\n }\n cleanup() {\n this.runningTick = false;\n this.cancelScheduledCallback?.();\n this.cancelScheduledCallback = null;\n // If this is the last task, the service will synchronously emit a stable\n // notification. If there is a subscriber that then acts in a way that\n // tries to notify the scheduler again, we need to be able to respond to\n // schedule a new change detection. Therefore, we should clear the task ID\n // before removing it from the pending tasks (or the tasks service should\n // not synchronously emit stable, similar to how Zone stableness only\n // happens if it's still stable after a microtask).\n if (this.pendingRenderTaskId !== null) {\n const taskId = this.pendingRenderTaskId;\n this.pendingRenderTaskId = null;\n this.taskService.remove(taskId);\n }\n }\n static { this.ɵfac = function ChangeDetectionSchedulerImpl_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ChangeDetectionSchedulerImpl)(); }; }\n static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ChangeDetectionSchedulerImpl, factory: ChangeDetectionSchedulerImpl.ɵfac, providedIn: 'root' }); }\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ChangeDetectionSchedulerImpl, [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], () => [], null); })();\n/**\n * Provides change detection without ZoneJS for the application bootstrapped using\n * `bootstrapApplication`.\n *\n * This function allows you to configure the application to not use the state/state changes of\n * ZoneJS to schedule change detection in the application. This will work when ZoneJS is not present\n * on the page at all or if it exists because something else is using it (either another Angular\n * application which uses ZoneJS for scheduling or some other library that relies on ZoneJS).\n *\n * This can also be added to the `TestBed` providers to configure the test environment to more\n * closely match production behavior. This will help give higher confidence that components are\n * compatible with zoneless change detection.\n *\n * ZoneJS uses browser events to trigger change detection. When using this provider, Angular will\n * instead use Angular APIs to schedule change detection. These APIs include:\n *\n * - `ChangeDetectorRef.markForCheck`\n * - `ComponentRef.setInput`\n * - updating a signal that is read in a template\n * - when bound host or template listeners are triggered\n * - attaching a view that was marked dirty by one of the above\n * - removing a view\n * - registering a render hook (templates are only refreshed if render hooks do one of the above)\n *\n * @usageNotes\n * ```typescript\n * bootstrapApplication(MyApp, {providers: [\n * provideExperimentalZonelessChangeDetection(),\n * ]});\n * ```\n *\n * This API is experimental. Neither the shape, nor the underlying behavior is stable and can change\n * in patch versions. There are known feature gaps and API ergonomic considerations. We will iterate\n * on the exact API based on the feedback and our understanding of the problem and solution space.\n *\n * @publicApi\n * @experimental\n * @see [bootstrapApplication](/api/platform-browser/bootstrapApplication)\n */\nfunction provideExperimentalZonelessChangeDetection() {\n performanceMarkFeature('NgZoneless');\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && typeof Zone !== 'undefined' && Zone) {\n const message = formatRuntimeError(914 /* RuntimeErrorCode.UNEXPECTED_ZONEJS_PRESENT_IN_ZONELESS_MODE */, `The application is using zoneless change detection, but is still loading Zone.js. ` +\n `Consider removing Zone.js to get the full benefits of zoneless. ` +\n `In applications using the Angular CLI, Zone.js is typically included in the \"polyfills\" section of the angular.json file.`);\n console.warn(message);\n }\n return makeEnvironmentProviders([\n { provide: ChangeDetectionScheduler, useExisting: ChangeDetectionSchedulerImpl },\n { provide: NgZone, useClass: NoopNgZone },\n { provide: ZONELESS_ENABLED, useValue: true },\n { provide: SCHEDULE_IN_ROOT_ZONE, useValue: false },\n typeof ngDevMode === 'undefined' || ngDevMode\n ? [{ provide: PROVIDED_ZONELESS, useValue: true }]\n : [],\n ]);\n}\n\n/**\n * Work out the locale from the potential global properties.\n *\n * * Closure Compiler: use `goog.LOCALE`.\n * * Ivy enabled: use `$localize.locale`\n */\nfunction getGlobalLocale() {\n if (typeof ngI18nClosureMode !== 'undefined' &&\n ngI18nClosureMode &&\n typeof goog !== 'undefined' &&\n goog.LOCALE !== 'en') {\n // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.\n // * In order to preserve backwards compatibility, we use Angular default value over\n // Closure Compiler's one.\n return goog.LOCALE;\n }\n else {\n // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE\n // COMPILE-TIME INLINER.\n //\n // * During compile time inlining of translations the expression will be replaced\n // with a string literal that is the current locale. Other forms of this expression are not\n // guaranteed to be replaced.\n //\n // * During runtime translation evaluation, the developer is required to set `$localize.locale`\n // if required, or just to provide their own `LOCALE_ID` provider.\n return (typeof $localize !== 'undefined' && $localize.locale) || DEFAULT_LOCALE_ID;\n }\n}\n/**\n * Provide this token to set the locale of your application.\n * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,\n * DecimalPipe and PercentPipe) and by ICU expressions.\n *\n * See the [i18n guide](guide/i18n/locale-id) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { LOCALE_ID } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]\n * });\n * ```\n *\n * @publicApi\n */\nconst LOCALE_ID = new InjectionToken(ngDevMode ? 'LocaleId' : '', {\n providedIn: 'root',\n factory: () => inject(LOCALE_ID, InjectFlags.Optional | InjectFlags.SkipSelf) || getGlobalLocale(),\n});\n/**\n * Provide this token to set the default currency code your application uses for\n * CurrencyPipe when there is no currency code passed into it. This is only used by\n * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.\n *\n * See the [i18n guide](guide/i18n/locale-id) for more information.\n *\n * <div class=\"alert is-helpful\">\n *\n * **Deprecation notice:**\n *\n * The default currency code is currently always `USD` but this is deprecated from v9.\n *\n * **In v10 the default currency code will be taken from the current locale.**\n *\n * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in\n * your application `NgModule`:\n *\n * ```ts\n * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}\n * ```\n *\n * </div>\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]\n * });\n * ```\n *\n * @publicApi\n */\nconst DEFAULT_CURRENCY_CODE = new InjectionToken(ngDevMode ? 'DefaultCurrencyCode' : '', {\n providedIn: 'root',\n factory: () => USD_CURRENCY_CODE,\n});\n/**\n * Use this token at bootstrap to provide the content of your translation file (`xtb`,\n * `xlf` or `xlf2`) when you want to translate your application in another language.\n *\n * See the [i18n guide](guide/i18n/merge) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { TRANSLATIONS } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * // content of your translation file\n * const translations = '....';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS, useValue: translations }]\n * });\n * ```\n *\n * @publicApi\n */\nconst TRANSLATIONS = new InjectionToken(ngDevMode ? 'Translations' : '');\n/**\n * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,\n * `xlf` or `xlf2`.\n *\n * See the [i18n guide](guide/i18n/merge) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { TRANSLATIONS_FORMAT } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]\n * });\n * ```\n *\n * @publicApi\n */\nconst TRANSLATIONS_FORMAT = new InjectionToken(ngDevMode ? 'TranslationsFormat' : '');\n/**\n * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy\n * that the compiler should use in case of missing translations:\n * - Error: throw if you have missing translations.\n * - Warning (default): show a warning in the console and/or shell.\n * - Ignore: do nothing.\n *\n * See the [i18n guide](guide/i18n/merge#report-missing-translations) for more information.\n *\n * @usageNotes\n * ### Example\n * ```typescript\n * import { MissingTranslationStrategy } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * missingTranslation: MissingTranslationStrategy.Error\n * });\n * ```\n *\n * @publicApi\n */\nvar MissingTranslationStrategy;\n(function (MissingTranslationStrategy) {\n MissingTranslationStrategy[MissingTranslationStrategy[\"Error\"] = 0] = \"Error\";\n MissingTranslationStrategy[MissingTranslationStrategy[\"Warning\"] = 1] = \"Warning\";\n MissingTranslationStrategy[MissingTranslationStrategy[\"Ignore\"] = 2] = \"Ignore\";\n})(MissingTranslationStrategy || (MissingTranslationStrategy = {}));\n\n// A delay in milliseconds before the scan is run after onLoad, to avoid any\n// potential race conditions with other LCP-related functions. This delay\n// happens outside of the main JavaScript execution and will only effect the timing\n// on when the warning becomes visible in the console.\nconst SCAN_DELAY = 200;\nconst OVERSIZED_IMAGE_TOLERANCE = 1200;\nclass ImagePerformanceWarning {\n constructor() {\n // Map of full image URLs -> original `ngSrc` values.\n this.window = null;\n this.observer = null;\n this.options = inject(IMAGE_CONFIG);\n this.isBrowser = inject(PLATFORM_ID) === 'browser';\n }\n start() {\n if (!this.isBrowser ||\n typeof PerformanceObserver === 'undefined' ||\n (this.options?.disableImageSizeWarning && this.options?.disableImageLazyLoadWarning)) {\n return;\n }\n this.observer = this.initPerformanceObserver();\n const doc = getDocument();\n const win = doc.defaultView;\n if (typeof win !== 'undefined') {\n this.window = win;\n // Wait to avoid race conditions where LCP image triggers\n // load event before it's recorded by the performance observer\n const waitToScan = () => {\n setTimeout(this.scanImages.bind(this), SCAN_DELAY);\n };\n const setup = () => {\n // Consider the case when the application is created and destroyed multiple times.\n // Typically, applications are created instantly once the page is loaded, and the\n // `window.load` listener is always triggered. However, the `window.load` event will never\n // be fired if the page is loaded, and the application is created later. Checking for\n // `readyState` is the easiest way to determine whether the page has been loaded or not.\n if (doc.readyState === 'complete') {\n waitToScan();\n }\n else {\n this.window?.addEventListener('load', waitToScan, { once: true });\n }\n };\n // Angular doesn't have to run change detection whenever any asynchronous tasks are invoked in\n // the scope of this functionality.\n if (typeof Zone !== 'undefined') {\n Zone.root.run(() => setup());\n }\n else {\n setup();\n }\n }\n }\n ngOnDestroy() {\n this.observer?.disconnect();\n }\n initPerformanceObserver() {\n if (typeof PerformanceObserver === 'undefined') {\n return null;\n }\n const observer = new PerformanceObserver((entryList) => {\n const entries = entryList.getEntries();\n if (entries.length === 0)\n return;\n // We use the latest entry produced by the `PerformanceObserver` as the best\n // signal on which element is actually an LCP one. As an example, the first image to load on\n // a page, by virtue of being the only thing on the page so far, is often a LCP candidate\n // and gets reported by PerformanceObserver, but isn't necessarily the LCP element.\n const lcpElement = entries[entries.length - 1];\n // Cast to `any` due to missing `element` on the `LargestContentfulPaint` type of entry.\n // See https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint\n const imgSrc = lcpElement.element?.src ?? '';\n // Exclude `data:` and `blob:` URLs, since they are fetched resources.\n if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:'))\n return;\n this.lcpImageUrl = imgSrc;\n });\n observer.observe({ type: 'largest-contentful-paint', buffered: true });\n return observer;\n }\n scanImages() {\n const images = getDocument().querySelectorAll('img');\n let lcpElementFound, lcpElementLoadedCorrectly = false;\n images.forEach((image) => {\n if (!this.options?.disableImageSizeWarning) {\n // Image elements using the NgOptimizedImage directive are excluded,\n // as that directive has its own version of this check.\n if (!image.getAttribute('ng-img') && this.isOversized(image)) {\n logOversizedImageWarning(image.src);\n }\n }\n if (!this.options?.disableImageLazyLoadWarning && this.lcpImageUrl) {\n if (image.src === this.lcpImageUrl) {\n lcpElementFound = true;\n if (image.loading !== 'lazy' || image.getAttribute('ng-img')) {\n // This variable is set to true and never goes back to false to account\n // for the case where multiple images have the same src url, and some\n // have lazy loading while others don't.\n // Also ignore NgOptimizedImage because there's a different warning for that.\n lcpElementLoadedCorrectly = true;\n }\n }\n }\n });\n if (lcpElementFound &&\n !lcpElementLoadedCorrectly &&\n this.lcpImageUrl &&\n !this.options?.disableImageLazyLoadWarning) {\n logLazyLCPWarning(this.lcpImageUrl);\n }\n }\n isOversized(image) {\n if (!this.window) {\n return false;\n }\n // The `isOversized` check may not be applicable or may require adjustments\n // for several types of image formats or scenarios. Currently, we specify only\n // `svg`, but this may also include `gif` since their quality isnt tied to\n // dimensions in the same way as raster images.\n const nonOversizedImageExtentions = [\n // SVG images are vector-based, which means they can scale\n // to any size without losing quality.\n '.svg',\n ];\n // Convert it to lowercase because this may have uppercase\n // extensions, such as `IMAGE.SVG`.\n // We fallback to an empty string because `src` may be `undefined`\n // if it is explicitly set to `null` by some third-party code\n // (e.g., `image.src = null`).\n const imageSource = (image.src || '').toLowerCase();\n if (nonOversizedImageExtentions.some((extension) => imageSource.endsWith(extension))) {\n return false;\n }\n const computedStyle = this.window.getComputedStyle(image);\n let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));\n let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));\n const boxSizing = computedStyle.getPropertyValue('box-sizing');\n const objectFit = computedStyle.getPropertyValue('object-fit');\n if (objectFit === `cover`) {\n // Object fit cover may indicate a use case such as a sprite sheet where\n // this warning does not apply.\n return false;\n }\n if (boxSizing === 'border-box') {\n // If the image `box-sizing` is set to `border-box`, we adjust the rendered\n // dimensions by subtracting padding values.\n const paddingTop = computedStyle.getPropertyValue('padding-top');\n const paddingRight = computedStyle.getPropertyValue('padding-right');\n const paddingBottom = computedStyle.getPropertyValue('padding-bottom');\n const paddingLeft = computedStyle.getPropertyValue('padding-left');\n renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);\n renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);\n }\n const intrinsicWidth = image.naturalWidth;\n const intrinsicHeight = image.naturalHeight;\n const recommendedWidth = this.window.devicePixelRatio * renderedWidth;\n const recommendedHeight = this.window.devicePixelRatio * renderedHeight;\n const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE;\n const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE;\n return oversizedWidth || oversizedHeight;\n }\n static { this.ɵfac = function ImagePerformanceWarning_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ImagePerformanceWarning)(); }; }\n static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ImagePerformanceWarning, factory: ImagePerformanceWarning.ɵfac, providedIn: 'root' }); }\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ImagePerformanceWarning, [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], null, null); })();\nfunction logLazyLCPWarning(src) {\n console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} is the Largest Contentful Paint (LCP) element ` +\n `but was given a \"loading\" value of \"lazy\", which can negatively impact ` +\n `application loading performance. This warning can be addressed by ` +\n `changing the loading value of the LCP image to \"eager\", or by using the ` +\n `NgOptimizedImage directive's prioritization utilities. For more ` +\n `information about addressing or disabling this warning, see ` +\n `https://angular.dev/errors/NG0913`));\n}\nfunction logOversizedImageWarning(src) {\n console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} has intrinsic file dimensions much larger than its ` +\n `rendered size. This can negatively impact application loading performance. ` +\n `For more information about addressing or disabling this warning, see ` +\n `https://angular.dev/errors/NG0913`));\n}\n\n/**\n * Internal token that allows to register extra callbacks that should be invoked during the\n * `PlatformRef.destroy` operation. This token is needed to avoid a direct reference to the\n * `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the\n * entire class tree-shakeable.\n */\nconst PLATFORM_DESTROY_LISTENERS = new InjectionToken(ngDevMode ? 'PlatformDestroyListeners' : '');\n\nfunction isApplicationBootstrapConfig(config) {\n return !config.moduleRef;\n}\nfunction bootstrap(config) {\n const envInjector = isApplicationBootstrapConfig(config)\n ? config.r3Injector\n : config.moduleRef.injector;\n const ngZone = envInjector.get(NgZone);\n return ngZone.run(() => {\n if (isApplicationBootstrapConfig(config)) {\n config.r3Injector.resolveInjectorInitializers();\n }\n else {\n config.moduleRef.resolveInjectorInitializers();\n }\n const exceptionHandler = envInjector.get(ErrorHandler, null);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (exceptionHandler === null) {\n const errorMessage = isApplicationBootstrapConfig(config)\n ? 'No `ErrorHandler` found in the Dependency Injection tree.'\n : 'No ErrorHandler. Is platform module (BrowserModule) included';\n throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, errorMessage);\n }\n if (envInjector.get(PROVIDED_ZONELESS) && envInjector.get(PROVIDED_NG_ZONE)) {\n throw new RuntimeError(408 /* RuntimeErrorCode.PROVIDED_BOTH_ZONE_AND_ZONELESS */, 'Invalid change detection configuration: ' +\n 'provideZoneChangeDetection and provideExperimentalZonelessChangeDetection cannot be used together.');\n }\n }\n let onErrorSubscription;\n ngZone.runOutsideAngular(() => {\n onErrorSubscription = ngZone.onError.subscribe({\n next: (error) => {\n exceptionHandler.handleError(error);\n },\n });\n });\n // If the whole platform is destroyed, invoke the `destroy` method\n // for all bootstrapped applications as well.\n if (isApplicationBootstrapConfig(config)) {\n const destroyListener = () => envInjector.destroy();\n const onPlatformDestroyListeners = config.platformInjector.get(PLATFORM_DESTROY_LISTENERS);\n onPlatformDestroyListeners.add(destroyListener);\n envInjector.onDestroy(() => {\n onErrorSubscription.unsubscribe();\n onPlatformDestroyListeners.delete(destroyListener);\n });\n }\n else {\n const destroyListener = () => config.moduleRef.destroy();\n const onPlatformDestroyListeners = config.platformInjector.get(PLATFORM_DESTROY_LISTENERS);\n onPlatformDestroyListeners.add(destroyListener);\n config.moduleRef.onDestroy(() => {\n remove(config.allPlatformModules, config.moduleRef);\n onErrorSubscription.unsubscribe();\n onPlatformDestroyListeners.delete(destroyListener);\n });\n }\n return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {\n const initStatus = envInjector.get(ApplicationInitStatus);\n initStatus.runInitializers();\n return initStatus.donePromise.then(() => {\n // If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy\n const localeId = envInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);\n setLocaleId(localeId || DEFAULT_LOCALE_ID);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const imagePerformanceService = envInjector.get(ImagePerformanceWarning);\n imagePerformanceService.start();\n }\n if (isApplicationBootstrapConfig(config)) {\n const appRef = envInjector.get(ApplicationRef);\n if (config.rootComponent !== undefined) {\n appRef.bootstrap(config.rootComponent);\n }\n return appRef;\n }\n else {\n moduleDoBootstrap(config.moduleRef, config.allPlatformModules);\n return config.moduleRef;\n }\n });\n });\n });\n}\nfunction moduleDoBootstrap(moduleRef, allPlatformModules) {\n const appRef = moduleRef.injector.get(ApplicationRef);\n if (moduleRef._bootstrapComponents.length > 0) {\n moduleRef._bootstrapComponents.forEach((f) => appRef.bootstrap(f));\n }\n else if (moduleRef.instance.ngDoBootstrap) {\n moduleRef.instance.ngDoBootstrap(appRef);\n }\n else {\n throw new RuntimeError(-403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode &&\n `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +\n `but it does not declare \"@NgModule.bootstrap\" components nor a \"ngDoBootstrap\" method. ` +\n `Please define one of these.`);\n }\n allPlatformModules.push(moduleRef);\n}\n\n/**\n * The Angular platform is the entry point for Angular on a web page.\n * Each page has exactly one platform. Services (such as reflection) which are common\n * to every Angular application running on the page are bound in its scope.\n * A page's platform is initialized implicitly when a platform is created using a platform\n * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.\n *\n * @publicApi\n */\nclass PlatformRef {\n /** @internal */\n constructor(_injector) {\n this._injector = _injector;\n this._modules = [];\n this._destroyListeners = [];\n this._destroyed = false;\n }\n /**\n * Creates an instance of an `@NgModule` for the given platform.\n *\n * @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function\n * argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.\n */\n bootstrapModuleFactory(moduleFactory, options) {\n const scheduleInRootZone = options?.scheduleInRootZone;\n const ngZoneFactory = () => getNgZone(options?.ngZone, {\n ...getNgZoneOptions({\n eventCoalescing: options?.ngZoneEventCoalescing,\n runCoalescing: options?.ngZoneRunCoalescing,\n }),\n scheduleInRootZone,\n });\n const ignoreChangesOutsideZone = options?.ignoreChangesOutsideZone;\n const allAppProviders = [\n internalProvideZoneChangeDetection({\n ngZoneFactory,\n ignoreChangesOutsideZone,\n }),\n { provide: ChangeDetectionScheduler, useExisting: ChangeDetectionSchedulerImpl },\n ];\n const moduleRef = createNgModuleRefWithProviders(moduleFactory.moduleType, this.injector, allAppProviders);\n return bootstrap({\n moduleRef,\n allPlatformModules: this._modules,\n platformInjector: this.injector,\n });\n }\n /**\n * Creates an instance of an `@NgModule` for a given platform.\n *\n * @usageNotes\n * ### Simple Example\n *\n * ```typescript\n * @NgModule({\n * imports: [BrowserModule]\n * })\n * class MyModule {}\n *\n * let moduleRef = platformBrowser().bootstrapModule(MyModule);\n * ```\n *\n */\n bootstrapModule(moduleType, compilerOptions = []) {\n const options = optionsReducer({}, compilerOptions);\n return compileNgModuleFactory(this.injector, options, moduleType).then((moduleFactory) => this.bootstrapModuleFactory(moduleFactory, options));\n }\n /**\n * Registers a listener to be called when the platform is destroyed.\n */\n onDestroy(callback) {\n this._destroyListeners.push(callback);\n }\n /**\n * Retrieves the platform {@link Injector}, which is the parent injector for\n * every Angular application on the page and provides singleton providers.\n */\n get injector() {\n return this._injector;\n }\n /**\n * Destroys the current Angular platform and all Angular applications on the page.\n * Destroys all modules and listeners registered with the platform.\n */\n destroy() {\n if (this._destroyed) {\n throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');\n }\n this._modules.slice().forEach((module) => module.destroy());\n this._destroyListeners.forEach((listener) => listener());\n const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);\n if (destroyListeners) {\n destroyListeners.forEach((listener) => listener());\n destroyListeners.clear();\n }\n this._destroyed = true;\n }\n /**\n * Indicates whether this instance was destroyed.\n */\n get destroyed() {\n return this._destroyed;\n }\n static { this.ɵfac = function PlatformRef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PlatformRef)(ɵɵinject(Injector)); }; }\n static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' }); }\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(PlatformRef, [{\n type: Injectable,\n args: [{ providedIn: 'platform' }]\n }], () => [{ type: Injector }], null); })();\n\nlet _platformInjector = null;\n/**\n * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only\n * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.\n */\nconst ALLOW_MULTIPLE_PLATFORMS = new InjectionToken(ngDevMode ? 'AllowMultipleToken' : '');\n/**\n * Creates a platform.\n * Platforms must be created on launch using this function.\n *\n * @publicApi\n */\nfunction createPlatform(injector) {\n if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode && 'There can be only one platform. Destroy the previous one to create a new one.');\n }\n publishDefaultGlobalUtils();\n publishSignalConfiguration();\n _platformInjector = injector;\n const platform = injector.get(PlatformRef);\n runPlatformInitializers(injector);\n return platform;\n}\n/**\n * Creates a factory for a platform. Can be used to provide or override `Providers` specific to\n * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.\n * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories\n * to build up configurations that might be required by different libraries or parts of the\n * application.\n * @param name Identifies the new platform factory.\n * @param providers A set of dependency providers for platforms created with the new factory.\n *\n * @publicApi\n */\nfunction createPlatformFactory(parentPlatformFactory, name, providers = []) {\n const desc = `Platform: ${name}`;\n const marker = new InjectionToken(desc);\n return (extraProviders = []) => {\n let platform = getPlatform();\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n const platformProviders = [\n ...providers,\n ...extraProviders,\n { provide: marker, useValue: true },\n ];\n if (parentPlatformFactory) {\n parentPlatformFactory(platformProviders);\n }\n else {\n createPlatform(createPlatformInjector(platformProviders, desc));\n }\n }\n return assertPlatform(marker);\n };\n}\n/**\n * Helper function to create an instance of a platform injector (that maintains the 'platform'\n * scope).\n */\nfunction createPlatformInjector(providers = [], name) {\n return Injector.create({\n name,\n providers: [\n { provide: INJECTOR_SCOPE, useValue: 'platform' },\n { provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => (_platformInjector = null)]) },\n ...providers,\n ],\n });\n}\n/**\n * Checks that there is currently a platform that contains the given token as a provider.\n *\n * @publicApi\n */\nfunction assertPlatform(requiredToken) {\n const platform = getPlatform();\n if (!platform) {\n throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');\n }\n if ((typeof ngDevMode === 'undefined' || ngDevMode) &&\n !platform.injector.get(requiredToken, null)) {\n throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');\n }\n return platform;\n}\n/**\n * Returns the current platform.\n *\n * @publicApi\n */\nfunction getPlatform() {\n return _platformInjector?.get(PlatformRef) ?? null;\n}\n/**\n * Destroys the current Angular platform and all Angular applications on the page.\n * Destroys all modules and listeners registered with the platform.\n *\n * @publicApi\n */\nfunction destroyPlatform() {\n getPlatform()?.destroy();\n}\n/**\n * The goal of this function is to bootstrap a platform injector,\n * but avoid referencing `PlatformRef` class.\n * This function is needed for bootstrapping a Standalone Component.\n */\nfunction createOrReusePlatformInjector(providers = []) {\n // If a platform injector already exists, it means that the platform\n // is already bootstrapped and no additional actions are required.\n if (_platformInjector)\n return _platformInjector;\n publishDefaultGlobalUtils();\n // Otherwise, setup a new platform injector and run platform initializers.\n const injector = createPlatformInjector(providers);\n _platformInjector = injector;\n publishSignalConfiguration();\n runPlatformInitializers(injector);\n return injector;\n}\nfunction runPlatformInitializers(injector) {\n const inits = injector.get(PLATFORM_INITIALIZER, null);\n inits?.forEach((init) => init());\n}\n\n/**\n * Used to periodically verify no expressions have changed after they were checked.\n *\n * @param options Used to configure when the check will execute.\n * - `interval` will periodically run exhaustive `checkNoChanges` on application views\n * - `useNgZoneOnStable` will use ZoneJS to determine when change detection might have run\n * in an application using ZoneJS to drive change detection. When the `NgZone.onStable` would\n * have emitted, all views attached to the `ApplicationRef` are checked for changes.\n * - 'exhaustive' means that all views attached to `ApplicationRef` and all the descendants of those views will be\n * checked for changes (excluding those subtrees which are detached via `ChangeDetectorRef.detach()`).\n * This is useful because the check that runs after regular change detection does not work for components using `ChangeDetectionStrategy.OnPush`.\n * This check is will surface any existing errors hidden by `OnPush` components. By default, this check is exhaustive\n * and will always check all views, regardless of their \"dirty\" state and `ChangeDetectionStrategy`.\n *\n * When the `useNgZoneOnStable` option is `true`, this function will provide its own `NgZone` implementation and needs\n * to come after any other `NgZone` provider, including `provideZoneChangeDetection()` and `provideExperimentalZonelessChangeDetection()`.\n *\n * @experimental\n * @publicApi\n */\nfunction provideExperimentalCheckNoChangesForDebug(options) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (options.interval === undefined && !options.useNgZoneOnStable) {\n throw new Error('Must provide one of `useNgZoneOnStable` or `interval`');\n }\n const checkNoChangesMode = options?.exhaustive === false\n ? CheckNoChangesMode.OnlyDirtyViews\n : CheckNoChangesMode.Exhaustive;\n return makeEnvironmentProviders([\n options?.useNgZoneOnStable\n ? { provide: NgZone, useFactory: () => new DebugNgZoneForCheckNoChanges(checkNoChangesMode) }\n : [],\n options?.interval !== undefined\n ? exhaustiveCheckNoChangesInterval(options.interval, checkNoChangesMode)\n : [],\n {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useValue: () => {\n if (options?.useNgZoneOnStable &&\n !(inject(NgZone) instanceof DebugNgZoneForCheckNoChanges)) {\n throw new Error('`provideExperimentalCheckNoChangesForDebug` with `useNgZoneOnStable` must be after any other provider for `NgZone`.');\n }\n },\n },\n ]);\n }\n else {\n return makeEnvironmentProviders([]);\n }\n}\nclass DebugNgZoneForCheckNoChanges extends NgZone {\n constructor(checkNoChangesMode) {\n const zonelessEnabled = inject(ZONELESS_ENABLED);\n // Use coalescing to ensure we aren't ever running this check synchronously\n super({\n shouldCoalesceEventChangeDetection: true,\n shouldCoalesceRunChangeDetection: zonelessEnabled,\n });\n this.checkNoChangesMode = checkNoChangesMode;\n this.injector = inject(EnvironmentInjector);\n if (zonelessEnabled) {\n // prevent emits to ensure code doesn't rely on these\n this.onMicrotaskEmpty.emit = () => { };\n this.onStable.emit = () => {\n this.scheduler ||= this.injector.get(ChangeDetectionSchedulerImpl);\n if (this.scheduler.pendingRenderTaskId || this.scheduler.runningTick) {\n return;\n }\n this.checkApplicationViews();\n };\n this.onUnstable.emit = () => { };\n }\n else {\n this.runOutsideAngular(() => {\n this.onStable.subscribe(() => {\n this.checkApplicationViews();\n });\n });\n }\n }\n checkApplicationViews() {\n this.applicationRef ||= this.injector.get(ApplicationRef);\n for (const view of this.applicationRef.allViews) {\n try {\n checkNoChangesInternal(view._lView, this.checkNoChangesMode, view.notifyErrorHandler);\n }\n catch (e) {\n this.errorHandler ||= this.injector.get(ErrorHandler);\n this.errorHandler.handleError(e);\n }\n }\n }\n}\nfunction exhaustiveCheckNoChangesInterval(interval, checkNoChangesMode) {\n return {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory: () => {\n const applicationRef = inject(ApplicationRef);\n const errorHandler = inject(ErrorHandler);\n const scheduler = inject(ChangeDetectionSchedulerImpl);\n const ngZone = inject(NgZone);\n return () => {\n function scheduleCheckNoChanges() {\n ngZone.runOutsideAngular(() => {\n setTimeout(() => {\n if (applicationRef.destroyed) {\n return;\n }\n if (scheduler.pendingRenderTaskId || scheduler.runningTick) {\n scheduleCheckNoChanges();\n return;\n }\n for (const view of applicationRef.allViews) {\n try {\n checkNoChangesInternal(view._lView, checkNoChangesMode, view.notifyErrorHandler);\n }\n catch (e) {\n errorHandler.handleError(e);\n }\n }\n scheduleCheckNoChanges();\n }, interval);\n });\n }\n scheduleCheckNoChanges();\n };\n },\n };\n}\n\n/**\n * Returns whether Angular is in development mode.\n *\n * By default, this is true, unless `enableProdMode` is invoked prior to calling this method or the\n * application is built using the Angular CLI with the `optimization` option.\n * @see {@link cli/build ng build}\n *\n * @publicApi\n */\nfunction isDevMode() {\n return typeof ngDevMode === 'undefined' || !!ngDevMode;\n}\n/**\n * Disable Angular's development mode, which turns off assertions and other\n * checks within the framework.\n *\n * One important assertion this disables verifies that a change detection pass\n * does not result in additional changes to any bindings (also known as\n * unidirectional data flow).\n *\n * Using this method is discouraged as the Angular CLI will set production mode when using the\n * `optimization` option.\n * @see {@link cli/build ng build}\n *\n * @publicApi\n */\nfunction enableProdMode() {\n // The below check is there so when ngDevMode is set via terser\n // `global['ngDevMode'] = false;` is also dropped.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _global['ngDevMode'] = false;\n }\n}\n\n// Public API for render\n\n/**\n * Returns the NgModuleFactory with the given id (specified using [@NgModule.id\n * field](api/core/NgModule#id)), if it exists and has been loaded. Factories for NgModules that do\n * not specify an `id` cannot be retrieved. Throws if an NgModule cannot be found.\n * @publicApi\n * @deprecated Use `getNgModuleById` instead.\n */\nfunction getModuleFactory(id) {\n const type = getRegisteredNgModuleType(id);\n if (!type)\n throw noModuleError(id);\n return new NgModuleFactory(type);\n}\n/**\n * Returns the NgModule class with the given id (specified using [@NgModule.id\n * field](api/core/NgModule#id)), if it exists and has been loaded. Classes for NgModules that do\n * not specify an `id` cannot be retrieved. Throws if an NgModule cannot be found.\n * @publicApi\n */\nfunction getNgModuleById(id) {\n const type = getRegisteredNgModuleType(id);\n if (!type)\n throw noModuleError(id);\n return type;\n}\nfunction noModuleError(id) {\n return new Error(`No module with ID ${id} loaded`);\n}\n\n/**\n * Base class that provides change detection functionality.\n * A change-detection tree collects all views that are to be checked for changes.\n * Use the methods to add and remove views from the tree, initiate change-detection,\n * and explicitly mark views as _dirty_, meaning that they have changed and need to be re-rendered.\n *\n * @see [Using change detection hooks](guide/components/lifecycle#using-change-detection-hooks)\n * @see [Defining custom change detection](guide/components/lifecycle#defining-custom-change-detection)\n *\n * @usageNotes\n *\n * The following examples demonstrate how to modify default change-detection behavior\n * to perform explicit detection when needed.\n *\n * ### Use `markForCheck()` with `CheckOnce` strategy\n *\n * The following example sets the `OnPush` change-detection strategy for a component\n * (`CheckOnce`, rather than the default `CheckAlways`), then forces a second check\n * after an interval.\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\"\n * region=\"mark-for-check\"></code-example>\n *\n * ### Detach change detector to limit how often check occurs\n *\n * The following example defines a component with a large list of read-only data\n * that is expected to change constantly, many times per second.\n * To improve performance, we want to check and update the list\n * less often than the changes actually occur. To do that, we detach\n * the component's change detector and perform an explicit local check every five seconds.\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\" region=\"detach\"></code-example>\n *\n *\n * ### Reattaching a detached component\n *\n * The following example creates a component displaying live data.\n * The component detaches its change detector from the main change detector tree\n * when the `live` property is set to false, and reattaches it when the property\n * becomes true.\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\" region=\"reattach\"></code-example>\n *\n * @publicApi\n */\nclass ChangeDetectorRef {\n /**\n * @internal\n * @nocollapse\n */\n static { this.__NG_ELEMENT_ID__ = injectChangeDetectorRef; }\n}\n/** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */\nfunction injectChangeDetectorRef(flags) {\n return createViewRef(getCurrentTNode(), getLView(), (flags & 16 /* InternalInjectFlags.ForPipe */) === 16 /* InternalInjectFlags.ForPipe */);\n}\n/**\n * Creates a ViewRef and stores it on the injector as ChangeDetectorRef (public alias).\n *\n * @param tNode The node that is requesting a ChangeDetectorRef\n * @param lView The view to which the node belongs\n * @param isPipe Whether the view is being injected into a pipe.\n * @returns The ChangeDetectorRef to use\n */\nfunction createViewRef(tNode, lView, isPipe) {\n if (isComponentHost(tNode) && !isPipe) {\n // The LView represents the location where the component is declared.\n // Instead we want the LView for the component View and so we need to look it up.\n const componentView = getComponentLViewByIndex(tNode.index, lView); // look down\n return new ViewRef$1(componentView, componentView);\n }\n else if (tNode.type &\n (3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 32 /* TNodeType.Icu */ | 128 /* TNodeType.LetDeclaration */)) {\n // The LView represents the location where the injection is requested from.\n // We need to locate the containing LView (in case where the `lView` is an embedded view)\n const hostComponentView = lView[DECLARATION_COMPONENT_VIEW]; // look up\n return new ViewRef$1(hostComponentView, lView);\n }\n return null;\n}\n\n/**\n * Represents an Angular view.\n *\n * @see [Change detection usage](/api/core/ChangeDetectorRef?tab=usage-notes)\n *\n * @publicApi\n */\nclass ViewRef extends ChangeDetectorRef {\n}\n/**\n * Represents an Angular view in a view container.\n * An embedded view can be referenced from a component\n * other than the hosting component whose template defines it, or it can be defined\n * independently by a `TemplateRef`.\n *\n * Properties of elements in a view can change, but the structure (number and order) of elements in\n * a view cannot. Change the structure of elements by inserting, moving, or\n * removing nested views in a view container.\n *\n * @see {@link ViewContainerRef}\n *\n * @usageNotes\n *\n * The following template breaks down into two separate `TemplateRef` instances,\n * an outer one and an inner one.\n *\n * ```\n * Count: {{items.length}}\n * <ul>\n * <li *ngFor=\"let item of items\">{{item}}</li>\n * </ul>\n * ```\n *\n * This is the outer `TemplateRef`:\n *\n * ```\n * Count: {{items.length}}\n * <ul>\n * <ng-template ngFor let-item [ngForOf]=\"items\"></ng-template>\n * </ul>\n * ```\n *\n * This is the inner `TemplateRef`:\n *\n * ```\n * <li>{{item}}</li>\n * ```\n *\n * The outer and inner `TemplateRef` instances are assembled into views as follows:\n *\n * ```\n * <!-- ViewRef: outer-0 -->\n * Count: 2\n * <ul>\n * <ng-template view-container-ref></ng-template>\n * <!-- ViewRef: inner-1 --><li>first</li><!-- /ViewRef: inner-1 -->\n * <!-- ViewRef: inner-2 --><li>second</li><!-- /ViewRef: inner-2 -->\n * </ul>\n * <!-- /ViewRef: outer-0 -->\n * ```\n * @publicApi\n */\nclass EmbeddedViewRef extends ViewRef {\n}\n\n// Public API for compiler\n\n// This file exists for easily patching NgModuleFactoryLoader in g3\nvar ng_module_factory_loader_impl = {};\n\n/**\n * @publicApi\n */\nclass DebugEventListener {\n constructor(name, callback) {\n this.name = name;\n this.callback = callback;\n }\n}\n/**\n * @publicApi\n */\nfunction asNativeElements(debugEls) {\n return debugEls.map((el) => el.nativeElement);\n}\n/**\n * @publicApi\n */\nclass DebugNode {\n constructor(nativeNode) {\n this.nativeNode = nativeNode;\n }\n /**\n * The `DebugElement` parent. Will be `null` if this is the root element.\n */\n get parent() {\n const parent = this.nativeNode.parentNode;\n return parent ? new DebugElement(parent) : null;\n }\n /**\n * The host dependency injector. For example, the root element's component instance injector.\n */\n get injector() {\n return getInjector(this.nativeNode);\n }\n /**\n * The element's own component instance, if it has one.\n */\n get componentInstance() {\n const nativeElement = this.nativeNode;\n return (nativeElement && (getComponent$1(nativeElement) || getOwningComponent(nativeElement)));\n }\n /**\n * An object that provides parent context for this element. Often an ancestor component instance\n * that governs this element.\n *\n * When an element is repeated within *ngFor, the context is an `NgForOf` whose `$implicit`\n * property is the value of the row instance value. For example, the `hero` in `*ngFor=\"let hero\n * of heroes\"`.\n */\n get context() {\n return getComponent$1(this.nativeNode) || getContext(this.nativeNode);\n }\n /**\n * The callbacks attached to the component's @Output properties and/or the element's event\n * properties.\n */\n get listeners() {\n return getListeners(this.nativeNode).filter((listener) => listener.type === 'dom');\n }\n /**\n * Dictionary of objects associated with template local variables (e.g. #foo), keyed by the local\n * variable name.\n */\n get references() {\n return getLocalRefs(this.nativeNode);\n }\n /**\n * This component's injector lookup tokens. Includes the component itself plus the tokens that the\n * component lists in its providers metadata.\n */\n get providerTokens() {\n return getInjectionTokens(this.nativeNode);\n }\n}\n/**\n * @publicApi\n *\n * @see [Component testing scenarios](guide/testing/components-scenarios)\n * @see [Basics of testing components](guide/testing/components-basics)\n * @see [Testing utility APIs](guide/testing/utility-apis)\n */\nclass DebugElement extends DebugNode {\n constructor(nativeNode) {\n ngDevMode && assertDomNode(nativeNode);\n super(nativeNode);\n }\n /**\n * The underlying DOM element at the root of the component.\n */\n get nativeElement() {\n return this.nativeNode.nodeType == Node.ELEMENT_NODE ? this.nativeNode : null;\n }\n /**\n * The element tag name, if it is an element.\n */\n get name() {\n const context = getLContext(this.nativeNode);\n const lView = context ? context.lView : null;\n if (lView !== null) {\n const tData = lView[TVIEW].data;\n const tNode = tData[context.nodeIndex];\n return tNode.value;\n }\n else {\n return this.nativeNode.nodeName;\n }\n }\n /**\n * Gets a map of property names to property values for an element.\n *\n * This map includes:\n * - Regular property bindings (e.g. `[id]=\"id\"`)\n * - Host property bindings (e.g. `host: { '[id]': \"id\" }`)\n * - Interpolated property bindings (e.g. `id=\"{{ value }}\")\n *\n * It does not include:\n * - input property bindings (e.g. `[myCustomInput]=\"value\"`)\n * - attribute bindings (e.g. `[attr.role]=\"menu\"`)\n */\n get properties() {\n const context = getLContext(this.nativeNode);\n const lView = context ? context.lView : null;\n if (lView === null) {\n return {};\n }\n const tData = lView[TVIEW].data;\n const tNode = tData[context.nodeIndex];\n const properties = {};\n // Collect properties from the DOM.\n copyDomProperties(this.nativeElement, properties);\n // Collect properties from the bindings. This is needed for animation renderer which has\n // synthetic properties which don't get reflected into the DOM.\n collectPropertyBindings(properties, tNode, lView, tData);\n return properties;\n }\n /**\n * A map of attribute names to attribute values for an element.\n */\n // TODO: replace null by undefined in the return type\n get attributes() {\n const attributes = {};\n const element = this.nativeElement;\n if (!element) {\n return attributes;\n }\n const context = getLContext(element);\n const lView = context ? context.lView : null;\n if (lView === null) {\n return {};\n }\n const tNodeAttrs = lView[TVIEW].data[context.nodeIndex].attrs;\n const lowercaseTNodeAttrs = [];\n // For debug nodes we take the element's attribute directly from the DOM since it allows us\n // to account for ones that weren't set via bindings (e.g. ViewEngine keeps track of the ones\n // that are set through `Renderer2`). The problem is that the browser will lowercase all names,\n // however since we have the attributes already on the TNode, we can preserve the case by going\n // through them once, adding them to the `attributes` map and putting their lower-cased name\n // into an array. Afterwards when we're going through the native DOM attributes, we can check\n // whether we haven't run into an attribute already through the TNode.\n if (tNodeAttrs) {\n let i = 0;\n while (i < tNodeAttrs.length) {\n const attrName = tNodeAttrs[i];\n // Stop as soon as we hit a marker. We only care about the regular attributes. Everything\n // else will be handled below when we read the final attributes off the DOM.\n if (typeof attrName !== 'string')\n break;\n const attrValue = tNodeAttrs[i + 1];\n attributes[attrName] = attrValue;\n lowercaseTNodeAttrs.push(attrName.toLowerCase());\n i += 2;\n }\n }\n for (const attr of element.attributes) {\n // Make sure that we don't assign the same attribute both in its\n // case-sensitive form and the lower-cased one from the browser.\n if (!lowercaseTNodeAttrs.includes(attr.name)) {\n attributes[attr.name] = attr.value;\n }\n }\n return attributes;\n }\n /**\n * The inline styles of the DOM element.\n */\n // TODO: replace null by undefined in the return type\n get styles() {\n const element = this.nativeElement;\n return (element?.style ?? {});\n }\n /**\n * A map containing the class names on the element as keys.\n *\n * This map is derived from the `className` property of the DOM element.\n *\n * Note: The values of this object will always be `true`. The class key will not appear in the KV\n * object if it does not exist on the element.\n *\n * @see [Element.className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className)\n */\n get classes() {\n const result = {};\n const element = this.nativeElement;\n // SVG elements return an `SVGAnimatedString` instead of a plain string for the `className`.\n const className = element.className;\n const classes = typeof className !== 'string' ? className.baseVal.split(' ') : className.split(' ');\n classes.forEach((value) => (result[value] = true));\n return result;\n }\n /**\n * The `childNodes` of the DOM element as a `DebugNode` array.\n *\n * @see [Node.childNodes](https://developer.mozilla.org/en-US/docs/Web/API/Node/childNodes)\n */\n get childNodes() {\n const childNodes = this.nativeNode.childNodes;\n const children = [];\n for (let i = 0; i < childNodes.length; i++) {\n const element = childNodes[i];\n children.push(getDebugNode(element));\n }\n return children;\n }\n /**\n * The immediate `DebugElement` children. Walk the tree by descending through `children`.\n */\n get children() {\n const nativeElement = this.nativeElement;\n if (!nativeElement)\n return [];\n const childNodes = nativeElement.children;\n const children = [];\n for (let i = 0; i < childNodes.length; i++) {\n const element = childNodes[i];\n children.push(getDebugNode(element));\n }\n return children;\n }\n /**\n * @returns the first `DebugElement` that matches the predicate at any depth in the subtree.\n */\n query(predicate) {\n const results = this.queryAll(predicate);\n return results[0] || null;\n }\n /**\n * @returns All `DebugElement` matches for the predicate at any depth in the subtree.\n */\n queryAll(predicate) {\n const matches = [];\n _queryAll(this, predicate, matches, true);\n return matches;\n }\n /**\n * @returns All `DebugNode` matches for the predicate at any depth in the subtree.\n */\n queryAllNodes(predicate) {\n const matches = [];\n _queryAll(this, predicate, matches, false);\n return matches;\n }\n /**\n * Triggers the event by its name if there is a corresponding listener in the element's\n * `listeners` collection.\n *\n * If the event lacks a listener or there's some other problem, consider\n * calling `nativeElement.dispatchEvent(eventObject)`.\n *\n * @param eventName The name of the event to trigger\n * @param eventObj The _event object_ expected by the handler\n *\n * @see [Testing components scenarios](guide/testing/components-scenarios#trigger-event-handler)\n */\n triggerEventHandler(eventName, eventObj) {\n const node = this.nativeNode;\n const invokedListeners = [];\n this.listeners.forEach((listener) => {\n if (listener.name === eventName) {\n const callback = listener.callback;\n callback.call(node, eventObj);\n invokedListeners.push(callback);\n }\n });\n // We need to check whether `eventListeners` exists, because it's something\n // that Zone.js only adds to `EventTarget` in browser environments.\n if (typeof node.eventListeners === 'function') {\n // Note that in Ivy we wrap event listeners with a call to `event.preventDefault` in some\n // cases. We use '__ngUnwrap__' as a special token that gives us access to the actual event\n // listener.\n node.eventListeners(eventName).forEach((listener) => {\n // In order to ensure that we can detect the special __ngUnwrap__ token described above, we\n // use `toString` on the listener and see if it contains the token. We use this approach to\n // ensure that it still worked with compiled code since it cannot remove or rename string\n // literals. We also considered using a special function name (i.e. if(listener.name ===\n // special)) but that was more cumbersome and we were also concerned the compiled code could\n // strip the name, turning the condition in to (\"\" === \"\") and always returning true.\n if (listener.toString().indexOf('__ngUnwrap__') !== -1) {\n const unwrappedListener = listener('__ngUnwrap__');\n return (invokedListeners.indexOf(unwrappedListener) === -1 &&\n unwrappedListener.call(node, eventObj));\n }\n });\n }\n }\n}\nfunction copyDomProperties(element, properties) {\n if (element) {\n // Skip own properties (as those are patched)\n let obj = Object.getPrototypeOf(element);\n const NodePrototype = Node.prototype;\n while (obj !== null && obj !== NodePrototype) {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n for (let key in descriptors) {\n if (!key.startsWith('__') && !key.startsWith('on')) {\n // don't include properties starting with `__` and `on`.\n // `__` are patched values which should not be included.\n // `on` are listeners which also should not be included.\n const value = element[key];\n if (isPrimitiveValue(value)) {\n properties[key] = value;\n }\n }\n }\n obj = Object.getPrototypeOf(obj);\n }\n }\n}\nfunction isPrimitiveValue(value) {\n return (typeof value === 'string' ||\n typeof value === 'boolean' ||\n typeof value === 'number' ||\n value === null);\n}\nfunction _queryAll(parentElement, predicate, matches, elementsOnly) {\n const context = getLContext(parentElement.nativeNode);\n const lView = context ? context.lView : null;\n if (lView !== null) {\n const parentTNode = lView[TVIEW].data[context.nodeIndex];\n _queryNodeChildren(parentTNode, lView, predicate, matches, elementsOnly, parentElement.nativeNode);\n }\n else {\n // If the context is null, then `parentElement` was either created with Renderer2 or native DOM\n // APIs.\n _queryNativeNodeDescendants(parentElement.nativeNode, predicate, matches, elementsOnly);\n }\n}\n/**\n * Recursively match the current TNode against the predicate, and goes on with the next ones.\n *\n * @param tNode the current TNode\n * @param lView the LView of this TNode\n * @param predicate the predicate to match\n * @param matches the list of positive matches\n * @param elementsOnly whether only elements should be searched\n * @param rootNativeNode the root native node on which predicate should not be matched\n */\nfunction _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, rootNativeNode) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n const nativeNode = getNativeByTNodeOrNull(tNode, lView);\n // For each type of TNode, specific logic is executed.\n if (tNode.type & (3 /* TNodeType.AnyRNode */ | 8 /* TNodeType.ElementContainer */)) {\n // Case 1: the TNode is an element\n // The native node has to be checked.\n _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);\n if (isComponentHost(tNode)) {\n // If the element is the host of a component, then all nodes in its view have to be processed.\n // Note: the component's content (tNode.child) will be processed from the insertion points.\n const componentView = getComponentLViewByIndex(tNode.index, lView);\n if (componentView && componentView[TVIEW].firstChild) {\n _queryNodeChildren(componentView[TVIEW].firstChild, componentView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else {\n if (tNode.child) {\n // Otherwise, its children have to be processed.\n _queryNodeChildren(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n // We also have to query the DOM directly in order to catch elements inserted through\n // Renderer2. Note that this is __not__ optimal, because we're walking similar trees multiple\n // times. ViewEngine could do it more efficiently, because all the insertions go through\n // Renderer2, however that's not the case in Ivy. This approach is being used because:\n // 1. Matching the ViewEngine behavior would mean potentially introducing a dependency\n // from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.\n // 2. It allows us to capture nodes that were inserted directly via the DOM.\n nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);\n }\n // In all cases, if a dynamic container exists for this node, each view inside it has to be\n // processed.\n const nodeOrContainer = lView[tNode.index];\n if (isLContainer(nodeOrContainer)) {\n _queryNodeChildrenInContainer(nodeOrContainer, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else if (tNode.type & 4 /* TNodeType.Container */) {\n // Case 2: the TNode is a container\n // The native node has to be checked.\n const lContainer = lView[tNode.index];\n _addQueryMatch(lContainer[NATIVE], predicate, matches, elementsOnly, rootNativeNode);\n // Each view inside the container has to be processed.\n _queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode);\n }\n else if (tNode.type & 16 /* TNodeType.Projection */) {\n // Case 3: the TNode is a projection insertion point (i.e. a <ng-content>).\n // The nodes projected at this location all need to be processed.\n const componentView = lView[DECLARATION_COMPONENT_VIEW];\n const componentHost = componentView[T_HOST];\n const head = componentHost.projection[tNode.projection];\n if (Array.isArray(head)) {\n for (let nativeNode of head) {\n _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else if (head) {\n const nextLView = componentView[PARENT];\n const nextTNode = nextLView[TVIEW].data[head.index];\n _queryNodeChildren(nextTNode, nextLView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else if (tNode.child) {\n // Case 4: the TNode is a view.\n _queryNodeChildren(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n // We don't want to go to the next sibling of the root node.\n if (rootNativeNode !== nativeNode) {\n // To determine the next node to be processed, we need to use the next or the projectionNext\n // link, depending on whether the current node has been projected.\n const nextTNode = tNode.flags & 2 /* TNodeFlags.isProjected */ ? tNode.projectionNext : tNode.next;\n if (nextTNode) {\n _queryNodeChildren(nextTNode, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}\n/**\n * Process all TNodes in a given container.\n *\n * @param lContainer the container to be processed\n * @param predicate the predicate to match\n * @param matches the list of positive matches\n * @param elementsOnly whether only elements should be searched\n * @param rootNativeNode the root native node on which predicate should not be matched\n */\nfunction _queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildren(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}\n/**\n * Match the current native node against the predicate.\n *\n * @param nativeNode the current native node\n * @param predicate the predicate to match\n * @param matches the list of positive matches\n * @param elementsOnly whether only elements should be searched\n * @param rootNativeNode the root native node on which predicate should not be matched\n */\nfunction _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode) {\n if (rootNativeNode !== nativeNode) {\n const debugNode = getDebugNode(nativeNode);\n if (!debugNode) {\n return;\n }\n // Type of the \"predicate and \"matches\" array are set based on the value of\n // the \"elementsOnly\" parameter. TypeScript is not able to properly infer these\n // types with generics, so we manually cast the parameters accordingly.\n if (elementsOnly &&\n debugNode instanceof DebugElement &&\n predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly &&\n predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n }\n}\n/**\n * Match all the descendants of a DOM node against a predicate.\n *\n * @param nativeNode the current native node\n * @param predicate the predicate to match\n * @param matches the list where matches are stored\n * @param elementsOnly whether only elements should be searched\n */\nfunction _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode(node);\n if (debugNode) {\n if (elementsOnly &&\n debugNode instanceof DebugElement &&\n predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly &&\n predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}\n/**\n * Iterates through the property bindings for a given node and generates\n * a map of property names to values. This map only contains property bindings\n * defined in templates, not in host bindings.\n */\nfunction collectPropertyBindings(properties, tNode, lView, tData) {\n let bindingIndexes = tNode.propertyBindings;\n if (bindingIndexes !== null) {\n for (let i = 0; i < bindingIndexes.length; i++) {\n const bindingIndex = bindingIndexes[i];\n const propMetadata = tData[bindingIndex];\n const metadataParts = propMetadata.split(INTERPOLATION_DELIMITER);\n const propertyName = metadataParts[0];\n if (metadataParts.length > 1) {\n let value = metadataParts[1];\n for (let j = 1; j < metadataParts.length - 1; j++) {\n value += renderStringify(lView[bindingIndex + j - 1]) + metadataParts[j + 1];\n }\n properties[propertyName] = value;\n }\n else {\n properties[propertyName] = lView[bindingIndex];\n }\n }\n }\n}\n// Need to keep the nodes in a global Map so that multiple angular apps are supported.\nconst _nativeNodeToDebugNode = new Map();\nconst NG_DEBUG_PROPERTY = '__ng_debug__';\n/**\n * @publicApi\n */\nfunction getDebugNode(nativeNode) {\n if (nativeNode instanceof Node) {\n if (!nativeNode.hasOwnProperty(NG_DEBUG_PROPERTY)) {\n nativeNode[NG_DEBUG_PROPERTY] =\n nativeNode.nodeType == Node.ELEMENT_NODE\n ? new DebugElement(nativeNode)\n : new DebugNode(nativeNode);\n }\n return nativeNode[NG_DEBUG_PROPERTY];\n }\n return null;\n}\nfunction getAllDebugNodes() {\n return Array.from(_nativeNodeToDebugNode.values());\n}\nfunction indexDebugNode(node) {\n _nativeNodeToDebugNode.set(node.nativeNode, node);\n}\nfunction removeDebugNodeFromIndex(node) {\n _nativeNodeToDebugNode.delete(node.nativeNode);\n}\n\nclass DefaultIterableDifferFactory {\n constructor() { }\n supports(obj) {\n return isListLikeIterable(obj);\n }\n create(trackByFn) {\n return new DefaultIterableDiffer(trackByFn);\n }\n}\nconst trackByIdentity = (index, item) => item;\n/**\n * @deprecated v4.0.0 - Should not be part of public API.\n * @publicApi\n */\nclass DefaultIterableDiffer {\n constructor(trackByFn) {\n this.length = 0;\n // Keeps track of the used records at any point in time (during & across `_check()` calls)\n this._linkedRecords = null;\n // Keeps track of the removed records at any point in time during `_check()` calls.\n this._unlinkedRecords = null;\n this._previousItHead = null;\n this._itHead = null;\n this._itTail = null;\n this._additionsHead = null;\n this._additionsTail = null;\n this._movesHead = null;\n this._movesTail = null;\n this._removalsHead = null;\n this._removalsTail = null;\n // Keeps track of records where custom track by is the same, but item identity has changed\n this._identityChangesHead = null;\n this._identityChangesTail = null;\n this._trackByFn = trackByFn || trackByIdentity;\n }\n forEachItem(fn) {\n let record;\n for (record = this._itHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n forEachOperation(fn) {\n let nextIt = this._itHead;\n let nextRemove = this._removalsHead;\n let addRemoveOffset = 0;\n let moveOffsets = null;\n while (nextIt || nextRemove) {\n // Figure out which is the next record to process\n // Order: remove, add, move\n const record = !nextRemove ||\n (nextIt &&\n nextIt.currentIndex < getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets))\n ? nextIt\n : nextRemove;\n const adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);\n const currentIndex = record.currentIndex;\n // consume the item, and adjust the addRemoveOffset and update moveDistance if necessary\n if (record === nextRemove) {\n addRemoveOffset--;\n nextRemove = nextRemove._nextRemoved;\n }\n else {\n nextIt = nextIt._next;\n if (record.previousIndex == null) {\n addRemoveOffset++;\n }\n else {\n // INVARIANT: currentIndex < previousIndex\n if (!moveOffsets)\n moveOffsets = [];\n const localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;\n const localCurrentIndex = currentIndex - addRemoveOffset;\n if (localMovePreviousIndex != localCurrentIndex) {\n for (let i = 0; i < localMovePreviousIndex; i++) {\n const offset = i < moveOffsets.length ? moveOffsets[i] : (moveOffsets[i] = 0);\n const index = offset + i;\n if (localCurrentIndex <= index && index < localMovePreviousIndex) {\n moveOffsets[i] = offset + 1;\n }\n }\n const previousIndex = record.previousIndex;\n moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex;\n }\n }\n }\n if (adjPreviousIndex !== currentIndex) {\n fn(record, adjPreviousIndex, currentIndex);\n }\n }\n }\n forEachPreviousItem(fn) {\n let record;\n for (record = this._previousItHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n forEachAddedItem(fn) {\n let record;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n forEachMovedItem(fn) {\n let record;\n for (record = this._movesHead; record !== null; record = record._nextMoved) {\n fn(record);\n }\n }\n forEachRemovedItem(fn) {\n let record;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n forEachIdentityChange(fn) {\n let record;\n for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {\n fn(record);\n }\n }\n diff(collection) {\n if (collection == null)\n collection = [];\n if (!isListLikeIterable(collection)) {\n throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode &&\n `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);\n }\n if (this.check(collection)) {\n return this;\n }\n else {\n return null;\n }\n }\n onDestroy() { }\n check(collection) {\n this._reset();\n let record = this._itHead;\n let mayBeDirty = false;\n let index;\n let item;\n let itemTrackBy;\n if (Array.isArray(collection)) {\n this.length = collection.length;\n for (let index = 0; index < this.length; index++) {\n item = collection[index];\n itemTrackBy = this._trackByFn(index, item);\n if (record === null || !Object.is(record.trackById, itemTrackBy)) {\n record = this._mismatch(record, item, itemTrackBy, index);\n mayBeDirty = true;\n }\n else {\n if (mayBeDirty) {\n // TODO(misko): can we limit this to duplicates only?\n record = this._verifyReinsertion(record, item, itemTrackBy, index);\n }\n if (!Object.is(record.item, item))\n this._addIdentityChange(record, item);\n }\n record = record._next;\n }\n }\n else {\n index = 0;\n iterateListLike(collection, (item) => {\n itemTrackBy = this._trackByFn(index, item);\n if (record === null || !Object.is(record.trackById, itemTrackBy)) {\n record = this._mismatch(record, item, itemTrackBy, index);\n mayBeDirty = true;\n }\n else {\n if (mayBeDirty) {\n // TODO(misko): can we limit this to duplicates only?\n record = this._verifyReinsertion(record, item, itemTrackBy, index);\n }\n if (!Object.is(record.item, item))\n this._addIdentityChange(record, item);\n }\n record = record._next;\n index++;\n });\n this.length = index;\n }\n this._truncate(record);\n this.collection = collection;\n return this.isDirty;\n }\n /* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity\n * changes.\n */\n get isDirty() {\n return (this._additionsHead !== null ||\n this._movesHead !== null ||\n this._removalsHead !== null ||\n this._identityChangesHead !== null);\n }\n /**\n * Reset the state of the change objects to show no changes. This means set previousKey to\n * currentKey, and clear all of the queues (additions, moves, removals).\n * Set the previousIndexes of moved and added items to their currentIndexes\n * Reset the list of additions, moves and removals\n *\n * @internal\n */\n _reset() {\n if (this.isDirty) {\n let record;\n for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n record.previousIndex = record.currentIndex;\n }\n this._additionsHead = this._additionsTail = null;\n for (record = this._movesHead; record !== null; record = record._nextMoved) {\n record.previousIndex = record.currentIndex;\n }\n this._movesHead = this._movesTail = null;\n this._removalsHead = this._removalsTail = null;\n this._identityChangesHead = this._identityChangesTail = null;\n // TODO(vicb): when assert gets supported\n // assert(!this.isDirty);\n }\n }\n /**\n * This is the core function which handles differences between collections.\n *\n * - `record` is the record which we saw at this position last time. If null then it is a new\n * item.\n * - `item` is the current item in the collection\n * - `index` is the position of the item in the collection\n *\n * @internal\n */\n _mismatch(record, item, itemTrackBy, index) {\n // The previous record after which we will append the current one.\n let previousRecord;\n if (record === null) {\n previousRecord = this._itTail;\n }\n else {\n previousRecord = record._prev;\n // Remove the record from the collection since we know it does not match the item.\n this._remove(record);\n }\n // See if we have evicted the item, which used to be at some anterior position of _itHead list.\n record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (record !== null) {\n // It is an item which we have evicted earlier: reinsert it back into the list.\n // But first we need to check if identity changed, so we can update in view if necessary.\n if (!Object.is(record.item, item))\n this._addIdentityChange(record, item);\n this._reinsertAfter(record, previousRecord, index);\n }\n else {\n // Attempt to see if the item is at some posterior position of _itHead list.\n record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);\n if (record !== null) {\n // We have the item in _itHead at/after `index` position. We need to move it forward in the\n // collection.\n // But first we need to check if identity changed, so we can update in view if necessary.\n if (!Object.is(record.item, item))\n this._addIdentityChange(record, item);\n this._moveAfter(record, previousRecord, index);\n }\n else {\n // It is a new item: add it.\n record = this._addAfter(new IterableChangeRecord_(item, itemTrackBy), previousRecord, index);\n }\n }\n return record;\n }\n /**\n * This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)\n *\n * Use case: `[a, a]` => `[b, a, a]`\n *\n * If we did not have this check then the insertion of `b` would:\n * 1) evict first `a`\n * 2) insert `b` at `0` index.\n * 3) leave `a` at index `1` as is. <-- this is wrong!\n * 3) reinsert `a` at index 2. <-- this is wrong!\n *\n * The correct behavior is:\n * 1) evict first `a`\n * 2) insert `b` at `0` index.\n * 3) reinsert `a` at index 1.\n * 3) move `a` at from `1` to `2`.\n *\n *\n * Double check that we have not evicted a duplicate item. We need to check if the item type may\n * have already been removed:\n * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted\n * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a\n * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'\n * at the end.\n *\n * @internal\n */\n _verifyReinsertion(record, item, itemTrackBy, index) {\n let reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (reinsertRecord !== null) {\n record = this._reinsertAfter(reinsertRecord, record._prev, index);\n }\n else if (record.currentIndex != index) {\n record.currentIndex = index;\n this._addToMoves(record, index);\n }\n return record;\n }\n /**\n * Get rid of any excess {@link IterableChangeRecord_}s from the previous collection\n *\n * - `record` The first excess {@link IterableChangeRecord_}.\n *\n * @internal\n */\n _truncate(record) {\n // Anything after that needs to be removed;\n while (record !== null) {\n const nextRecord = record._next;\n this._addToRemovals(this._unlink(record));\n record = nextRecord;\n }\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.clear();\n }\n if (this._additionsTail !== null) {\n this._additionsTail._nextAdded = null;\n }\n if (this._movesTail !== null) {\n this._movesTail._nextMoved = null;\n }\n if (this._itTail !== null) {\n this._itTail._next = null;\n }\n if (this._removalsTail !== null) {\n this._removalsTail._nextRemoved = null;\n }\n if (this._identityChangesTail !== null) {\n this._identityChangesTail._nextIdentityChange = null;\n }\n }\n /** @internal */\n _reinsertAfter(record, prevRecord, index) {\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.remove(record);\n }\n const prev = record._prevRemoved;\n const next = record._nextRemoved;\n if (prev === null) {\n this._removalsHead = next;\n }\n else {\n prev._nextRemoved = next;\n }\n if (next === null) {\n this._removalsTail = prev;\n }\n else {\n next._prevRemoved = prev;\n }\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n /** @internal */\n _moveAfter(record, prevRecord, index) {\n this._unlink(record);\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n /** @internal */\n _addAfter(record, prevRecord, index) {\n this._insertAfter(record, prevRecord, index);\n if (this._additionsTail === null) {\n // TODO(vicb):\n // assert(this._additionsHead === null);\n this._additionsTail = this._additionsHead = record;\n }\n else {\n // TODO(vicb):\n // assert(_additionsTail._nextAdded === null);\n // assert(record._nextAdded === null);\n this._additionsTail = this._additionsTail._nextAdded = record;\n }\n return record;\n }\n /** @internal */\n _insertAfter(record, prevRecord, index) {\n // TODO(vicb):\n // assert(record != prevRecord);\n // assert(record._next === null);\n // assert(record._prev === null);\n const next = prevRecord === null ? this._itHead : prevRecord._next;\n // TODO(vicb):\n // assert(next != record);\n // assert(prevRecord != record);\n record._next = next;\n record._prev = prevRecord;\n if (next === null) {\n this._itTail = record;\n }\n else {\n next._prev = record;\n }\n if (prevRecord === null) {\n this._itHead = record;\n }\n else {\n prevRecord._next = record;\n }\n if (this._linkedRecords === null) {\n this._linkedRecords = new _DuplicateMap();\n }\n this._linkedRecords.put(record);\n record.currentIndex = index;\n return record;\n }\n /** @internal */\n _remove(record) {\n return this._addToRemovals(this._unlink(record));\n }\n /** @internal */\n _unlink(record) {\n if (this._linkedRecords !== null) {\n this._linkedRecords.remove(record);\n }\n const prev = record._prev;\n const next = record._next;\n // TODO(vicb):\n // assert((record._prev = null) === null);\n // assert((record._next = null) === null);\n if (prev === null) {\n this._itHead = next;\n }\n else {\n prev._next = next;\n }\n if (next === null) {\n this._itTail = prev;\n }\n else {\n next._prev = prev;\n }\n return record;\n }\n /** @internal */\n _addToMoves(record, toIndex) {\n // TODO(vicb):\n // assert(record._nextMoved === null);\n if (record.previousIndex === toIndex) {\n return record;\n }\n if (this._movesTail === null) {\n // TODO(vicb):\n // assert(_movesHead === null);\n this._movesTail = this._movesHead = record;\n }\n else {\n // TODO(vicb):\n // assert(_movesTail._nextMoved === null);\n this._movesTail = this._movesTail._nextMoved = record;\n }\n return record;\n }\n _addToRemovals(record) {\n if (this._unlinkedRecords === null) {\n this._unlinkedRecords = new _DuplicateMap();\n }\n this._unlinkedRecords.put(record);\n record.currentIndex = null;\n record._nextRemoved = null;\n if (this._removalsTail === null) {\n // TODO(vicb):\n // assert(_removalsHead === null);\n this._removalsTail = this._removalsHead = record;\n record._prevRemoved = null;\n }\n else {\n // TODO(vicb):\n // assert(_removalsTail._nextRemoved === null);\n // assert(record._nextRemoved === null);\n record._prevRemoved = this._removalsTail;\n this._removalsTail = this._removalsTail._nextRemoved = record;\n }\n return record;\n }\n /** @internal */\n _addIdentityChange(record, item) {\n record.item = item;\n if (this._identityChangesTail === null) {\n this._identityChangesTail = this._identityChangesHead = record;\n }\n else {\n this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record;\n }\n return record;\n }\n}\nclass IterableChangeRecord_ {\n constructor(item, trackById) {\n this.item = item;\n this.trackById = trackById;\n this.currentIndex = null;\n this.previousIndex = null;\n /** @internal */\n this._nextPrevious = null;\n /** @internal */\n this._prev = null;\n /** @internal */\n this._next = null;\n /** @internal */\n this._prevDup = null;\n /** @internal */\n this._nextDup = null;\n /** @internal */\n this._prevRemoved = null;\n /** @internal */\n this._nextRemoved = null;\n /** @internal */\n this._nextAdded = null;\n /** @internal */\n this._nextMoved = null;\n /** @internal */\n this._nextIdentityChange = null;\n }\n}\n// A linked list of IterableChangeRecords with the same IterableChangeRecord_.item\nclass _DuplicateItemRecordList {\n constructor() {\n /** @internal */\n this._head = null;\n /** @internal */\n this._tail = null;\n }\n /**\n * Append the record to the list of duplicates.\n *\n * Note: by design all records in the list of duplicates hold the same value in record.item.\n */\n add(record) {\n if (this._head === null) {\n this._head = this._tail = record;\n record._nextDup = null;\n record._prevDup = null;\n }\n else {\n // TODO(vicb):\n // assert(record.item == _head.item ||\n // record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN);\n this._tail._nextDup = record;\n record._prevDup = this._tail;\n record._nextDup = null;\n this._tail = record;\n }\n }\n // Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and\n // IterableChangeRecord_.currentIndex >= atOrAfterIndex\n get(trackById, atOrAfterIndex) {\n let record;\n for (record = this._head; record !== null; record = record._nextDup) {\n if ((atOrAfterIndex === null || atOrAfterIndex <= record.currentIndex) &&\n Object.is(record.trackById, trackById)) {\n return record;\n }\n }\n return null;\n }\n /**\n * Remove one {@link IterableChangeRecord_} from the list of duplicates.\n *\n * Returns whether the list of duplicates is empty.\n */\n remove(record) {\n // TODO(vicb):\n // assert(() {\n // // verify that the record being removed is in the list.\n // for (IterableChangeRecord_ cursor = _head; cursor != null; cursor = cursor._nextDup) {\n // if (identical(cursor, record)) return true;\n // }\n // return false;\n //});\n const prev = record._prevDup;\n const next = record._nextDup;\n if (prev === null) {\n this._head = next;\n }\n else {\n prev._nextDup = next;\n }\n if (next === null) {\n this._tail = prev;\n }\n else {\n next._prevDup = prev;\n }\n return this._head === null;\n }\n}\nclass _DuplicateMap {\n constructor() {\n this.map = new Map();\n }\n put(record) {\n const key = record.trackById;\n let duplicates = this.map.get(key);\n if (!duplicates) {\n duplicates = new _DuplicateItemRecordList();\n this.map.set(key, duplicates);\n }\n duplicates.add(record);\n }\n /**\n * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we\n * have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.\n *\n * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we\n * have any more `a`s needs to return the second `a`.\n */\n get(trackById, atOrAfterIndex) {\n const key = trackById;\n const recordList = this.map.get(key);\n return recordList ? recordList.get(trackById, atOrAfterIndex) : null;\n }\n /**\n * Removes a {@link IterableChangeRecord_} from the list of duplicates.\n *\n * The list of duplicates also is removed from the map if it gets empty.\n */\n remove(record) {\n const key = record.trackById;\n const recordList = this.map.get(key);\n // Remove the list of duplicates when it gets empty\n if (recordList.remove(record)) {\n this.map.delete(key);\n }\n return record;\n }\n get isEmpty() {\n return this.map.size === 0;\n }\n clear() {\n this.map.clear();\n }\n}\nfunction getPreviousIndex(item, addRemoveOffset, moveOffsets) {\n const previousIndex = item.previousIndex;\n if (previousIndex === null)\n return previousIndex;\n let moveOffset = 0;\n if (moveOffsets && previousIndex < moveOffsets.length) {\n moveOffset = moveOffsets[previousIndex];\n }\n return previousIndex + addRemoveOffset + moveOffset;\n}\n\nclass DefaultKeyValueDifferFactory {\n constructor() { }\n supports(obj) {\n return obj instanceof Map || isJsObject(obj);\n }\n create() {\n return new DefaultKeyValueDiffer();\n }\n}\nclass DefaultKeyValueDiffer {\n constructor() {\n this._records = new Map();\n this._mapHead = null;\n // _appendAfter is used in the check loop\n this._appendAfter = null;\n this._previousMapHead = null;\n this._changesHead = null;\n this._changesTail = null;\n this._additionsHead = null;\n this._additionsTail = null;\n this._removalsHead = null;\n this._removalsTail = null;\n }\n get isDirty() {\n return (this._additionsHead !== null || this._changesHead !== null || this._removalsHead !== null);\n }\n forEachItem(fn) {\n let record;\n for (record = this._mapHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n forEachPreviousItem(fn) {\n let record;\n for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n forEachChangedItem(fn) {\n let record;\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n fn(record);\n }\n }\n forEachAddedItem(fn) {\n let record;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n forEachRemovedItem(fn) {\n let record;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n diff(map) {\n if (!map) {\n map = new Map();\n }\n else if (!(map instanceof Map || isJsObject(map))) {\n throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode && `Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);\n }\n return this.check(map) ? this : null;\n }\n onDestroy() { }\n /**\n * Check the current state of the map vs the previous.\n * The algorithm is optimised for when the keys do no change.\n */\n check(map) {\n this._reset();\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n this._forEach(map, (value, key) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n }\n else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n this._removalsHead = insertBefore;\n for (let record = insertBefore; record !== null; record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n // Make sure tails have no next records from previous runs\n if (this._changesTail)\n this._changesTail._nextChanged = null;\n if (this._additionsTail)\n this._additionsTail._nextAdded = null;\n return this.isDirty;\n }\n /**\n * Inserts a record before `before` or append at the end of the list when `before` is null.\n *\n * Notes:\n * - This method appends at `this._appendAfter`,\n * - This method updates `this._appendAfter`,\n * - The return value is the new value for the insertion pointer.\n */\n _insertBeforeOrAppend(before, record) {\n if (before) {\n const prev = before._prev;\n record._next = before;\n record._prev = prev;\n before._prev = record;\n if (prev) {\n prev._next = record;\n }\n if (before === this._mapHead) {\n this._mapHead = record;\n }\n this._appendAfter = before;\n return before;\n }\n if (this._appendAfter) {\n this._appendAfter._next = record;\n record._prev = this._appendAfter;\n }\n else {\n this._mapHead = record;\n }\n this._appendAfter = record;\n return null;\n }\n _getOrCreateRecordForKey(key, value) {\n if (this._records.has(key)) {\n const record = this._records.get(key);\n this._maybeAddToChanges(record, value);\n const prev = record._prev;\n const next = record._next;\n if (prev) {\n prev._next = next;\n }\n if (next) {\n next._prev = prev;\n }\n record._next = null;\n record._prev = null;\n return record;\n }\n const record = new KeyValueChangeRecord_(key);\n this._records.set(key, record);\n record.currentValue = value;\n this._addToAdditions(record);\n return record;\n }\n /** @internal */\n _reset() {\n if (this.isDirty) {\n let record;\n // let `_previousMapHead` contain the state of the map before the changes\n this._previousMapHead = this._mapHead;\n for (record = this._previousMapHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n // Update `record.previousValue` with the value of the item before the changes\n // We need to update all changed items (that's those which have been added and changed)\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n record.previousValue = record.currentValue;\n }\n for (record = this._additionsHead; record != null; record = record._nextAdded) {\n record.previousValue = record.currentValue;\n }\n this._changesHead = this._changesTail = null;\n this._additionsHead = this._additionsTail = null;\n this._removalsHead = null;\n }\n }\n // Add the record or a given key to the list of changes only when the value has actually changed\n _maybeAddToChanges(record, newValue) {\n if (!Object.is(newValue, record.currentValue)) {\n record.previousValue = record.currentValue;\n record.currentValue = newValue;\n this._addToChanges(record);\n }\n }\n _addToAdditions(record) {\n if (this._additionsHead === null) {\n this._additionsHead = this._additionsTail = record;\n }\n else {\n this._additionsTail._nextAdded = record;\n this._additionsTail = record;\n }\n }\n _addToChanges(record) {\n if (this._changesHead === null) {\n this._changesHead = this._changesTail = record;\n }\n else {\n this._changesTail._nextChanged = record;\n this._changesTail = record;\n }\n }\n /** @internal */\n _forEach(obj, fn) {\n if (obj instanceof Map) {\n obj.forEach(fn);\n }\n else {\n Object.keys(obj).forEach((k) => fn(obj[k], k));\n }\n }\n}\nclass KeyValueChangeRecord_ {\n constructor(key) {\n this.key = key;\n this.previousValue = null;\n this.currentValue = null;\n /** @internal */\n this._nextPrevious = null;\n /** @internal */\n this._next = null;\n /** @internal */\n this._prev = null;\n /** @internal */\n this._nextAdded = null;\n /** @internal */\n this._nextRemoved = null;\n /** @internal */\n this._nextChanged = null;\n }\n}\n\nfunction defaultIterableDiffersFactory() {\n return new IterableDiffers([new DefaultIterableDifferFactory()]);\n}\n/**\n * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.\n *\n * @publicApi\n */\nclass IterableDiffers {\n /** @nocollapse */\n static { this.ɵprov = ɵɵdefineInjectable({\n token: IterableDiffers,\n providedIn: 'root',\n factory: defaultIterableDiffersFactory,\n }); }\n constructor(factories) {\n this.factories = factories;\n }\n static create(factories, parent) {\n if (parent != null) {\n const copied = parent.factories.slice();\n factories = factories.concat(copied);\n }\n return new IterableDiffers(factories);\n }\n /**\n * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the\n * inherited {@link IterableDiffers} instance with the provided factories and return a new\n * {@link IterableDiffers} instance.\n *\n * @usageNotes\n * ### Example\n *\n * The following example shows how to extend an existing list of factories,\n * which will only be applied to the injector for this component and its children.\n * This step is all that's required to make a new {@link IterableDiffer} available.\n *\n * ```\n * @Component({\n * viewProviders: [\n * IterableDiffers.extend([new ImmutableListDiffer()])\n * ]\n * })\n * ```\n */\n static extend(factories) {\n return {\n provide: IterableDiffers,\n useFactory: (parent) => {\n // if parent is null, it means that we are in the root injector and we have just overridden\n // the default injection mechanism for IterableDiffers, in such a case just assume\n // `defaultIterableDiffersFactory`.\n return IterableDiffers.create(factories, parent || defaultIterableDiffersFactory());\n },\n // Dependency technically isn't optional, but we can provide a better error message this way.\n deps: [[IterableDiffers, new SkipSelf(), new Optional()]],\n };\n }\n find(iterable) {\n const factory = this.factories.find((f) => f.supports(iterable));\n if (factory != null) {\n return factory;\n }\n else {\n throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode &&\n `Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);\n }\n }\n}\nfunction getTypeNameForDebugging(type) {\n return type['name'] || typeof type;\n}\n\nfunction defaultKeyValueDiffersFactory() {\n return new KeyValueDiffers([new DefaultKeyValueDifferFactory()]);\n}\n/**\n * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.\n *\n * @publicApi\n */\nclass KeyValueDiffers {\n /** @nocollapse */\n static { this.ɵprov = ɵɵdefineInjectable({\n token: KeyValueDiffers,\n providedIn: 'root',\n factory: defaultKeyValueDiffersFactory,\n }); }\n constructor(factories) {\n this.factories = factories;\n }\n static create(factories, parent) {\n if (parent) {\n const copied = parent.factories.slice();\n factories = factories.concat(copied);\n }\n return new KeyValueDiffers(factories);\n }\n /**\n * Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the\n * inherited {@link KeyValueDiffers} instance with the provided factories and return a new\n * {@link KeyValueDiffers} instance.\n *\n * @usageNotes\n * ### Example\n *\n * The following example shows how to extend an existing list of factories,\n * which will only be applied to the injector for this component and its children.\n * This step is all that's required to make a new {@link KeyValueDiffer} available.\n *\n * ```\n * @Component({\n * viewProviders: [\n * KeyValueDiffers.extend([new ImmutableMapDiffer()])\n * ]\n * })\n * ```\n */\n static extend(factories) {\n return {\n provide: KeyValueDiffers,\n useFactory: (parent) => {\n // if parent is null, it means that we are in the root injector and we have just overridden\n // the default injection mechanism for KeyValueDiffers, in such a case just assume\n // `defaultKeyValueDiffersFactory`.\n return KeyValueDiffers.create(factories, parent || defaultKeyValueDiffersFactory());\n },\n // Dependency technically isn't optional, but we can provide a better error message this way.\n deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]],\n };\n }\n find(kv) {\n const factory = this.factories.find((f) => f.supports(kv));\n if (factory) {\n return factory;\n }\n throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode && `Cannot find a differ supporting object '${kv}'`);\n }\n}\n\n/**\n * Structural diffing for `Object`s and `Map`s.\n */\nconst keyValDiff = [new DefaultKeyValueDifferFactory()];\n/**\n * Structural diffing for `Iterable` types such as `Array`s.\n */\nconst iterableDiff = [new DefaultIterableDifferFactory()];\nconst defaultIterableDiffers = new IterableDiffers(iterableDiff);\nconst defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);\n\n/**\n * @module\n * @description\n * Change detection enables data binding in Angular.\n */\n\n/**\n * This platform has to be included in any other platform\n *\n * @publicApi\n */\nconst platformCore = createPlatformFactory(null, 'core', []);\n\n/**\n * Re-exported by `BrowserModule`, which is included automatically in the root\n * `AppModule` when you create a new app with the CLI `new` command. Eagerly injects\n * `ApplicationRef` to instantiate it.\n *\n * @publicApi\n */\nclass ApplicationModule {\n // Inject ApplicationRef to make it eager...\n constructor(appRef) { }\n static { this.ɵfac = function ApplicationModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ApplicationModule)(ɵɵinject(ApplicationRef)); }; }\n static { this.ɵmod = /*@__PURE__*/ ɵɵdefineNgModule({ type: ApplicationModule }); }\n static { this.ɵinj = /*@__PURE__*/ ɵɵdefineInjector({}); }\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ApplicationModule, [{\n type: NgModule\n }], () => [{ type: ApplicationRef }], null); })();\n\n/**\n * The default equality function used for `signal` and `computed`, which uses referential equality.\n */\nfunction defaultEquals(a, b) {\n return Object.is(a, b);\n}\n\n/**\n * The currently active consumer `ReactiveNode`, if running code in a reactive context.\n *\n * Change this via `setActiveConsumer`.\n */\nlet activeConsumer = null;\nlet inNotificationPhase = false;\n/**\n * Global epoch counter. Incremented whenever a source signal is set.\n */\nlet epoch = 1;\n/**\n * Symbol used to tell `Signal`s apart from other functions.\n *\n * This can be used to auto-unwrap signals in various cases, or to auto-wrap non-signal values.\n */\nconst SIGNAL = /* @__PURE__ */ Symbol('SIGNAL');\nfunction setActiveConsumer(consumer) {\n const prev = activeConsumer;\n activeConsumer = consumer;\n return prev;\n}\nfunction getActiveConsumer() {\n return activeConsumer;\n}\nfunction isInNotificationPhase() {\n return inNotificationPhase;\n}\nfunction isReactive(value) {\n return value[SIGNAL] !== undefined;\n}\nconst REACTIVE_NODE = {\n version: 0,\n lastCleanEpoch: 0,\n dirty: false,\n producerNode: undefined,\n producerLastReadVersion: undefined,\n producerIndexOfThis: undefined,\n nextProducerIndex: 0,\n liveConsumerNode: undefined,\n liveConsumerIndexOfThis: undefined,\n consumerAllowSignalWrites: false,\n consumerIsAlwaysLive: false,\n producerMustRecompute: () => false,\n producerRecomputeValue: () => { },\n consumerMarkedDirty: () => { },\n consumerOnSignalRead: () => { },\n};\n/**\n * Called by implementations when a producer's signal is read.\n */\nfunction producerAccessed(node) {\n if (inNotificationPhase) {\n throw new Error(typeof ngDevMode !== 'undefined' && ngDevMode\n ? `Assertion error: signal read during notification phase`\n : '');\n }\n if (activeConsumer === null) {\n // Accessed outside of a reactive context, so nothing to record.\n return;\n }\n activeConsumer.consumerOnSignalRead(node);\n // This producer is the `idx`th dependency of `activeConsumer`.\n const idx = activeConsumer.nextProducerIndex++;\n assertConsumerNode(activeConsumer);\n if (idx < activeConsumer.producerNode.length && activeConsumer.producerNode[idx] !== node) {\n // There's been a change in producers since the last execution of `activeConsumer`.\n // `activeConsumer.producerNode[idx]` holds a stale dependency which will be be removed and\n // replaced with `this`.\n //\n // If `activeConsumer` isn't live, then this is a no-op, since we can replace the producer in\n // `activeConsumer.producerNode` directly. However, if `activeConsumer` is live, then we need\n // to remove it from the stale producer's `liveConsumer`s.\n if (consumerIsLive(activeConsumer)) {\n const staleProducer = activeConsumer.producerNode[idx];\n producerRemoveLiveConsumerAtIndex(staleProducer, activeConsumer.producerIndexOfThis[idx]);\n // At this point, the only record of `staleProducer` is the reference at\n // `activeConsumer.producerNode[idx]` which will be overwritten below.\n }\n }\n if (activeConsumer.producerNode[idx] !== node) {\n // We're a new dependency of the consumer (at `idx`).\n activeConsumer.producerNode[idx] = node;\n // If the active consumer is live, then add it as a live consumer. If not, then use 0 as a\n // placeholder value.\n activeConsumer.producerIndexOfThis[idx] = consumerIsLive(activeConsumer)\n ? producerAddLiveConsumer(node, activeConsumer, idx)\n : 0;\n }\n activeConsumer.producerLastReadVersion[idx] = node.version;\n}\n/**\n * Increment the global epoch counter.\n *\n * Called by source producers (that is, not computeds) whenever their values change.\n */\nfunction producerIncrementEpoch() {\n epoch++;\n}\n/**\n * Ensure this producer's `version` is up-to-date.\n */\nfunction producerUpdateValueVersion(node) {\n if (consumerIsLive(node) && !node.dirty) {\n // A live consumer will be marked dirty by producers, so a clean state means that its version\n // is guaranteed to be up-to-date.\n return;\n }\n if (!node.dirty && node.lastCleanEpoch === epoch) {\n // Even non-live consumers can skip polling if they previously found themselves to be clean at\n // the current epoch, since their dependencies could not possibly have changed (such a change\n // would've increased the epoch).\n return;\n }\n if (!node.producerMustRecompute(node) && !consumerPollProducersForChange(node)) {\n // None of our producers report a change since the last time they were read, so no\n // recomputation of our value is necessary, and we can consider ourselves clean.\n node.dirty = false;\n node.lastCleanEpoch = epoch;\n return;\n }\n node.producerRecomputeValue(node);\n // After recomputing the value, we're no longer dirty.\n node.dirty = false;\n node.lastCleanEpoch = epoch;\n}\n/**\n * Propagate a dirty notification to live consumers of this producer.\n */\nfunction producerNotifyConsumers(node) {\n if (node.liveConsumerNode === undefined) {\n return;\n }\n // Prevent signal reads when we're updating the graph\n const prev = inNotificationPhase;\n inNotificationPhase = true;\n try {\n for (const consumer of node.liveConsumerNode) {\n if (!consumer.dirty) {\n consumerMarkDirty(consumer);\n }\n }\n }\n finally {\n inNotificationPhase = prev;\n }\n}\n/**\n * Whether this `ReactiveNode` in its producer capacity is currently allowed to initiate updates,\n * based on the current consumer context.\n */\nfunction producerUpdatesAllowed() {\n return activeConsumer?.consumerAllowSignalWrites !== false;\n}\nfunction consumerMarkDirty(node) {\n node.dirty = true;\n producerNotifyConsumers(node);\n node.consumerMarkedDirty?.(node);\n}\n/**\n * Prepare this consumer to run a computation in its reactive context.\n *\n * Must be called by subclasses which represent reactive computations, before those computations\n * begin.\n */\nfunction consumerBeforeComputation(node) {\n node && (node.nextProducerIndex = 0);\n return setActiveConsumer(node);\n}\n/**\n * Finalize this consumer's state after a reactive computation has run.\n *\n * Must be called by subclasses which represent reactive computations, after those computations\n * have finished.\n */\nfunction consumerAfterComputation(node, prevConsumer) {\n setActiveConsumer(prevConsumer);\n if (!node ||\n node.producerNode === undefined ||\n node.producerIndexOfThis === undefined ||\n node.producerLastReadVersion === undefined) {\n return;\n }\n if (consumerIsLive(node)) {\n // For live consumers, we need to remove the producer -> consumer edge for any stale producers\n // which weren't dependencies after the recomputation.\n for (let i = node.nextProducerIndex; i < node.producerNode.length; i++) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n }\n }\n // Truncate the producer tracking arrays.\n // Perf note: this is essentially truncating the length to `node.nextProducerIndex`, but\n // benchmarking has shown that individual pop operations are faster.\n while (node.producerNode.length > node.nextProducerIndex) {\n node.producerNode.pop();\n node.producerLastReadVersion.pop();\n node.producerIndexOfThis.pop();\n }\n}\n/**\n * Determine whether this consumer has any dependencies which have changed since the last time\n * they were read.\n */\nfunction consumerPollProducersForChange(node) {\n assertConsumerNode(node);\n // Poll producers for change.\n for (let i = 0; i < node.producerNode.length; i++) {\n const producer = node.producerNode[i];\n const seenVersion = node.producerLastReadVersion[i];\n // First check the versions. A mismatch means that the producer's value is known to have\n // changed since the last time we read it.\n if (seenVersion !== producer.version) {\n return true;\n }\n // The producer's version is the same as the last time we read it, but it might itself be\n // stale. Force the producer to recompute its version (calculating a new value if necessary).\n producerUpdateValueVersion(producer);\n // Now when we do this check, `producer.version` is guaranteed to be up to date, so if the\n // versions still match then it has not changed since the last time we read it.\n if (seenVersion !== producer.version) {\n return true;\n }\n }\n return false;\n}\n/**\n * Disconnect this consumer from the graph.\n */\nfunction consumerDestroy(node) {\n assertConsumerNode(node);\n if (consumerIsLive(node)) {\n // Drop all connections from the graph to this node.\n for (let i = 0; i < node.producerNode.length; i++) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n }\n }\n // Truncate all the arrays to drop all connection from this node to the graph.\n node.producerNode.length =\n node.producerLastReadVersion.length =\n node.producerIndexOfThis.length =\n 0;\n if (node.liveConsumerNode) {\n node.liveConsumerNode.length = node.liveConsumerIndexOfThis.length = 0;\n }\n}\n/**\n * Add `consumer` as a live consumer of this node.\n *\n * Note that this operation is potentially transitive. If this node becomes live, then it becomes\n * a live consumer of all of its current producers.\n */\nfunction producerAddLiveConsumer(node, consumer, indexOfThis) {\n assertProducerNode(node);\n if (node.liveConsumerNode.length === 0 && isConsumerNode(node)) {\n // When going from 0 to 1 live consumers, we become a live consumer to our producers.\n for (let i = 0; i < node.producerNode.length; i++) {\n node.producerIndexOfThis[i] = producerAddLiveConsumer(node.producerNode[i], node, i);\n }\n }\n node.liveConsumerIndexOfThis.push(indexOfThis);\n return node.liveConsumerNode.push(consumer) - 1;\n}\n/**\n * Remove the live consumer at `idx`.\n */\nfunction producerRemoveLiveConsumerAtIndex(node, idx) {\n assertProducerNode(node);\n if (typeof ngDevMode !== 'undefined' && ngDevMode && idx >= node.liveConsumerNode.length) {\n throw new Error(`Assertion error: active consumer index ${idx} is out of bounds of ${node.liveConsumerNode.length} consumers)`);\n }\n if (node.liveConsumerNode.length === 1 && isConsumerNode(node)) {\n // When removing the last live consumer, we will no longer be live. We need to remove\n // ourselves from our producers' tracking (which may cause consumer-producers to lose\n // liveness as well).\n for (let i = 0; i < node.producerNode.length; i++) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n }\n }\n // Move the last value of `liveConsumers` into `idx`. Note that if there's only a single\n // live consumer, this is a no-op.\n const lastIdx = node.liveConsumerNode.length - 1;\n node.liveConsumerNode[idx] = node.liveConsumerNode[lastIdx];\n node.liveConsumerIndexOfThis[idx] = node.liveConsumerIndexOfThis[lastIdx];\n // Truncate the array.\n node.liveConsumerNode.length--;\n node.liveConsumerIndexOfThis.length--;\n // If the index is still valid, then we need to fix the index pointer from the producer to this\n // consumer, and update it from `lastIdx` to `idx` (accounting for the move above).\n if (idx < node.liveConsumerNode.length) {\n const idxProducer = node.liveConsumerIndexOfThis[idx];\n const consumer = node.liveConsumerNode[idx];\n assertConsumerNode(consumer);\n consumer.producerIndexOfThis[idxProducer] = idx;\n }\n}\nfunction consumerIsLive(node) {\n return node.consumerIsAlwaysLive || (node?.liveConsumerNode?.length ?? 0) > 0;\n}\nfunction assertConsumerNode(node) {\n node.producerNode ??= [];\n node.producerIndexOfThis ??= [];\n node.producerLastReadVersion ??= [];\n}\nfunction assertProducerNode(node) {\n node.liveConsumerNode ??= [];\n node.liveConsumerIndexOfThis ??= [];\n}\nfunction isConsumerNode(node) {\n return node.producerNode !== undefined;\n}\n\n/**\n * Create a computed signal which derives a reactive value from an expression.\n */\nfunction createComputed(computation) {\n const node = Object.create(COMPUTED_NODE);\n node.computation = computation;\n const computed = () => {\n // Check if the value needs updating before returning it.\n producerUpdateValueVersion(node);\n // Record that someone looked at this signal.\n producerAccessed(node);\n if (node.value === ERRORED) {\n throw node.error;\n }\n return node.value;\n };\n computed[SIGNAL] = node;\n return computed;\n}\n/**\n * A dedicated symbol used before a computed value has been calculated for the first time.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nconst UNSET = /* @__PURE__ */ Symbol('UNSET');\n/**\n * A dedicated symbol used in place of a computed signal value to indicate that a given computation\n * is in progress. Used to detect cycles in computation chains.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nconst COMPUTING = /* @__PURE__ */ Symbol('COMPUTING');\n/**\n * A dedicated symbol used in place of a computed signal value to indicate that a given computation\n * failed. The thrown error is cached until the computation gets dirty again.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nconst ERRORED = /* @__PURE__ */ Symbol('ERRORED');\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst COMPUTED_NODE = /* @__PURE__ */ (() => {\n return {\n ...REACTIVE_NODE,\n value: UNSET,\n dirty: true,\n error: null,\n equal: defaultEquals,\n producerMustRecompute(node) {\n // Force a recomputation if there's no current value, or if the current value is in the\n // process of being calculated (which should throw an error).\n return node.value === UNSET || node.value === COMPUTING;\n },\n producerRecomputeValue(node) {\n if (node.value === COMPUTING) {\n // Our computation somehow led to a cyclic read of itself.\n throw new Error('Detected cycle in computations.');\n }\n const oldValue = node.value;\n node.value = COMPUTING;\n const prevConsumer = consumerBeforeComputation(node);\n let newValue;\n try {\n newValue = node.computation();\n }\n catch (err) {\n newValue = ERRORED;\n node.error = err;\n }\n finally {\n consumerAfterComputation(node, prevConsumer);\n }\n if (oldValue !== UNSET &&\n oldValue !== ERRORED &&\n newValue !== ERRORED &&\n node.equal(oldValue, newValue)) {\n // No change to `valueVersion` - old and new values are\n // semantically equivalent.\n node.value = oldValue;\n return;\n }\n node.value = newValue;\n node.version++;\n },\n };\n})();\n\nfunction defaultThrowError() {\n throw new Error();\n}\nlet throwInvalidWriteToSignalErrorFn = defaultThrowError;\nfunction throwInvalidWriteToSignalError() {\n throwInvalidWriteToSignalErrorFn();\n}\nfunction setThrowInvalidWriteToSignalError(fn) {\n throwInvalidWriteToSignalErrorFn = fn;\n}\n\n/**\n * If set, called after `WritableSignal`s are updated.\n *\n * This hook can be used to achieve various effects, such as running effects synchronously as part\n * of setting a signal.\n */\nlet postSignalSetFn = null;\n/**\n * Create a `Signal` that can be set or updated directly.\n */\nfunction createSignal(initialValue) {\n const node = Object.create(SIGNAL_NODE);\n node.value = initialValue;\n const getter = (() => {\n producerAccessed(node);\n return node.value;\n });\n getter[SIGNAL] = node;\n return getter;\n}\nfunction setPostSignalSetFn(fn) {\n const prev = postSignalSetFn;\n postSignalSetFn = fn;\n return prev;\n}\nfunction signalGetFn() {\n producerAccessed(this);\n return this.value;\n}\nfunction signalSetFn(node, newValue) {\n if (!producerUpdatesAllowed()) {\n throwInvalidWriteToSignalError();\n }\n if (!node.equal(node.value, newValue)) {\n node.value = newValue;\n signalValueChanged(node);\n }\n}\nfunction signalUpdateFn(node, updater) {\n if (!producerUpdatesAllowed()) {\n throwInvalidWriteToSignalError();\n }\n signalSetFn(node, updater(node.value));\n}\nfunction runPostSignalSetFn() {\n postSignalSetFn?.();\n}\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst SIGNAL_NODE = /* @__PURE__ */ (() => {\n return {\n ...REACTIVE_NODE,\n equal: defaultEquals,\n value: undefined,\n };\n})();\nfunction signalValueChanged(node) {\n node.version++;\n producerIncrementEpoch();\n producerNotifyConsumers(node);\n postSignalSetFn?.();\n}\n\nfunction createWatch(fn, schedule, allowSignalWrites) {\n const node = Object.create(WATCH_NODE);\n if (allowSignalWrites) {\n node.consumerAllowSignalWrites = true;\n }\n node.fn = fn;\n node.schedule = schedule;\n const registerOnCleanup = (cleanupFn) => {\n node.cleanupFn = cleanupFn;\n };\n function isWatchNodeDestroyed(node) {\n return node.fn === null && node.schedule === null;\n }\n function destroyWatchNode(node) {\n if (!isWatchNodeDestroyed(node)) {\n consumerDestroy(node); // disconnect watcher from the reactive graph\n node.cleanupFn();\n // nullify references to the integration functions to mark node as destroyed\n node.fn = null;\n node.schedule = null;\n node.cleanupFn = NOOP_CLEANUP_FN;\n }\n }\n const run = () => {\n if (node.fn === null) {\n // trying to run a destroyed watch is noop\n return;\n }\n if (isInNotificationPhase()) {\n throw new Error(`Schedulers cannot synchronously execute watches while scheduling.`);\n }\n node.dirty = false;\n if (node.hasRun && !consumerPollProducersForChange(node)) {\n return;\n }\n node.hasRun = true;\n const prevConsumer = consumerBeforeComputation(node);\n try {\n node.cleanupFn();\n node.cleanupFn = NOOP_CLEANUP_FN;\n node.fn(registerOnCleanup);\n }\n finally {\n consumerAfterComputation(node, prevConsumer);\n }\n };\n node.ref = {\n notify: () => consumerMarkDirty(node),\n run,\n cleanup: () => node.cleanupFn(),\n destroy: () => destroyWatchNode(node),\n [SIGNAL]: node,\n };\n return node.ref;\n}\nconst NOOP_CLEANUP_FN = () => { };\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst WATCH_NODE = /* @__PURE__ */ (() => {\n return {\n ...REACTIVE_NODE,\n consumerIsAlwaysLive: true,\n consumerAllowSignalWrites: false,\n consumerMarkedDirty: (node) => {\n if (node.schedule !== null) {\n node.schedule(node.ref);\n }\n },\n hasRun: false,\n cleanupFn: NOOP_CLEANUP_FN,\n };\n})();\n\nfunction setAlternateWeakRefImpl(impl) {\n // TODO: remove this function\n}\n\n/**\n * Internal create application API that implements the core application creation logic and optional\n * bootstrap logic.\n *\n * Platforms (such as `platform-browser`) may require different set of application and platform\n * providers for an application to function correctly. As a result, platforms may use this function\n * internally and supply the necessary providers during the bootstrap, while exposing\n * platform-specific APIs as a part of their public API.\n *\n * @returns A promise that returns an `ApplicationRef` instance once resolved.\n */\nfunction internalCreateApplication(config) {\n try {\n const { rootComponent, appProviders, platformProviders } = config;\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && rootComponent !== undefined) {\n assertStandaloneComponentType(rootComponent);\n }\n const platformInjector = createOrReusePlatformInjector(platformProviders);\n // Create root application injector based on a set of providers configured at the platform\n // bootstrap level as well as providers passed to the bootstrap call by a user.\n const allAppProviders = [\n internalProvideZoneChangeDetection({}),\n { provide: ChangeDetectionScheduler, useExisting: ChangeDetectionSchedulerImpl },\n ...(appProviders || []),\n ];\n const adapter = new EnvironmentNgModuleRefAdapter({\n providers: allAppProviders,\n parent: platformInjector,\n debugName: typeof ngDevMode === 'undefined' || ngDevMode ? 'Environment Injector' : '',\n // We skip environment initializers because we need to run them inside the NgZone, which\n // happens after we get the NgZone instance from the Injector.\n runEnvironmentInitializers: false,\n });\n return bootstrap({\n r3Injector: adapter.injector,\n platformInjector,\n rootComponent,\n });\n }\n catch (e) {\n return Promise.reject(e);\n }\n}\n\n/**\n * Retrieves all defer blocks in a given LView.\n *\n * @param lView lView with defer blocks\n * @param deferBlocks defer block aggregator array\n */\nfunction getDeferBlocks(lView, deferBlocks) {\n const tView = lView[TVIEW];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (isLContainer(lView[i])) {\n const lContainer = lView[i];\n // An LContainer may represent an instance of a defer block, in which case\n // we store it as a result. Otherwise, keep iterating over LContainer views and\n // look for defer blocks.\n const isLast = i === tView.bindingStartIndex - 1;\n if (!isLast) {\n const tNode = tView.data[i];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (isTDeferBlockDetails(tDetails)) {\n deferBlocks.push({ lContainer, lView, tNode, tDetails });\n // This LContainer represents a defer block, so we exit\n // this iteration and don't inspect views in this LContainer.\n continue;\n }\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n getDeferBlocks(lContainer[i], deferBlocks);\n }\n }\n else if (isLView(lView[i])) {\n // This is a component, enter the `getDeferBlocks` recursively.\n getDeferBlocks(lView[i], deferBlocks);\n }\n }\n}\n\nfunction invokeRegisteredListeners(event) {\n const handlerFns = event.currentTarget?.__jsaction_fns?.get(event.type);\n if (!handlerFns) {\n return;\n }\n for (const handler of handlerFns) {\n handler(event);\n }\n}\nfunction setJSActionAttributes(nativeElement, eventTypes) {\n if (!eventTypes.length) {\n return;\n }\n const parts = eventTypes.reduce((prev, curr) => prev + curr + ':;', '');\n const existingAttr = nativeElement.getAttribute(Attribute$1.JSACTION);\n nativeElement.setAttribute(Attribute$1.JSACTION, `${existingAttr ?? ''}${parts}`);\n}\nconst sharedStashFunction = (rEl, eventType, listenerFn) => {\n const el = rEl;\n const eventListenerMap = el.__jsaction_fns ?? new Map();\n const eventListeners = eventListenerMap.get(eventType) ?? [];\n eventListeners.push(listenerFn);\n eventListenerMap.set(eventType, eventListeners);\n el.__jsaction_fns = eventListenerMap;\n};\nconst removeListeners = (el) => {\n el.removeAttribute(Attribute$1.JSACTION);\n el.__jsaction_fns = undefined;\n};\nconst JSACTION_EVENT_CONTRACT = new InjectionToken(ngDevMode ? 'EVENT_CONTRACT_DETAILS' : '', {\n providedIn: 'root',\n factory: () => ({}),\n});\n\n/**\n * A set of DOM elements with `jsaction` attributes.\n */\nconst jsactionSet = new Set();\n/**\n * Determines whether Event Replay feature should be activated on the client.\n */\nfunction shouldEnableEventReplay(injector) {\n return injector.get(IS_EVENT_REPLAY_ENABLED, EVENT_REPLAY_ENABLED_DEFAULT);\n}\n/**\n * Returns a set of providers required to setup support for event replay.\n * Requires hydration to be enabled separately.\n */\nfunction withEventReplay() {\n return [\n {\n provide: IS_EVENT_REPLAY_ENABLED,\n useFactory: () => {\n let isEnabled = true;\n if (isPlatformBrowser()) {\n // Note: globalThis[CONTRACT_PROPERTY] may be undefined in case Event Replay feature\n // is enabled, but there are no events configured in this application, in which case\n // we don't activate this feature, since there are no events to replay.\n const appId = inject(APP_ID);\n isEnabled = !!window._ejsas?.[appId];\n }\n if (isEnabled) {\n performanceMarkFeature('NgEventReplay');\n }\n return isEnabled;\n },\n },\n {\n provide: ENVIRONMENT_INITIALIZER,\n useValue: () => {\n const injector = inject(Injector);\n if (isPlatformBrowser(injector) && shouldEnableEventReplay(injector)) {\n setStashFn((rEl, eventName, listenerFn) => {\n sharedStashFunction(rEl, eventName, listenerFn);\n jsactionSet.add(rEl);\n });\n }\n },\n multi: true,\n },\n {\n provide: APP_BOOTSTRAP_LISTENER,\n useFactory: () => {\n if (isPlatformBrowser()) {\n const injector = inject(Injector);\n const appRef = inject(ApplicationRef);\n return () => {\n if (!shouldEnableEventReplay(injector)) {\n return;\n }\n // Kick off event replay logic once hydration for the initial part\n // of the application is completed. This timing is similar to the unclaimed\n // dehydrated views cleanup timing.\n whenStable(appRef).then(() => {\n const eventContractDetails = injector.get(JSACTION_EVENT_CONTRACT);\n initEventReplay(eventContractDetails, injector);\n jsactionSet.forEach(removeListeners);\n // After hydration, we shouldn't need to do anymore work related to\n // event replay anymore.\n setStashFn(() => { });\n });\n };\n }\n return () => { }; // noop for the server code\n },\n multi: true,\n },\n ];\n}\nconst initEventReplay = (eventDelegation, injector) => {\n const appId = injector.get(APP_ID);\n // This is set in packages/platform-server/src/utils.ts\n const earlyJsactionData = window._ejsas[appId];\n const eventContract = (eventDelegation.instance = new EventContract(new EventContractContainer(earlyJsactionData.c)));\n for (const et of earlyJsactionData.et) {\n eventContract.addEvent(et);\n }\n for (const et of earlyJsactionData.etc) {\n eventContract.addEvent(et);\n }\n const eventInfos = getAppScopedQueuedEventInfos(appId);\n eventContract.replayEarlyEventInfos(eventInfos);\n clearAppScopedEarlyEventContract(appId);\n const dispatcher = new EventDispatcher(invokeRegisteredListeners);\n registerDispatcher(eventContract, dispatcher);\n};\n/**\n * Extracts information about all DOM events (added in a template) registered on elements in a give\n * LView. Maps collected events to a corresponding DOM element (an element is used as a key).\n */\nfunction collectDomEventsInfo(tView, lView, eventTypesToReplay) {\n const domEventsInfo = new Map();\n const lCleanup = lView[CLEANUP];\n const tCleanup = tView.cleanup;\n if (!tCleanup || !lCleanup) {\n return domEventsInfo;\n }\n for (let i = 0; i < tCleanup.length;) {\n const firstParam = tCleanup[i++];\n const secondParam = tCleanup[i++];\n if (typeof firstParam !== 'string') {\n continue;\n }\n const eventType = firstParam;\n if (!isEarlyEventType(eventType)) {\n continue;\n }\n if (isCaptureEventType(eventType)) {\n eventTypesToReplay.capture.add(eventType);\n }\n else {\n eventTypesToReplay.regular.add(eventType);\n }\n const listenerElement = unwrapRNode(lView[secondParam]);\n i++; // move the cursor to the next position (location of the listener idx)\n const useCaptureOrIndx = tCleanup[i++];\n // if useCaptureOrIndx is boolean then report it as is.\n // if useCaptureOrIndx is positive number then it in unsubscribe method\n // if useCaptureOrIndx is negative number then it is a Subscription\n const isDomEvent = typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0;\n if (!isDomEvent) {\n continue;\n }\n if (!domEventsInfo.has(listenerElement)) {\n domEventsInfo.set(listenerElement, [eventType]);\n }\n else {\n domEventsInfo.get(listenerElement).push(eventType);\n }\n }\n return domEventsInfo;\n}\n\n/**\n * A collection that tracks all serialized views (`ngh` DOM annotations)\n * to avoid duplication. An attempt to add a duplicate view results in the\n * collection returning the index of the previously collected serialized view.\n * This reduces the number of annotations needed for a given page.\n */\nclass SerializedViewCollection {\n constructor() {\n this.views = [];\n this.indexByContent = new Map();\n }\n add(serializedView) {\n const viewAsString = JSON.stringify(serializedView);\n if (!this.indexByContent.has(viewAsString)) {\n const index = this.views.length;\n this.views.push(serializedView);\n this.indexByContent.set(viewAsString, index);\n return index;\n }\n return this.indexByContent.get(viewAsString);\n }\n getAll() {\n return this.views;\n }\n}\n/**\n * Global counter that is used to generate a unique id for TViews\n * during the serialization process.\n */\nlet tViewSsrId = 0;\n/**\n * Generates a unique id for a given TView and returns this id.\n * The id is also stored on this instance of a TView and reused in\n * subsequent calls.\n *\n * This id is needed to uniquely identify and pick up dehydrated views\n * at runtime.\n */\nfunction getSsrId(tView) {\n if (!tView.ssrId) {\n tView.ssrId = `t${tViewSsrId++}`;\n }\n return tView.ssrId;\n}\n/**\n * Computes the number of root nodes in a given view\n * (or child nodes in a given container if a tNode is provided).\n */\nfunction calcNumRootNodes(tView, lView, tNode) {\n const rootNodes = [];\n collectNativeNodes(tView, lView, tNode, rootNodes);\n return rootNodes.length;\n}\n/**\n * Computes the number of root nodes in all views in a given LContainer.\n */\nfunction calcNumRootNodesInLContainer(lContainer) {\n const rootNodes = [];\n collectNativeNodesInLContainer(lContainer, rootNodes);\n return rootNodes.length;\n}\n/**\n * Annotates root level component's LView for hydration,\n * see `annotateHostElementForHydration` for additional information.\n */\nfunction annotateComponentLViewForHydration(lView, context) {\n const hostElement = lView[HOST];\n // Root elements might also be annotated with the `ngSkipHydration` attribute,\n // check if it's present before starting the serialization process.\n if (hostElement && !hostElement.hasAttribute(SKIP_HYDRATION_ATTR_NAME)) {\n return annotateHostElementForHydration(hostElement, lView, context);\n }\n return null;\n}\n/**\n * Annotates root level LContainer for hydration. This happens when a root component\n * injects ViewContainerRef, thus making the component an anchor for a view container.\n * This function serializes the component itself as well as all views from the view\n * container.\n */\nfunction annotateLContainerForHydration(lContainer, context) {\n const componentLView = unwrapLView(lContainer[HOST]);\n // Serialize the root component itself.\n const componentLViewNghIndex = annotateComponentLViewForHydration(componentLView, context);\n if (componentLViewNghIndex === null) {\n // Component was not serialized (for example, if hydration was skipped by adding\n // the `ngSkipHydration` attribute or this component uses i18n blocks in the template,\n // but `withI18nSupport()` was not added), avoid annotating host element with the `ngh`\n // attribute.\n return;\n }\n const hostElement = unwrapRNode(componentLView[HOST]);\n // Serialize all views within this view container.\n const rootLView = lContainer[PARENT];\n const rootLViewNghIndex = annotateHostElementForHydration(hostElement, rootLView, context);\n const renderer = componentLView[RENDERER];\n // For cases when a root component also acts as an anchor node for a ViewContainerRef\n // (for example, when ViewContainerRef is injected in a root component), there is a need\n // to serialize information about the component itself, as well as an LContainer that\n // represents this ViewContainerRef. Effectively, we need to serialize 2 pieces of info:\n // (1) hydration info for the root component itself and (2) hydration info for the\n // ViewContainerRef instance (an LContainer). Each piece of information is included into\n // the hydration data (in the TransferState object) separately, thus we end up with 2 ids.\n // Since we only have 1 root element, we encode both bits of info into a single string:\n // ids are separated by the `|` char (e.g. `10|25`, where `10` is the ngh for a component view\n // and 25 is the `ngh` for a root view which holds LContainer).\n const finalIndex = `${componentLViewNghIndex}|${rootLViewNghIndex}`;\n renderer.setAttribute(hostElement, NGH_ATTR_NAME, finalIndex);\n}\n/**\n * Annotates all components bootstrapped in a given ApplicationRef\n * with info needed for hydration.\n *\n * @param appRef An instance of an ApplicationRef.\n * @param doc A reference to the current Document instance.\n * @return event types that need to be replayed\n */\nfunction annotateForHydration(appRef, doc) {\n const injector = appRef.injector;\n const isI18nHydrationEnabledVal = isI18nHydrationEnabled(injector);\n const serializedViewCollection = new SerializedViewCollection();\n const corruptedTextNodes = new Map();\n const viewRefs = appRef._views;\n const shouldReplayEvents = injector.get(IS_EVENT_REPLAY_ENABLED, EVENT_REPLAY_ENABLED_DEFAULT);\n const eventTypesToReplay = {\n regular: new Set(),\n capture: new Set(),\n };\n for (const viewRef of viewRefs) {\n const lNode = getLNodeForHydration(viewRef);\n // An `lView` might be `null` if a `ViewRef` represents\n // an embedded view (not a component view).\n if (lNode !== null) {\n const context = {\n serializedViewCollection,\n corruptedTextNodes,\n isI18nHydrationEnabled: isI18nHydrationEnabledVal,\n i18nChildren: new Map(),\n eventTypesToReplay,\n shouldReplayEvents,\n };\n if (isLContainer(lNode)) {\n annotateLContainerForHydration(lNode, context);\n }\n else {\n annotateComponentLViewForHydration(lNode, context);\n }\n insertCorruptedTextNodeMarkers(corruptedTextNodes, doc);\n }\n }\n // Note: we *always* include hydration info key and a corresponding value\n // into the TransferState, even if the list of serialized views is empty.\n // This is needed as a signal to the client that the server part of the\n // hydration logic was setup and enabled correctly. Otherwise, if a client\n // hydration doesn't find a key in the transfer state - an error is produced.\n const serializedViews = serializedViewCollection.getAll();\n const transferState = injector.get(TransferState);\n transferState.set(NGH_DATA_KEY, serializedViews);\n return eventTypesToReplay;\n}\n/**\n * Serializes the lContainer data into a list of SerializedView objects,\n * that represent views within this lContainer.\n *\n * @param lContainer the lContainer we are serializing\n * @param context the hydration context\n * @returns an array of the `SerializedView` objects\n */\nfunction serializeLContainer(lContainer, context) {\n const views = [];\n let lastViewAsString = '';\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n let childLView = lContainer[i];\n let template;\n let numRootNodes;\n let serializedView;\n if (isRootView(childLView)) {\n // If this is a root view, get an LView for the underlying component,\n // because it contains information about the view to serialize.\n childLView = childLView[HEADER_OFFSET];\n // If we have an LContainer at this position, this indicates that the\n // host element was used as a ViewContainerRef anchor (e.g. a `ViewContainerRef`\n // was injected within the component class). This case requires special handling.\n if (isLContainer(childLView)) {\n // Calculate the number of root nodes in all views in a given container\n // and increment by one to account for an anchor node itself, i.e. in this\n // scenario we'll have a layout that would look like this:\n // `<app-root /><#VIEW1><#VIEW2>...<!--container-->`\n // The `+1` is to capture the `<app-root />` element.\n numRootNodes = calcNumRootNodesInLContainer(childLView) + 1;\n annotateLContainerForHydration(childLView, context);\n const componentLView = unwrapLView(childLView[HOST]);\n serializedView = {\n [TEMPLATE_ID]: componentLView[TVIEW].ssrId,\n [NUM_ROOT_NODES]: numRootNodes,\n };\n }\n }\n if (!serializedView) {\n const childTView = childLView[TVIEW];\n if (childTView.type === 1 /* TViewType.Component */) {\n template = childTView.ssrId;\n // This is a component view, thus it has only 1 root node: the component\n // host node itself (other nodes would be inside that host node).\n numRootNodes = 1;\n }\n else {\n template = getSsrId(childTView);\n numRootNodes = calcNumRootNodes(childTView, childLView, childTView.firstChild);\n }\n serializedView = {\n [TEMPLATE_ID]: template,\n [NUM_ROOT_NODES]: numRootNodes,\n ...serializeLView(lContainer[i], context),\n };\n }\n // Check if the previous view has the same shape (for example, it was\n // produced by the *ngFor), in which case bump the counter on the previous\n // view instead of including the same information again.\n const currentViewAsString = JSON.stringify(serializedView);\n if (views.length > 0 && currentViewAsString === lastViewAsString) {\n const previousView = views[views.length - 1];\n previousView[MULTIPLIER] ??= 1;\n previousView[MULTIPLIER]++;\n }\n else {\n // Record this view as most recently added.\n lastViewAsString = currentViewAsString;\n views.push(serializedView);\n }\n }\n return views;\n}\n/**\n * Helper function to produce a node path (which navigation steps runtime logic\n * needs to take to locate a node) and stores it in the `NODES` section of the\n * current serialized view.\n */\nfunction appendSerializedNodePath(ngh, tNode, lView, excludedParentNodes) {\n const noOffsetIndex = tNode.index - HEADER_OFFSET;\n ngh[NODES] ??= {};\n // Ensure we don't calculate the path multiple times.\n ngh[NODES][noOffsetIndex] ??= calcPathForNode(tNode, lView, excludedParentNodes);\n}\n/**\n * Helper function to append information about a disconnected node.\n * This info is needed at runtime to avoid DOM lookups for this element\n * and instead, the element would be created from scratch.\n */\nfunction appendDisconnectedNodeIndex(ngh, tNodeOrNoOffsetIndex) {\n const noOffsetIndex = typeof tNodeOrNoOffsetIndex === 'number'\n ? tNodeOrNoOffsetIndex\n : tNodeOrNoOffsetIndex.index - HEADER_OFFSET;\n ngh[DISCONNECTED_NODES] ??= [];\n if (!ngh[DISCONNECTED_NODES].includes(noOffsetIndex)) {\n ngh[DISCONNECTED_NODES].push(noOffsetIndex);\n }\n}\n/**\n * Serializes the lView data into a SerializedView object that will later be added\n * to the TransferState storage and referenced using the `ngh` attribute on a host\n * element.\n *\n * @param lView the lView we are serializing\n * @param context the hydration context\n * @returns the `SerializedView` object containing the data to be added to the host node\n */\nfunction serializeLView(lView, context) {\n const ngh = {};\n const tView = lView[TVIEW];\n const i18nChildren = getOrComputeI18nChildren(tView, context);\n const nativeElementsToEventTypes = context.shouldReplayEvents\n ? collectDomEventsInfo(tView, lView, context.eventTypesToReplay)\n : null;\n // Iterate over DOM element references in an LView.\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n const tNode = tView.data[i];\n const noOffsetIndex = i - HEADER_OFFSET;\n // Attempt to serialize any i18n data for the given slot. We do this first, as i18n\n // has its own process for serialization.\n const i18nData = trySerializeI18nBlock(lView, i, context);\n if (i18nData) {\n ngh[I18N_DATA] ??= {};\n ngh[I18N_DATA][noOffsetIndex] = i18nData.caseQueue;\n for (const nodeNoOffsetIndex of i18nData.disconnectedNodes) {\n appendDisconnectedNodeIndex(ngh, nodeNoOffsetIndex);\n }\n for (const nodeNoOffsetIndex of i18nData.disjointNodes) {\n const tNode = tView.data[nodeNoOffsetIndex + HEADER_OFFSET];\n ngDevMode && assertTNode(tNode);\n appendSerializedNodePath(ngh, tNode, lView, i18nChildren);\n }\n continue;\n }\n // Skip processing of a given slot in the following cases:\n // - Local refs (e.g. <div #localRef>) take up an extra slot in LViews\n // to store the same element. In this case, there is no information in\n // a corresponding slot in TNode data structure.\n // - When a slot contains something other than a TNode. For example, there\n // might be some metadata information about a defer block or a control flow block.\n if (!isTNodeShape(tNode)) {\n continue;\n }\n // Skip any nodes that are in an i18n block but are considered detached (i.e. not\n // present in the template). These nodes are disconnected from the DOM tree, and\n // so we don't want to serialize any information about them.\n if (isDetachedByI18n(tNode)) {\n continue;\n }\n // Check if a native node that represents a given TNode is disconnected from the DOM tree.\n // Such nodes must be excluded from the hydration (since the hydration won't be able to\n // find them), so the TNode ids are collected and used at runtime to skip the hydration.\n //\n // This situation may happen during the content projection, when some nodes don't make it\n // into one of the content projection slots (for example, when there is no default\n // <ng-content /> slot in projector component's template).\n if (isDisconnectedNode(tNode, lView) && isContentProjectedNode(tNode)) {\n appendDisconnectedNodeIndex(ngh, tNode);\n continue;\n }\n // Attach `jsaction` attribute to elements that have registered listeners,\n // thus potentially having a need to do an event replay.\n if (nativeElementsToEventTypes && tNode.type & 2 /* TNodeType.Element */) {\n const nativeElement = unwrapRNode(lView[i]);\n if (nativeElementsToEventTypes.has(nativeElement)) {\n setJSActionAttributes(nativeElement, nativeElementsToEventTypes.get(nativeElement));\n }\n }\n if (Array.isArray(tNode.projection)) {\n for (const projectionHeadTNode of tNode.projection) {\n // We may have `null`s in slots with no projected content.\n if (!projectionHeadTNode)\n continue;\n if (!Array.isArray(projectionHeadTNode)) {\n // If we process re-projected content (i.e. `<ng-content>`\n // appears at projection location), skip annotations for this content\n // since all DOM nodes in this projection were handled while processing\n // a parent lView, which contains those nodes.\n if (!isProjectionTNode(projectionHeadTNode) &&\n !isInSkipHydrationBlock(projectionHeadTNode)) {\n if (isDisconnectedNode(projectionHeadTNode, lView)) {\n // Check whether this node is connected, since we may have a TNode\n // in the data structure as a projection segment head, but the\n // content projection slot might be disabled (e.g.\n // <ng-content *ngIf=\"false\" />).\n appendDisconnectedNodeIndex(ngh, projectionHeadTNode);\n }\n else {\n appendSerializedNodePath(ngh, projectionHeadTNode, lView, i18nChildren);\n }\n }\n }\n else {\n // If a value is an array, it means that we are processing a projection\n // where projectable nodes were passed in as DOM nodes (for example, when\n // calling `ViewContainerRef.createComponent(CmpA, {projectableNodes: [...]})`).\n //\n // In this scenario, nodes can come from anywhere (either created manually,\n // accessed via `document.querySelector`, etc) and may be in any state\n // (attached or detached from the DOM tree). As a result, we can not reliably\n // restore the state for such cases during hydration.\n throw unsupportedProjectionOfDomNodes(unwrapRNode(lView[i]));\n }\n }\n }\n conditionallyAnnotateNodePath(ngh, tNode, lView, i18nChildren);\n if (isLContainer(lView[i])) {\n // Serialize information about a template.\n const embeddedTView = tNode.tView;\n if (embeddedTView !== null) {\n ngh[TEMPLATES] ??= {};\n ngh[TEMPLATES][noOffsetIndex] = getSsrId(embeddedTView);\n }\n // Serialize views within this LContainer.\n const hostNode = lView[i][HOST]; // host node of this container\n // LView[i][HOST] can be of 2 different types:\n // - either a DOM node\n // - or an array that represents an LView of a component\n if (Array.isArray(hostNode)) {\n // This is a component, serialize info about it.\n const targetNode = unwrapRNode(hostNode);\n if (!targetNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME)) {\n annotateHostElementForHydration(targetNode, hostNode, context);\n }\n }\n ngh[CONTAINERS] ??= {};\n ngh[CONTAINERS][noOffsetIndex] = serializeLContainer(lView[i], context);\n }\n else if (Array.isArray(lView[i]) && !isLetDeclaration(tNode)) {\n // This is a component, annotate the host node with an `ngh` attribute.\n // Note: Let declarations that return an array are also storing an array in the LView,\n // we need to exclude them.\n const targetNode = unwrapRNode(lView[i][HOST]);\n if (!targetNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME)) {\n annotateHostElementForHydration(targetNode, lView[i], context);\n }\n }\n else {\n // <ng-container> case\n if (tNode.type & 8 /* TNodeType.ElementContainer */) {\n // An <ng-container> is represented by the number of\n // top-level nodes. This information is needed to skip over\n // those nodes to reach a corresponding anchor node (comment node).\n ngh[ELEMENT_CONTAINERS] ??= {};\n ngh[ELEMENT_CONTAINERS][noOffsetIndex] = calcNumRootNodes(tView, lView, tNode.child);\n }\n else if (tNode.type & (16 /* TNodeType.Projection */ | 128 /* TNodeType.LetDeclaration */)) {\n // Current TNode represents an `<ng-content>` slot or `@let` declaration,\n // thus it has no DOM elements associated with it, so the **next sibling**\n // node would not be able to find an anchor. In this case, use full path instead.\n let nextTNode = tNode.next;\n // Skip over all `<ng-content>` slots and `@let` declarations in a row.\n while (nextTNode !== null &&\n nextTNode.type & (16 /* TNodeType.Projection */ | 128 /* TNodeType.LetDeclaration */)) {\n nextTNode = nextTNode.next;\n }\n if (nextTNode && !isInSkipHydrationBlock(nextTNode)) {\n // Handle a tNode after the `<ng-content>` slot.\n appendSerializedNodePath(ngh, nextTNode, lView, i18nChildren);\n }\n }\n else if (tNode.type & 1 /* TNodeType.Text */) {\n const rNode = unwrapRNode(lView[i]);\n processTextNodeBeforeSerialization(context, rNode);\n }\n }\n }\n return ngh;\n}\n/**\n * Serializes node location in cases when it's needed, specifically:\n *\n * 1. If `tNode.projectionNext` is different from `tNode.next` - it means that\n * the next `tNode` after projection is different from the one in the original\n * template. Since hydration relies on `tNode.next`, this serialized info\n * is required to help runtime code find the node at the correct location.\n * 2. In certain content projection-based use-cases, it's possible that only\n * a content of a projected element is rendered. In this case, content nodes\n * require an extra annotation, since runtime logic can't rely on parent-child\n * connection to identify the location of a node.\n */\nfunction conditionallyAnnotateNodePath(ngh, tNode, lView, excludedParentNodes) {\n if (isProjectionTNode(tNode)) {\n // Do not annotate projection nodes (<ng-content />), since\n // they don't have a corresponding DOM node representing them.\n return;\n }\n // Handle case #1 described above.\n if (tNode.projectionNext &&\n tNode.projectionNext !== tNode.next &&\n !isInSkipHydrationBlock(tNode.projectionNext)) {\n appendSerializedNodePath(ngh, tNode.projectionNext, lView, excludedParentNodes);\n }\n // Handle case #2 described above.\n // Note: we only do that for the first node (i.e. when `tNode.prev === null`),\n // the rest of the nodes would rely on the current node location, so no extra\n // annotation is needed.\n if (tNode.prev === null &&\n tNode.parent !== null &&\n isDisconnectedNode(tNode.parent, lView) &&\n !isDisconnectedNode(tNode, lView)) {\n appendSerializedNodePath(ngh, tNode, lView, excludedParentNodes);\n }\n}\n/**\n * Determines whether a component instance that is represented\n * by a given LView uses `ViewEncapsulation.ShadowDom`.\n */\nfunction componentUsesShadowDomEncapsulation(lView) {\n const instance = lView[CONTEXT];\n return instance?.constructor\n ? getComponentDef(instance.constructor)?.encapsulation === ViewEncapsulation$1.ShadowDom\n : false;\n}\n/**\n * Annotates component host element for hydration:\n * - by either adding the `ngh` attribute and collecting hydration-related info\n * for the serialization and transferring to the client\n * - or by adding the `ngSkipHydration` attribute in case Angular detects that\n * component contents is not compatible with hydration.\n *\n * @param element The Host element to be annotated\n * @param lView The associated LView\n * @param context The hydration context\n * @returns An index of serialized view from the transfer state object\n * or `null` when a given component can not be serialized.\n */\nfunction annotateHostElementForHydration(element, lView, context) {\n const renderer = lView[RENDERER];\n if ((hasI18n(lView) && !isI18nHydrationSupportEnabled()) ||\n componentUsesShadowDomEncapsulation(lView)) {\n // Attach the skip hydration attribute if this component:\n // - either has i18n blocks, since hydrating such blocks is not yet supported\n // - or uses ShadowDom view encapsulation, since Domino doesn't support\n // shadow DOM, so we can not guarantee that client and server representations\n // would exactly match\n renderer.setAttribute(element, SKIP_HYDRATION_ATTR_NAME, '');\n return null;\n }\n else {\n const ngh = serializeLView(lView, context);\n const index = context.serializedViewCollection.add(ngh);\n renderer.setAttribute(element, NGH_ATTR_NAME, index.toString());\n return index;\n }\n}\n/**\n * Physically inserts the comment nodes to ensure empty text nodes and adjacent\n * text node separators are preserved after server serialization of the DOM.\n * These get swapped back for empty text nodes or separators once hydration happens\n * on the client.\n *\n * @param corruptedTextNodes The Map of text nodes to be replaced with comments\n * @param doc The document\n */\nfunction insertCorruptedTextNodeMarkers(corruptedTextNodes, doc) {\n for (const [textNode, marker] of corruptedTextNodes) {\n textNode.after(doc.createComment(marker));\n }\n}\n/**\n * Detects whether a given TNode represents a node that\n * is being content projected.\n */\nfunction isContentProjectedNode(tNode) {\n let currentTNode = tNode;\n while (currentTNode != null) {\n // If we come across a component host node in parent nodes -\n // this TNode is in the content projection section.\n if (isComponentHost(currentTNode)) {\n return true;\n }\n currentTNode = currentTNode.parent;\n }\n return false;\n}\n\n/**\n * Indicates whether the hydration-related code was added,\n * prevents adding it multiple times.\n */\nlet isHydrationSupportEnabled = false;\n/**\n * Indicates whether the i18n-related code was added,\n * prevents adding it multiple times.\n *\n * Note: This merely controls whether the code is loaded,\n * while `setIsI18nHydrationSupportEnabled` determines\n * whether i18n blocks are serialized or hydrated.\n */\nlet isI18nHydrationRuntimeSupportEnabled = false;\n/**\n * Defines a period of time that Angular waits for the `ApplicationRef.isStable` to emit `true`.\n * If there was no event with the `true` value during this time, Angular reports a warning.\n */\nconst APPLICATION_IS_STABLE_TIMEOUT = 10_000;\n/**\n * Brings the necessary hydration code in tree-shakable manner.\n * The code is only present when the `provideClientHydration` is\n * invoked. Otherwise, this code is tree-shaken away during the\n * build optimization step.\n *\n * This technique allows us to swap implementations of methods so\n * tree shaking works appropriately when hydration is disabled or\n * enabled. It brings in the appropriate version of the method that\n * supports hydration only when enabled.\n */\nfunction enableHydrationRuntimeSupport() {\n if (!isHydrationSupportEnabled) {\n isHydrationSupportEnabled = true;\n enableRetrieveHydrationInfoImpl();\n enableLocateOrCreateElementNodeImpl();\n enableLocateOrCreateTextNodeImpl();\n enableLocateOrCreateElementContainerNodeImpl();\n enableLocateOrCreateContainerAnchorImpl();\n enableLocateOrCreateContainerRefImpl();\n enableFindMatchingDehydratedViewImpl();\n enableApplyRootElementTransformImpl();\n }\n}\n/**\n * Brings the necessary i18n hydration code in tree-shakable manner.\n * Similar to `enableHydrationRuntimeSupport`, the code is only\n * present when `withI18nSupport` is invoked.\n */\nfunction enableI18nHydrationRuntimeSupport() {\n if (!isI18nHydrationRuntimeSupportEnabled) {\n isI18nHydrationRuntimeSupportEnabled = true;\n enableLocateOrCreateI18nNodeImpl();\n enablePrepareI18nBlockForHydrationImpl();\n enableClaimDehydratedIcuCaseImpl();\n }\n}\n/**\n * Outputs a message with hydration stats into a console.\n */\nfunction printHydrationStats(injector) {\n const console = injector.get(Console);\n const message = `Angular hydrated ${ngDevMode.hydratedComponents} component(s) ` +\n `and ${ngDevMode.hydratedNodes} node(s), ` +\n `${ngDevMode.componentsSkippedHydration} component(s) were skipped. ` +\n `Learn more at https://angular.dev/guide/hydration.`;\n // tslint:disable-next-line:no-console\n console.log(message);\n}\n/**\n * Returns a Promise that is resolved when an application becomes stable.\n */\nfunction whenStableWithTimeout(appRef, injector) {\n const whenStablePromise = whenStable(appRef);\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n const timeoutTime = APPLICATION_IS_STABLE_TIMEOUT;\n const console = injector.get(Console);\n const ngZone = injector.get(NgZone);\n // The following call should not and does not prevent the app to become stable\n // We cannot use RxJS timer here because the app would remain unstable.\n // This also avoids an extra change detection cycle.\n const timeoutId = ngZone.runOutsideAngular(() => {\n return setTimeout(() => logWarningOnStableTimedout(timeoutTime, console), timeoutTime);\n });\n whenStablePromise.finally(() => clearTimeout(timeoutId));\n }\n return whenStablePromise;\n}\n/**\n * Returns a set of providers required to setup hydration support\n * for an application that is server side rendered. This function is\n * included into the `provideClientHydration` public API function from\n * the `platform-browser` package.\n *\n * The function sets up an internal flag that would be recognized during\n * the server side rendering time as well, so there is no need to\n * configure or change anything in NgUniversal to enable the feature.\n */\nfunction withDomHydration() {\n return makeEnvironmentProviders([\n {\n provide: IS_HYDRATION_DOM_REUSE_ENABLED,\n useFactory: () => {\n let isEnabled = true;\n if (isPlatformBrowser()) {\n // On the client, verify that the server response contains\n // hydration annotations. Otherwise, keep hydration disabled.\n const transferState = inject(TransferState, { optional: true });\n isEnabled = !!transferState?.get(NGH_DATA_KEY, null);\n if (!isEnabled && typeof ngDevMode !== 'undefined' && ngDevMode) {\n const console = inject(Console);\n const message = formatRuntimeError(-505 /* RuntimeErrorCode.MISSING_HYDRATION_ANNOTATIONS */, 'Angular hydration was requested on the client, but there was no ' +\n 'serialized information present in the server response, ' +\n 'thus hydration was not enabled. ' +\n 'Make sure the `provideClientHydration()` is included into the list ' +\n 'of providers in the server part of the application configuration.');\n // tslint:disable-next-line:no-console\n console.warn(message);\n }\n }\n if (isEnabled) {\n performanceMarkFeature('NgHydration');\n }\n return isEnabled;\n },\n },\n {\n provide: ENVIRONMENT_INITIALIZER,\n useValue: () => {\n // i18n support is enabled by calling withI18nSupport(), but there's\n // no way to turn it off (e.g. for tests), so we turn it off by default.\n setIsI18nHydrationSupportEnabled(false);\n // Since this function is used across both server and client,\n // make sure that the runtime code is only added when invoked\n // on the client. Moving forward, the `isPlatformBrowser` check should\n // be replaced with a tree-shakable alternative (e.g. `isServer`\n // flag).\n if (isPlatformBrowser() && inject(IS_HYDRATION_DOM_REUSE_ENABLED)) {\n verifySsrContentsIntegrity();\n enableHydrationRuntimeSupport();\n }\n },\n multi: true,\n },\n {\n provide: PRESERVE_HOST_CONTENT,\n useFactory: () => {\n // Preserve host element content only in a browser\n // environment and when hydration is configured properly.\n // On a server, an application is rendered from scratch,\n // so the host content needs to be empty.\n return isPlatformBrowser() && inject(IS_HYDRATION_DOM_REUSE_ENABLED);\n },\n },\n {\n provide: APP_BOOTSTRAP_LISTENER,\n useFactory: () => {\n if (isPlatformBrowser() && inject(IS_HYDRATION_DOM_REUSE_ENABLED)) {\n const appRef = inject(ApplicationRef);\n const injector = inject(Injector);\n return () => {\n // Wait until an app becomes stable and cleanup all views that\n // were not claimed during the application bootstrap process.\n // The timing is similar to when we start the serialization process\n // on the server.\n //\n // Note: the cleanup task *MUST* be scheduled within the Angular zone in Zone apps\n // to ensure that change detection is properly run afterward.\n whenStableWithTimeout(appRef, injector).then(() => {\n cleanupDehydratedViews(appRef);\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n printHydrationStats(injector);\n }\n });\n };\n }\n return () => { }; // noop\n },\n multi: true,\n },\n ]);\n}\n/**\n * Returns a set of providers required to setup support for i18n hydration.\n * Requires hydration to be enabled separately.\n */\nfunction withI18nSupport() {\n return [\n {\n provide: IS_I18N_HYDRATION_ENABLED,\n useValue: true,\n },\n {\n provide: ENVIRONMENT_INITIALIZER,\n useValue: () => {\n enableI18nHydrationRuntimeSupport();\n setIsI18nHydrationSupportEnabled(true);\n performanceMarkFeature('NgI18nHydration');\n },\n multi: true,\n },\n ];\n}\n/**\n *\n * @param time The time in ms until the stable timedout warning message is logged\n */\nfunction logWarningOnStableTimedout(time, console) {\n const message = `Angular hydration expected the ApplicationRef.isStable() to emit \\`true\\`, but it ` +\n `didn't happen within ${time}ms. Angular hydration logic depends on the application becoming stable ` +\n `as a signal to complete hydration process.`;\n console.warn(formatRuntimeError(-506 /* RuntimeErrorCode.HYDRATION_STABLE_TIMEDOUT */, message));\n}\n/**\n * Verifies whether the DOM contains a special marker added during SSR time to make sure\n * there is no SSR'ed contents transformations happen after SSR is completed. Typically that\n * happens either by CDN or during the build process as an optimization to remove comment nodes.\n * Hydration process requires comment nodes produced by Angular to locate correct DOM segments.\n * When this special marker is *not* present - throw an error and do not proceed with hydration,\n * since it will not be able to function correctly.\n *\n * Note: this function is invoked only on the client, so it's safe to use DOM APIs.\n */\nfunction verifySsrContentsIntegrity() {\n const doc = getDocument();\n let hydrationMarker;\n for (const node of doc.body.childNodes) {\n if (node.nodeType === Node.COMMENT_NODE &&\n node.textContent?.trim() === SSR_CONTENT_INTEGRITY_MARKER) {\n hydrationMarker = node;\n break;\n }\n }\n if (!hydrationMarker) {\n throw new RuntimeError(-507 /* RuntimeErrorCode.MISSING_SSR_CONTENT_INTEGRITY_MARKER */, typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n 'Angular hydration logic detected that HTML content of this page was modified after it ' +\n 'was produced during server side rendering. Make sure that there are no optimizations ' +\n 'that remove comment nodes from HTML enabled on your CDN. Angular hydration ' +\n 'relies on HTML produced by the server, including whitespaces and comment nodes.');\n }\n}\n\n/**\n * Transforms a value (typically a string) to a boolean.\n * Intended to be used as a transform function of an input.\n *\n * @usageNotes\n * ```typescript\n * @Input({ transform: booleanAttribute }) status!: boolean;\n * ```\n * @param value Value to be transformed.\n *\n * @publicApi\n */\nfunction booleanAttribute(value) {\n return typeof value === 'boolean' ? value : value != null && value !== 'false';\n}\n/**\n * Transforms a value (typically a string) to a number.\n * Intended to be used as a transform function of an input.\n * @param value Value to be transformed.\n * @param fallbackValue Value to use if the provided value can't be parsed as a number.\n *\n * @usageNotes\n * ```typescript\n * @Input({ transform: numberAttribute }) id!: number;\n * ```\n *\n * @publicApi\n */\nfunction numberAttribute(value, fallbackValue = NaN) {\n // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\n // and other non-number values as NaN, where Number just uses 0) but it considers the string\n // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\n const isNumberValue = !isNaN(parseFloat(value)) && !isNaN(Number(value));\n return isNumberValue ? Number(value) : fallbackValue;\n}\n\n/**\n * Compiles a partial directive declaration object into a full directive definition object.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareDirective(decl) {\n const compiler = getCompilerFacade({\n usage: 1 /* JitCompilerUsage.PartialDeclaration */,\n kind: 'directive',\n type: decl.type,\n });\n return compiler.compileDirectiveDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵfac.js`, decl);\n}\n/**\n * Evaluates the class metadata declaration.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareClassMetadata(decl) {\n setClassMetadata(decl.type, decl.decorators, decl.ctorParameters ?? null, decl.propDecorators ?? null);\n}\n/**\n * Evaluates the class metadata of a component that contains deferred blocks.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareClassMetadataAsync(decl) {\n setClassMetadataAsync(decl.type, decl.resolveDeferredDeps, (...types) => {\n const meta = decl.resolveMetadata(...types);\n setClassMetadata(decl.type, meta.decorators, meta.ctorParameters, meta.propDecorators);\n });\n}\n/**\n * Compiles a partial component declaration object into a full component definition object.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareComponent(decl) {\n const compiler = getCompilerFacade({\n usage: 1 /* JitCompilerUsage.PartialDeclaration */,\n kind: 'component',\n type: decl.type,\n });\n return compiler.compileComponentDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵcmp.js`, decl);\n}\n/**\n * Compiles a partial pipe declaration object into a full pipe definition object.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareFactory(decl) {\n const compiler = getCompilerFacade({\n usage: 1 /* JitCompilerUsage.PartialDeclaration */,\n kind: getFactoryKind(decl.target),\n type: decl.type,\n });\n return compiler.compileFactoryDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵfac.js`, decl);\n}\nfunction getFactoryKind(target) {\n switch (target) {\n case FactoryTarget.Directive:\n return 'directive';\n case FactoryTarget.Component:\n return 'component';\n case FactoryTarget.Injectable:\n return 'injectable';\n case FactoryTarget.Pipe:\n return 'pipe';\n case FactoryTarget.NgModule:\n return 'NgModule';\n }\n}\n/**\n * Compiles a partial injectable declaration object into a full injectable definition object.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareInjectable(decl) {\n const compiler = getCompilerFacade({\n usage: 1 /* JitCompilerUsage.PartialDeclaration */,\n kind: 'injectable',\n type: decl.type,\n });\n return compiler.compileInjectableDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵprov.js`, decl);\n}\n/**\n * Compiles a partial injector declaration object into a full injector definition object.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareInjector(decl) {\n const compiler = getCompilerFacade({\n usage: 1 /* JitCompilerUsage.PartialDeclaration */,\n kind: 'NgModule',\n type: decl.type,\n });\n return compiler.compileInjectorDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵinj.js`, decl);\n}\n/**\n * Compiles a partial NgModule declaration object into a full NgModule definition object.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclareNgModule(decl) {\n const compiler = getCompilerFacade({\n usage: 1 /* JitCompilerUsage.PartialDeclaration */,\n kind: 'NgModule',\n type: decl.type,\n });\n return compiler.compileNgModuleDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵmod.js`, decl);\n}\n/**\n * Compiles a partial pipe declaration object into a full pipe definition object.\n *\n * @codeGenApi\n */\nfunction ɵɵngDeclarePipe(decl) {\n const compiler = getCompilerFacade({\n usage: 1 /* JitCompilerUsage.PartialDeclaration */,\n kind: 'pipe',\n type: decl.type,\n });\n return compiler.compilePipeDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵpipe.js`, decl);\n}\n\n// we reexport these symbols just so that they are retained during the dead code elimination\n\n/**\n * Create a computed `Signal` which derives a reactive value from an expression.\n */\nfunction computed(computation, options) {\n performanceMarkFeature('NgSignals');\n const getter = createComputed$1(computation);\n if (options?.equal) {\n getter[SIGNAL$1].equal = options.equal;\n }\n if (ngDevMode) {\n getter.toString = () => `[Computed: ${getter()}]`;\n }\n return getter;\n}\n\n/**\n * Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function\n * can, optionally, return a value.\n */\nfunction untracked(nonReactiveReadsFn) {\n const prevConsumer = setActiveConsumer$1(null);\n // We are not trying to catch any particular errors here, just making sure that the consumers\n // stack is restored in case of errors.\n try {\n return nonReactiveReadsFn();\n }\n finally {\n setActiveConsumer$1(prevConsumer);\n }\n}\n\n/**\n * Not public API, which guarantees `EffectScheduler` only ever comes from the application root\n * injector.\n */\nconst APP_EFFECT_SCHEDULER = new InjectionToken('', {\n providedIn: 'root',\n factory: () => inject(EffectScheduler),\n});\n/**\n * A scheduler which manages the execution of effects.\n */\nclass EffectScheduler {\n /** @nocollapse */\n static { this.ɵprov = ɵɵdefineInjectable({\n token: EffectScheduler,\n providedIn: 'root',\n factory: () => new ZoneAwareEffectScheduler(),\n }); }\n}\n/**\n * A wrapper around `ZoneAwareQueueingScheduler` that schedules flushing via the microtask queue\n * when.\n */\nclass ZoneAwareEffectScheduler {\n constructor() {\n this.queuedEffectCount = 0;\n this.queues = new Map();\n this.pendingTasks = inject(PendingTasks);\n this.taskId = null;\n }\n scheduleEffect(handle) {\n this.enqueue(handle);\n if (this.taskId === null) {\n const taskId = (this.taskId = this.pendingTasks.add());\n queueMicrotask(() => {\n this.flush();\n this.pendingTasks.remove(taskId);\n this.taskId = null;\n });\n }\n }\n enqueue(handle) {\n const zone = handle.creationZone;\n if (!this.queues.has(zone)) {\n this.queues.set(zone, new Set());\n }\n const queue = this.queues.get(zone);\n if (queue.has(handle)) {\n return;\n }\n this.queuedEffectCount++;\n queue.add(handle);\n }\n /**\n * Run all scheduled effects.\n *\n * Execution order of effects within the same zone is guaranteed to be FIFO, but there is no\n * ordering guarantee between effects scheduled in different zones.\n */\n flush() {\n while (this.queuedEffectCount > 0) {\n for (const [zone, queue] of this.queues) {\n // `zone` here must be defined.\n if (zone === null) {\n this.flushQueue(queue);\n }\n else {\n zone.run(() => this.flushQueue(queue));\n }\n }\n }\n }\n flushQueue(queue) {\n for (const handle of queue) {\n queue.delete(handle);\n this.queuedEffectCount--;\n // TODO: what happens if this throws an error?\n handle.run();\n }\n }\n}\n/**\n * Core reactive node for an Angular effect.\n *\n * `EffectHandle` combines the reactive graph's `Watch` base node for effects with the framework's\n * scheduling abstraction (`EffectScheduler`) as well as automatic cleanup via `DestroyRef` if\n * available/requested.\n */\nclass EffectHandle {\n constructor(scheduler, effectFn, creationZone, destroyRef, injector, allowSignalWrites) {\n this.scheduler = scheduler;\n this.effectFn = effectFn;\n this.creationZone = creationZone;\n this.injector = injector;\n this.watcher = createWatch$1((onCleanup) => this.runEffect(onCleanup), () => this.schedule(), allowSignalWrites);\n this.unregisterOnDestroy = destroyRef?.onDestroy(() => this.destroy());\n }\n runEffect(onCleanup) {\n try {\n this.effectFn(onCleanup);\n }\n catch (err) {\n // Inject the `ErrorHandler` here in order to avoid circular DI error\n // if the effect is used inside of a custom `ErrorHandler`.\n const errorHandler = this.injector.get(ErrorHandler, null, { optional: true });\n errorHandler?.handleError(err);\n }\n }\n run() {\n this.watcher.run();\n }\n schedule() {\n this.scheduler.scheduleEffect(this);\n }\n destroy() {\n this.watcher.destroy();\n this.unregisterOnDestroy?.();\n // Note: if the effect is currently scheduled, it's not un-scheduled, and so the scheduler will\n // retain a reference to it. Attempting to execute it will be a no-op.\n }\n}\n/**\n * Create a global `Effect` for the given reactive function.\n *\n * @developerPreview\n */\nfunction effect(effectFn, options) {\n performanceMarkFeature('NgSignals');\n ngDevMode &&\n assertNotInReactiveContext(effect, 'Call `effect` outside of a reactive context. For example, schedule the ' +\n 'effect inside the component constructor.');\n !options?.injector && assertInInjectionContext(effect);\n const injector = options?.injector ?? inject(Injector);\n const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;\n const handle = new EffectHandle(injector.get(APP_EFFECT_SCHEDULER), effectFn, typeof Zone === 'undefined' ? null : Zone.current, destroyRef, injector, options?.allowSignalWrites ?? false);\n // Effects need to be marked dirty manually to trigger their initial run. The timing of this\n // marking matters, because the effects may read signals that track component inputs, which are\n // only available after those components have had their first update pass.\n //\n // We inject `ChangeDetectorRef` optionally, to determine whether this effect is being created in\n // the context of a component or not. If it is, then we check whether the component has already\n // run its update pass, and defer the effect's initial scheduling until the update pass if it\n // hasn't already run.\n const cdr = injector.get(ChangeDetectorRef, null, { optional: true });\n if (!cdr || !(cdr._lView[FLAGS] & 8 /* LViewFlags.FirstLViewPass */)) {\n // This effect is either not running in a view injector, or the view has already\n // undergone its first change detection pass, which is necessary for any required inputs to be\n // set.\n handle.watcher.notify();\n }\n else {\n // Delay the initialization of the effect until the view is fully initialized.\n (cdr._lView[EFFECTS_TO_SCHEDULE] ??= []).push(handle.watcher.notify);\n }\n return handle;\n}\n\n// This file exists to allow the set of reactivity exports to be modified in g3, as these APIs are\n\n/**\n * Creates a `ComponentRef` instance based on provided component type and a set of options.\n *\n * @usageNotes\n *\n * The example below demonstrates how the `createComponent` function can be used\n * to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef,\n * so that it gets included into change detection cycles.\n *\n * Note: the example uses standalone components, but the function can also be used for\n * non-standalone components (declared in an NgModule) as well.\n *\n * ```typescript\n * @Component({\n * standalone: true,\n * template: `Hello {{ name }}!`\n * })\n * class HelloComponent {\n * name = 'Angular';\n * }\n *\n * @Component({\n * standalone: true,\n * template: `<div id=\"hello-component-host\"></div>`\n * })\n * class RootComponent {}\n *\n * // Bootstrap an application.\n * const applicationRef = await bootstrapApplication(RootComponent);\n *\n * // Locate a DOM node that would be used as a host.\n * const hostElement = document.getElementById('hello-component-host');\n *\n * // Get an `EnvironmentInjector` instance from the `ApplicationRef`.\n * const environmentInjector = applicationRef.injector;\n *\n * // We can now create a `ComponentRef` instance.\n * const componentRef = createComponent(HelloComponent, {hostElement, environmentInjector});\n *\n * // Last step is to register the newly created ref using the `ApplicationRef` instance\n * // to include the component view into change detection cycles.\n * applicationRef.attachView(componentRef.hostView);\n * componentRef.changeDetectorRef.detectChanges();\n * ```\n *\n * @param component Component class reference.\n * @param options Set of options to use:\n * * `environmentInjector`: An `EnvironmentInjector` instance to be used for the component.\n * * `hostElement` (optional): A DOM node that should act as a host node for the component. If not\n * provided, Angular creates one based on the tag name used in the component selector (and falls\n * back to using `div` if selector doesn't have tag name info).\n * * `elementInjector` (optional): An `ElementInjector` instance, see additional info about it\n * [here](guide/di/hierarchical-dependency-injection#elementinjector).\n * * `projectableNodes` (optional): A list of DOM nodes that should be projected through\n * [`<ng-content>`](api/core/ng-content) of the new component instance.\n * @returns ComponentRef instance that represents a given Component.\n *\n * @publicApi\n */\nfunction createComponent(component, options) {\n ngDevMode && assertComponentDef(component);\n const componentDef = getComponentDef(component);\n const elementInjector = options.elementInjector || getNullInjector();\n const factory = new ComponentFactory(componentDef);\n return factory.create(elementInjector, options.projectableNodes, options.hostElement, options.environmentInjector);\n}\n/**\n * Creates an object that allows to retrieve component metadata.\n *\n * @usageNotes\n *\n * The example below demonstrates how to use the function and how the fields\n * of the returned object map to the component metadata.\n *\n * ```typescript\n * @Component({\n * standalone: true,\n * selector: 'foo-component',\n * template: `\n * <ng-content></ng-content>\n * <ng-content select=\"content-selector-a\"></ng-content>\n * `,\n * })\n * class FooComponent {\n * @Input('inputName') inputPropName: string;\n * @Output('outputName') outputPropName = new EventEmitter<void>();\n * }\n *\n * const mirror = reflectComponentType(FooComponent);\n * expect(mirror.type).toBe(FooComponent);\n * expect(mirror.selector).toBe('foo-component');\n * expect(mirror.isStandalone).toBe(true);\n * expect(mirror.inputs).toEqual([{propName: 'inputName', templateName: 'inputPropName'}]);\n * expect(mirror.outputs).toEqual([{propName: 'outputName', templateName: 'outputPropName'}]);\n * expect(mirror.ngContentSelectors).toEqual([\n * '*', // first `<ng-content>` in a template, the selector defaults to `*`\n * 'content-selector-a' // second `<ng-content>` in a template\n * ]);\n * ```\n *\n * @param component Component class reference.\n * @returns An object that allows to retrieve component metadata.\n *\n * @publicApi\n */\nfunction reflectComponentType(component) {\n const componentDef = getComponentDef(component);\n if (!componentDef)\n return null;\n const factory = new ComponentFactory(componentDef);\n return {\n get selector() {\n return factory.selector;\n },\n get type() {\n return factory.componentType;\n },\n get inputs() {\n return factory.inputs;\n },\n get outputs() {\n return factory.outputs;\n },\n get ngContentSelectors() {\n return factory.ngContentSelectors;\n },\n get isStandalone() {\n return componentDef.standalone;\n },\n get isSignal() {\n return componentDef.signals;\n },\n };\n}\n\n/**\n * Merge multiple application configurations from left to right.\n *\n * @param configs Two or more configurations to be merged.\n * @returns A merged [ApplicationConfig](api/core/ApplicationConfig).\n *\n * @publicApi\n */\nfunction mergeApplicationConfig(...configs) {\n return configs.reduce((prev, curr) => {\n return Object.assign(prev, curr, { providers: [...prev.providers, ...curr.providers] });\n }, { providers: [] });\n}\n\n/**\n * @module\n * @description\n * Entry point from which you should import all public core APIs.\n */\nif (typeof ngDevMode !== 'undefined' && ngDevMode) {\n // This helper is to give a reasonable error message to people upgrading to v9 that have not yet\n // installed `@angular/localize` in their app.\n // tslint:disable-next-line: no-toplevel-property-access\n _global.$localize ??= function () {\n throw new Error('It looks like your application or one of its dependencies is using i18n.\\n' +\n 'Angular 9 introduced a global `$localize()` function that needs to be loaded.\\n' +\n 'Please run `ng add @angular/localize` from the Angular CLI.\\n' +\n \"(For non-CLI projects, add `import '@angular/localize/init';` to your `polyfills.ts` file.\\n\" +\n 'For server-side rendering applications add the import to your `main.server.ts` file.)');\n };\n}\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\n// This file only reexports content of the `src` folder. Keep it that way.\n\n/* This file is not used to build this module. It is only used during editing\n * by the TypeScript language service and during build for verification. `ngc`\n * replaces this file with production index.ts when it rewrites private symbol\n * names.\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AfterRenderPhase, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, DestroyRef, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, ExperimentalPendingTasks, HOST_TAG_NAME, Host, HostAttributeToken, HostBinding, HostListener, INJECTOR$1 as INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, OutputEmitterRef, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, Renderer2, RendererFactory2, RendererStyleFlags2, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TransferState, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, afterNextRender, afterRender, asNativeElements, assertInInjectionContext, assertNotInReactiveContext, assertPlatform, booleanAttribute, computed, contentChild, contentChildren, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, input, isDevMode, isSignal, isStandalone, makeEnvironmentProviders, makeStateKey, mergeApplicationConfig, model, numberAttribute, output, platformCore, provideExperimentalCheckNoChangesForDebug, provideExperimentalZonelessChangeDetection, provideZoneChangeDetection, reflectComponentType, resolveForwardRef, runInInjectionContext, setTestabilityGetter, signal, untracked, viewChild, viewChildren, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, AfterRenderManager as ɵAfterRenderManager, CONTAINER_HEADER_OFFSET as ɵCONTAINER_HEADER_OFFSET, ChangeDetectionScheduler as ɵChangeDetectionScheduler, ChangeDetectionSchedulerImpl as ɵChangeDetectionSchedulerImpl, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG as ɵDEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR as ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DeferBlockBehavior as ɵDeferBlockBehavior, DeferBlockState as ɵDeferBlockState, EffectScheduler as ɵEffectScheduler, IMAGE_CONFIG as ɵIMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS as ɵIMAGE_CONFIG_DEFAULTS, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, ɵINPUT_SIGNAL_BRAND_WRITE_TYPE, INTERNAL_APPLICATION_ERROR_HANDLER as ɵINTERNAL_APPLICATION_ERROR_HANDLER, IS_HYDRATION_DOM_REUSE_ENABLED as ɵIS_HYDRATION_DOM_REUSE_ENABLED, JSACTION_EVENT_CONTRACT as ɵJSACTION_EVENT_CONTRACT, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, PROVIDED_NG_ZONE as ɵPROVIDED_NG_ZONE, PendingTasks as ɵPendingTasks, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, SSR_CONTENT_INTEGRITY_MARKER as ɵSSR_CONTENT_INTEGRITY_MARKER, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, USE_RUNTIME_DEPS_TRACKER_FOR_JIT as ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, ViewRef$1 as ɵViewRef, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, ZONELESS_ENABLED as ɵZONELESS_ENABLED, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, annotateForHydration as ɵannotateForHydration, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, convertToBitFlags as ɵconvertToBitFlags, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, depsTracker as ɵdepsTracker, detectChangesInViewIfRequired as ɵdetectChangesInViewIfRequired, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, generateStandaloneInDeclarationsError as ɵgenerateStandaloneInDeclarationsError, getAsyncClassMetadataFn as ɵgetAsyncClassMetadataFn, getDebugNode as ɵgetDebugNode, getDeferBlocks as ɵgetDeferBlocks, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getOutputDestroyRef as ɵgetOutputDestroyRef, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalCreateApplication as ɵinternalCreateApplication, internalProvideZoneChangeDetection as ɵinternalProvideZoneChangeDetection, isBoundToModule as ɵisBoundToModule, isComponentDefPendingResolution as ɵisComponentDefPendingResolution, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, performanceMarkFeature as ɵperformanceMarkFeature, readHydrationInfo as ɵreadHydrationInfo, registerLocaleData as ɵregisterLocaleData, renderDeferBlockState as ɵrenderDeferBlockState, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, restoreComponentResolutionQueue as ɵrestoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl, ɵsetClassDebugInfo, setClassMetadata as ɵsetClassMetadata, setClassMetadataAsync as ɵsetClassMetadataAsync, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setInjectorProfilerContext as ɵsetInjectorProfilerContext, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, triggerResourceLoading as ɵtriggerResourceLoading, truncateMiddle as ɵtruncateMiddle, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, ɵunwrapWritableSignal, whenStable as ɵwhenStable, withDomHydration as ɵwithDomHydration, withEventReplay as ɵwithEventReplay, withI18nSupport as ɵwithI18nSupport, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵInputTransformsFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵcontentQuery, ɵɵcontentQuerySignal, ɵɵdeclareLet, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareClassMetadataAsync, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryAdvance, ɵɵqueryRefresh, ɵɵreadContextLet, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstoreLet, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵtwoWayBindingSet, ɵɵtwoWayListener, ɵɵtwoWayProperty, ɵɵvalidateIframeAttribute, ɵɵviewQuery, ɵɵviewQuerySignal };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,IAAIC,aAAa,EAAEC,WAAW,IAAIC,aAAa,EAAEC,gBAAgB,IAAIC,kBAAkB,EAAEC,MAAM,IAAIC,QAAQ,EAAEC,iBAAiB,IAAIC,mBAAmB,EAAEC,iBAAiB,IAAIC,mBAAmB,EAAEC,eAAe,IAAIC,iBAAiB,EAAEC,aAAa,IAAIC,eAAe,EAAEC,yBAAyB,IAAIC,2BAA2B,EAAEC,wBAAwB,IAAIC,0BAA0B,EAAEC,8BAA8B,IAAIC,gCAAgC,EAAEC,YAAY,IAAIC,cAAc,EAAEC,cAAc,IAAIC,gBAAgB,EAAEC,cAAc,IAAIC,gBAAgB,EAAEC,iCAAiC,IAAIC,mCAAmC,EAAEC,WAAW,IAAIC,aAAa,QAAQ,kCAAkC;AAC3sB,SAASzB,MAAM,IAAI0B,OAAO,QAAQ,kCAAkC;AACpE,SAASC,eAAe,EAAEC,OAAO,EAAEC,YAAY,QAAQ,MAAM;AAC7D,SAASC,GAAG,EAAEC,KAAK,QAAQ,gBAAgB;AAC3C,SAASC,SAAS,IAAIC,WAAW,EAAEC,aAAa,EAAEC,sBAAsB,EAAEC,4BAA4B,EAAEC,gCAAgC,EAAEC,eAAe,EAAEC,kBAAkB,EAAEC,gBAAgB,EAAEC,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,IACnF,sKAAsK,CAAC;EAC/K,CAAC,MACI,IAAIiR,gBAAgB,KAAK,IAAI,EAAE;IAChC,OAAOb,kBAAkB,CAACpJ,KAAK,EAAExG,SAAS,EAAE6M,KAAK,CAAC;EACtD,CAAC,MACI;IACD,MAAM1M,KAAK,GAAGsQ,gBAAgB,CAACM,GAAG,CAACvK,KAAK,EAAEqG,KAAK,GAAG0C,WAAW,CAACQ,QAAQ,GAAG,IAAI,GAAG/P,SAAS,EAAE6M,KAAK,CAAC;IACjGrN,SAAS,IAAIoN,eAAe,CAACpG,KAAK,EAAErG,KAAK,EAAE0M,KAAK,CAAC;IACjD,OAAO1M,KAAK;EAChB;AACJ;AACA,SAAS6Q,QAAQA,CAACxK,KAAK,EAAEqG,KAAK,GAAG0C,WAAW,CAACuB,OAAO,EAAE;EAClD,OAAO,CAACrB,uBAAuB,CAAC,CAAC,IAAIoB,kBAAkB,EAAElJ,iBAAiB,CAACnB,KAAK,CAAC,EAAEqG,KAAK,CAAC;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASoE,mBAAmBA,CAAChO,KAAK,EAAE;EAChC,MAAM,IAAInE,YAAY,CAAC,GAAG,CAAC,mDAAmDU,SAAS,IACnF,wGAAwGyD,KAAK;AACrH;AACA;AACA,2DAA2DA,KAAK,iGAAiG,CAAC;AAClK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASiO,MAAMA,CAAC1K,KAAK,EAAEqG,KAAK,GAAG0C,WAAW,CAACuB,OAAO,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AC,CAAC;AAC7B;AACA;AACA;AACA;AACA;AACA,IAAIC,kBAAkB,GAAG,KAAK;AAC9B;AACA;AACA;AACA;AACA;AACA,SAASC,+BAA+BA,CAAA,EAAG;EACvC,OAAOR,gBAAgB,CAACC,MAAM,CAAC7O,MAAM,KAAK,IAAI;AAClD;AACA,SAASqP,oBAAoBA,CAAA,EAAG;EAC5B,OAAOT,gBAAgB,CAACC,MAAM,CAACS,iBAAiB;AACpD;AACA,SAASC,yBAAyBA,CAAA,EAAG;EACjCX,gBAAgB,CAACC,MAAM,CAACS,iBAAiB,EAAE;AAC/C;AACA,SAASE,yBAAyBA,CAAA,EAAG;EACjCZ,gBAAgB,CAACC,MAAM,CAACS,iBAAiB,EAAE;AAC/C;AACA,SAASG,kBAAkBA,CAAA,EAAG;EAC1B,OAAOb,gBAAgB,CAACG,eAAe;AAC3C;AACA;AACA;AACA;AACA;AACA,SAASW,wBAAwBA,CAAA,EAAG;EAChC,OAAOd,gBAAgB,CAACI,sBAAsB,KAAK,IAAI;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,SAASW,wBAAwBA,CAACjvB,KAAK,EAAE;EACrC,OAAOkuB,gBAAgB,CAACI,sBAAsB,KAAKtuB,KAAK;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASkvB,gBAAgBA,CAAA,EAAG;EACxBhB,gBAAgB,CAACG,eAAe,GAAG,IAAI;AAC3C;AACA;AACA;AACA;AACA;AACA,SAASc,uBAAuBA,CAACnvB,KAAK,EAAE;EACpCkuB,gBAAgB,CAACI,sBAAsB,GAAGtuB,KAAK;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASovB,iBAAiBA,CAAA,EAAG;EACzBlB,gBAAgB,CAACG,eAAe,GAAG,KAAK;AAC5C;AAC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CAAC,IAAI,EAAE,CAAC;IACvD;IACA,IAAIqQ,qBAAqB,GACrBzI,WAAW,CAAC7G,mBAAmB,CAAC,IAAI,EAAE,CAAC,wDACvC,CAAC6G,WAAW,CAAC5H,KAAK,CAAC,GAAG,CAAC,CAAC,yCAAyC0P,SAAS,EAAE;MAC5E9H,WAAW,CAAC5H,KAAK,CAAC,IAAI,KAAK,CAAC;MAC5BmQ,gBAAgB,CAACC,SAAS,EAAE5V,IAAI,CAAC;IACrC;EACJ,CAAC,MACI;IACD2V,gBAAgB,CAACC,SAAS,EAAE5V,IAAI,CAAC;EACrC;AACJ;AAEA,MAAM8V,kBAAkB,GAAG,CAAC,CAAC;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,CAAC;EACtBv7B,WAAWA;EACX;AACJ;AACA;EACIiL,OAAO;EACP;AACJ;AACA;EACIqC,cAAc,EAAEkuB,oBAAoB,EAAE;IAClC,IAAI,CAACvwB,OAAO,GAAGA,OAAO;IACtB;AACR;AACA;AACA;IACQ,IAAI,CAACwwB,SAAS,GAAG,KAAK;IACtBj7B,SAAS,IAAIyJ,aAAa,CAACgB,OAAO,EAAE,uBAAuB,CAAC;IAC5DzK,SAAS,IAAIiJ,WAAW,CAAC,OAAOwB,OAAO,EAAE,UAAU,EAA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ACljC,MAAM,EAAEgjC,IAAI,CAAC;EAC9C;EACAG,YAAYA,CAACL,QAAQ,EAAEM,YAAY,EAAEC,UAAU,EAAEL,IAAI,EAAEM,SAAS,EAAEC,SAAS,EAAE;IACzE,IAAIC,GAAG;IACP,IAAIR,IAAI,CAACC,WAAW,EAAE;MAClBO,GAAG,GAAGR,IAAI,CAACC,WAAW,CAACQ,GAAG,CAAC,MAAMX,QAAQ,CAACY,UAAU,CAACL,UAAU,EAAEL,IAAI,EAAEM,SAAS,EAAEC,SAAS,CAAC,CAAC;IACjG,CAAC,MACI;MACDC,GAAG,GAAGV,QAAQ,CAACY,UAAU,CAACL,UAAU,EAAEL,IAAI,EAAEM,SAAS,EAAEC,SAAS,CAAC;IACrE;IACA,OAAOC,GAAG;EACd;AACJ;AAEA,MAAMG,qBAAqB,GAAG,eAAe;AAC7C,MAAMC,6BAA6B,GAAGD,qBAAqB,GAAG,KAAK;AACnE,IAAIE,gBAAgB,GAAG,CAAC;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,MAAM,CAAC;EACTtoC,WAAWA,CAACwB,OAAO,EAAE;IACjB,IAAI,CAAC+mC,oBAAoB,GAAG,KAAK;IACjC,IAAI,CAACC,oBAAoB,GAAG,KAAK;IACjC;AACR;AACA;IACQ,IAAI,CAACC,QAAQ,GAAG,IAAI;IACpB;AACR;AACA;IACQ,IAAI,CAACC,UAAU,GAAG,IAAIpC,YAAY,CAAC,KAAK,CA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C;MACJ;IACJ,CAAC,SACO;MACJrvC,mBAAmB,CAACmvC,gBAAgB,CAAC;IACzC;EACJ;AACJ;AACA;AACA,SAASG,mBAAmBA,CAACC,GAAG,EAAE;EAC9B,OAAOA,GAAG,CAACtH,UAAU;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASuH,MAAMA,CAAChiC,IAAI,EAAE;EAClBvK,SAAS,IAAI+mB,wBAAwB,CAACwlB,MAAM,CAAC;EAC7C,OAAO,IAAIV,gBAAgB,CAAC,CAAC;AACjC;AAEA,SAASW,aAAaA,CAACzrC,YAAY,EAAEwJ,IAAI,EAAE;EACvCvK,SAAS,IAAI+mB,wBAAwB,CAACxS,KAAK,CAAC;EAC5C,OAAOzT,iBAAiB,CAACC,YAAY,EAAEwJ,IAAI,CAAC;AAChD;AACA,SAASkiC,qBAAqBA,CAACliC,IAAI,EAAE;EACjCvK,SAAS,IAAI+mB,wBAAwB,CAACxS,KAAK,CAAC;EAC5C,OAAOzT,iBAAiB,CAACV,oBAAoB,EAAEmK,IAAI,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMgK,KAAK,GAAG,CAAC,MAAM;EACjB;EACA;EACA;EACAi4B,aAAa,CAACE,QAAQ,GAAGD,qBAAqB;EAC9C,OAAOD,aAAa;AACxB,CAAC,EAAE,CAAC;;AAEJ;AACA;AAC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,GAAG/7C,MAAM,CAACgI,SAAS,CAAC;QAClC,MAAMzoB,KAAK,GAAGw8D,QAAQ,GAAGA,QAAQ,CAACv7D,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpD,IAAIjB,KAAK,GAAG,CAAC,CAAC,EAAE;UACZzD,SAAS,IACLiJ,WAAW,CAACxF,KAAK,EAAEygB,MAAM,CAACxf,OAAO,CAAC,IAAI,CAACq8B,MAAM,CAAC,GAAG3U,uBAAuB,EAAE,6GAA6G,CAAC;UAC5L0gC,UAAU,CAAC5oC,MAAM,EAAEzgB,KAAK,CAAC;UACzBkR,eAAe,CAACsrD,QAAQ,EAAEx8D,KAAK,CAAC;QACpC;MACJ;MACA,IAAI,CAACu8D,wBAAwB,GAAG,KAAK;IACzC;IACA9S,YAAY,CAAC,IAAI,CAACnsB,MAAM,CAACxW,KAAK,CAAC,EAAE,IAAI,CAACwW,MAAM,CAAC;EACjD;EACAtiB,SAASA,CAAChR,QAAQ,EAAE;IAChBklB,mBAAmB,CAAC,IAAI,CAACoO,MAAM,EAAEtzB,QAAQ,CAAC;EAC9C;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACIyyD,YAAYA,CAAA,EAAG;IACXR,aAAa,CAAC,IAAI,CAACI,mBAAmB,IAAI,IAAI,CAAC/+B,MAAM,EAAE,CAAC,CAAC,qCAAqC,CAAC;EACnG;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACIo/B,MAAMA,CAAA,EAAG;IACL,IAAI,CAACp/B,MAAM,CAACvW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;EAC/B;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACI41C,QAAQA,CAAA,EAAG;IACP7tC,oCAAoC,CAAC,IAAI,CAACwO,MAAM,CAAC;IACjD,IAAI,CAACA,MAAM,CAACvW,KAAK,CAAC,IAAI,GAAG,CAAC;EAC9B;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACI61C,aAAaA,CAAA,EAAG;IACZ;IACA;IACA;IACA;IACA;IACA,IAAI,CAACt/B,MAAM,CAACvW,KAAK,CAAC,IAAI,IAAI,CAAC;IAC3B2zC,qBAAqB,CAAC,IAAI,CAACp9B,MAAM,EAAE,IAAI,CAACq9B,kBAAkB,CAAC;EAC/D;EACA;AACJ;AACA;AACA;AACA;AACA;EACIkC,cAAcA,CAAA,EAAG;IACb,IAAItgE,SAAS,EAAE;MACX4+D,sBAAsB,CAAC,IAAI,CAAC79B,MAAM,EAAE5N,kBAAkB,CAACotC,cAAc,EAAE,IAAI,CAACnC,kBAAkB,CAAC;IACnG;EACJ;EACAoC,wBAAwBA,CAAA,EAAG;IACvB,IAAI,IAAI,CAACT,OAAO,EAAE;MACd,MAAM,IAAIzgE,YAAY,CAAC,GAAG,CAAC,8CAA8CU,SAAS,IAAI,+DAA+D,CAAC;IAC1J;IACA,IAAI,CAACggE,wBAAwB,GAAG,IAAI;EACxC;EACAS,gBAAgBA,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B,CAAC;EAC3D,OAAQA,aAAa,GAAG,CAAC,CAAC;AAC9B;AACA,SAASQ,oBAAoBA,CAACR,aAAa,EAAE;EACzC34F,SAAS,IAAIsI,YAAY,CAACqwF,aAAa,EAAE,iBAAiB,CAAC;EAC3D,MAAMl0D,IAAI,GAAGs0D,oBAAoB,CAACJ,aAAa,CAAC;EAChD,OAAOl0D,IAAI,KAAK,CAAC,GAAGi0D,oBAAoB,CAACC,aAAa,CAAC,GAAGl0D,IAAI;AAClE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI20D,mEAAmE;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,qBAAqBA,CAAChsE,KAAK,EAAEzoB,KAAK,EAAE00F,qBAAq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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS+7F,WAAWA,CAAC/yE,IAAI,EAAEhpB,KAAK,EAAE41F,MAAM,EAAE;EACtCoG,oBAAoB,CAAChzE,IAAI,EAAEhpB,KAAK,EAAE41F,MAAM,EAAE,KAAK,CAAC;EAChD,OAAOmG,WAAW;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,WAAWA,CAACztF,SAAS,EAAExO,KAAK,EAAE;EACnCg8F,oBAAoB,CAACxtF,SAAS,EAAExO,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC;EAClD,OAAOi8F,WAAW;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,UAAUA,CAACjgF,MAAM,EAAE;EACxBkgF,eAAe,CAACC,qBAAqB,EAAEC,iBAAiB,EAAEpgF,MAAM,EAAE,KAAK,CAAC;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASogF,iBAAiBA,CAACrnF,aAAa,EAAE7C,IAAI,EAAE;EAC5C,KAAK,IAAIZ,CAAC,GAAGspF,UAAU,CAAC1oF,IAAI,CAAC,EAAEZ,CAAC,IAAI,CAAC,EAAEA,CAAC,GAAGupF,cAAc,CAAC3oF,IAAI,EAAEZ,CAAC,CAAC,EAAE;IAChE6qF,qBAAqB,CAACpnF,aAAa,EAAEslF,gBAAgB,CAACnoF,IAAI,CAAC,EAAEooF,kBAAkB,CAACpoF,IAAI,CAAC,CAAC;EAC1F;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASmqF,UAAUA,CAAC3hF,OAAO,EAAE;EACzBwhF,eAAe,CAACI,qBAAqB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BAAmB,CAAC3iH,IAAI;MAAE9D,UAAU,EAAE;IAAW,CAAC,CAAC;EAAE;AACvJ;AACA,CAAC,MAAM;EAAE,CAAC,OAAOxK,SAAS,KAAK,WAAW,IAAIA,SAAS,KAAK4/G,gBAAgB,CAACqR,mBAAmB,EAAE,CAAC;IAC3F7oH,IAAI,EAAEu6B,UAAU;IAChBvgC,IAAI,EAAE,CAAC;MAAEoI,UAAU,EAAE;IAAW,CAAC;EACrC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;AAAE,CAAC,EAAE,CAAC;AACzB;AACA;AACA;AACA;AACA,SAASulH,oBAAoBA,CAACpyC,MAAM,EAAE;EAClCmyC,kBAAkB,GAAGnyC,MAAM;AAC/B;AACA,IAAImyC,kBAAkB;;AAEtB;AACA;AACA;AACA,SAAS8B,SAASA,CAAC7+G,GAAG,EAAE;EACpB;EACA;EACA,OAAO,CAAC,CAACA,GAAG,IAAI,OAAOA,GAAG,CAACisE,IAAI,KAAK,UAAU;AAClD;AACA;AACA;AACA;AACA,SAAS6yC,cAAcA,CAAC9+G,GAAG,EAAE;EACzB,OAAO,CAAC,CAACA,GAAG,IAAI,OAAOA,GAAG,CAACoyB,SAAS,KAAK,UAAU;AACvD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AAK;QACvB22E,MAAM,CAAC1/C,iBAAiB,CAAC,MAAMoC,YAAY,CAACZ,WAAW,CAACz4B,CAAC,CAAC,CAAC;QAC3D;QACA,MAAMA,CAAC;MACX,CAAC,CAAC;IACN;IACA,OAAOqI,MAAM;EACjB,CAAC,CACD,OAAOrI,CAAC,EAAE;IACN22E,MAAM,CAAC1/C,iBAAiB,CAAC,MAAMoC,YAAY,CAACZ,WAAW,CAACz4B,CAAC,CAAC,CAAC;IAC3D;IACA,MAAMA,CAAC;EACX;AACJ;AACA,SAASwgH,cAAcA,CAACj7G,GAAG,EAAEk7G,IAAI,EAAE;EAC/B,IAAIlsH,KAAK,CAACC,OAAO,CAACisH,IAAI,CAAC,EAAE;IACrB,OAAOA,IAAI,CAACxlF,MAAM,CAACulF,cAAc,EAAEj7G,GAAG,CAAC;EAC3C;EACA,OAAO;IAAE,GAAGA,GAAG;IAAE,GAAGk7G;EAAK,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,CAAC;EACjB5zH,WAAWA,CAAA,EAAG;IACV;IACA,IAAI,CAAC6zH,mBAAmB,GAAG,EAAE;IAC7B;IACA,IAAI,CAACC,YAAY,GAAG,KAAK;IACzB,IAAI,CAACrvG,UAAU,GAAG,KAAK;IACvB,IAAI,CAACsvG,iBA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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,qBAAqB,GAAG,IAAI9tH,cAAc,CAAC/L,SAAS,GAAG,qBAAqB,GAAG,EAAE,EAAE;EACrFwK,UAAU,EAAE,MAAM;EAClBC,OAAO,EAAEA,CAAA,KAAM2/F;AACnB,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM0vB,YAAY,GAAG,IAAI/tH,cAAc,CAAC/L,SAAS,GAAG,cAAc,GAAG,EAAE,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM+5H,mBAAmB,GAAG,IAAIhuH,cAAc,CAAC/L,SAAS,GAAG,oBAAoB,GAAG,EAAE,CAAC;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIg6H,0BAA0B;AAC9B,CAAC,UAAUA,0BAA0B,EAAE;EACnCA,0BAA0B,CAACA,0BAA0B,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO;EAC7EA,0BAA0B,CAACA,0BAA0B,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;EACjFA,0BAA0B,CAACA,0BAA0B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;AACnF,CAAC,EAAEA,0BAA0B,KAAKA,0BAA0B,GAAG,CAAC,CAAC,CAAC,CAAC;;AAEnE;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,GAAG;AACtB,MAAMC,yBAAyB,GAAG,IAAI;AACtC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